dockview 1.0.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +243 -186
- package/dist/cjs/api/component.api.d.ts +31 -25
- package/dist/cjs/api/component.api.js +97 -40
- 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 +2 -2
- package/dist/cjs/dnd/abstractDragHandler.js +15 -15
- 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 +72 -48
- package/dist/cjs/dnd/droptarget.js.map +1 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +1 -2
- package/dist/cjs/dockview/components/tab/defaultTab.js +1 -9
- package/dist/cjs/dockview/components/tab/defaultTab.js.map +1 -1
- package/dist/cjs/dockview/components/watermark/watermark.d.ts +3 -3
- package/dist/cjs/dockview/components/watermark/watermark.js +4 -4
- package/dist/cjs/dockview/components/watermark/watermark.js.map +1 -1
- package/dist/cjs/dockview/deserializer.js.map +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +34 -23
- package/dist/cjs/dockview/dockviewComponent.js +117 -209
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +3 -5
- package/dist/cjs/dockview/dockviewGroupPanel.js +10 -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 +12 -20
- package/dist/cjs/gridview/baseComponentGridview.js +49 -45
- package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
- package/dist/cjs/gridview/basePanelView.d.ts +5 -8
- package/dist/cjs/gridview/basePanelView.js +16 -8
- package/dist/cjs/gridview/basePanelView.js.map +1 -1
- package/dist/cjs/gridview/branchNode.js +3 -3
- package/dist/cjs/gridview/branchNode.js.map +1 -1
- package/dist/cjs/gridview/gridview.js +21 -18
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +5 -6
- package/dist/cjs/gridview/gridviewComponent.js +33 -9
- 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 +2 -1
- package/dist/cjs/gridview/leafNode.js.map +1 -1
- package/dist/cjs/groupview/groupPanel.d.ts +1 -7
- package/dist/cjs/groupview/groupview.d.ts +18 -10
- package/dist/cjs/groupview/groupview.js +51 -129
- 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.d.ts +1 -1
- package/dist/cjs/groupview/panel/content.js +2 -1
- 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/hostedContainer.js +2 -2
- package/dist/cjs/hostedContainer.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +8 -4
- package/dist/cjs/index.js.map +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/defaultPaneviewHeader.d.ts +1 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.js +1 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.js.map +1 -1
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.js +32 -29
- package/dist/cjs/paneview/draggablePaneviewPanel.js.map +1 -1
- package/dist/cjs/paneview/paneview.d.ts +3 -1
- package/dist/cjs/paneview/paneview.js +13 -7
- package/dist/cjs/paneview/paneview.js.map +1 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +7 -6
- package/dist/cjs/paneview/paneviewComponent.js +65 -8
- 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/components.js +5 -1
- package/dist/cjs/react/dockview/components.js.map +1 -1
- package/dist/cjs/react/dockview/dockview.d.ts +9 -9
- package/dist/cjs/react/dockview/dockview.js +40 -5
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/cjs/react/dockview/reactContentPart.d.ts +2 -2
- package/dist/cjs/react/dockview/reactContentPart.js +6 -17
- package/dist/cjs/react/dockview/reactContentPart.js.map +1 -1
- package/dist/cjs/react/dockview/reactHeaderPart.d.ts +2 -2
- package/dist/cjs/react/dockview/reactHeaderPart.js +3 -2
- package/dist/cjs/react/dockview/reactHeaderPart.js.map +1 -1
- package/dist/cjs/react/dockview/reactWatermarkPart.d.ts +3 -4
- package/dist/cjs/react/dockview/reactWatermarkPart.js +3 -4
- package/dist/cjs/react/dockview/reactWatermarkPart.js.map +1 -1
- package/dist/cjs/react/dockview/v2/reactContentRenderer.d.ts +2 -2
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js +2 -2
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js.map +1 -1
- package/dist/cjs/react/dockview/v2/webviewContentRenderer.d.ts +2 -2
- package/dist/cjs/react/dockview/v2/webviewContentRenderer.js +2 -2
- package/dist/cjs/react/dockview/v2/webviewContentRenderer.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/gridview/view.d.ts +3 -2
- 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 +5 -1
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/react/paneview/paneview.js +6 -2
- package/dist/cjs/react/paneview/paneview.js.map +1 -1
- package/dist/cjs/react/react.js +6 -3
- 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/react/splitview/view.js +2 -2
- package/dist/cjs/react/splitview/view.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.d.ts +0 -3
- package/dist/cjs/splitview/splitviewComponent.js +50 -6
- 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 +666 -791
- package/dist/dockview.amd.min.js +2 -16
- package/dist/dockview.amd.min.noStyle.js +2 -16
- package/dist/dockview.amd.noStyle.js +665 -790
- package/dist/dockview.cjs.js +666 -791
- package/dist/dockview.esm.js +666 -780
- package/dist/dockview.esm.min.js +2 -16
- package/dist/dockview.js +666 -791
- package/dist/dockview.min.js +2 -16
- package/dist/dockview.min.noStyle.js +2 -16
- package/dist/dockview.noStyle.js +665 -790
- package/dist/esm/api/component.api.d.ts +31 -25
- package/dist/esm/api/component.api.js +47 -26
- 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 +2 -2
- package/dist/esm/dnd/abstractDragHandler.js +10 -10
- 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 +72 -48
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +1 -2
- package/dist/esm/dockview/components/tab/defaultTab.js +2 -10
- package/dist/esm/dockview/components/watermark/watermark.d.ts +3 -3
- package/dist/esm/dockview/components/watermark/watermark.js +4 -4
- package/dist/esm/dockview/dockviewComponent.d.ts +34 -23
- package/dist/esm/dockview/dockviewComponent.js +82 -150
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +3 -5
- package/dist/esm/dockview/dockviewGroupPanel.js +6 -30
- package/dist/esm/dockview/options.d.ts +2 -1
- package/dist/esm/events.js +2 -3
- package/dist/esm/gridview/baseComponentGridview.d.ts +12 -20
- package/dist/esm/gridview/baseComponentGridview.js +27 -45
- package/dist/esm/gridview/basePanelView.d.ts +5 -8
- package/dist/esm/gridview/basePanelView.js +12 -8
- package/dist/esm/gridview/branchNode.js +3 -3
- package/dist/esm/gridview/gridview.js +18 -16
- package/dist/esm/gridview/gridviewComponent.d.ts +5 -6
- package/dist/esm/gridview/gridviewComponent.js +12 -10
- 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 +1 -7
- package/dist/esm/groupview/groupview.d.ts +18 -10
- package/dist/esm/groupview/groupview.js +30 -59
- package/dist/esm/groupview/groupviewPanel.d.ts +5 -2
- package/dist/esm/groupview/panel/content.d.ts +1 -1
- package/dist/esm/groupview/panel/content.js +2 -1
- 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/hostedContainer.js +2 -2
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +1 -2
- package/dist/esm/lifecycle.js +2 -1
- package/dist/esm/panel/types.d.ts +0 -2
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +1 -1
- package/dist/esm/paneview/defaultPaneviewHeader.js +1 -1
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/esm/paneview/draggablePaneviewPanel.js +32 -29
- package/dist/esm/paneview/paneview.d.ts +3 -1
- package/dist/esm/paneview/paneview.js +10 -6
- package/dist/esm/paneview/paneviewComponent.d.ts +7 -6
- package/dist/esm/paneview/paneviewComponent.js +31 -7
- 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 +36 -5
- package/dist/esm/react/dockview/reactContentPart.d.ts +2 -2
- package/dist/esm/react/dockview/reactContentPart.js +6 -17
- package/dist/esm/react/dockview/reactHeaderPart.d.ts +2 -2
- package/dist/esm/react/dockview/reactHeaderPart.js +3 -2
- package/dist/esm/react/dockview/reactWatermarkPart.d.ts +3 -4
- package/dist/esm/react/dockview/reactWatermarkPart.js +3 -4
- package/dist/esm/react/dockview/v2/reactContentRenderer.d.ts +2 -2
- package/dist/esm/react/dockview/v2/reactContentRenderer.js +2 -2
- package/dist/esm/react/dockview/v2/webviewContentRenderer.d.ts +2 -2
- package/dist/esm/react/dockview/v2/webviewContentRenderer.js +2 -2
- package/dist/esm/react/gridview/gridview.js +4 -1
- package/dist/esm/react/gridview/view.d.ts +3 -2
- package/dist/esm/react/gridview/view.js +2 -2
- package/dist/esm/react/index.d.ts +1 -0
- package/dist/esm/react/paneview/paneview.js +1 -1
- package/dist/esm/react/react.js +1 -2
- package/dist/esm/react/splitview/splitview.js +3 -1
- package/dist/esm/react/splitview/view.js +2 -2
- package/dist/esm/splitview/core/splitview.js +1 -1
- package/dist/esm/splitview/splitviewComponent.d.ts +0 -3
- package/dist/esm/splitview/splitviewComponent.js +17 -6
- package/dist/esm/splitview/splitviewPanel.d.ts +1 -6
- package/dist/esm/splitview/splitviewPanel.js +5 -3
- package/dist/styles/dockview.css +14 -17
- package/package.json +13 -13
- 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.3.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -27,6 +27,76 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
27
27
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
28
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
29
29
|
|
|
30
|
+
class TransferObject {
|
|
31
|
+
constructor() {
|
|
32
|
+
//
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
class PanelTransfer extends TransferObject {
|
|
36
|
+
constructor(viewId, groupId, panelId) {
|
|
37
|
+
super();
|
|
38
|
+
this.viewId = viewId;
|
|
39
|
+
this.groupId = groupId;
|
|
40
|
+
this.panelId = panelId;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
class PaneTransfer extends TransferObject {
|
|
44
|
+
constructor(viewId, paneId) {
|
|
45
|
+
super();
|
|
46
|
+
this.viewId = viewId;
|
|
47
|
+
this.paneId = paneId;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
52
|
+
*/
|
|
53
|
+
class LocalSelectionTransfer {
|
|
54
|
+
constructor() {
|
|
55
|
+
// protect against external instantiation
|
|
56
|
+
}
|
|
57
|
+
static getInstance() {
|
|
58
|
+
return LocalSelectionTransfer.INSTANCE;
|
|
59
|
+
}
|
|
60
|
+
hasData(proto) {
|
|
61
|
+
return proto && proto === this.proto;
|
|
62
|
+
}
|
|
63
|
+
clearData(proto) {
|
|
64
|
+
if (this.hasData(proto)) {
|
|
65
|
+
this.proto = undefined;
|
|
66
|
+
this.data = undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
getData(proto) {
|
|
70
|
+
if (this.hasData(proto)) {
|
|
71
|
+
return this.data;
|
|
72
|
+
}
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
setData(data, proto) {
|
|
76
|
+
if (proto) {
|
|
77
|
+
this.data = data;
|
|
78
|
+
this.proto = proto;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
LocalSelectionTransfer.INSTANCE = new LocalSelectionTransfer();
|
|
83
|
+
function getPanelData() {
|
|
84
|
+
const panelTransfer = LocalSelectionTransfer.getInstance();
|
|
85
|
+
const isPanelEvent = panelTransfer.hasData(PanelTransfer.prototype);
|
|
86
|
+
if (!isPanelEvent) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
return panelTransfer.getData(PanelTransfer.prototype)[0];
|
|
90
|
+
}
|
|
91
|
+
function getPaneData() {
|
|
92
|
+
const paneTransfer = LocalSelectionTransfer.getInstance();
|
|
93
|
+
const isPanelEvent = paneTransfer.hasData(PaneTransfer.prototype);
|
|
94
|
+
if (!isPanelEvent) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
return paneTransfer.getData(PaneTransfer.prototype)[0];
|
|
98
|
+
}
|
|
99
|
+
|
|
30
100
|
exports.Event = void 0;
|
|
31
101
|
(function (Event) {
|
|
32
102
|
Event.any = (...children) => {
|
|
@@ -57,7 +127,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
57
127
|
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.replay) && this._last !== undefined) {
|
|
58
128
|
listener(this._last);
|
|
59
129
|
}
|
|
60
|
-
this._listeners.length === 0;
|
|
61
130
|
this._listeners.push(listener);
|
|
62
131
|
return {
|
|
63
132
|
dispose: () => {
|
|
@@ -73,9 +142,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
73
142
|
}
|
|
74
143
|
fire(e) {
|
|
75
144
|
this._last = e;
|
|
76
|
-
this._listeners
|
|
145
|
+
for (const listener of this._listeners) {
|
|
77
146
|
listener(e);
|
|
78
|
-
}
|
|
147
|
+
}
|
|
79
148
|
}
|
|
80
149
|
dispose() {
|
|
81
150
|
this._listeners = [];
|
|
@@ -117,164 +186,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
117
186
|
}
|
|
118
187
|
}
|
|
119
188
|
|
|
120
|
-
exports.Disposable = void 0;
|
|
121
|
-
(function (Disposable) {
|
|
122
|
-
Disposable.NONE = {
|
|
123
|
-
dispose: () => {
|
|
124
|
-
// noop
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
})(exports.Disposable || (exports.Disposable = {}));
|
|
128
|
-
class CompositeDisposable {
|
|
129
|
-
constructor(...args) {
|
|
130
|
-
this.disposables = args;
|
|
131
|
-
}
|
|
132
|
-
static from(...args) {
|
|
133
|
-
return new CompositeDisposable(...args);
|
|
134
|
-
}
|
|
135
|
-
addDisposables(...args) {
|
|
136
|
-
args === null || args === void 0 ? void 0 : args.forEach((arg) => this.disposables.push(arg));
|
|
137
|
-
}
|
|
138
|
-
dispose() {
|
|
139
|
-
this.disposables.forEach((arg) => arg.dispose());
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
class MutableDisposable {
|
|
143
|
-
constructor() {
|
|
144
|
-
this._disposable = exports.Disposable.NONE;
|
|
145
|
-
}
|
|
146
|
-
set value(disposable) {
|
|
147
|
-
if (this._disposable) {
|
|
148
|
-
this._disposable.dispose();
|
|
149
|
-
}
|
|
150
|
-
this._disposable = disposable;
|
|
151
|
-
}
|
|
152
|
-
dispose() {
|
|
153
|
-
if (this._disposable) {
|
|
154
|
-
this._disposable.dispose();
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
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
|
-
class TransferObject {
|
|
170
|
-
constructor() {
|
|
171
|
-
//
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
class PanelTransfer extends TransferObject {
|
|
175
|
-
constructor(viewId, groupId, panelId) {
|
|
176
|
-
super();
|
|
177
|
-
this.viewId = viewId;
|
|
178
|
-
this.groupId = groupId;
|
|
179
|
-
this.panelId = panelId;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
class PaneTransfer extends TransferObject {
|
|
183
|
-
constructor(viewId, paneId) {
|
|
184
|
-
super();
|
|
185
|
-
this.viewId = viewId;
|
|
186
|
-
this.paneId = paneId;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
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
|
-
/**
|
|
229
|
-
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
230
|
-
*/
|
|
231
|
-
class LocalSelectionTransfer {
|
|
232
|
-
constructor() {
|
|
233
|
-
// protect against external instantiation
|
|
234
|
-
}
|
|
235
|
-
static getInstance() {
|
|
236
|
-
return LocalSelectionTransfer.INSTANCE;
|
|
237
|
-
}
|
|
238
|
-
hasData(proto) {
|
|
239
|
-
return proto && proto === this.proto;
|
|
240
|
-
}
|
|
241
|
-
clearData(proto) {
|
|
242
|
-
if (this.hasData(proto)) {
|
|
243
|
-
this.proto = undefined;
|
|
244
|
-
this.data = undefined;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
getData(proto) {
|
|
248
|
-
if (this.hasData(proto)) {
|
|
249
|
-
return this.data;
|
|
250
|
-
}
|
|
251
|
-
return undefined;
|
|
252
|
-
}
|
|
253
|
-
setData(data, proto) {
|
|
254
|
-
if (proto) {
|
|
255
|
-
this.data = data;
|
|
256
|
-
this.proto = proto;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
LocalSelectionTransfer.INSTANCE = new LocalSelectionTransfer();
|
|
261
|
-
function getPanelData() {
|
|
262
|
-
const panelTransfer = LocalSelectionTransfer.getInstance();
|
|
263
|
-
const isPanelEvent = panelTransfer.hasData(PanelTransfer.prototype);
|
|
264
|
-
if (!isPanelEvent) {
|
|
265
|
-
return undefined;
|
|
266
|
-
}
|
|
267
|
-
return panelTransfer.getData(PanelTransfer.prototype)[0];
|
|
268
|
-
}
|
|
269
|
-
function getPaneData() {
|
|
270
|
-
const paneTransfer = LocalSelectionTransfer.getInstance();
|
|
271
|
-
const isPanelEvent = paneTransfer.hasData(PaneTransfer.prototype);
|
|
272
|
-
if (!isPanelEvent) {
|
|
273
|
-
return undefined;
|
|
274
|
-
}
|
|
275
|
-
return paneTransfer.getData(PaneTransfer.prototype)[0];
|
|
276
|
-
}
|
|
277
|
-
|
|
278
189
|
class SplitviewApi {
|
|
279
190
|
constructor(component) {
|
|
280
191
|
this.component = component;
|
|
@@ -294,6 +205,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
294
205
|
get length() {
|
|
295
206
|
return this.component.length;
|
|
296
207
|
}
|
|
208
|
+
get orientation() {
|
|
209
|
+
return this.component.orientation;
|
|
210
|
+
}
|
|
297
211
|
get onDidLayoutChange() {
|
|
298
212
|
return this.component.onDidLayoutChange;
|
|
299
213
|
}
|
|
@@ -303,9 +217,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
303
217
|
get onDidRemoveView() {
|
|
304
218
|
return this.component.onDidRemoveView;
|
|
305
219
|
}
|
|
306
|
-
get orientation() {
|
|
307
|
-
return this.component.orientation;
|
|
308
|
-
}
|
|
309
220
|
updateOptions(options) {
|
|
310
221
|
this.component.updateOptions(options);
|
|
311
222
|
}
|
|
@@ -350,18 +261,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
350
261
|
constructor(component) {
|
|
351
262
|
this.component = component;
|
|
352
263
|
}
|
|
353
|
-
get width() {
|
|
354
|
-
return this.component.width;
|
|
355
|
-
}
|
|
356
|
-
get height() {
|
|
357
|
-
return this.component.height;
|
|
358
|
-
}
|
|
359
264
|
get minimumSize() {
|
|
360
265
|
return this.component.minimumSize;
|
|
361
266
|
}
|
|
362
267
|
get maximumSize() {
|
|
363
268
|
return this.component.maximumSize;
|
|
364
269
|
}
|
|
270
|
+
get height() {
|
|
271
|
+
return this.component.height;
|
|
272
|
+
}
|
|
273
|
+
get width() {
|
|
274
|
+
return this.component.width;
|
|
275
|
+
}
|
|
365
276
|
get onDidLayoutChange() {
|
|
366
277
|
return this.component.onDidLayoutChange;
|
|
367
278
|
}
|
|
@@ -401,7 +312,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
401
312
|
this.component.layout(width, height);
|
|
402
313
|
}
|
|
403
314
|
addPanel(options) {
|
|
404
|
-
|
|
315
|
+
this.component.addPanel(options);
|
|
405
316
|
}
|
|
406
317
|
resizeToFit() {
|
|
407
318
|
this.component.resizeToFit();
|
|
@@ -417,12 +328,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
417
328
|
constructor(component) {
|
|
418
329
|
this.component = component;
|
|
419
330
|
}
|
|
420
|
-
get width() {
|
|
421
|
-
return this.component.width;
|
|
422
|
-
}
|
|
423
|
-
get height() {
|
|
424
|
-
return this.component.height;
|
|
425
|
-
}
|
|
426
331
|
get minimumHeight() {
|
|
427
332
|
return this.component.minimumHeight;
|
|
428
333
|
}
|
|
@@ -435,12 +340,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
435
340
|
get maximumWidth() {
|
|
436
341
|
return this.component.maximumWidth;
|
|
437
342
|
}
|
|
438
|
-
get
|
|
439
|
-
return this.component.
|
|
343
|
+
get width() {
|
|
344
|
+
return this.component.width;
|
|
345
|
+
}
|
|
346
|
+
get height() {
|
|
347
|
+
return this.component.height;
|
|
440
348
|
}
|
|
441
349
|
get onDidLayoutChange() {
|
|
442
350
|
return this.component.onDidLayoutChange;
|
|
443
351
|
}
|
|
352
|
+
get onDidAddGroup() {
|
|
353
|
+
return this.component.onDidAddGroup;
|
|
354
|
+
}
|
|
355
|
+
get onDidRemoveGroup() {
|
|
356
|
+
return this.component.onDidRemoveGroup;
|
|
357
|
+
}
|
|
358
|
+
get onDidActiveGroupChange() {
|
|
359
|
+
return this.component.onDidActiveGroupChange;
|
|
360
|
+
}
|
|
361
|
+
get onDidLayoutFromJSON() {
|
|
362
|
+
return this.component.onDidLayoutFromJSON;
|
|
363
|
+
}
|
|
444
364
|
get panels() {
|
|
445
365
|
return this.component.groups;
|
|
446
366
|
}
|
|
@@ -515,8 +435,26 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
515
435
|
get totalPanels() {
|
|
516
436
|
return this.component.totalPanels;
|
|
517
437
|
}
|
|
518
|
-
get
|
|
519
|
-
return this.component.
|
|
438
|
+
get onDidActiveGroupChange() {
|
|
439
|
+
return this.component.onDidActiveGroupChange;
|
|
440
|
+
}
|
|
441
|
+
get onDidAddGroup() {
|
|
442
|
+
return this.component.onDidAddGroup;
|
|
443
|
+
}
|
|
444
|
+
get onDidRemoveGroup() {
|
|
445
|
+
return this.component.onDidRemoveGroup;
|
|
446
|
+
}
|
|
447
|
+
get onDidActivePanelChange() {
|
|
448
|
+
return this.component.onDidActivePanelChange;
|
|
449
|
+
}
|
|
450
|
+
get onDidAddPanel() {
|
|
451
|
+
return this.component.onDidAddPanel;
|
|
452
|
+
}
|
|
453
|
+
get onDidRemovePanel() {
|
|
454
|
+
return this.component.onDidRemovePanel;
|
|
455
|
+
}
|
|
456
|
+
get onDidLayoutfromJSON() {
|
|
457
|
+
return this.component.onDidLayoutfromJSON;
|
|
520
458
|
}
|
|
521
459
|
get onDidLayoutChange() {
|
|
522
460
|
return this.component.onDidLayoutChange;
|
|
@@ -545,18 +483,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
545
483
|
getPanel(id) {
|
|
546
484
|
return this.component.getGroupPanel(id);
|
|
547
485
|
}
|
|
548
|
-
setActivePanel(panel) {
|
|
549
|
-
this.component.setActivePanel(panel);
|
|
550
|
-
}
|
|
551
486
|
layout(width, height, force = false) {
|
|
552
487
|
this.component.layout(width, height, force);
|
|
553
488
|
}
|
|
554
489
|
addPanel(options) {
|
|
555
490
|
return this.component.addPanel(options);
|
|
556
491
|
}
|
|
557
|
-
removePanel(panel) {
|
|
558
|
-
this.component.removePanel(panel);
|
|
559
|
-
}
|
|
560
492
|
addEmptyGroup(options) {
|
|
561
493
|
this.component.addEmptyGroup(options);
|
|
562
494
|
}
|
|
@@ -586,6 +518,46 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
586
518
|
}
|
|
587
519
|
}
|
|
588
520
|
|
|
521
|
+
var Disposable;
|
|
522
|
+
(function (Disposable) {
|
|
523
|
+
Disposable.NONE = {
|
|
524
|
+
dispose: () => {
|
|
525
|
+
// noop
|
|
526
|
+
},
|
|
527
|
+
};
|
|
528
|
+
})(Disposable || (Disposable = {}));
|
|
529
|
+
class CompositeDisposable {
|
|
530
|
+
constructor(...args) {
|
|
531
|
+
this.disposables = args;
|
|
532
|
+
}
|
|
533
|
+
static from(...args) {
|
|
534
|
+
return new CompositeDisposable(...args);
|
|
535
|
+
}
|
|
536
|
+
addDisposables(...args) {
|
|
537
|
+
args.forEach((arg) => this.disposables.push(arg));
|
|
538
|
+
}
|
|
539
|
+
dispose() {
|
|
540
|
+
this.disposables.forEach((arg) => arg.dispose());
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
class MutableDisposable {
|
|
544
|
+
constructor() {
|
|
545
|
+
this._disposable = Disposable.NONE;
|
|
546
|
+
}
|
|
547
|
+
set value(disposable) {
|
|
548
|
+
if (this._disposable) {
|
|
549
|
+
this._disposable.dispose();
|
|
550
|
+
}
|
|
551
|
+
this._disposable = disposable;
|
|
552
|
+
}
|
|
553
|
+
dispose() {
|
|
554
|
+
if (this._disposable) {
|
|
555
|
+
this._disposable.dispose();
|
|
556
|
+
this._disposable = Disposable.NONE;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
589
561
|
function watchElementResize(element, cb) {
|
|
590
562
|
const observer = new ResizeObserver((entires) => {
|
|
591
563
|
const firstEntry = entires[0];
|
|
@@ -1531,13 +1503,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1531
1503
|
this._onDidSashEnd.dispose();
|
|
1532
1504
|
this._onDidAddView.dispose();
|
|
1533
1505
|
this._onDidRemoveView.dispose();
|
|
1534
|
-
this.element.remove();
|
|
1535
1506
|
for (let i = 0; i < this.element.children.length; i++) {
|
|
1536
1507
|
if (this.element.children.item(i) === this.element) {
|
|
1537
1508
|
this.element.removeChild(this.element);
|
|
1538
1509
|
break;
|
|
1539
1510
|
}
|
|
1540
1511
|
}
|
|
1512
|
+
this.element.remove();
|
|
1541
1513
|
}
|
|
1542
1514
|
}
|
|
1543
1515
|
|
|
@@ -1560,7 +1532,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1560
1532
|
});
|
|
1561
1533
|
// if we've added views from the descriptor we need to
|
|
1562
1534
|
// add the panes to our Pane array and setup animation
|
|
1563
|
-
this.getPanes().forEach((pane
|
|
1535
|
+
this.getPanes().forEach((pane) => {
|
|
1564
1536
|
const disposable = new CompositeDisposable(pane.onDidChangeExpansionState(() => {
|
|
1565
1537
|
this.setupAnimation();
|
|
1566
1538
|
this._onDidChange.fire(undefined);
|
|
@@ -1576,7 +1548,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1576
1548
|
this.paneItems.push(paneItem);
|
|
1577
1549
|
pane.orthogonalSize = this.splitview.orthogonalSize;
|
|
1578
1550
|
});
|
|
1579
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
1551
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
1580
1552
|
this._onDidChange.fire(undefined);
|
|
1581
1553
|
}), this.splitview.onDidAddView(() => {
|
|
1582
1554
|
this._onDidChange.fire();
|
|
@@ -1628,17 +1600,20 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1628
1600
|
getPanes() {
|
|
1629
1601
|
return this.splitview.getViews();
|
|
1630
1602
|
}
|
|
1631
|
-
removePane(index) {
|
|
1603
|
+
removePane(index, options = { skipDispose: false }) {
|
|
1632
1604
|
const paneItem = this.paneItems.splice(index, 1)[0];
|
|
1633
1605
|
this.splitview.removeView(index);
|
|
1634
|
-
|
|
1606
|
+
if (!options.skipDispose) {
|
|
1607
|
+
paneItem.disposable.dispose();
|
|
1608
|
+
paneItem.pane.dispose();
|
|
1609
|
+
}
|
|
1635
1610
|
return paneItem;
|
|
1636
1611
|
}
|
|
1637
1612
|
moveView(from, to) {
|
|
1638
1613
|
if (from === to) {
|
|
1639
1614
|
return;
|
|
1640
1615
|
}
|
|
1641
|
-
const view = this.removePane(from);
|
|
1616
|
+
const view = this.removePane(from, { skipDispose: true });
|
|
1642
1617
|
this.skipAnimation = true;
|
|
1643
1618
|
try {
|
|
1644
1619
|
this.addPane(view.pane, view.pane.size, to, false);
|
|
@@ -1666,15 +1641,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1666
1641
|
}
|
|
1667
1642
|
dispose() {
|
|
1668
1643
|
super.dispose();
|
|
1669
|
-
this.splitview.dispose();
|
|
1670
1644
|
if (this.animationTimer) {
|
|
1671
1645
|
clearTimeout(this.animationTimer);
|
|
1672
1646
|
this.animationTimer = undefined;
|
|
1673
1647
|
}
|
|
1674
1648
|
this.paneItems.forEach((paneItem) => {
|
|
1675
1649
|
paneItem.disposable.dispose();
|
|
1650
|
+
paneItem.pane.dispose();
|
|
1676
1651
|
});
|
|
1677
1652
|
this.paneItems = [];
|
|
1653
|
+
this.splitview.dispose();
|
|
1678
1654
|
this.element.remove();
|
|
1679
1655
|
}
|
|
1680
1656
|
}
|
|
@@ -1737,8 +1713,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1737
1713
|
this.options = options;
|
|
1738
1714
|
this._onDrop = new Emitter();
|
|
1739
1715
|
this.onDrop = this._onDrop.event;
|
|
1740
|
-
this.addDisposables(new DragAndDropObserver(this.element, {
|
|
1741
|
-
onDragEnter: (
|
|
1716
|
+
this.addDisposables(this._onDrop, new DragAndDropObserver(this.element, {
|
|
1717
|
+
onDragEnter: () => undefined,
|
|
1742
1718
|
onDragOver: (e) => {
|
|
1743
1719
|
if (isBooleanValue(this.options.canDisplayOverlay)) {
|
|
1744
1720
|
if (!this.options.canDisplayOverlay) {
|
|
@@ -1773,56 +1749,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1773
1749
|
const y = e.offsetY;
|
|
1774
1750
|
const xp = (100 * x) / width;
|
|
1775
1751
|
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
|
-
}
|
|
1752
|
+
const quadrant = this.calculateQuadrant(this.options.validOverlays, xp, yp);
|
|
1796
1753
|
const isSmallX = width < 100;
|
|
1797
1754
|
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
|
-
}
|
|
1755
|
+
this.toggleClasses(quadrant, isSmallX, isSmallY);
|
|
1756
|
+
this.setState(quadrant);
|
|
1821
1757
|
},
|
|
1822
|
-
onDragLeave: (
|
|
1758
|
+
onDragLeave: () => {
|
|
1823
1759
|
this.removeDropTarget();
|
|
1824
1760
|
},
|
|
1825
|
-
onDragEnd: (
|
|
1761
|
+
onDragEnd: () => {
|
|
1826
1762
|
this.removeDropTarget();
|
|
1827
1763
|
},
|
|
1828
1764
|
onDrop: (e) => {
|
|
@@ -1846,9 +1782,73 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1846
1782
|
this.options.canDisplayOverlay = value;
|
|
1847
1783
|
}
|
|
1848
1784
|
dispose() {
|
|
1849
|
-
this._onDrop.dispose();
|
|
1850
1785
|
this.removeDropTarget();
|
|
1851
1786
|
}
|
|
1787
|
+
toggleClasses(quadrant, isSmallX, isSmallY) {
|
|
1788
|
+
if (!this.overlay) {
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1791
|
+
const isLeft = quadrant === 'left';
|
|
1792
|
+
const isRight = quadrant === 'right';
|
|
1793
|
+
const isTop = quadrant === 'top';
|
|
1794
|
+
const isBottom = quadrant === 'bottom';
|
|
1795
|
+
toggleClass(this.overlay, 'right', !isSmallX && isRight);
|
|
1796
|
+
toggleClass(this.overlay, 'left', !isSmallX && isLeft);
|
|
1797
|
+
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1798
|
+
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1799
|
+
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1800
|
+
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1801
|
+
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1802
|
+
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1803
|
+
}
|
|
1804
|
+
setState(quadrant) {
|
|
1805
|
+
switch (quadrant) {
|
|
1806
|
+
case 'top':
|
|
1807
|
+
this._state = exports.Position.Top;
|
|
1808
|
+
break;
|
|
1809
|
+
case 'left':
|
|
1810
|
+
this._state = exports.Position.Left;
|
|
1811
|
+
break;
|
|
1812
|
+
case 'bottom':
|
|
1813
|
+
this._state = exports.Position.Bottom;
|
|
1814
|
+
break;
|
|
1815
|
+
case 'right':
|
|
1816
|
+
this._state = exports.Position.Right;
|
|
1817
|
+
break;
|
|
1818
|
+
default:
|
|
1819
|
+
this._state = exports.Position.Center;
|
|
1820
|
+
break;
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
calculateQuadrant(overlayType, xp, yp) {
|
|
1824
|
+
switch (overlayType) {
|
|
1825
|
+
case 'all':
|
|
1826
|
+
if (xp < 20) {
|
|
1827
|
+
return 'left';
|
|
1828
|
+
}
|
|
1829
|
+
if (xp > 80) {
|
|
1830
|
+
return 'right';
|
|
1831
|
+
}
|
|
1832
|
+
if (yp < 20) {
|
|
1833
|
+
return 'top';
|
|
1834
|
+
}
|
|
1835
|
+
if (yp > 80) {
|
|
1836
|
+
return 'bottom';
|
|
1837
|
+
}
|
|
1838
|
+
break;
|
|
1839
|
+
case 'vertical':
|
|
1840
|
+
if (yp < 50) {
|
|
1841
|
+
return 'top';
|
|
1842
|
+
}
|
|
1843
|
+
return 'bottom';
|
|
1844
|
+
case 'horizontal':
|
|
1845
|
+
if (xp < 50) {
|
|
1846
|
+
return 'left';
|
|
1847
|
+
}
|
|
1848
|
+
return 'right';
|
|
1849
|
+
}
|
|
1850
|
+
return null;
|
|
1851
|
+
}
|
|
1852
1852
|
removeDropTarget() {
|
|
1853
1853
|
if (this.target) {
|
|
1854
1854
|
this._state = undefined;
|
|
@@ -1951,6 +1951,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1951
1951
|
this.view.layout(this.width, this.height);
|
|
1952
1952
|
}
|
|
1953
1953
|
dispose() {
|
|
1954
|
+
this._onDidChange.dispose();
|
|
1954
1955
|
this._disposable.dispose();
|
|
1955
1956
|
}
|
|
1956
1957
|
}
|
|
@@ -1968,7 +1969,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1968
1969
|
this.children = [];
|
|
1969
1970
|
this._onDidChange = new Emitter();
|
|
1970
1971
|
this.onDidChange = this._onDidChange.event;
|
|
1971
|
-
this._childrenDisposable =
|
|
1972
|
+
this._childrenDisposable = Disposable.NONE;
|
|
1972
1973
|
this._orthogonalSize = orthogonalSize;
|
|
1973
1974
|
this._size = size;
|
|
1974
1975
|
this.element = document.createElement('div');
|
|
@@ -1993,7 +1994,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1993
1994
|
: true,
|
|
1994
1995
|
};
|
|
1995
1996
|
}),
|
|
1996
|
-
size: this.
|
|
1997
|
+
size: this.size,
|
|
1997
1998
|
};
|
|
1998
1999
|
this.children = childDescriptors.map((c) => c.node);
|
|
1999
2000
|
this.splitview = new Splitview(this.element, {
|
|
@@ -2002,7 +2003,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2002
2003
|
proportionalLayout,
|
|
2003
2004
|
});
|
|
2004
2005
|
}
|
|
2005
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
2006
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
2006
2007
|
this._onDidChange.fire(undefined);
|
|
2007
2008
|
}));
|
|
2008
2009
|
this.setupChildrenEvents();
|
|
@@ -2154,7 +2155,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2154
2155
|
}
|
|
2155
2156
|
setupChildrenEvents() {
|
|
2156
2157
|
this._childrenDisposable.dispose();
|
|
2157
|
-
this._childrenDisposable = exports.Event.any(...this.children.map((c) => c.onDidChange))((
|
|
2158
|
+
this._childrenDisposable = exports.Event.any(...this.children.map((c) => c.onDidChange))(() => {
|
|
2158
2159
|
/**
|
|
2159
2160
|
* indicate a change has occured to allows any re-rendering but don't bubble
|
|
2160
2161
|
* event because that was specific to this branch
|
|
@@ -2174,6 +2175,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2174
2175
|
* Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
|
|
2175
2176
|
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
|
|
2176
2177
|
*--------------------------------------------------------------------------------------------*/
|
|
2178
|
+
function findLeaf(candiateNode, last) {
|
|
2179
|
+
if (candiateNode instanceof LeafNode) {
|
|
2180
|
+
return candiateNode;
|
|
2181
|
+
}
|
|
2182
|
+
if (candiateNode instanceof BranchNode) {
|
|
2183
|
+
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2184
|
+
}
|
|
2185
|
+
throw new Error('invalid node');
|
|
2186
|
+
}
|
|
2177
2187
|
function flipNode(node, size, orthogonalSize) {
|
|
2178
2188
|
if (node instanceof BranchNode) {
|
|
2179
2189
|
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize);
|
|
@@ -2305,6 +2315,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2305
2315
|
this.disposable.dispose();
|
|
2306
2316
|
this._onDidChange.dispose();
|
|
2307
2317
|
this.root.dispose();
|
|
2318
|
+
this.element.remove();
|
|
2308
2319
|
}
|
|
2309
2320
|
clear() {
|
|
2310
2321
|
const orientation = this.root.orientation;
|
|
@@ -2312,13 +2323,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2312
2323
|
}
|
|
2313
2324
|
deserialize(json, deserializer) {
|
|
2314
2325
|
const orientation = json.orientation;
|
|
2315
|
-
const height = json.height;
|
|
2326
|
+
const height = orientation === exports.Orientation.VERTICAL ? json.height : json.width;
|
|
2316
2327
|
this._deserialize(json.root, orientation, deserializer, height);
|
|
2317
2328
|
}
|
|
2318
2329
|
_deserialize(root, orientation, deserializer, orthogonalSize) {
|
|
2319
|
-
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize);
|
|
2330
|
+
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize, true);
|
|
2320
2331
|
}
|
|
2321
|
-
_deserializeNode(node, orientation, deserializer, orthogonalSize) {
|
|
2332
|
+
_deserializeNode(node, orientation, deserializer, orthogonalSize, isRoot = false) {
|
|
2322
2333
|
let result;
|
|
2323
2334
|
if (node.type === 'branch') {
|
|
2324
2335
|
const serializedChildren = node.data;
|
|
@@ -2328,7 +2339,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2328
2339
|
visible: serializedChild.visible,
|
|
2329
2340
|
};
|
|
2330
2341
|
});
|
|
2331
|
-
|
|
2342
|
+
// HORIZONTAL => height=orthogonalsize width=size
|
|
2343
|
+
// VERTICAL => height=size width=orthogonalsize
|
|
2344
|
+
result = new BranchNode(orientation, this.proportionalLayout, this.styles, isRoot ? orthogonalSize : node.size, isRoot ? node.size : orthogonalSize, children);
|
|
2332
2345
|
}
|
|
2333
2346
|
else {
|
|
2334
2347
|
result = new LeafNode(deserializer.fromJSON(node), orientation, orthogonalSize, node.size);
|
|
@@ -2389,15 +2402,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2389
2402
|
if (!(node instanceof LeafNode)) {
|
|
2390
2403
|
throw new Error('invalid location');
|
|
2391
2404
|
}
|
|
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
2405
|
for (let i = path.length - 1; i > -1; i--) {
|
|
2402
2406
|
const n = path[i];
|
|
2403
2407
|
const l = location[i] || 0;
|
|
@@ -2499,9 +2503,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2499
2503
|
if (parent.children.length > 1) {
|
|
2500
2504
|
return node.view;
|
|
2501
2505
|
}
|
|
2506
|
+
const sibling = parent.children[0];
|
|
2502
2507
|
if (pathToParent.length === 0) {
|
|
2503
2508
|
// parent is root
|
|
2504
|
-
const sibling = parent.children[0];
|
|
2505
2509
|
if (sibling instanceof LeafNode) {
|
|
2506
2510
|
return node.view;
|
|
2507
2511
|
}
|
|
@@ -2512,10 +2516,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2512
2516
|
}
|
|
2513
2517
|
const [grandParent, ..._] = [...pathToParent].reverse();
|
|
2514
2518
|
const [parentIndex, ...__] = [...rest].reverse();
|
|
2515
|
-
const sibling = parent.children[0];
|
|
2516
2519
|
const isSiblingVisible = parent.isChildVisible(0);
|
|
2517
2520
|
parent.removeChild(0, sizing);
|
|
2518
|
-
const sizes = grandParent.children.map((
|
|
2521
|
+
const sizes = grandParent.children.map((_size, i) => grandParent.getChildSize(i));
|
|
2519
2522
|
grandParent.removeChild(parentIndex, sizing);
|
|
2520
2523
|
if (sibling instanceof BranchNode) {
|
|
2521
2524
|
sizes.splice(parentIndex, 1, ...sibling.children.map((c) => c.size));
|
|
@@ -2559,31 +2562,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2559
2562
|
}
|
|
2560
2563
|
}
|
|
2561
2564
|
|
|
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
2565
|
class ContentContainer extends CompositeDisposable {
|
|
2588
2566
|
constructor() {
|
|
2589
2567
|
super();
|
|
@@ -2595,6 +2573,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2595
2573
|
this._element = document.createElement('div');
|
|
2596
2574
|
this._element.className = 'content-container';
|
|
2597
2575
|
this._element.tabIndex = -1;
|
|
2576
|
+
this.addDisposables(this._onDidFocus, this._onDidBlur);
|
|
2598
2577
|
// for hosted containers
|
|
2599
2578
|
// 1) register a drop target on the host
|
|
2600
2579
|
// 2) register window dragStart events to disable pointer events
|
|
@@ -2638,7 +2617,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2638
2617
|
}
|
|
2639
2618
|
this.disposable.value = disposable;
|
|
2640
2619
|
}
|
|
2641
|
-
layout(
|
|
2620
|
+
layout(_width, _height) {
|
|
2642
2621
|
// noop
|
|
2643
2622
|
}
|
|
2644
2623
|
closePanel() {
|
|
@@ -2661,6 +2640,41 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2661
2640
|
DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
|
|
2662
2641
|
})(DockviewDropTargets || (DockviewDropTargets = {}));
|
|
2663
2642
|
|
|
2643
|
+
class DragHandler extends CompositeDisposable {
|
|
2644
|
+
constructor(el) {
|
|
2645
|
+
super();
|
|
2646
|
+
this.el = el;
|
|
2647
|
+
this.disposable = new MutableDisposable();
|
|
2648
|
+
this._onDragStart = new Emitter();
|
|
2649
|
+
this.onDragStart = this._onDragStart.event;
|
|
2650
|
+
this.iframes = [];
|
|
2651
|
+
this.configure();
|
|
2652
|
+
}
|
|
2653
|
+
configure() {
|
|
2654
|
+
this.addDisposables(this._onDragStart, addDisposableListener(this.el, 'dragstart', (event) => {
|
|
2655
|
+
this.iframes = [
|
|
2656
|
+
...getElementsByTagName('iframe'),
|
|
2657
|
+
...getElementsByTagName('webview'),
|
|
2658
|
+
];
|
|
2659
|
+
for (const iframe of this.iframes) {
|
|
2660
|
+
iframe.style.pointerEvents = 'none';
|
|
2661
|
+
}
|
|
2662
|
+
this.el.classList.add('dragged');
|
|
2663
|
+
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
2664
|
+
this.disposable.value = this.getData();
|
|
2665
|
+
if (event.dataTransfer) {
|
|
2666
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
2667
|
+
}
|
|
2668
|
+
}), addDisposableListener(this.el, 'dragend', () => {
|
|
2669
|
+
for (const iframe of this.iframes) {
|
|
2670
|
+
iframe.style.pointerEvents = 'auto';
|
|
2671
|
+
}
|
|
2672
|
+
this.iframes = [];
|
|
2673
|
+
this.disposable.dispose();
|
|
2674
|
+
}));
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2664
2678
|
exports.MouseEventKind = void 0;
|
|
2665
2679
|
(function (MouseEventKind) {
|
|
2666
2680
|
MouseEventKind["CLICK"] = "CLICK";
|
|
@@ -2670,42 +2684,34 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2670
2684
|
constructor(panelId, accessor, group) {
|
|
2671
2685
|
super();
|
|
2672
2686
|
this.panelId = panelId;
|
|
2673
|
-
this.accessor = accessor;
|
|
2674
2687
|
this.group = group;
|
|
2675
2688
|
this._onChanged = new Emitter();
|
|
2676
2689
|
this.onChanged = this._onChanged.event;
|
|
2677
2690
|
this._onDropped = new Emitter();
|
|
2678
2691
|
this.onDrop = this._onDropped.event;
|
|
2679
|
-
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2680
|
-
this.iframes = [];
|
|
2681
2692
|
this.addDisposables(this._onChanged, this._onDropped);
|
|
2682
2693
|
this._element = document.createElement('div');
|
|
2683
2694
|
this._element.className = 'tab';
|
|
2684
2695
|
this._element.tabIndex = 0;
|
|
2685
2696
|
this._element.draggable = true;
|
|
2686
|
-
this.addDisposables(
|
|
2687
|
-
|
|
2688
|
-
...
|
|
2689
|
-
|
|
2690
|
-
];
|
|
2691
|
-
for (const iframe of this.iframes) {
|
|
2692
|
-
iframe.style.pointerEvents = 'none';
|
|
2697
|
+
this.addDisposables(new (class Handler extends DragHandler {
|
|
2698
|
+
constructor() {
|
|
2699
|
+
super(...arguments);
|
|
2700
|
+
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2693
2701
|
}
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2702
|
+
getData() {
|
|
2703
|
+
this.panelTransfer.setData([new PanelTransfer(accessor.id, group.id, panelId)], PanelTransfer.prototype);
|
|
2704
|
+
return {
|
|
2705
|
+
dispose: () => {
|
|
2706
|
+
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
2707
|
+
},
|
|
2708
|
+
};
|
|
2701
2709
|
}
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
iframe.style.pointerEvents = 'auto';
|
|
2710
|
+
dispose() {
|
|
2711
|
+
//
|
|
2705
2712
|
}
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
}), addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2713
|
+
})(this._element));
|
|
2714
|
+
this.addDisposables(addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2709
2715
|
if (event.defaultPrevented) {
|
|
2710
2716
|
return;
|
|
2711
2717
|
}
|
|
@@ -2907,12 +2913,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2907
2913
|
if (!isLeftClick || event.event.defaultPrevented) {
|
|
2908
2914
|
return;
|
|
2909
2915
|
}
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
});
|
|
2915
|
-
break;
|
|
2916
|
+
if (event.kind === exports.MouseEventKind.CLICK) {
|
|
2917
|
+
this.group.model.openPanel(panel, {
|
|
2918
|
+
skipFocus: alreadyFocused,
|
|
2919
|
+
});
|
|
2916
2920
|
}
|
|
2917
2921
|
}), tabToAdd.onDrop((event) => {
|
|
2918
2922
|
this._onDrop.fire({
|
|
@@ -2941,7 +2945,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2941
2945
|
GroupChangeKind2["ADD_PANEL"] = "ADD_PANEL";
|
|
2942
2946
|
GroupChangeKind2["REMOVE_PANEL"] = "REMOVE_PANEL";
|
|
2943
2947
|
GroupChangeKind2["PANEL_ACTIVE"] = "PANEL_ACTIVE";
|
|
2944
|
-
GroupChangeKind2["GROUP_ACTIVE"] = "GROUP_ACTIVE";
|
|
2945
2948
|
})(exports.GroupChangeKind2 || (exports.GroupChangeKind2 = {}));
|
|
2946
2949
|
class Groupview extends CompositeDisposable {
|
|
2947
2950
|
constructor(container, accessor, id, options, parent) {
|
|
@@ -2962,15 +2965,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2962
2965
|
this.onMove = this._onMove.event;
|
|
2963
2966
|
this._onDidGroupChange = new Emitter();
|
|
2964
2967
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
2965
|
-
this.
|
|
2966
|
-
|
|
2967
|
-
return false;
|
|
2968
|
-
}
|
|
2969
|
-
this.doClose(panel);
|
|
2970
|
-
return true;
|
|
2971
|
-
});
|
|
2968
|
+
this._onDidDrop = new Emitter();
|
|
2969
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
2972
2970
|
this.container.classList.add('groupview');
|
|
2973
|
-
this.addDisposables(this._onMove, this._onDidGroupChange);
|
|
2971
|
+
this.addDisposables(this._onMove, this._onDidGroupChange, this._onDidChange, this._onDidDrop);
|
|
2974
2972
|
this.tabsContainer = new TabsContainer(this.accessor, this.parent, {
|
|
2975
2973
|
tabHeight: options.tabHeight,
|
|
2976
2974
|
});
|
|
@@ -3034,6 +3032,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3034
3032
|
get maximumWidth() {
|
|
3035
3033
|
return Number.MAX_SAFE_INTEGER;
|
|
3036
3034
|
}
|
|
3035
|
+
get hasWatermark() {
|
|
3036
|
+
return !!(this.watermark && this.container.contains(this.watermark.element));
|
|
3037
|
+
}
|
|
3037
3038
|
initialize() {
|
|
3038
3039
|
var _a, _b;
|
|
3039
3040
|
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.panels) {
|
|
@@ -3112,10 +3113,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3112
3113
|
containsPanel(panel) {
|
|
3113
3114
|
return this.panels.includes(panel);
|
|
3114
3115
|
}
|
|
3115
|
-
init(
|
|
3116
|
+
init(_params) {
|
|
3116
3117
|
//noop
|
|
3117
3118
|
}
|
|
3118
|
-
update(
|
|
3119
|
+
update(_params) {
|
|
3119
3120
|
//noop
|
|
3120
3121
|
}
|
|
3121
3122
|
focus() {
|
|
@@ -3127,6 +3128,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3127
3128
|
options.index > this.panels.length) {
|
|
3128
3129
|
options.index = this.panels.length;
|
|
3129
3130
|
}
|
|
3131
|
+
// ensure the group is updated before we fire any events
|
|
3132
|
+
panel.updateParentGroup(this.parent, true);
|
|
3130
3133
|
if (this._activePanel === panel) {
|
|
3131
3134
|
this.accessor.doSetGroupActive(this.parent);
|
|
3132
3135
|
return;
|
|
@@ -3147,43 +3150,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3147
3150
|
return this._removePanel(panelToRemove);
|
|
3148
3151
|
}
|
|
3149
3152
|
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)));
|
|
3153
|
+
if (this.panels.length > 0) {
|
|
3154
|
+
// take a copy since we will be edting the array as we iterate through
|
|
3155
|
+
const arrPanelCpy = [...this.panels];
|
|
3156
|
+
for (const panel of arrPanelCpy) {
|
|
3157
|
+
this.doClose(panel);
|
|
3181
3158
|
}
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3159
|
+
}
|
|
3160
|
+
else {
|
|
3161
|
+
this.accessor.removeGroup(this.parent);
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
closePanel(panel) {
|
|
3165
|
+
this.doClose(panel);
|
|
3187
3166
|
}
|
|
3188
3167
|
doClose(panel) {
|
|
3189
3168
|
this.accessor.removePanel(panel);
|
|
@@ -3326,8 +3305,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3326
3305
|
this.tabsContainer.show();
|
|
3327
3306
|
}
|
|
3328
3307
|
}
|
|
3329
|
-
canDisplayOverlay(
|
|
3308
|
+
canDisplayOverlay(event, target) {
|
|
3330
3309
|
// custom overlay handler
|
|
3310
|
+
if (this.accessor.options.showDndOverlay) {
|
|
3311
|
+
return this.accessor.options.showDndOverlay(event, target);
|
|
3312
|
+
}
|
|
3331
3313
|
return false;
|
|
3332
3314
|
}
|
|
3333
3315
|
handleDropEvent(event, position, index) {
|
|
@@ -3352,31 +3334,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3352
3334
|
index,
|
|
3353
3335
|
});
|
|
3354
3336
|
}
|
|
3337
|
+
else {
|
|
3338
|
+
this._onDidDrop.fire({ nativeEvent: event, position, index });
|
|
3339
|
+
}
|
|
3355
3340
|
}
|
|
3356
3341
|
dispose() {
|
|
3342
|
+
var _a;
|
|
3343
|
+
super.dispose();
|
|
3344
|
+
(_a = this.watermark) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
3357
3345
|
for (const panel of this.panels) {
|
|
3358
3346
|
panel.dispose();
|
|
3359
3347
|
}
|
|
3360
|
-
super.dispose();
|
|
3361
3348
|
this.dropTarget.dispose();
|
|
3362
3349
|
this.tabsContainer.dispose();
|
|
3363
3350
|
this.contentContainer.dispose();
|
|
3364
3351
|
}
|
|
3365
3352
|
}
|
|
3366
3353
|
|
|
3367
|
-
exports.GroupChangeKind = void 0;
|
|
3368
|
-
(function (GroupChangeKind) {
|
|
3369
|
-
GroupChangeKind["ADD_PANEL"] = "ADD_PANEL";
|
|
3370
|
-
GroupChangeKind["REMOVE_PANEL"] = "REMOVE_PANEL";
|
|
3371
|
-
GroupChangeKind["PANEL_ACTIVE"] = "PANEL_ACTIVE";
|
|
3372
|
-
//
|
|
3373
|
-
GroupChangeKind["GROUP_ACTIVE"] = "GROUP_ACTIVE";
|
|
3374
|
-
GroupChangeKind["ADD_GROUP"] = "ADD_GROUP";
|
|
3375
|
-
GroupChangeKind["REMOVE_GROUP"] = "REMOVE_GROUP";
|
|
3376
|
-
//
|
|
3377
|
-
GroupChangeKind["LAYOUT_FROM_JSON"] = "LAYOUT_FROM_JSON";
|
|
3378
|
-
GroupChangeKind["LAYOUT"] = "LAYOUT";
|
|
3379
|
-
})(exports.GroupChangeKind || (exports.GroupChangeKind = {}));
|
|
3380
3354
|
const nextLayoutId = sequentialNumberGenerator();
|
|
3381
3355
|
function toTarget(direction) {
|
|
3382
3356
|
switch (direction) {
|
|
@@ -3399,36 +3373,26 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3399
3373
|
this._element = _element;
|
|
3400
3374
|
this._id = nextLayoutId.next();
|
|
3401
3375
|
this._groups = new Map();
|
|
3402
|
-
//
|
|
3403
|
-
this._onGridEvent = new Emitter();
|
|
3404
|
-
this.onGridEvent = this._onGridEvent.event;
|
|
3405
3376
|
this._onDidLayoutChange = new Emitter();
|
|
3406
3377
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
3378
|
+
this._onDidRemoveGroup = new Emitter();
|
|
3379
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
3380
|
+
this._onDidAddGroup = new Emitter();
|
|
3381
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
3382
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3383
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3384
|
+
this._bufferOnDidLayoutChange = new TickDelayedEvent();
|
|
3407
3385
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
|
|
3408
3386
|
this.element.appendChild(this.gridview.element);
|
|
3409
|
-
|
|
3410
|
-
this.layout(0, 0, true);
|
|
3387
|
+
this.layout(0, 0, true); // set some elements height/widths
|
|
3411
3388
|
this.addDisposables(this.gridview.onDidChange(() => {
|
|
3412
|
-
this.
|
|
3389
|
+
this._onDidLayoutChange.fire();
|
|
3413
3390
|
}));
|
|
3414
|
-
this.addDisposables((() => {
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
exports.GroupChangeKind.REMOVE_GROUP,
|
|
3420
|
-
exports.GroupChangeKind.ADD_PANEL,
|
|
3421
|
-
exports.GroupChangeKind.REMOVE_PANEL,
|
|
3422
|
-
exports.GroupChangeKind.GROUP_ACTIVE,
|
|
3423
|
-
exports.GroupChangeKind.PANEL_ACTIVE,
|
|
3424
|
-
exports.GroupChangeKind.LAYOUT,
|
|
3425
|
-
].includes(event.kind)) {
|
|
3426
|
-
tickDelayedEvent.fire();
|
|
3427
|
-
}
|
|
3428
|
-
}), tickDelayedEvent.onEvent(() => {
|
|
3429
|
-
this._onDidLayoutChange.fire();
|
|
3430
|
-
}), tickDelayedEvent);
|
|
3431
|
-
})());
|
|
3391
|
+
this.addDisposables(exports.Event.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
|
|
3392
|
+
this._bufferOnDidLayoutChange.fire();
|
|
3393
|
+
}), this._bufferOnDidLayoutChange.onEvent(() => {
|
|
3394
|
+
this._onDidLayoutChange.fire();
|
|
3395
|
+
}), this._bufferOnDidLayoutChange);
|
|
3432
3396
|
}
|
|
3433
3397
|
get id() {
|
|
3434
3398
|
return this._id;
|
|
@@ -3465,14 +3429,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3465
3429
|
}
|
|
3466
3430
|
setVisible(panel, visible) {
|
|
3467
3431
|
this.gridview.setViewVisible(getGridLocation(panel.element), visible);
|
|
3468
|
-
this.
|
|
3432
|
+
this._onDidLayoutChange.fire();
|
|
3469
3433
|
}
|
|
3470
3434
|
isVisible(panel) {
|
|
3471
3435
|
return this.gridview.isViewVisible(getGridLocation(panel.element));
|
|
3472
3436
|
}
|
|
3473
3437
|
doAddGroup(group, location = [0], size) {
|
|
3474
3438
|
this.gridview.addView(group, size !== null && size !== void 0 ? size : exports.Sizing.Distribute, location);
|
|
3475
|
-
this.
|
|
3439
|
+
this._onDidAddGroup.fire(group);
|
|
3476
3440
|
this.doSetGroupActive(group);
|
|
3477
3441
|
}
|
|
3478
3442
|
doRemoveGroup(group, options) {
|
|
@@ -3483,9 +3447,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3483
3447
|
const view = this.gridview.remove(group, exports.Sizing.Distribute);
|
|
3484
3448
|
if (item && !(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
3485
3449
|
item.disposable.dispose();
|
|
3450
|
+
item.value.dispose();
|
|
3486
3451
|
this._groups.delete(group.id);
|
|
3487
3452
|
}
|
|
3488
|
-
this.
|
|
3453
|
+
this._onDidRemoveGroup.fire(group);
|
|
3489
3454
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
3490
3455
|
const groups = Array.from(this._groups.values());
|
|
3491
3456
|
this.doSetGroupActive(groups.length > 0 ? groups[0].value : undefined);
|
|
@@ -3513,9 +3478,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3513
3478
|
}
|
|
3514
3479
|
}
|
|
3515
3480
|
this._activeGroup = group;
|
|
3516
|
-
this.
|
|
3517
|
-
kind: exports.GroupChangeKind.GROUP_ACTIVE,
|
|
3518
|
-
});
|
|
3481
|
+
this._onDidActiveGroupChange.fire(group);
|
|
3519
3482
|
}
|
|
3520
3483
|
removeGroup(group) {
|
|
3521
3484
|
this.doRemoveGroup(group);
|
|
@@ -3571,7 +3534,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3571
3534
|
}
|
|
3572
3535
|
dispose() {
|
|
3573
3536
|
super.dispose();
|
|
3574
|
-
this.
|
|
3537
|
+
this._onDidActiveGroupChange.dispose();
|
|
3538
|
+
this._onDidAddGroup.dispose();
|
|
3539
|
+
this._onDidRemoveGroup.dispose();
|
|
3540
|
+
this._onDidLayoutChange.dispose();
|
|
3541
|
+
for (const group of this.groups) {
|
|
3542
|
+
group.dispose();
|
|
3543
|
+
}
|
|
3575
3544
|
this.gridview.dispose();
|
|
3576
3545
|
}
|
|
3577
3546
|
}
|
|
@@ -3583,15 +3552,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3583
3552
|
constructor(id) {
|
|
3584
3553
|
super();
|
|
3585
3554
|
this.id = id;
|
|
3586
|
-
this._state = {};
|
|
3587
3555
|
this._isFocused = false;
|
|
3588
3556
|
this._isActive = false;
|
|
3589
3557
|
this._isVisible = true;
|
|
3590
3558
|
this._width = 0;
|
|
3591
3559
|
this._height = 0;
|
|
3592
|
-
this._onDidStateChange = new Emitter();
|
|
3593
|
-
this.onDidStateChange = this._onDidStateChange.event;
|
|
3594
|
-
//
|
|
3595
3560
|
this._onDidPanelDimensionChange = new Emitter({
|
|
3596
3561
|
replay: true,
|
|
3597
3562
|
});
|
|
@@ -3620,7 +3585,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3620
3585
|
//
|
|
3621
3586
|
this._onActiveChange = new Emitter();
|
|
3622
3587
|
this.onActiveChange = this._onActiveChange.event;
|
|
3623
|
-
this.addDisposables(this.
|
|
3588
|
+
this.addDisposables(this._onDidPanelDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3624
3589
|
this._isFocused = event.isFocused;
|
|
3625
3590
|
}), this.onDidActiveChange((event) => {
|
|
3626
3591
|
this._isActive = event.isActive;
|
|
@@ -3653,21 +3618,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3653
3618
|
setActive() {
|
|
3654
3619
|
this._onActiveChange.fire();
|
|
3655
3620
|
}
|
|
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
3621
|
dispose() {
|
|
3672
3622
|
super.dispose();
|
|
3673
3623
|
}
|
|
@@ -3687,6 +3637,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3687
3637
|
//
|
|
3688
3638
|
this._onDidSizeChange = new Emitter();
|
|
3689
3639
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
3640
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
3690
3641
|
}
|
|
3691
3642
|
setConstraints(value) {
|
|
3692
3643
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -3700,19 +3651,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3700
3651
|
constructor(panel, group) {
|
|
3701
3652
|
super(panel.id);
|
|
3702
3653
|
this.panel = panel;
|
|
3703
|
-
this._onDidDirtyChange = new Emitter();
|
|
3704
|
-
this.onDidDirtyChange = this._onDidDirtyChange.event;
|
|
3705
3654
|
this._onDidTitleChange = new Emitter();
|
|
3706
3655
|
this.onDidTitleChange = this._onDidTitleChange.event;
|
|
3707
3656
|
this._titleChanged = new Emitter();
|
|
3708
3657
|
this.titleChanged = this._titleChanged.event;
|
|
3709
3658
|
this._suppressClosableChanged = new Emitter();
|
|
3710
3659
|
this.suppressClosableChanged = this._suppressClosableChanged.event;
|
|
3711
|
-
this.
|
|
3712
|
-
this.
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3660
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3661
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3662
|
+
this._onDidGroupChange = new Emitter();
|
|
3663
|
+
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
3664
|
+
this.disposable = new MutableDisposable();
|
|
3665
|
+
this.group = group;
|
|
3666
|
+
this.addDisposables(this.disposable, this._onDidTitleChange, this._titleChanged, this._suppressClosableChanged, this._onDidGroupChange, this._onDidActiveGroupChange);
|
|
3716
3667
|
}
|
|
3717
3668
|
get title() {
|
|
3718
3669
|
return this.panel.title;
|
|
@@ -3725,7 +3676,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3725
3676
|
return !!((_a = this.group) === null || _a === void 0 ? void 0 : _a.isActive);
|
|
3726
3677
|
}
|
|
3727
3678
|
set group(value) {
|
|
3679
|
+
const isOldGroupActive = this.isGroupActive;
|
|
3728
3680
|
this._group = value;
|
|
3681
|
+
this._onDidGroupChange.fire();
|
|
3682
|
+
if (this._group) {
|
|
3683
|
+
this.disposable.value = this._group.api.onDidActiveChange(() => {
|
|
3684
|
+
this._onDidActiveGroupChange.fire();
|
|
3685
|
+
});
|
|
3686
|
+
if (this.isGroupActive !== isOldGroupActive) {
|
|
3687
|
+
this._onDidActiveGroupChange.fire();
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3729
3690
|
}
|
|
3730
3691
|
get group() {
|
|
3731
3692
|
return this._group;
|
|
@@ -3739,16 +3700,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3739
3700
|
}
|
|
3740
3701
|
return this.group.model.closePanel(this.panel);
|
|
3741
3702
|
}
|
|
3742
|
-
interceptOnCloseAction(interceptor) {
|
|
3743
|
-
this._interceptor = interceptor;
|
|
3744
|
-
}
|
|
3745
|
-
dispose() {
|
|
3746
|
-
super.dispose();
|
|
3747
|
-
}
|
|
3748
3703
|
}
|
|
3749
3704
|
|
|
3750
3705
|
class DockviewGroupPanel extends CompositeDisposable {
|
|
3751
|
-
constructor(id, containerApi) {
|
|
3706
|
+
constructor(id, accessor, containerApi) {
|
|
3752
3707
|
super();
|
|
3753
3708
|
this.id = id;
|
|
3754
3709
|
this.containerApi = containerApi;
|
|
@@ -3756,14 +3711,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3756
3711
|
this._suppressClosable = false;
|
|
3757
3712
|
this._title = '';
|
|
3758
3713
|
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
3759
|
-
this.onDidStateChange = this.api.onDidStateChange;
|
|
3760
3714
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
3761
|
-
|
|
3715
|
+
accessor.setActivePanel(this);
|
|
3762
3716
|
}), this.api.onDidTitleChange((event) => {
|
|
3763
3717
|
const title = event.title;
|
|
3764
3718
|
this.update({ params: { title } });
|
|
3765
3719
|
}));
|
|
3766
3720
|
}
|
|
3721
|
+
get params() {
|
|
3722
|
+
var _a;
|
|
3723
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
3724
|
+
}
|
|
3767
3725
|
get title() {
|
|
3768
3726
|
return this._title;
|
|
3769
3727
|
}
|
|
@@ -3782,32 +3740,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3782
3740
|
this._view = params.view;
|
|
3783
3741
|
this.setTitle(params.title);
|
|
3784
3742
|
this.setSuppressClosable(params.suppressClosable || false);
|
|
3785
|
-
if (params.state) {
|
|
3786
|
-
this.api.setState(params.state);
|
|
3787
|
-
}
|
|
3788
3743
|
(_a = this.view) === null || _a === void 0 ? void 0 : _a.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
3789
3744
|
}
|
|
3790
3745
|
focus() {
|
|
3791
3746
|
this.api._onFocusEvent.fire();
|
|
3792
3747
|
}
|
|
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
3748
|
toJSON() {
|
|
3803
|
-
const state = this.api.getState();
|
|
3804
3749
|
return {
|
|
3805
3750
|
id: this.id,
|
|
3806
3751
|
view: this.view.toJSON(),
|
|
3807
3752
|
params: Object.keys(this._params || {}).length > 0
|
|
3808
3753
|
? this._params
|
|
3809
3754
|
: undefined,
|
|
3810
|
-
state: state && Object.keys(state).length > 0 ? state : undefined,
|
|
3811
3755
|
suppressClosable: this.suppressClosable || undefined,
|
|
3812
3756
|
title: this.title,
|
|
3813
3757
|
};
|
|
@@ -3852,18 +3796,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3852
3796
|
var _a;
|
|
3853
3797
|
this._group = group;
|
|
3854
3798
|
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
3799
|
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
3868
3800
|
this.api._onDidActiveChange.fire({
|
|
3869
3801
|
isActive: isGroupActive && isPanelVisible,
|
|
@@ -3938,7 +3870,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3938
3870
|
get id() {
|
|
3939
3871
|
return 'watermark';
|
|
3940
3872
|
}
|
|
3941
|
-
update(
|
|
3873
|
+
update(_event) {
|
|
3942
3874
|
// noop
|
|
3943
3875
|
}
|
|
3944
3876
|
focus() {
|
|
@@ -3947,17 +3879,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3947
3879
|
toJSON() {
|
|
3948
3880
|
return {};
|
|
3949
3881
|
}
|
|
3950
|
-
layout(
|
|
3882
|
+
layout(_width, _height) {
|
|
3951
3883
|
// noop
|
|
3952
3884
|
}
|
|
3953
3885
|
init(params) {
|
|
3954
3886
|
this.params = params;
|
|
3955
|
-
this.addDisposables(this.params.containerApi.onDidLayoutChange((
|
|
3887
|
+
this.addDisposables(this.params.containerApi.onDidLayoutChange(() => {
|
|
3956
3888
|
this.render();
|
|
3957
3889
|
}));
|
|
3958
3890
|
this.render();
|
|
3959
3891
|
}
|
|
3960
|
-
updateParentGroup(group,
|
|
3892
|
+
updateParentGroup(group, _visible) {
|
|
3961
3893
|
this.group = group;
|
|
3962
3894
|
this.render();
|
|
3963
3895
|
}
|
|
@@ -3973,15 +3905,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3973
3905
|
}
|
|
3974
3906
|
}
|
|
3975
3907
|
|
|
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
3908
|
class DefaultDeserializer {
|
|
3986
3909
|
constructor(layout, panelDeserializer) {
|
|
3987
3910
|
this.layout = layout;
|
|
@@ -4082,9 +4005,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4082
4005
|
this._isGroupActive = false;
|
|
4083
4006
|
//
|
|
4084
4007
|
this.params = {};
|
|
4085
|
-
//
|
|
4086
|
-
this.isDirtyDisposable = new MutableDisposable();
|
|
4087
|
-
this.addDisposables(this.isDirtyDisposable);
|
|
4088
4008
|
this._element = document.createElement('div');
|
|
4089
4009
|
this._element.className = 'default-tab';
|
|
4090
4010
|
//
|
|
@@ -4129,10 +4049,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4129
4049
|
init(params) {
|
|
4130
4050
|
this.params = params;
|
|
4131
4051
|
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
4052
|
if (!this.params.suppressClosable) {
|
|
4137
4053
|
addDisposableListener(this.action, 'click', (ev) => {
|
|
4138
4054
|
ev.preventDefault(); //
|
|
@@ -4148,7 +4064,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4148
4064
|
this._isGroupActive = group.isActive;
|
|
4149
4065
|
this.render();
|
|
4150
4066
|
}
|
|
4151
|
-
layout(
|
|
4067
|
+
layout(_width, _height) {
|
|
4152
4068
|
// noop
|
|
4153
4069
|
}
|
|
4154
4070
|
render() {
|
|
@@ -4186,6 +4102,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4186
4102
|
get height() {
|
|
4187
4103
|
return this._height;
|
|
4188
4104
|
}
|
|
4105
|
+
get params() {
|
|
4106
|
+
var _a;
|
|
4107
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
4108
|
+
}
|
|
4189
4109
|
focus() {
|
|
4190
4110
|
this.api._onFocusEvent.fire();
|
|
4191
4111
|
}
|
|
@@ -4194,34 +4114,34 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4194
4114
|
this._height = height;
|
|
4195
4115
|
this.api._onDidPanelDimensionChange.fire({ width, height });
|
|
4196
4116
|
if (this.part) {
|
|
4197
|
-
if (this.
|
|
4198
|
-
this.part.update(this.
|
|
4117
|
+
if (this._params) {
|
|
4118
|
+
this.part.update(this._params.params);
|
|
4199
4119
|
}
|
|
4200
4120
|
}
|
|
4201
4121
|
}
|
|
4202
4122
|
init(parameters) {
|
|
4203
|
-
this.
|
|
4123
|
+
this._params = parameters;
|
|
4204
4124
|
this.part = this.getComponent();
|
|
4205
4125
|
}
|
|
4206
4126
|
update(event) {
|
|
4207
4127
|
var _a, _b;
|
|
4208
|
-
this.
|
|
4209
|
-
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this.
|
|
4128
|
+
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) });
|
|
4129
|
+
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this._params.params });
|
|
4210
4130
|
}
|
|
4211
4131
|
toJSON() {
|
|
4212
4132
|
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 : {};
|
|
4133
|
+
const params = (_b = (_a = this._params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4215
4134
|
return {
|
|
4216
4135
|
id: this.id,
|
|
4217
4136
|
component: this.component,
|
|
4218
4137
|
params: Object.keys(params).length > 0 ? params : undefined,
|
|
4219
|
-
state: Object.keys(state).length === 0 ? undefined : state,
|
|
4220
4138
|
};
|
|
4221
4139
|
}
|
|
4222
4140
|
dispose() {
|
|
4141
|
+
var _a;
|
|
4223
4142
|
super.dispose();
|
|
4224
4143
|
this.api.dispose();
|
|
4144
|
+
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
4225
4145
|
}
|
|
4226
4146
|
}
|
|
4227
4147
|
|
|
@@ -4239,12 +4159,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4239
4159
|
this._snap = false;
|
|
4240
4160
|
this._onDidChange = new Emitter();
|
|
4241
4161
|
this.onDidChange = this._onDidChange.event;
|
|
4242
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
4162
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4243
4163
|
const { isVisible } = event;
|
|
4244
|
-
const { containerApi } = this.
|
|
4164
|
+
const { containerApi } = this._params;
|
|
4245
4165
|
containerApi.setVisible(this, isVisible);
|
|
4246
4166
|
}), this.api.onActiveChange(() => {
|
|
4247
|
-
const { containerApi } = this.
|
|
4167
|
+
const { containerApi } = this._params;
|
|
4248
4168
|
containerApi.setActive(this);
|
|
4249
4169
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4250
4170
|
if (typeof event.minimumWidth === 'number' ||
|
|
@@ -4359,9 +4279,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4359
4279
|
const minimum = (value) => (value <= 0 ? undefined : value);
|
|
4360
4280
|
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
4281
|
}
|
|
4362
|
-
dispose() {
|
|
4363
|
-
super.dispose();
|
|
4364
|
-
}
|
|
4365
4282
|
}
|
|
4366
4283
|
|
|
4367
4284
|
class GroupviewPanel extends GridviewPanel {
|
|
@@ -4468,15 +4385,24 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4468
4385
|
orientation: options.orientation || exports.Orientation.HORIZONTAL,
|
|
4469
4386
|
styles: options.styles,
|
|
4470
4387
|
});
|
|
4471
|
-
this._panels = new Map();
|
|
4472
|
-
this.dirtyPanels = new Set();
|
|
4473
|
-
this.debouncedDeque = debounce(this.syncConfigs.bind(this), 5000);
|
|
4474
4388
|
// events
|
|
4475
4389
|
this._onTabInteractionEvent = new Emitter();
|
|
4476
4390
|
this.onTabInteractionEvent = this._onTabInteractionEvent.event;
|
|
4477
4391
|
this._onTabContextMenu = new Emitter();
|
|
4478
4392
|
this.onTabContextMenu = this._onTabContextMenu.event;
|
|
4479
|
-
this.
|
|
4393
|
+
this._onDidDrop = new Emitter();
|
|
4394
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
4395
|
+
this._onDidRemovePanel = new Emitter();
|
|
4396
|
+
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4397
|
+
this._onDidAddPanel = new Emitter();
|
|
4398
|
+
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
4399
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4400
|
+
this.onDidLayoutfromJSON = this._onDidLayoutfromJSON.event;
|
|
4401
|
+
this._onDidActivePanelChange = new Emitter();
|
|
4402
|
+
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4403
|
+
this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
4404
|
+
this._bufferOnDidLayoutChange.fire();
|
|
4405
|
+
}));
|
|
4480
4406
|
this._options = options;
|
|
4481
4407
|
if (!this.options.components) {
|
|
4482
4408
|
this.options.components = {};
|
|
@@ -4497,10 +4423,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4497
4423
|
this._api = new DockviewApi(this);
|
|
4498
4424
|
}
|
|
4499
4425
|
get totalPanels() {
|
|
4500
|
-
return this.
|
|
4426
|
+
return this.panels.length;
|
|
4501
4427
|
}
|
|
4502
4428
|
get panels() {
|
|
4503
|
-
return
|
|
4429
|
+
return this.groups.flatMap((group) => group.model.panels);
|
|
4504
4430
|
}
|
|
4505
4431
|
get deserializer() {
|
|
4506
4432
|
return this._deserializer;
|
|
@@ -4530,10 +4456,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4530
4456
|
updateOptions(options) {
|
|
4531
4457
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
4532
4458
|
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
4459
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
4538
4460
|
if (hasOrientationChanged) {
|
|
4539
4461
|
this.gridview.orientation = options.orientation;
|
|
@@ -4545,8 +4467,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4545
4467
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4546
4468
|
}
|
|
4547
4469
|
getGroupPanel(id) {
|
|
4548
|
-
|
|
4549
|
-
return (_a = this._panels.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
4470
|
+
return this.panels.find((panel) => panel.id === id);
|
|
4550
4471
|
}
|
|
4551
4472
|
setActivePanel(panel) {
|
|
4552
4473
|
if (!panel.group) {
|
|
@@ -4595,24 +4516,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4595
4516
|
this.doSetGroupActive(next);
|
|
4596
4517
|
}
|
|
4597
4518
|
}
|
|
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
4519
|
/**
|
|
4617
4520
|
* Serialize the current state of the layout
|
|
4618
4521
|
*
|
|
@@ -4620,12 +4523,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4620
4523
|
*/
|
|
4621
4524
|
toJSON() {
|
|
4622
4525
|
var _a;
|
|
4623
|
-
this.syncConfigs();
|
|
4624
4526
|
const data = this.gridview.serialize();
|
|
4625
|
-
const panels =
|
|
4626
|
-
|
|
4627
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4628
|
-
}
|
|
4527
|
+
const panels = this.panels.reduce((collection, panel) => {
|
|
4528
|
+
collection[panel.id] = panel.toJSON();
|
|
4629
4529
|
return collection;
|
|
4630
4530
|
}, {});
|
|
4631
4531
|
return {
|
|
@@ -4636,13 +4536,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4636
4536
|
};
|
|
4637
4537
|
}
|
|
4638
4538
|
fromJSON(data) {
|
|
4539
|
+
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
4540
|
+
for (const group of groups) {
|
|
4541
|
+
// remove the group will automatically remove the panels
|
|
4542
|
+
this.removeGroup(group, true);
|
|
4543
|
+
}
|
|
4639
4544
|
this.gridview.clear();
|
|
4640
|
-
this._panels.forEach((panel) => {
|
|
4641
|
-
panel.disposable.dispose();
|
|
4642
|
-
panel.value.dispose();
|
|
4643
|
-
});
|
|
4644
|
-
this._panels.clear();
|
|
4645
|
-
this._groups.clear();
|
|
4646
4545
|
if (!this.deserializer) {
|
|
4647
4546
|
throw new Error('invalid deserializer');
|
|
4648
4547
|
}
|
|
@@ -4656,9 +4555,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4656
4555
|
this.gridview.deserialize(grid, new DefaultDeserializer(this, {
|
|
4657
4556
|
createPanel: (id) => {
|
|
4658
4557
|
const panelData = panels[id];
|
|
4659
|
-
|
|
4660
|
-
this.registerPanel(panel);
|
|
4661
|
-
return panel;
|
|
4558
|
+
return this.deserializer.fromJSON(panelData);
|
|
4662
4559
|
},
|
|
4663
4560
|
}));
|
|
4664
4561
|
if (typeof activeGroup === 'string') {
|
|
@@ -4668,36 +4565,31 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4668
4565
|
}
|
|
4669
4566
|
}
|
|
4670
4567
|
this.gridview.layout(this.width, this.height);
|
|
4671
|
-
this.
|
|
4568
|
+
this._onDidLayoutfromJSON.fire();
|
|
4672
4569
|
}
|
|
4673
4570
|
closeAllGroups() {
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
if (!didCloseAll) {
|
|
4679
|
-
return false;
|
|
4680
|
-
}
|
|
4681
|
-
}
|
|
4682
|
-
return true;
|
|
4683
|
-
});
|
|
4571
|
+
for (const entry of this._groups.entries()) {
|
|
4572
|
+
const [_, group] = entry;
|
|
4573
|
+
group.value.model.closeAllPanels();
|
|
4574
|
+
}
|
|
4684
4575
|
}
|
|
4685
4576
|
fireMouseEvent(event) {
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
}
|
|
4695
|
-
break;
|
|
4577
|
+
if (event.kind === exports.MouseEventKind.CONTEXT_MENU) {
|
|
4578
|
+
if (event.tab && event.panel) {
|
|
4579
|
+
this._onTabContextMenu.fire({
|
|
4580
|
+
event: event.event,
|
|
4581
|
+
api: this._api,
|
|
4582
|
+
panel: event.panel,
|
|
4583
|
+
});
|
|
4584
|
+
}
|
|
4696
4585
|
}
|
|
4697
4586
|
}
|
|
4698
4587
|
addPanel(options) {
|
|
4699
4588
|
var _a, _b;
|
|
4700
|
-
|
|
4589
|
+
if (this.panels.find((_) => _.id === options.id)) {
|
|
4590
|
+
throw new Error(`panel with id ${options.id} already exists`);
|
|
4591
|
+
}
|
|
4592
|
+
const panel = this.createPanel(options);
|
|
4701
4593
|
let referenceGroup;
|
|
4702
4594
|
if ((_a = options.position) === null || _a === void 0 ? void 0 : _a.referencePanel) {
|
|
4703
4595
|
const referencePanel = this.getGroupPanel(options.position.referencePanel);
|
|
@@ -4725,14 +4617,20 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4725
4617
|
}
|
|
4726
4618
|
return panel;
|
|
4727
4619
|
}
|
|
4728
|
-
removePanel(panel
|
|
4729
|
-
|
|
4620
|
+
removePanel(panel, options = {
|
|
4621
|
+
removeEmptyGroup: true,
|
|
4622
|
+
skipDispose: false,
|
|
4623
|
+
}) {
|
|
4730
4624
|
const group = panel.group;
|
|
4731
4625
|
if (!group) {
|
|
4732
4626
|
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
4733
4627
|
}
|
|
4734
4628
|
group.model.removePanel(panel);
|
|
4735
|
-
|
|
4629
|
+
panel.dispose();
|
|
4630
|
+
const retainGroupForWatermark = this.size === 1;
|
|
4631
|
+
if (!retainGroupForWatermark &&
|
|
4632
|
+
group.model.size === 0 &&
|
|
4633
|
+
options.removeEmptyGroup) {
|
|
4736
4634
|
this.removeGroup(group);
|
|
4737
4635
|
}
|
|
4738
4636
|
}
|
|
@@ -4745,10 +4643,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4745
4643
|
: {}, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.watermark);
|
|
4746
4644
|
}
|
|
4747
4645
|
addEmptyGroup(options) {
|
|
4748
|
-
var _a;
|
|
4749
4646
|
const group = this.createGroup();
|
|
4750
4647
|
if (options) {
|
|
4751
|
-
const referencePanel =
|
|
4648
|
+
const referencePanel = this.panels.find((panel) => panel.id === options.referencePanel);
|
|
4752
4649
|
if (!referencePanel) {
|
|
4753
4650
|
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
4754
4651
|
}
|
|
@@ -4765,25 +4662,24 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4765
4662
|
this.doAddGroup(group);
|
|
4766
4663
|
}
|
|
4767
4664
|
}
|
|
4768
|
-
removeGroup(group) {
|
|
4665
|
+
removeGroup(group, skipActive = false) {
|
|
4769
4666
|
const panels = [...group.model.panels]; // reassign since group panels will mutate
|
|
4770
|
-
|
|
4771
|
-
this.removePanel(panel
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
return;
|
|
4667
|
+
for (const panel of panels) {
|
|
4668
|
+
this.removePanel(panel, {
|
|
4669
|
+
removeEmptyGroup: false,
|
|
4670
|
+
skipDispose: false,
|
|
4671
|
+
});
|
|
4776
4672
|
}
|
|
4777
|
-
super.
|
|
4673
|
+
super.doRemoveGroup(group, { skipActive });
|
|
4778
4674
|
}
|
|
4779
4675
|
moveGroupOrPanel(referenceGroup, groupId, itemId, target, index) {
|
|
4780
|
-
var _a
|
|
4676
|
+
var _a;
|
|
4781
4677
|
const sourceGroup = groupId
|
|
4782
4678
|
? (_a = this._groups.get(groupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
4783
4679
|
: undefined;
|
|
4784
4680
|
if (!target || target === exports.Position.Center) {
|
|
4785
4681
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4786
|
-
|
|
4682
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4787
4683
|
if (!groupItem) {
|
|
4788
4684
|
throw new Error(`No panel with id ${itemId}`);
|
|
4789
4685
|
}
|
|
@@ -4819,7 +4715,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4819
4715
|
}
|
|
4820
4716
|
else {
|
|
4821
4717
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4822
|
-
|
|
4718
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4823
4719
|
if (!groupItem) {
|
|
4824
4720
|
throw new Error(`No panel with id ${itemId}`);
|
|
4825
4721
|
}
|
|
@@ -4833,10 +4729,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4833
4729
|
const isGroupAlreadyFocused = this._activeGroup === group;
|
|
4834
4730
|
super.doSetGroupActive(group, skipFocus);
|
|
4835
4731
|
if (!isGroupAlreadyFocused && ((_a = this._activeGroup) === null || _a === void 0 ? void 0 : _a.model.activePanel)) {
|
|
4836
|
-
this.
|
|
4837
|
-
kind: exports.GroupChangeKind.PANEL_ACTIVE,
|
|
4838
|
-
panel: (_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel,
|
|
4839
|
-
});
|
|
4732
|
+
this._onDidActivePanelChange.fire((_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel);
|
|
4840
4733
|
}
|
|
4841
4734
|
}
|
|
4842
4735
|
createGroup(options) {
|
|
@@ -4858,35 +4751,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4858
4751
|
}
|
|
4859
4752
|
}
|
|
4860
4753
|
const view = new GroupviewPanel(this, id, options);
|
|
4754
|
+
view.init({ params: {}, containerApi: null }); // required to initialized .part and allow for correct disposal of group
|
|
4861
4755
|
if (!this._groups.has(view.id)) {
|
|
4862
4756
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4863
4757
|
const { groupId, itemId, target, index } = event;
|
|
4864
4758
|
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
4759
|
+
}), view.model.onDidDrop((event) => {
|
|
4760
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api }));
|
|
4865
4761
|
}), view.model.onDidGroupChange((event) => {
|
|
4866
4762
|
switch (event.kind) {
|
|
4867
4763
|
case exports.GroupChangeKind2.ADD_PANEL:
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
});
|
|
4872
|
-
break;
|
|
4873
|
-
case exports.GroupChangeKind2.GROUP_ACTIVE:
|
|
4874
|
-
this._onGridEvent.fire({
|
|
4875
|
-
kind: exports.GroupChangeKind.GROUP_ACTIVE,
|
|
4876
|
-
panel: event.panel,
|
|
4877
|
-
});
|
|
4764
|
+
if (event.panel) {
|
|
4765
|
+
this._onDidAddPanel.fire(event.panel);
|
|
4766
|
+
}
|
|
4878
4767
|
break;
|
|
4879
4768
|
case exports.GroupChangeKind2.REMOVE_PANEL:
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
});
|
|
4769
|
+
if (event.panel) {
|
|
4770
|
+
this._onDidRemovePanel.fire(event.panel);
|
|
4771
|
+
}
|
|
4884
4772
|
break;
|
|
4885
4773
|
case exports.GroupChangeKind2.PANEL_ACTIVE:
|
|
4886
|
-
this.
|
|
4887
|
-
kind: exports.GroupChangeKind.PANEL_ACTIVE,
|
|
4888
|
-
panel: event.panel,
|
|
4889
|
-
});
|
|
4774
|
+
this._onDidActivePanelChange.fire(event.panel);
|
|
4890
4775
|
break;
|
|
4891
4776
|
}
|
|
4892
4777
|
}));
|
|
@@ -4900,44 +4785,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4900
4785
|
}
|
|
4901
4786
|
return view;
|
|
4902
4787
|
}
|
|
4903
|
-
|
|
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
|
-
_addPanel(options) {
|
|
4788
|
+
createPanel(options) {
|
|
4929
4789
|
const view = new DefaultGroupPanelView({
|
|
4930
4790
|
content: this.createContentComponent(options.id, options.component),
|
|
4931
4791
|
tab: this.createTabComponent(options.id, options.tabComponent),
|
|
4932
4792
|
});
|
|
4933
|
-
const panel = new DockviewGroupPanel(options.id, this._api);
|
|
4793
|
+
const panel = new DockviewGroupPanel(options.id, this, this._api);
|
|
4934
4794
|
panel.init({
|
|
4935
4795
|
view,
|
|
4936
4796
|
title: options.title || options.id,
|
|
4937
4797
|
suppressClosable: options === null || options === void 0 ? void 0 : options.suppressClosable,
|
|
4938
4798
|
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
4939
4799
|
});
|
|
4940
|
-
this.registerPanel(panel);
|
|
4941
4800
|
return panel;
|
|
4942
4801
|
}
|
|
4943
4802
|
createContentComponent(id, componentName) {
|
|
@@ -4957,10 +4816,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4957
4816
|
var _a;
|
|
4958
4817
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
4959
4818
|
}
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
this.
|
|
4819
|
+
dispose() {
|
|
4820
|
+
super.dispose();
|
|
4821
|
+
this._onDidActivePanelChange.dispose();
|
|
4822
|
+
this._onDidAddPanel.dispose();
|
|
4823
|
+
this._onDidRemovePanel.dispose();
|
|
4824
|
+
this._onDidLayoutfromJSON.dispose();
|
|
4964
4825
|
}
|
|
4965
4826
|
}
|
|
4966
4827
|
|
|
@@ -4971,6 +4832,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4971
4832
|
orientation: options.orientation,
|
|
4972
4833
|
styles: options.styles,
|
|
4973
4834
|
});
|
|
4835
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4836
|
+
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
4974
4837
|
this._options = options;
|
|
4975
4838
|
if (!this.options.components) {
|
|
4976
4839
|
this.options.components = {};
|
|
@@ -5023,7 +4886,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5023
4886
|
this.gridview.setViewVisible(getGridLocation(panel.element), visible);
|
|
5024
4887
|
}
|
|
5025
4888
|
setActive(panel) {
|
|
5026
|
-
this._groups.forEach((value,
|
|
4889
|
+
this._groups.forEach((value, _key) => {
|
|
5027
4890
|
value.value.setActive(panel === value.value);
|
|
5028
4891
|
});
|
|
5029
4892
|
}
|
|
@@ -5036,8 +4899,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5036
4899
|
}
|
|
5037
4900
|
fromJSON(serializedGridview, deferComponentLayout) {
|
|
5038
4901
|
const { grid, activePanel } = serializedGridview;
|
|
4902
|
+
const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
|
|
4903
|
+
for (const group of groups) {
|
|
4904
|
+
group.disposable.dispose();
|
|
4905
|
+
this.doRemoveGroup(group.value, { skipActive: true });
|
|
4906
|
+
}
|
|
5039
4907
|
this.gridview.clear();
|
|
5040
|
-
this._groups.clear();
|
|
5041
4908
|
const queue = [];
|
|
5042
4909
|
this.gridview.deserialize(grid, {
|
|
5043
4910
|
fromJSON: (node) => {
|
|
@@ -5078,7 +4945,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5078
4945
|
this.doSetGroupActive(panel);
|
|
5079
4946
|
}
|
|
5080
4947
|
}
|
|
5081
|
-
this.
|
|
4948
|
+
this._onDidLayoutfromJSON.fire();
|
|
5082
4949
|
}
|
|
5083
4950
|
movePanel(panel, options) {
|
|
5084
4951
|
var _a;
|
|
@@ -5134,7 +5001,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5134
5001
|
});
|
|
5135
5002
|
this.registerPanel(view);
|
|
5136
5003
|
this.doAddGroup(view, relativeLocation, options.size);
|
|
5137
|
-
return { api: view.api };
|
|
5138
5004
|
}
|
|
5139
5005
|
registerPanel(panel) {
|
|
5140
5006
|
const disposable = new CompositeDisposable(panel.api.onDidFocusChange((event) => {
|
|
@@ -5185,14 +5051,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5185
5051
|
}
|
|
5186
5052
|
removeGroup(group) {
|
|
5187
5053
|
super.removeGroup(group);
|
|
5188
|
-
const panel = this._groups.get(group.id);
|
|
5189
|
-
if (panel) {
|
|
5190
|
-
panel.disposable.dispose();
|
|
5191
|
-
this._groups.delete(group.id);
|
|
5192
|
-
}
|
|
5193
5054
|
}
|
|
5194
5055
|
dispose() {
|
|
5195
5056
|
super.dispose();
|
|
5057
|
+
this._onDidLayoutfromJSON.dispose();
|
|
5196
5058
|
}
|
|
5197
5059
|
}
|
|
5198
5060
|
|
|
@@ -5219,7 +5081,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5219
5081
|
options.frameworkComponents = {};
|
|
5220
5082
|
}
|
|
5221
5083
|
this.splitview = new Splitview(this.element, options);
|
|
5222
|
-
this.addDisposables(this._disposable);
|
|
5084
|
+
this.addDisposables(this._disposable, this._onDidAddView, this._onDidRemoveView, this._onDidLayoutChange);
|
|
5223
5085
|
}
|
|
5224
5086
|
get options() {
|
|
5225
5087
|
return this._options;
|
|
@@ -5295,7 +5157,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5295
5157
|
}
|
|
5296
5158
|
removePanel(panel, sizing) {
|
|
5297
5159
|
const disposable = this.panels.get(panel.id);
|
|
5298
|
-
|
|
5160
|
+
if (!disposable) {
|
|
5161
|
+
throw new Error(`unknown splitview panel ${panel.id}`);
|
|
5162
|
+
}
|
|
5163
|
+
disposable.disposable.dispose();
|
|
5164
|
+
disposable.value.dispose();
|
|
5299
5165
|
this.panels.delete(panel.id);
|
|
5300
5166
|
const index = this.getPanels().findIndex((_) => _ === panel);
|
|
5301
5167
|
this.splitview.removeView(index, sizing);
|
|
@@ -5354,7 +5220,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5354
5220
|
}
|
|
5355
5221
|
this.setActive(view, true);
|
|
5356
5222
|
});
|
|
5357
|
-
this.panels.set(view.id, disposable);
|
|
5223
|
+
this.panels.set(view.id, { disposable, value: view });
|
|
5358
5224
|
}
|
|
5359
5225
|
toJSON() {
|
|
5360
5226
|
var _a;
|
|
@@ -5378,6 +5244,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5378
5244
|
}
|
|
5379
5245
|
fromJSON(serializedSplitview, deferComponentLayout = false) {
|
|
5380
5246
|
const { views, orientation, size, activeView } = serializedSplitview;
|
|
5247
|
+
for (const [_, value] of this.panels.entries()) {
|
|
5248
|
+
value.disposable.dispose();
|
|
5249
|
+
value.value.dispose();
|
|
5250
|
+
}
|
|
5251
|
+
this.panels.clear();
|
|
5381
5252
|
this.splitview.dispose();
|
|
5382
5253
|
const queue = [];
|
|
5383
5254
|
this.splitview = new Splitview(this.element, {
|
|
@@ -5433,49 +5304,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5433
5304
|
}
|
|
5434
5305
|
}
|
|
5435
5306
|
dispose() {
|
|
5436
|
-
|
|
5437
|
-
value.dispose();
|
|
5438
|
-
|
|
5307
|
+
for (const [_, value] of this.panels.entries()) {
|
|
5308
|
+
value.disposable.dispose();
|
|
5309
|
+
value.value.dispose();
|
|
5310
|
+
}
|
|
5439
5311
|
this.panels.clear();
|
|
5312
|
+
this.splitview.dispose();
|
|
5440
5313
|
super.dispose();
|
|
5441
5314
|
}
|
|
5442
5315
|
}
|
|
5443
5316
|
|
|
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
5317
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
5480
5318
|
//
|
|
5481
5319
|
constructor(id) {
|
|
@@ -5490,6 +5328,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5490
5328
|
//
|
|
5491
5329
|
this._onDidSizeChange = new Emitter();
|
|
5492
5330
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
5331
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
5493
5332
|
}
|
|
5494
5333
|
setConstraints(value) {
|
|
5495
5334
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -5497,11 +5336,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5497
5336
|
setSize(event) {
|
|
5498
5337
|
this._onDidSizeChange.fire(event);
|
|
5499
5338
|
}
|
|
5500
|
-
dispose() {
|
|
5501
|
-
super.dispose();
|
|
5502
|
-
this._onDidConstraintsChange.dispose();
|
|
5503
|
-
this._onDidSizeChange.dispose();
|
|
5504
|
-
}
|
|
5505
5339
|
}
|
|
5506
5340
|
|
|
5507
5341
|
class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
@@ -5515,6 +5349,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5515
5349
|
this.onMouseEnter = this._onMouseEnter.event;
|
|
5516
5350
|
this._onMouseLeave = new Emitter({});
|
|
5517
5351
|
this.onMouseLeave = this._onMouseLeave.event;
|
|
5352
|
+
this.addDisposables(this._onDidExpansionChange, this._onMouseEnter, this._onMouseLeave);
|
|
5518
5353
|
}
|
|
5519
5354
|
set pane(pane) {
|
|
5520
5355
|
this._pane = pane;
|
|
@@ -5683,7 +5518,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5683
5518
|
}
|
|
5684
5519
|
}
|
|
5685
5520
|
toJSON() {
|
|
5686
|
-
const params = this.
|
|
5521
|
+
const params = this._params;
|
|
5687
5522
|
return Object.assign(Object.assign({}, super.toJSON()), { headerComponent: this.headerComponent, title: params.title });
|
|
5688
5523
|
}
|
|
5689
5524
|
renderOnce() {
|
|
@@ -5743,7 +5578,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5743
5578
|
})(this.header);
|
|
5744
5579
|
this.target = new Droptarget(this.element, {
|
|
5745
5580
|
validOverlays: 'vertical',
|
|
5746
|
-
canDisplayOverlay: (
|
|
5581
|
+
canDisplayOverlay: () => {
|
|
5747
5582
|
const data = getPaneData();
|
|
5748
5583
|
if (!data) {
|
|
5749
5584
|
return true;
|
|
@@ -5752,36 +5587,39 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5752
5587
|
},
|
|
5753
5588
|
});
|
|
5754
5589
|
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);
|
|
5590
|
+
this.onDrop(event);
|
|
5783
5591
|
}));
|
|
5784
5592
|
}
|
|
5593
|
+
onDrop(event) {
|
|
5594
|
+
const data = getPaneData();
|
|
5595
|
+
if (!data) {
|
|
5596
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5597
|
+
return;
|
|
5598
|
+
}
|
|
5599
|
+
const containerApi = this._params
|
|
5600
|
+
.containerApi;
|
|
5601
|
+
const panelId = data.paneId;
|
|
5602
|
+
const existingPanel = containerApi.getPanel(panelId);
|
|
5603
|
+
if (!existingPanel) {
|
|
5604
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5605
|
+
return;
|
|
5606
|
+
}
|
|
5607
|
+
const allPanels = containerApi.getPanels();
|
|
5608
|
+
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5609
|
+
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5610
|
+
if (event.position === exports.Position.Left ||
|
|
5611
|
+
event.position === exports.Position.Top) {
|
|
5612
|
+
toIndex = Math.max(0, toIndex - 1);
|
|
5613
|
+
}
|
|
5614
|
+
if (event.position === exports.Position.Right ||
|
|
5615
|
+
event.position === exports.Position.Bottom) {
|
|
5616
|
+
if (fromIndex > toIndex) {
|
|
5617
|
+
toIndex++;
|
|
5618
|
+
}
|
|
5619
|
+
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5620
|
+
}
|
|
5621
|
+
containerApi.movePanel(fromIndex, toIndex);
|
|
5622
|
+
}
|
|
5785
5623
|
}
|
|
5786
5624
|
|
|
5787
5625
|
class DefaultHeader extends CompositeDisposable {
|
|
@@ -5811,7 +5649,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5811
5649
|
this._expander.textContent = e.isExpanded ? '<' : '>';
|
|
5812
5650
|
});
|
|
5813
5651
|
}
|
|
5814
|
-
update(
|
|
5652
|
+
update(_params) {
|
|
5815
5653
|
//
|
|
5816
5654
|
}
|
|
5817
5655
|
dispose() {
|
|
@@ -5837,6 +5675,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5837
5675
|
super();
|
|
5838
5676
|
this.element = element;
|
|
5839
5677
|
this._disposable = new MutableDisposable();
|
|
5678
|
+
this._viewDisposables = new Map();
|
|
5840
5679
|
this._onDidLayoutChange = new Emitter();
|
|
5841
5680
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
5842
5681
|
this._onDidDrop = new Emitter();
|
|
@@ -5845,6 +5684,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5845
5684
|
this.onDidAddView = this._onDidAddView.event;
|
|
5846
5685
|
this._onDidRemoveView = new Emitter();
|
|
5847
5686
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
5687
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
|
|
5848
5688
|
this._options = options;
|
|
5849
5689
|
if (!options.components) {
|
|
5850
5690
|
options.components = {};
|
|
@@ -5920,9 +5760,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5920
5760
|
isExpanded: !!options.isExpanded,
|
|
5921
5761
|
disableDnd: !!this.options.disableDnd,
|
|
5922
5762
|
});
|
|
5923
|
-
|
|
5924
|
-
this._onDidDrop.fire(event);
|
|
5925
|
-
}));
|
|
5763
|
+
this.doAddPanel(view);
|
|
5926
5764
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
5927
5765
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
5928
5766
|
view.init({
|
|
@@ -5935,7 +5773,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5935
5773
|
});
|
|
5936
5774
|
this.paneview.addPane(view, size, index);
|
|
5937
5775
|
view.orientation = this.paneview.orientation;
|
|
5938
|
-
return
|
|
5776
|
+
return view;
|
|
5939
5777
|
}
|
|
5940
5778
|
getPanels() {
|
|
5941
5779
|
return this.paneview.getPanes();
|
|
@@ -5944,6 +5782,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5944
5782
|
const views = this.getPanels();
|
|
5945
5783
|
const index = views.findIndex((_) => _ === panel);
|
|
5946
5784
|
this.paneview.removePane(index);
|
|
5785
|
+
this.doRemovePanel(panel);
|
|
5947
5786
|
}
|
|
5948
5787
|
movePanel(from, to) {
|
|
5949
5788
|
this.paneview.moveView(from, to);
|
|
@@ -5993,6 +5832,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5993
5832
|
fromJSON(serializedPaneview, deferComponentLayout) {
|
|
5994
5833
|
const { views, size } = serializedPaneview;
|
|
5995
5834
|
const queue = [];
|
|
5835
|
+
for (const [_, value] of this._viewDisposables.entries()) {
|
|
5836
|
+
value.dispose();
|
|
5837
|
+
}
|
|
5838
|
+
this._viewDisposables.clear();
|
|
5996
5839
|
this.paneview.dispose();
|
|
5997
5840
|
this.paneview = new Paneview(this.element, {
|
|
5998
5841
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -6028,9 +5871,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6028
5871
|
isExpanded: !!view.expanded,
|
|
6029
5872
|
disableDnd: !!this.options.disableDnd,
|
|
6030
5873
|
});
|
|
6031
|
-
|
|
6032
|
-
this._onDidDrop.fire(event);
|
|
6033
|
-
});
|
|
5874
|
+
this.doAddPanel(panel);
|
|
6034
5875
|
queue.push(() => {
|
|
6035
5876
|
panel.init({
|
|
6036
5877
|
params: data.params || {},
|
|
@@ -6060,6 +5901,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6060
5901
|
queue.forEach((f) => f());
|
|
6061
5902
|
}
|
|
6062
5903
|
}
|
|
5904
|
+
doAddPanel(panel) {
|
|
5905
|
+
const disposable = panel.onDidDrop((event) => {
|
|
5906
|
+
this._onDidDrop.fire(event);
|
|
5907
|
+
});
|
|
5908
|
+
this._viewDisposables.set(panel.id, disposable);
|
|
5909
|
+
}
|
|
5910
|
+
doRemovePanel(panel) {
|
|
5911
|
+
const disposable = this._viewDisposables.get(panel.id);
|
|
5912
|
+
if (disposable) {
|
|
5913
|
+
disposable.dispose();
|
|
5914
|
+
this._viewDisposables.delete(panel.id);
|
|
5915
|
+
}
|
|
5916
|
+
}
|
|
5917
|
+
dispose() {
|
|
5918
|
+
super.dispose();
|
|
5919
|
+
for (const [_, value] of this._viewDisposables.entries()) {
|
|
5920
|
+
value.dispose();
|
|
5921
|
+
}
|
|
5922
|
+
this._viewDisposables.clear();
|
|
5923
|
+
this.paneview.dispose();
|
|
5924
|
+
}
|
|
6063
5925
|
}
|
|
6064
5926
|
|
|
6065
5927
|
class SplitviewPanel extends BasePanelView {
|
|
@@ -6072,12 +5934,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6072
5934
|
this._snap = false;
|
|
6073
5935
|
this._onDidChange = new Emitter();
|
|
6074
5936
|
this.onDidChange = this._onDidChange.event;
|
|
6075
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
5937
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
6076
5938
|
const { isVisible } = event;
|
|
6077
|
-
const { containerApi } = this
|
|
5939
|
+
const { containerApi } = this
|
|
5940
|
+
._params;
|
|
6078
5941
|
containerApi.setVisible(this, isVisible);
|
|
6079
5942
|
}), this.api.onActiveChange(() => {
|
|
6080
|
-
const { containerApi } = this
|
|
5943
|
+
const { containerApi } = this
|
|
5944
|
+
._params;
|
|
6081
5945
|
containerApi.setActive(this);
|
|
6082
5946
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
6083
5947
|
if (typeof event.minimumSize === 'number' ||
|
|
@@ -6220,14 +6084,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6220
6084
|
if (this.disposed) {
|
|
6221
6085
|
throw new Error('invalid operation: resource is already disposed');
|
|
6222
6086
|
}
|
|
6223
|
-
// TODO use a better check for isReactFunctionalComponent
|
|
6224
6087
|
if (typeof this.component !== 'function') {
|
|
6225
6088
|
/**
|
|
6226
6089
|
* we know this isn't a React.FunctionComponent so throw an error here.
|
|
6227
6090
|
* if we do not intercept this the React library will throw a very obsure error
|
|
6228
6091
|
* for the same reason, at least at this point we will emit a sensible stacktrace.
|
|
6229
6092
|
*/
|
|
6230
|
-
throw new Error('
|
|
6093
|
+
throw new Error('Invalid Operation. dockview only supports React Functional Components.');
|
|
6231
6094
|
}
|
|
6232
6095
|
const bridgeComponent = React__namespace.createElement(React__namespace.forwardRef(ReactComponentBridge), {
|
|
6233
6096
|
component: this
|
|
@@ -6285,22 +6148,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6285
6148
|
this.id = id;
|
|
6286
6149
|
this.component = component;
|
|
6287
6150
|
this.reactPortalStore = reactPortalStore;
|
|
6288
|
-
// private hostedContainer: HostedContainer;
|
|
6289
6151
|
this._onDidFocus = new Emitter();
|
|
6290
6152
|
this.onDidFocus = this._onDidFocus.event;
|
|
6291
6153
|
this._onDidBlur = new Emitter();
|
|
6292
6154
|
this.onDidBlur = this._onDidBlur.event;
|
|
6293
6155
|
this._element = document.createElement('div');
|
|
6294
|
-
this._element.
|
|
6295
|
-
this._element.style.width = '100%';
|
|
6296
|
-
// this.hostedContainer = new HostedContainer({
|
|
6297
|
-
// id,
|
|
6298
|
-
// });
|
|
6299
|
-
// this.hostedContainer.onDidFocus(() => this._onDidFocus.fire());
|
|
6300
|
-
// this.hostedContainer.onDidBlur(() => this._onDidBlur.fire());
|
|
6156
|
+
this._element.className = 'dockview-react-part';
|
|
6301
6157
|
this._actionsElement = document.createElement('div');
|
|
6302
|
-
this._actionsElement.
|
|
6303
|
-
this._actionsElement.style.width = '100%';
|
|
6158
|
+
this._actionsElement.className = 'dockview-react-part';
|
|
6304
6159
|
}
|
|
6305
6160
|
get element() {
|
|
6306
6161
|
return this._element;
|
|
@@ -6333,23 +6188,20 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6333
6188
|
var _a;
|
|
6334
6189
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
6335
6190
|
}
|
|
6336
|
-
updateParentGroup(group,
|
|
6191
|
+
updateParentGroup(group, _isPanelVisible) {
|
|
6337
6192
|
this._group = group;
|
|
6338
6193
|
}
|
|
6339
|
-
layout(
|
|
6194
|
+
layout(_width, _height) {
|
|
6340
6195
|
// noop
|
|
6341
|
-
// this.hostedContainer.layout(
|
|
6342
|
-
// this.element
|
|
6343
|
-
// // { width, height }
|
|
6344
|
-
// );
|
|
6345
6196
|
}
|
|
6346
6197
|
close() {
|
|
6347
6198
|
return Promise.resolve(true);
|
|
6348
6199
|
}
|
|
6349
6200
|
dispose() {
|
|
6350
6201
|
var _a, _b;
|
|
6202
|
+
this._onDidFocus.dispose();
|
|
6203
|
+
this._onDidBlur.dispose();
|
|
6351
6204
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
6352
|
-
// this.hostedContainer?.dispose();
|
|
6353
6205
|
(_b = this.actionsPart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
6354
6206
|
}
|
|
6355
6207
|
}
|
|
@@ -6360,6 +6212,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6360
6212
|
this.component = component;
|
|
6361
6213
|
this.reactPortalStore = reactPortalStore;
|
|
6362
6214
|
this._element = document.createElement('div');
|
|
6215
|
+
this._element.className = 'dockview-react-part';
|
|
6363
6216
|
}
|
|
6364
6217
|
get element() {
|
|
6365
6218
|
return this._element;
|
|
@@ -6383,10 +6236,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6383
6236
|
id: this.id,
|
|
6384
6237
|
};
|
|
6385
6238
|
}
|
|
6386
|
-
layout(
|
|
6239
|
+
layout(_width, _height) {
|
|
6387
6240
|
// noop - retrieval from api
|
|
6388
6241
|
}
|
|
6389
|
-
updateParentGroup(
|
|
6242
|
+
updateParentGroup(_group, _isPanelVisible) {
|
|
6390
6243
|
// noop - retrieval from api
|
|
6391
6244
|
}
|
|
6392
6245
|
dispose() {
|
|
@@ -6404,7 +6257,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6404
6257
|
const panelId = panelData.id;
|
|
6405
6258
|
const params = panelData.params;
|
|
6406
6259
|
const title = panelData.title;
|
|
6407
|
-
const state = panelData.state;
|
|
6408
6260
|
const suppressClosable = panelData.suppressClosable;
|
|
6409
6261
|
const viewData = panelData.view;
|
|
6410
6262
|
const view = new DefaultGroupPanelView({
|
|
@@ -6413,13 +6265,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6413
6265
|
? 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
6266
|
: new DefaultTab(),
|
|
6415
6267
|
});
|
|
6416
|
-
const panel = new DockviewGroupPanel(panelId, new DockviewApi(this.layout));
|
|
6268
|
+
const panel = new DockviewGroupPanel(panelId, this.layout, new DockviewApi(this.layout));
|
|
6417
6269
|
panel.init({
|
|
6418
6270
|
view,
|
|
6419
6271
|
title,
|
|
6420
6272
|
suppressClosable,
|
|
6421
6273
|
params: params || {},
|
|
6422
|
-
state: state || {},
|
|
6423
6274
|
});
|
|
6424
6275
|
return panel;
|
|
6425
6276
|
}
|
|
@@ -6434,8 +6285,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6434
6285
|
value: undefined,
|
|
6435
6286
|
};
|
|
6436
6287
|
this._element = document.createElement('div');
|
|
6437
|
-
this._element.
|
|
6438
|
-
this._element.style.width = '100%';
|
|
6288
|
+
this._element.className = 'dockview-react-part';
|
|
6439
6289
|
}
|
|
6440
6290
|
get element() {
|
|
6441
6291
|
return this._element;
|
|
@@ -6468,10 +6318,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6468
6318
|
id: this.id,
|
|
6469
6319
|
};
|
|
6470
6320
|
}
|
|
6471
|
-
layout(
|
|
6321
|
+
layout(_width, _height) {
|
|
6472
6322
|
// noop - retrieval from api
|
|
6473
6323
|
}
|
|
6474
|
-
updateParentGroup(group,
|
|
6324
|
+
updateParentGroup(group, _isPanelVisible) {
|
|
6475
6325
|
// noop - retrieval from api
|
|
6476
6326
|
this._groupRef.value = group;
|
|
6477
6327
|
}
|
|
@@ -6505,21 +6355,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6505
6355
|
var _a;
|
|
6506
6356
|
const factory = {
|
|
6507
6357
|
content: {
|
|
6508
|
-
createComponent: (
|
|
6358
|
+
createComponent: (_id, componentId, component) => {
|
|
6509
6359
|
return new ReactPanelContentPart(componentId, component, {
|
|
6510
6360
|
addPortal,
|
|
6511
6361
|
});
|
|
6512
6362
|
},
|
|
6513
6363
|
},
|
|
6514
6364
|
tab: {
|
|
6515
|
-
createComponent: (
|
|
6365
|
+
createComponent: (_id, componentId, component) => {
|
|
6516
6366
|
return new ReactPanelHeaderPart(componentId, component, {
|
|
6517
6367
|
addPortal,
|
|
6518
6368
|
});
|
|
6519
6369
|
},
|
|
6520
6370
|
},
|
|
6521
6371
|
watermark: {
|
|
6522
|
-
createComponent: (
|
|
6372
|
+
createComponent: (_id, componentId, component) => {
|
|
6523
6373
|
return new ReactWatermarkPart(componentId, component, {
|
|
6524
6374
|
addPortal,
|
|
6525
6375
|
});
|
|
@@ -6533,7 +6383,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6533
6383
|
frameworkTabComponents: props.tabComponents,
|
|
6534
6384
|
tabHeight: props.tabHeight,
|
|
6535
6385
|
debug: props.debug,
|
|
6536
|
-
enableExternalDragEvents: props.enableExternalDragEvents,
|
|
6537
6386
|
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6538
6387
|
styles: props.hideBorders
|
|
6539
6388
|
? { separatorBorder: 'transparent' }
|
|
@@ -6549,8 +6398,24 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6549
6398
|
dockviewRef.current = dockview;
|
|
6550
6399
|
return () => {
|
|
6551
6400
|
dockview.dispose();
|
|
6401
|
+
element.remove();
|
|
6552
6402
|
};
|
|
6553
6403
|
}, []);
|
|
6404
|
+
React__namespace.useEffect(() => {
|
|
6405
|
+
if (!dockviewRef.current) {
|
|
6406
|
+
return () => {
|
|
6407
|
+
// noop
|
|
6408
|
+
};
|
|
6409
|
+
}
|
|
6410
|
+
const disposable = dockviewRef.current.onDidDrop((event) => {
|
|
6411
|
+
if (props.onDidDrop) {
|
|
6412
|
+
props.onDidDrop(event);
|
|
6413
|
+
}
|
|
6414
|
+
});
|
|
6415
|
+
return () => {
|
|
6416
|
+
disposable.dispose();
|
|
6417
|
+
};
|
|
6418
|
+
}, [props.onDidDrop]);
|
|
6554
6419
|
React__namespace.useEffect(() => {
|
|
6555
6420
|
if (!dockviewRef.current) {
|
|
6556
6421
|
return;
|
|
@@ -6559,6 +6424,22 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6559
6424
|
frameworkComponents: props.components,
|
|
6560
6425
|
});
|
|
6561
6426
|
}, [props.components]);
|
|
6427
|
+
React__namespace.useEffect(() => {
|
|
6428
|
+
if (!dockviewRef.current) {
|
|
6429
|
+
return;
|
|
6430
|
+
}
|
|
6431
|
+
dockviewRef.current.updateOptions({
|
|
6432
|
+
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6433
|
+
});
|
|
6434
|
+
}, [props.watermarkComponent]);
|
|
6435
|
+
React__namespace.useEffect(() => {
|
|
6436
|
+
if (!dockviewRef.current) {
|
|
6437
|
+
return;
|
|
6438
|
+
}
|
|
6439
|
+
dockviewRef.current.updateOptions({
|
|
6440
|
+
showDndOverlay: props.showDndOverlay,
|
|
6441
|
+
});
|
|
6442
|
+
}, [props.showDndOverlay]);
|
|
6562
6443
|
React__namespace.useEffect(() => {
|
|
6563
6444
|
if (!dockviewRef.current) {
|
|
6564
6445
|
return;
|
|
@@ -6647,9 +6528,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6647
6528
|
getComponent() {
|
|
6648
6529
|
var _a;
|
|
6649
6530
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6650
|
-
params: ((_a = this.
|
|
6531
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6651
6532
|
api: this.api,
|
|
6652
|
-
containerApi: this.
|
|
6533
|
+
containerApi: this._params
|
|
6653
6534
|
.containerApi,
|
|
6654
6535
|
});
|
|
6655
6536
|
}
|
|
@@ -6686,7 +6567,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6686
6567
|
});
|
|
6687
6568
|
},
|
|
6688
6569
|
},
|
|
6689
|
-
proportionalLayout: props.proportionalLayout
|
|
6570
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
6571
|
+
? props.proportionalLayout
|
|
6572
|
+
: true,
|
|
6690
6573
|
styles: props.hideBorders
|
|
6691
6574
|
? { separatorBorder: 'transparent' }
|
|
6692
6575
|
: undefined,
|
|
@@ -6722,9 +6605,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6722
6605
|
getComponent() {
|
|
6723
6606
|
var _a;
|
|
6724
6607
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6725
|
-
params: ((_a = this.
|
|
6608
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6726
6609
|
api: this.api,
|
|
6727
|
-
containerApi: this.
|
|
6610
|
+
containerApi: this._params
|
|
6728
6611
|
.containerApi,
|
|
6729
6612
|
});
|
|
6730
6613
|
}
|
|
@@ -6754,7 +6637,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6754
6637
|
var _a;
|
|
6755
6638
|
const element = document.createElement('div');
|
|
6756
6639
|
const gridview = new GridviewComponent(element, {
|
|
6757
|
-
proportionalLayout:
|
|
6640
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
6641
|
+
? props.proportionalLayout
|
|
6642
|
+
: true,
|
|
6758
6643
|
orientation: props.orientation,
|
|
6759
6644
|
frameworkComponents: props.components,
|
|
6760
6645
|
frameworkComponentFactory: {
|
|
@@ -6777,6 +6662,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6777
6662
|
gridviewRef.current = gridview;
|
|
6778
6663
|
return () => {
|
|
6779
6664
|
gridview.dispose();
|
|
6665
|
+
element.remove();
|
|
6780
6666
|
};
|
|
6781
6667
|
}, []);
|
|
6782
6668
|
React__namespace.useEffect(() => {
|
|
@@ -6847,7 +6733,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6847
6733
|
};
|
|
6848
6734
|
}, [props.disableAutoResizing]);
|
|
6849
6735
|
React__namespace.useEffect(() => {
|
|
6850
|
-
const createComponent = (id,
|
|
6736
|
+
const createComponent = (id, _componentId, component) => new PanePanelSection(id, component, {
|
|
6851
6737
|
addPortal,
|
|
6852
6738
|
});
|
|
6853
6739
|
const paneview = new PaneviewComponent(domRef.current, {
|
|
@@ -6913,14 +6799,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6913
6799
|
PaneviewReact.displayName = 'PaneviewComponent';
|
|
6914
6800
|
|
|
6915
6801
|
exports.BaseGrid = BaseGrid;
|
|
6916
|
-
exports.CompositeDisposable = CompositeDisposable;
|
|
6917
6802
|
exports.ContentContainer = ContentContainer;
|
|
6918
|
-
exports.DATA_KEY = DATA_KEY;
|
|
6919
6803
|
exports.DockviewApi = DockviewApi;
|
|
6920
6804
|
exports.DockviewComponent = DockviewComponent;
|
|
6921
6805
|
exports.DockviewComponents = DockviewComponents;
|
|
6922
6806
|
exports.DockviewReact = DockviewReact;
|
|
6923
|
-
exports.Emitter = Emitter;
|
|
6924
6807
|
exports.Gridview = Gridview;
|
|
6925
6808
|
exports.GridviewApi = GridviewApi;
|
|
6926
6809
|
exports.GridviewComponent = GridviewComponent;
|
|
@@ -6928,7 +6811,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6928
6811
|
exports.GridviewReact = GridviewReact;
|
|
6929
6812
|
exports.Groupview = Groupview;
|
|
6930
6813
|
exports.LocalSelectionTransfer = LocalSelectionTransfer;
|
|
6931
|
-
exports.MutableDisposable = MutableDisposable;
|
|
6932
6814
|
exports.PaneFramework = PaneFramework;
|
|
6933
6815
|
exports.PaneTransfer = PaneTransfer;
|
|
6934
6816
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -6947,10 +6829,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6947
6829
|
exports.SplitviewPanel = SplitviewPanel;
|
|
6948
6830
|
exports.SplitviewReact = SplitviewReact;
|
|
6949
6831
|
exports.Tab = Tab$1;
|
|
6950
|
-
exports.TickDelayedEvent = TickDelayedEvent;
|
|
6951
|
-
exports.addDisposableListener = addDisposableListener;
|
|
6952
|
-
exports.addDisposableWindowListener = addDisposableWindowListener;
|
|
6953
|
-
exports.extractData = extractData;
|
|
6954
6832
|
exports.getDirectionOrientation = getDirectionOrientation;
|
|
6955
6833
|
exports.getGridLocation = getGridLocation;
|
|
6956
6834
|
exports.getLocationOrientation = getLocationOrientation;
|
|
@@ -6958,11 +6836,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6958
6836
|
exports.getPanelData = getPanelData;
|
|
6959
6837
|
exports.getRelativeLocation = getRelativeLocation;
|
|
6960
6838
|
exports.indexInParent = indexInParent;
|
|
6961
|
-
exports.isCustomDragEvent = isCustomDragEvent;
|
|
6962
6839
|
exports.isGridBranchNode = isGridBranchNode;
|
|
6963
|
-
exports.isPanelTransferEvent = isPanelTransferEvent;
|
|
6964
6840
|
exports.isReactElement = isReactElement;
|
|
6965
|
-
exports.isTabDragEvent = isTabDragEvent;
|
|
6966
6841
|
exports.orthogonal = orthogonal;
|
|
6967
6842
|
exports.toTarget = toTarget;
|
|
6968
6843
|
exports.usePortalsLifecycle = usePortalsLifecycle;
|