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
package/dist/dockview.esm.js
CHANGED
|
@@ -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
|
*/
|
|
@@ -34,9 +34,79 @@ function styleInject(css, ref) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
var css_248z = ".dockview-theme-dark {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n}\n\n.dockview-theme-light {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: white;\n --dv-tabs-and-actions-container-background-color: #f3f3f3;\n --dv-activegroup-visiblepanel-tab-background-color: white;\n --dv-activegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-inactivegroup-visiblepanel-tab-background-color: white;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-tab-divider-color: white;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.35);\n --dv-separator-border: rgba(128, 128, 128, 0.35);\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n}\n\n.dockview-theme-vs {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n --dv-activegroup-visiblepanel-tab-background-color: dodgerblue;\n --dv-tabs-and-actions-container-height: 18px;\n --dv-tabs-and-actions-container-font-size: 11px;\n}\n.dockview-theme-vs .groupview.active-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.inactive-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.actions-bar {\n text-align: right;\n width: 28px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n.actions-bar .actions-container {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.actions-bar .actions-container a:active {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.actions-bar .actions-container .close-action {\n background-color: white;\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n cursor: pointer;\n}\n.drop-target {\n position: relative;\n}\n.drop-target > .drop-target-dropzone {\n position: absolute;\n left: 0px;\n top: 0px;\n height: 100%;\n width: 100%;\n z-index: 10000;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection {\n position: relative;\n pointer-events: none;\n box-sizing: border-box;\n height: 100%;\n width: 100%;\n background-color: var(--dv-drag-over-background-color);\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.left, .drop-target > .drop-target-dropzone > .drop-target-selection.right {\n width: 50%;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.right {\n transform: translate(100%, 0%);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.bottom {\n transform: translate(0%, 100%);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.top, .drop-target > .drop-target-dropzone > .drop-target-selection.bottom {\n height: 50%;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-top {\n border-top: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-bottom {\n border-bottom: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-left {\n border-left: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-right {\n border-right: 1px solid var(--dv-drag-over-border-color);\n}\n.custom-dragging {\n height: 24px;\n line-height: 24px;\n font-size: 11px;\n width: 100px;\n background-color: dodgerblue;\n color: ghostwhite;\n border-radius: 11px;\n position: absolute;\n padding-left: 10px;\n}\n\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab .tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {\n background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab .tab-action {\n background-color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-background-color);\n color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab .tab-action {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-background-color);\n color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab .tab-action {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n\n/**\n * when a tab is dragged we lose the above stylings because they are conditional on parent elements\n * therefore we also set some stylings for the dragging event\n **/\n.tab.dragging {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.grid-view,\n.branch-node {\n height: 100%;\n width: 100%;\n}\n.groupview {\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: var(--dv-group-view-background-color);\n overflow: hidden;\n}\n.groupview:focus {\n outline: none;\n}\n.groupview.empty > .tabs-and-actions-container {\n display: none;\n}\n.groupview > .content-container {\n flex-grow: 1;\n overflow: hidden;\n outline: none;\n}\n.pane-container {\n height: 100%;\n width: 100%;\n}\n.pane-container.animated .view {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.pane-container .view {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n padding: 0px !important;\n}\n.pane-container .view:not(:first-child)::before {\n background-color: transparent !important;\n}\n.pane-container .view:not(:first-child) .pane > .pane-header {\n border-top: 1px solid var(--dv-paneview-header-border-color);\n}\n.pane-container .view .default-header {\n background-color: var(--dv-group-view-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n display: flex;\n padding: 0px 8px;\n}\n.pane-container .view .default-header > span {\n flex-grow: 1;\n}\n.pane-container:first-of-type > .pane > .pane-header {\n border-top: none !important;\n}\n.pane-container .pane {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n height: 100%;\n}\n.pane-container .pane .pane-header {\n box-sizing: border-box;\n user-select: none;\n position: relative;\n outline: none;\n}\n.pane-container .pane .pane-header.pane-draggable {\n cursor: pointer;\n}\n.pane-container .pane .pane-header:focus:before, .pane-container .pane .pane-header:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: \"\";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.pane-container .pane .pane-body {\n overflow-y: auto;\n overflow-x: hidden;\n flex-grow: 1;\n position: relative;\n outline: none;\n}\n.pane-container .pane .pane-body:focus:before, .pane-container .pane .pane-body:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: \"\";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.tabs-and-actions-container {\n display: flex;\n background-color: var(--dv-tabs-and-actions-container-background-color);\n flex-shrink: 0;\n box-sizing: border-box;\n height: var(--dv-tabs-and-actions-container-height);\n font-size: var(--dv-tabs-and-actions-container-font-size);\n}\n.tabs-and-actions-container.hidden {\n display: none;\n}\n.tabs-and-actions-container .void-container {\n display: flex;\n flex-grow: 1;\n}\n.tabs-and-actions-container .tabs-container {\n display: flex;\n overflow-x: overlay;\n overflow-y: hidden;\n scrollbar-width: thin;\n /* Track */\n /* Handle */\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar {\n height: 3px;\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar-track {\n background: transparent;\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar-thumb {\n background: var(--dv-tabs-container-scrollbar-color);\n}\n.tabs-and-actions-container .tabs-container .tab {\n -webkit-user-drag: element;\n outline: none;\n min-width: 75px;\n cursor: pointer;\n position: relative;\n box-sizing: border-box;\n}\n.tabs-and-actions-container .tabs-container .tab:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-tab-divider-color);\n width: 1px;\n height: 100%;\n}\n.split-view-container {\n position: relative;\n overflow: hidden;\n height: 100%;\n width: 100%;\n}\n.split-view-container.animation .view,\n.split-view-container.animation .sash {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.split-view-container.horizontal {\n height: 100%;\n}\n.split-view-container.horizontal > .sash-container > .sash {\n height: 100%;\n width: 4px;\n}\n.split-view-container.horizontal > .sash-container > .sash.enabled {\n cursor: ew-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.horizontal > .sash-container > .sash.maximum {\n cursor: w-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.minimum {\n cursor: e-resize;\n}\n.split-view-container.horizontal > .view-container > .view:not(:first-child)::before {\n height: 100%;\n width: 1px;\n}\n.split-view-container.vertical {\n width: 100%;\n}\n.split-view-container.vertical > .sash-container > .sash {\n width: 100%;\n height: 4px;\n}\n.split-view-container.vertical > .sash-container > .sash.enabled {\n cursor: ns-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.vertical > .sash-container > .sash.maximum {\n cursor: n-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.minimum {\n cursor: s-resize;\n}\n.split-view-container.vertical > .view-container > .view {\n width: 100%;\n}\n.split-view-container.vertical > .view-container > .view:not(:first-child)::before {\n height: 1px;\n width: 100%;\n}\n.split-view-container .sash-container {\n height: 100%;\n width: 100%;\n position: absolute;\n}\n.split-view-container .sash-container .sash {\n position: absolute;\n z-index: 99;\n outline: none;\n}\n.split-view-container .sash-container .sash:active {\n transition: background-color 0.1s ease-in-out;\n background-color: var(--dv-active-sash-color, transparent);\n}\n.split-view-container .sash-container .sash:hover {\n background-color: var(--dv-active-sash-color, transparent);\n transition: background-color 0.1s ease-in-out;\n transition-delay: 0.5s;\n}\n.split-view-container .view-container {\n position: relative;\n height: 100%;\n width: 100%;\n}\n.split-view-container .view-container .view {\n height: 100%;\n box-sizing: border-box;\n overflow: auto;\n position: absolute;\n}\n.split-view-container.separator-border .view:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-separator-border);\n}\n.dragged {\n transform: translate3d(0px, 0px, 0px);\n /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */\n}\n\n.tab {\n flex-shrink: 0;\n}\n.tab.dragging .tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.tab.active-tab > .default-tab .tab-action {\n visibility: visible;\n}\n.tab.inactive-tab > .default-tab .tab-action:not(.dirty) {\n visibility: hidden;\n}\n.tab.inactive-tab > .default-tab:hover .tab-action {\n visibility: visible;\n}\n.tab .default-tab {\n position: relative;\n height: 100%;\n display: flex;\n min-width: 80px;\n align-items: center;\n padding-left: 10px;\n white-space: nowrap;\n text-overflow: elipsis;\n}\n.tab .default-tab .tab-content {\n flex-grow: 1;\n}\n.tab .default-tab .action-container {\n text-align: right;\n width: 28px;\n display: flex;\n}\n.tab .default-tab .action-container .tab-list {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.tab .default-tab .action-container .tab-list a:active:hover {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.tab .default-tab .action-container .tab-list .tab-action {\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n}\n.tab .default-tab .action-container .tab-list .tab-action.disable-close {\n display: none;\n}\n.tab .default-tab .action-container .tab-list .tab-action.dirty:not(:hover) {\n display: block;\n -webkit-mask: var(--dv-tab-dirty-icon) 50% 50%/60% 60% no-repeat;\n mask: var(--dv-tab-dirty-icon) 50% 50%/60% 60% no-repeat;\n}\n.watermark {\n display: flex;\n width: 100%;\n}\n.watermark.has-actions .watermark-title .actions-bar {\n display: none;\n}\n.watermark .watermark-title {\n height: 35px;\n width: 100%;\n display: flex;\n}\n.watermark .watermark-content {\n flex-grow: 1;\n}";
|
|
37
|
+
var css_248z = ".dockview-theme-dark {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n}\n\n.dockview-theme-light {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: white;\n --dv-tabs-and-actions-container-background-color: #f3f3f3;\n --dv-activegroup-visiblepanel-tab-background-color: white;\n --dv-activegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-inactivegroup-visiblepanel-tab-background-color: white;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-tab-divider-color: white;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.35);\n --dv-separator-border: rgba(128, 128, 128, 0.35);\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n}\n\n.dockview-theme-vs {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n --dv-activegroup-visiblepanel-tab-background-color: dodgerblue;\n --dv-tabs-and-actions-container-height: 18px;\n --dv-tabs-and-actions-container-font-size: 11px;\n}\n.dockview-theme-vs .groupview.active-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.inactive-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.actions-bar {\n text-align: right;\n width: 28px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n.actions-bar .actions-container {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.actions-bar .actions-container a:active {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.actions-bar .actions-container .close-action {\n background-color: white;\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n cursor: pointer;\n}\n.drop-target {\n position: relative;\n}\n.drop-target > .drop-target-dropzone {\n position: absolute;\n left: 0px;\n top: 0px;\n height: 100%;\n width: 100%;\n z-index: 10000;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection {\n position: relative;\n box-sizing: border-box;\n height: 100%;\n width: 100%;\n background-color: var(--dv-drag-over-background-color);\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n will-change: transform;\n pointer-events: none;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.left {\n transform: translateX(-25%) scaleX(50%);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.right {\n transform: translateX(25%) scaleX(50%);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.top {\n transform: translateY(-25%) scaleY(50%);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.bottom {\n transform: translateY(25%) scaleY(50%);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-top {\n border-top: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-bottom {\n border-bottom: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-left {\n border-left: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-right {\n border-right: 1px solid var(--dv-drag-over-border-color);\n}\n.custom-dragging {\n height: 24px;\n line-height: 24px;\n font-size: 11px;\n width: 100px;\n background-color: dodgerblue;\n color: ghostwhite;\n border-radius: 11px;\n position: absolute;\n padding-left: 10px;\n}\n\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab .tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {\n background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab .tab-action {\n background-color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-background-color);\n color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab .tab-action {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-background-color);\n color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab .tab-action {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n\n/**\n * when a tab is dragged we lose the above stylings because they are conditional on parent elements\n * therefore we also set some stylings for the dragging event\n **/\n.tab.dragging {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.grid-view,\n.branch-node {\n height: 100%;\n width: 100%;\n}\n.groupview {\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: var(--dv-group-view-background-color);\n overflow: hidden;\n}\n.groupview:focus {\n outline: none;\n}\n.groupview.empty > .tabs-and-actions-container {\n display: none;\n}\n.groupview > .content-container {\n flex-grow: 1;\n overflow: hidden;\n outline: none;\n}\n.pane-container {\n height: 100%;\n width: 100%;\n}\n.pane-container.animated .view {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.pane-container .view {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n padding: 0px !important;\n}\n.pane-container .view:not(:first-child)::before {\n background-color: transparent !important;\n}\n.pane-container .view:not(:first-child) .pane > .pane-header {\n border-top: 1px solid var(--dv-paneview-header-border-color);\n}\n.pane-container .view .default-header {\n background-color: var(--dv-group-view-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n display: flex;\n padding: 0px 8px;\n}\n.pane-container .view .default-header > span {\n flex-grow: 1;\n}\n.pane-container:first-of-type > .pane > .pane-header {\n border-top: none !important;\n}\n.pane-container .pane {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n height: 100%;\n}\n.pane-container .pane .pane-header {\n box-sizing: border-box;\n user-select: none;\n position: relative;\n outline: none;\n}\n.pane-container .pane .pane-header.pane-draggable {\n cursor: pointer;\n}\n.pane-container .pane .pane-header:focus:before, .pane-container .pane .pane-header:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: \"\";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.pane-container .pane .pane-body {\n overflow-y: auto;\n overflow-x: hidden;\n flex-grow: 1;\n position: relative;\n outline: none;\n}\n.pane-container .pane .pane-body:focus:before, .pane-container .pane .pane-body:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: \"\";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.tabs-and-actions-container {\n display: flex;\n background-color: var(--dv-tabs-and-actions-container-background-color);\n flex-shrink: 0;\n box-sizing: border-box;\n height: var(--dv-tabs-and-actions-container-height);\n font-size: var(--dv-tabs-and-actions-container-font-size);\n}\n.tabs-and-actions-container.hidden {\n display: none;\n}\n.tabs-and-actions-container .void-container {\n display: flex;\n flex-grow: 1;\n}\n.tabs-and-actions-container .tabs-container {\n display: flex;\n overflow-x: overlay;\n overflow-y: hidden;\n scrollbar-width: thin;\n /* Track */\n /* Handle */\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar {\n height: 3px;\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar-track {\n background: transparent;\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar-thumb {\n background: var(--dv-tabs-container-scrollbar-color);\n}\n.tabs-and-actions-container .tabs-container .tab {\n -webkit-user-drag: element;\n outline: none;\n min-width: 75px;\n cursor: pointer;\n position: relative;\n box-sizing: border-box;\n}\n.tabs-and-actions-container .tabs-container .tab:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-tab-divider-color);\n width: 1px;\n height: 100%;\n}\n.dockview-react-part {\n height: 100%;\n width: 100%;\n}\n.split-view-container {\n position: relative;\n overflow: hidden;\n height: 100%;\n width: 100%;\n}\n.split-view-container.animation .view,\n.split-view-container.animation .sash {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.split-view-container.horizontal {\n height: 100%;\n}\n.split-view-container.horizontal > .sash-container > .sash {\n height: 100%;\n width: 4px;\n}\n.split-view-container.horizontal > .sash-container > .sash.enabled {\n cursor: ew-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.horizontal > .sash-container > .sash.maximum {\n cursor: w-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.minimum {\n cursor: e-resize;\n}\n.split-view-container.horizontal > .view-container > .view:not(:first-child)::before {\n height: 100%;\n width: 1px;\n}\n.split-view-container.vertical {\n width: 100%;\n}\n.split-view-container.vertical > .sash-container > .sash {\n width: 100%;\n height: 4px;\n}\n.split-view-container.vertical > .sash-container > .sash.enabled {\n cursor: ns-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.vertical > .sash-container > .sash.maximum {\n cursor: n-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.minimum {\n cursor: s-resize;\n}\n.split-view-container.vertical > .view-container > .view {\n width: 100%;\n}\n.split-view-container.vertical > .view-container > .view:not(:first-child)::before {\n height: 1px;\n width: 100%;\n}\n.split-view-container .sash-container {\n height: 100%;\n width: 100%;\n position: absolute;\n}\n.split-view-container .sash-container .sash {\n position: absolute;\n z-index: 99;\n outline: none;\n}\n.split-view-container .sash-container .sash:active {\n transition: background-color 0.1s ease-in-out;\n background-color: var(--dv-active-sash-color, transparent);\n}\n.split-view-container .sash-container .sash:hover {\n background-color: var(--dv-active-sash-color, transparent);\n transition: background-color 0.1s ease-in-out;\n transition-delay: 0.5s;\n}\n.split-view-container .view-container {\n position: relative;\n height: 100%;\n width: 100%;\n}\n.split-view-container .view-container .view {\n height: 100%;\n box-sizing: border-box;\n overflow: auto;\n position: absolute;\n}\n.split-view-container.separator-border .view:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-separator-border);\n}\n.dragged {\n transform: translate3d(0px, 0px, 0px);\n /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */\n}\n\n.tab {\n flex-shrink: 0;\n}\n.tab.dragging .tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.tab.active-tab > .default-tab .tab-action {\n visibility: visible;\n}\n.tab.inactive-tab > .default-tab .tab-action {\n visibility: hidden;\n}\n.tab.inactive-tab > .default-tab:hover .tab-action {\n visibility: visible;\n}\n.tab .default-tab {\n position: relative;\n height: 100%;\n display: flex;\n min-width: 80px;\n align-items: center;\n padding-left: 10px;\n white-space: nowrap;\n text-overflow: elipsis;\n}\n.tab .default-tab .tab-content {\n flex-grow: 1;\n}\n.tab .default-tab .action-container {\n text-align: right;\n width: 28px;\n display: flex;\n}\n.tab .default-tab .action-container .tab-list {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.tab .default-tab .action-container .tab-list a:active:hover {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.tab .default-tab .action-container .tab-list .tab-action {\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n}\n.tab .default-tab .action-container .tab-list .tab-action.disable-close {\n display: none;\n}\n.watermark {\n display: flex;\n width: 100%;\n}\n.watermark.has-actions .watermark-title .actions-bar {\n display: none;\n}\n.watermark .watermark-title {\n height: 35px;\n width: 100%;\n display: flex;\n}\n.watermark .watermark-content {\n flex-grow: 1;\n}";
|
|
38
38
|
styleInject(css_248z);
|
|
39
39
|
|
|
40
|
+
class TransferObject {
|
|
41
|
+
constructor() {
|
|
42
|
+
//
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
class PanelTransfer extends TransferObject {
|
|
46
|
+
constructor(viewId, groupId, panelId) {
|
|
47
|
+
super();
|
|
48
|
+
this.viewId = viewId;
|
|
49
|
+
this.groupId = groupId;
|
|
50
|
+
this.panelId = panelId;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
class PaneTransfer extends TransferObject {
|
|
54
|
+
constructor(viewId, paneId) {
|
|
55
|
+
super();
|
|
56
|
+
this.viewId = viewId;
|
|
57
|
+
this.paneId = paneId;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
62
|
+
*/
|
|
63
|
+
class LocalSelectionTransfer {
|
|
64
|
+
constructor() {
|
|
65
|
+
// protect against external instantiation
|
|
66
|
+
}
|
|
67
|
+
static getInstance() {
|
|
68
|
+
return LocalSelectionTransfer.INSTANCE;
|
|
69
|
+
}
|
|
70
|
+
hasData(proto) {
|
|
71
|
+
return proto && proto === this.proto;
|
|
72
|
+
}
|
|
73
|
+
clearData(proto) {
|
|
74
|
+
if (this.hasData(proto)) {
|
|
75
|
+
this.proto = undefined;
|
|
76
|
+
this.data = undefined;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
getData(proto) {
|
|
80
|
+
if (this.hasData(proto)) {
|
|
81
|
+
return this.data;
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
setData(data, proto) {
|
|
86
|
+
if (proto) {
|
|
87
|
+
this.data = data;
|
|
88
|
+
this.proto = proto;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
LocalSelectionTransfer.INSTANCE = new LocalSelectionTransfer();
|
|
93
|
+
function getPanelData() {
|
|
94
|
+
const panelTransfer = LocalSelectionTransfer.getInstance();
|
|
95
|
+
const isPanelEvent = panelTransfer.hasData(PanelTransfer.prototype);
|
|
96
|
+
if (!isPanelEvent) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
return panelTransfer.getData(PanelTransfer.prototype)[0];
|
|
100
|
+
}
|
|
101
|
+
function getPaneData() {
|
|
102
|
+
const paneTransfer = LocalSelectionTransfer.getInstance();
|
|
103
|
+
const isPanelEvent = paneTransfer.hasData(PaneTransfer.prototype);
|
|
104
|
+
if (!isPanelEvent) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
return paneTransfer.getData(PaneTransfer.prototype)[0];
|
|
108
|
+
}
|
|
109
|
+
|
|
40
110
|
var Event;
|
|
41
111
|
(function (Event) {
|
|
42
112
|
Event.any = (...children) => {
|
|
@@ -67,7 +137,6 @@ class Emitter {
|
|
|
67
137
|
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.replay) && this._last !== undefined) {
|
|
68
138
|
listener(this._last);
|
|
69
139
|
}
|
|
70
|
-
this._listeners.length === 0;
|
|
71
140
|
this._listeners.push(listener);
|
|
72
141
|
return {
|
|
73
142
|
dispose: () => {
|
|
@@ -83,9 +152,9 @@ class Emitter {
|
|
|
83
152
|
}
|
|
84
153
|
fire(e) {
|
|
85
154
|
this._last = e;
|
|
86
|
-
this._listeners
|
|
155
|
+
for (const listener of this._listeners) {
|
|
87
156
|
listener(e);
|
|
88
|
-
}
|
|
157
|
+
}
|
|
89
158
|
}
|
|
90
159
|
dispose() {
|
|
91
160
|
this._listeners = [];
|
|
@@ -127,164 +196,6 @@ class TickDelayedEvent {
|
|
|
127
196
|
}
|
|
128
197
|
}
|
|
129
198
|
|
|
130
|
-
var Disposable;
|
|
131
|
-
(function (Disposable) {
|
|
132
|
-
Disposable.NONE = {
|
|
133
|
-
dispose: () => {
|
|
134
|
-
// noop
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
})(Disposable || (Disposable = {}));
|
|
138
|
-
class CompositeDisposable {
|
|
139
|
-
constructor(...args) {
|
|
140
|
-
this.disposables = args;
|
|
141
|
-
}
|
|
142
|
-
static from(...args) {
|
|
143
|
-
return new CompositeDisposable(...args);
|
|
144
|
-
}
|
|
145
|
-
addDisposables(...args) {
|
|
146
|
-
args === null || args === void 0 ? void 0 : args.forEach((arg) => this.disposables.push(arg));
|
|
147
|
-
}
|
|
148
|
-
dispose() {
|
|
149
|
-
this.disposables.forEach((arg) => arg.dispose());
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
class MutableDisposable {
|
|
153
|
-
constructor() {
|
|
154
|
-
this._disposable = Disposable.NONE;
|
|
155
|
-
}
|
|
156
|
-
set value(disposable) {
|
|
157
|
-
if (this._disposable) {
|
|
158
|
-
this._disposable.dispose();
|
|
159
|
-
}
|
|
160
|
-
this._disposable = disposable;
|
|
161
|
-
}
|
|
162
|
-
dispose() {
|
|
163
|
-
if (this._disposable) {
|
|
164
|
-
this._disposable.dispose();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function tryParseJSON(text, reviver) {
|
|
170
|
-
try {
|
|
171
|
-
return JSON.parse(text, reviver);
|
|
172
|
-
}
|
|
173
|
-
catch (err) {
|
|
174
|
-
console.warn('failed to parse JSON');
|
|
175
|
-
return undefined;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
class TransferObject {
|
|
180
|
-
constructor() {
|
|
181
|
-
//
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
class PanelTransfer extends TransferObject {
|
|
185
|
-
constructor(viewId, groupId, panelId) {
|
|
186
|
-
super();
|
|
187
|
-
this.viewId = viewId;
|
|
188
|
-
this.groupId = groupId;
|
|
189
|
-
this.panelId = panelId;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
class PaneTransfer extends TransferObject {
|
|
193
|
-
constructor(viewId, paneId) {
|
|
194
|
-
super();
|
|
195
|
-
this.viewId = viewId;
|
|
196
|
-
this.paneId = paneId;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
const DATA_KEY = 'splitview/transfer';
|
|
200
|
-
const isPanelTransferEvent = (event) => {
|
|
201
|
-
if (!event.dataTransfer) {
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
return event.dataTransfer.types.includes(DATA_KEY);
|
|
205
|
-
};
|
|
206
|
-
var DragType;
|
|
207
|
-
(function (DragType) {
|
|
208
|
-
DragType["DOCKVIEW_TAB"] = "dockview_tab";
|
|
209
|
-
DragType["EXTERNAL"] = "external_group_drag";
|
|
210
|
-
})(DragType || (DragType = {}));
|
|
211
|
-
/**
|
|
212
|
-
* Determine whether this data belong to that of an event that was started by
|
|
213
|
-
* dragging a tab component
|
|
214
|
-
*/
|
|
215
|
-
const isTabDragEvent = (data) => {
|
|
216
|
-
return data.type === DragType.DOCKVIEW_TAB;
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* Determine whether this data belong to that of an event that was started by
|
|
220
|
-
* a custom drag-enable component
|
|
221
|
-
*/
|
|
222
|
-
const isCustomDragEvent = (data) => {
|
|
223
|
-
return data.type === DragType.EXTERNAL;
|
|
224
|
-
};
|
|
225
|
-
const extractData = (event) => {
|
|
226
|
-
if (!event.dataTransfer) {
|
|
227
|
-
return null;
|
|
228
|
-
}
|
|
229
|
-
const data = tryParseJSON(event.dataTransfer.getData(DATA_KEY));
|
|
230
|
-
if (!data) {
|
|
231
|
-
console.warn(`[dragEvent] ${DATA_KEY} data is missing`);
|
|
232
|
-
}
|
|
233
|
-
if (typeof data.type !== 'string') {
|
|
234
|
-
console.warn(`[dragEvent] invalid type ${data.type}`);
|
|
235
|
-
}
|
|
236
|
-
return data;
|
|
237
|
-
};
|
|
238
|
-
/**
|
|
239
|
-
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
240
|
-
*/
|
|
241
|
-
class LocalSelectionTransfer {
|
|
242
|
-
constructor() {
|
|
243
|
-
// protect against external instantiation
|
|
244
|
-
}
|
|
245
|
-
static getInstance() {
|
|
246
|
-
return LocalSelectionTransfer.INSTANCE;
|
|
247
|
-
}
|
|
248
|
-
hasData(proto) {
|
|
249
|
-
return proto && proto === this.proto;
|
|
250
|
-
}
|
|
251
|
-
clearData(proto) {
|
|
252
|
-
if (this.hasData(proto)) {
|
|
253
|
-
this.proto = undefined;
|
|
254
|
-
this.data = undefined;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
getData(proto) {
|
|
258
|
-
if (this.hasData(proto)) {
|
|
259
|
-
return this.data;
|
|
260
|
-
}
|
|
261
|
-
return undefined;
|
|
262
|
-
}
|
|
263
|
-
setData(data, proto) {
|
|
264
|
-
if (proto) {
|
|
265
|
-
this.data = data;
|
|
266
|
-
this.proto = proto;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
LocalSelectionTransfer.INSTANCE = new LocalSelectionTransfer();
|
|
271
|
-
function getPanelData() {
|
|
272
|
-
const panelTransfer = LocalSelectionTransfer.getInstance();
|
|
273
|
-
const isPanelEvent = panelTransfer.hasData(PanelTransfer.prototype);
|
|
274
|
-
if (!isPanelEvent) {
|
|
275
|
-
return undefined;
|
|
276
|
-
}
|
|
277
|
-
return panelTransfer.getData(PanelTransfer.prototype)[0];
|
|
278
|
-
}
|
|
279
|
-
function getPaneData() {
|
|
280
|
-
const paneTransfer = LocalSelectionTransfer.getInstance();
|
|
281
|
-
const isPanelEvent = paneTransfer.hasData(PaneTransfer.prototype);
|
|
282
|
-
if (!isPanelEvent) {
|
|
283
|
-
return undefined;
|
|
284
|
-
}
|
|
285
|
-
return paneTransfer.getData(PaneTransfer.prototype)[0];
|
|
286
|
-
}
|
|
287
|
-
|
|
288
199
|
class SplitviewApi {
|
|
289
200
|
constructor(component) {
|
|
290
201
|
this.component = component;
|
|
@@ -304,6 +215,9 @@ class SplitviewApi {
|
|
|
304
215
|
get length() {
|
|
305
216
|
return this.component.length;
|
|
306
217
|
}
|
|
218
|
+
get orientation() {
|
|
219
|
+
return this.component.orientation;
|
|
220
|
+
}
|
|
307
221
|
get onDidLayoutChange() {
|
|
308
222
|
return this.component.onDidLayoutChange;
|
|
309
223
|
}
|
|
@@ -313,9 +227,6 @@ class SplitviewApi {
|
|
|
313
227
|
get onDidRemoveView() {
|
|
314
228
|
return this.component.onDidRemoveView;
|
|
315
229
|
}
|
|
316
|
-
get orientation() {
|
|
317
|
-
return this.component.orientation;
|
|
318
|
-
}
|
|
319
230
|
updateOptions(options) {
|
|
320
231
|
this.component.updateOptions(options);
|
|
321
232
|
}
|
|
@@ -360,18 +271,18 @@ class PaneviewApi {
|
|
|
360
271
|
constructor(component) {
|
|
361
272
|
this.component = component;
|
|
362
273
|
}
|
|
363
|
-
get width() {
|
|
364
|
-
return this.component.width;
|
|
365
|
-
}
|
|
366
|
-
get height() {
|
|
367
|
-
return this.component.height;
|
|
368
|
-
}
|
|
369
274
|
get minimumSize() {
|
|
370
275
|
return this.component.minimumSize;
|
|
371
276
|
}
|
|
372
277
|
get maximumSize() {
|
|
373
278
|
return this.component.maximumSize;
|
|
374
279
|
}
|
|
280
|
+
get height() {
|
|
281
|
+
return this.component.height;
|
|
282
|
+
}
|
|
283
|
+
get width() {
|
|
284
|
+
return this.component.width;
|
|
285
|
+
}
|
|
375
286
|
get onDidLayoutChange() {
|
|
376
287
|
return this.component.onDidLayoutChange;
|
|
377
288
|
}
|
|
@@ -411,7 +322,7 @@ class PaneviewApi {
|
|
|
411
322
|
this.component.layout(width, height);
|
|
412
323
|
}
|
|
413
324
|
addPanel(options) {
|
|
414
|
-
|
|
325
|
+
this.component.addPanel(options);
|
|
415
326
|
}
|
|
416
327
|
resizeToFit() {
|
|
417
328
|
this.component.resizeToFit();
|
|
@@ -427,12 +338,6 @@ class GridviewApi {
|
|
|
427
338
|
constructor(component) {
|
|
428
339
|
this.component = component;
|
|
429
340
|
}
|
|
430
|
-
get width() {
|
|
431
|
-
return this.component.width;
|
|
432
|
-
}
|
|
433
|
-
get height() {
|
|
434
|
-
return this.component.height;
|
|
435
|
-
}
|
|
436
341
|
get minimumHeight() {
|
|
437
342
|
return this.component.minimumHeight;
|
|
438
343
|
}
|
|
@@ -445,12 +350,27 @@ class GridviewApi {
|
|
|
445
350
|
get maximumWidth() {
|
|
446
351
|
return this.component.maximumWidth;
|
|
447
352
|
}
|
|
448
|
-
get
|
|
449
|
-
return this.component.
|
|
353
|
+
get width() {
|
|
354
|
+
return this.component.width;
|
|
355
|
+
}
|
|
356
|
+
get height() {
|
|
357
|
+
return this.component.height;
|
|
450
358
|
}
|
|
451
359
|
get onDidLayoutChange() {
|
|
452
360
|
return this.component.onDidLayoutChange;
|
|
453
361
|
}
|
|
362
|
+
get onDidAddGroup() {
|
|
363
|
+
return this.component.onDidAddGroup;
|
|
364
|
+
}
|
|
365
|
+
get onDidRemoveGroup() {
|
|
366
|
+
return this.component.onDidRemoveGroup;
|
|
367
|
+
}
|
|
368
|
+
get onDidActiveGroupChange() {
|
|
369
|
+
return this.component.onDidActiveGroupChange;
|
|
370
|
+
}
|
|
371
|
+
get onDidLayoutFromJSON() {
|
|
372
|
+
return this.component.onDidLayoutFromJSON;
|
|
373
|
+
}
|
|
454
374
|
get panels() {
|
|
455
375
|
return this.component.groups;
|
|
456
376
|
}
|
|
@@ -525,8 +445,26 @@ class DockviewApi {
|
|
|
525
445
|
get totalPanels() {
|
|
526
446
|
return this.component.totalPanels;
|
|
527
447
|
}
|
|
528
|
-
get
|
|
529
|
-
return this.component.
|
|
448
|
+
get onDidActiveGroupChange() {
|
|
449
|
+
return this.component.onDidActiveGroupChange;
|
|
450
|
+
}
|
|
451
|
+
get onDidAddGroup() {
|
|
452
|
+
return this.component.onDidAddGroup;
|
|
453
|
+
}
|
|
454
|
+
get onDidRemoveGroup() {
|
|
455
|
+
return this.component.onDidRemoveGroup;
|
|
456
|
+
}
|
|
457
|
+
get onDidActivePanelChange() {
|
|
458
|
+
return this.component.onDidActivePanelChange;
|
|
459
|
+
}
|
|
460
|
+
get onDidAddPanel() {
|
|
461
|
+
return this.component.onDidAddPanel;
|
|
462
|
+
}
|
|
463
|
+
get onDidRemovePanel() {
|
|
464
|
+
return this.component.onDidRemovePanel;
|
|
465
|
+
}
|
|
466
|
+
get onDidLayoutfromJSON() {
|
|
467
|
+
return this.component.onDidLayoutfromJSON;
|
|
530
468
|
}
|
|
531
469
|
get onDidLayoutChange() {
|
|
532
470
|
return this.component.onDidLayoutChange;
|
|
@@ -555,18 +493,12 @@ class DockviewApi {
|
|
|
555
493
|
getPanel(id) {
|
|
556
494
|
return this.component.getGroupPanel(id);
|
|
557
495
|
}
|
|
558
|
-
setActivePanel(panel) {
|
|
559
|
-
this.component.setActivePanel(panel);
|
|
560
|
-
}
|
|
561
496
|
layout(width, height, force = false) {
|
|
562
497
|
this.component.layout(width, height, force);
|
|
563
498
|
}
|
|
564
499
|
addPanel(options) {
|
|
565
500
|
return this.component.addPanel(options);
|
|
566
501
|
}
|
|
567
|
-
removePanel(panel) {
|
|
568
|
-
this.component.removePanel(panel);
|
|
569
|
-
}
|
|
570
502
|
addEmptyGroup(options) {
|
|
571
503
|
this.component.addEmptyGroup(options);
|
|
572
504
|
}
|
|
@@ -596,6 +528,46 @@ class DockviewApi {
|
|
|
596
528
|
}
|
|
597
529
|
}
|
|
598
530
|
|
|
531
|
+
var Disposable;
|
|
532
|
+
(function (Disposable) {
|
|
533
|
+
Disposable.NONE = {
|
|
534
|
+
dispose: () => {
|
|
535
|
+
// noop
|
|
536
|
+
},
|
|
537
|
+
};
|
|
538
|
+
})(Disposable || (Disposable = {}));
|
|
539
|
+
class CompositeDisposable {
|
|
540
|
+
constructor(...args) {
|
|
541
|
+
this.disposables = args;
|
|
542
|
+
}
|
|
543
|
+
static from(...args) {
|
|
544
|
+
return new CompositeDisposable(...args);
|
|
545
|
+
}
|
|
546
|
+
addDisposables(...args) {
|
|
547
|
+
args.forEach((arg) => this.disposables.push(arg));
|
|
548
|
+
}
|
|
549
|
+
dispose() {
|
|
550
|
+
this.disposables.forEach((arg) => arg.dispose());
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
class MutableDisposable {
|
|
554
|
+
constructor() {
|
|
555
|
+
this._disposable = Disposable.NONE;
|
|
556
|
+
}
|
|
557
|
+
set value(disposable) {
|
|
558
|
+
if (this._disposable) {
|
|
559
|
+
this._disposable.dispose();
|
|
560
|
+
}
|
|
561
|
+
this._disposable = disposable;
|
|
562
|
+
}
|
|
563
|
+
dispose() {
|
|
564
|
+
if (this._disposable) {
|
|
565
|
+
this._disposable.dispose();
|
|
566
|
+
this._disposable = Disposable.NONE;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
599
571
|
function watchElementResize(element, cb) {
|
|
600
572
|
const observer = new ResizeObserver((entires) => {
|
|
601
573
|
const firstEntry = entires[0];
|
|
@@ -1541,13 +1513,13 @@ class Splitview {
|
|
|
1541
1513
|
this._onDidSashEnd.dispose();
|
|
1542
1514
|
this._onDidAddView.dispose();
|
|
1543
1515
|
this._onDidRemoveView.dispose();
|
|
1544
|
-
this.element.remove();
|
|
1545
1516
|
for (let i = 0; i < this.element.children.length; i++) {
|
|
1546
1517
|
if (this.element.children.item(i) === this.element) {
|
|
1547
1518
|
this.element.removeChild(this.element);
|
|
1548
1519
|
break;
|
|
1549
1520
|
}
|
|
1550
1521
|
}
|
|
1522
|
+
this.element.remove();
|
|
1551
1523
|
}
|
|
1552
1524
|
}
|
|
1553
1525
|
|
|
@@ -1570,7 +1542,7 @@ class Paneview extends CompositeDisposable {
|
|
|
1570
1542
|
});
|
|
1571
1543
|
// if we've added views from the descriptor we need to
|
|
1572
1544
|
// add the panes to our Pane array and setup animation
|
|
1573
|
-
this.getPanes().forEach((pane
|
|
1545
|
+
this.getPanes().forEach((pane) => {
|
|
1574
1546
|
const disposable = new CompositeDisposable(pane.onDidChangeExpansionState(() => {
|
|
1575
1547
|
this.setupAnimation();
|
|
1576
1548
|
this._onDidChange.fire(undefined);
|
|
@@ -1586,7 +1558,7 @@ class Paneview extends CompositeDisposable {
|
|
|
1586
1558
|
this.paneItems.push(paneItem);
|
|
1587
1559
|
pane.orthogonalSize = this.splitview.orthogonalSize;
|
|
1588
1560
|
});
|
|
1589
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
1561
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
1590
1562
|
this._onDidChange.fire(undefined);
|
|
1591
1563
|
}), this.splitview.onDidAddView(() => {
|
|
1592
1564
|
this._onDidChange.fire();
|
|
@@ -1638,17 +1610,20 @@ class Paneview extends CompositeDisposable {
|
|
|
1638
1610
|
getPanes() {
|
|
1639
1611
|
return this.splitview.getViews();
|
|
1640
1612
|
}
|
|
1641
|
-
removePane(index) {
|
|
1613
|
+
removePane(index, options = { skipDispose: false }) {
|
|
1642
1614
|
const paneItem = this.paneItems.splice(index, 1)[0];
|
|
1643
1615
|
this.splitview.removeView(index);
|
|
1644
|
-
|
|
1616
|
+
if (!options.skipDispose) {
|
|
1617
|
+
paneItem.disposable.dispose();
|
|
1618
|
+
paneItem.pane.dispose();
|
|
1619
|
+
}
|
|
1645
1620
|
return paneItem;
|
|
1646
1621
|
}
|
|
1647
1622
|
moveView(from, to) {
|
|
1648
1623
|
if (from === to) {
|
|
1649
1624
|
return;
|
|
1650
1625
|
}
|
|
1651
|
-
const view = this.removePane(from);
|
|
1626
|
+
const view = this.removePane(from, { skipDispose: true });
|
|
1652
1627
|
this.skipAnimation = true;
|
|
1653
1628
|
try {
|
|
1654
1629
|
this.addPane(view.pane, view.pane.size, to, false);
|
|
@@ -1676,15 +1651,16 @@ class Paneview extends CompositeDisposable {
|
|
|
1676
1651
|
}
|
|
1677
1652
|
dispose() {
|
|
1678
1653
|
super.dispose();
|
|
1679
|
-
this.splitview.dispose();
|
|
1680
1654
|
if (this.animationTimer) {
|
|
1681
1655
|
clearTimeout(this.animationTimer);
|
|
1682
1656
|
this.animationTimer = undefined;
|
|
1683
1657
|
}
|
|
1684
1658
|
this.paneItems.forEach((paneItem) => {
|
|
1685
1659
|
paneItem.disposable.dispose();
|
|
1660
|
+
paneItem.pane.dispose();
|
|
1686
1661
|
});
|
|
1687
1662
|
this.paneItems = [];
|
|
1663
|
+
this.splitview.dispose();
|
|
1688
1664
|
this.element.remove();
|
|
1689
1665
|
}
|
|
1690
1666
|
}
|
|
@@ -1747,8 +1723,8 @@ class Droptarget extends CompositeDisposable {
|
|
|
1747
1723
|
this.options = options;
|
|
1748
1724
|
this._onDrop = new Emitter();
|
|
1749
1725
|
this.onDrop = this._onDrop.event;
|
|
1750
|
-
this.addDisposables(new DragAndDropObserver(this.element, {
|
|
1751
|
-
onDragEnter: (
|
|
1726
|
+
this.addDisposables(this._onDrop, new DragAndDropObserver(this.element, {
|
|
1727
|
+
onDragEnter: () => undefined,
|
|
1752
1728
|
onDragOver: (e) => {
|
|
1753
1729
|
if (isBooleanValue(this.options.canDisplayOverlay)) {
|
|
1754
1730
|
if (!this.options.canDisplayOverlay) {
|
|
@@ -1783,56 +1759,16 @@ class Droptarget extends CompositeDisposable {
|
|
|
1783
1759
|
const y = e.offsetY;
|
|
1784
1760
|
const xp = (100 * x) / width;
|
|
1785
1761
|
const yp = (100 * y) / height;
|
|
1786
|
-
|
|
1787
|
-
let isLeft = false;
|
|
1788
|
-
let isTop = false;
|
|
1789
|
-
let isBottom = false;
|
|
1790
|
-
switch (this.options.validOverlays) {
|
|
1791
|
-
case 'all':
|
|
1792
|
-
isRight = xp > 80;
|
|
1793
|
-
isLeft = xp < 20;
|
|
1794
|
-
isTop = !isRight && !isLeft && yp < 20;
|
|
1795
|
-
isBottom = !isRight && !isLeft && yp > 80;
|
|
1796
|
-
break;
|
|
1797
|
-
case 'vertical':
|
|
1798
|
-
isTop = yp < 50;
|
|
1799
|
-
isBottom = yp >= 50;
|
|
1800
|
-
break;
|
|
1801
|
-
case 'horizontal':
|
|
1802
|
-
isLeft = xp < 50;
|
|
1803
|
-
isRight = xp >= 50;
|
|
1804
|
-
break;
|
|
1805
|
-
}
|
|
1762
|
+
const quadrant = this.calculateQuadrant(this.options.validOverlays, xp, yp);
|
|
1806
1763
|
const isSmallX = width < 100;
|
|
1807
1764
|
const isSmallY = height < 100;
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1811
|
-
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1812
|
-
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1813
|
-
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1814
|
-
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1815
|
-
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1816
|
-
if (isRight) {
|
|
1817
|
-
this._state = Position.Right;
|
|
1818
|
-
}
|
|
1819
|
-
else if (isLeft) {
|
|
1820
|
-
this._state = Position.Left;
|
|
1821
|
-
}
|
|
1822
|
-
else if (isTop) {
|
|
1823
|
-
this._state = Position.Top;
|
|
1824
|
-
}
|
|
1825
|
-
else if (isBottom) {
|
|
1826
|
-
this._state = Position.Bottom;
|
|
1827
|
-
}
|
|
1828
|
-
else {
|
|
1829
|
-
this._state = Position.Center;
|
|
1830
|
-
}
|
|
1765
|
+
this.toggleClasses(quadrant, isSmallX, isSmallY);
|
|
1766
|
+
this.setState(quadrant);
|
|
1831
1767
|
},
|
|
1832
|
-
onDragLeave: (
|
|
1768
|
+
onDragLeave: () => {
|
|
1833
1769
|
this.removeDropTarget();
|
|
1834
1770
|
},
|
|
1835
|
-
onDragEnd: (
|
|
1771
|
+
onDragEnd: () => {
|
|
1836
1772
|
this.removeDropTarget();
|
|
1837
1773
|
},
|
|
1838
1774
|
onDrop: (e) => {
|
|
@@ -1856,9 +1792,73 @@ class Droptarget extends CompositeDisposable {
|
|
|
1856
1792
|
this.options.canDisplayOverlay = value;
|
|
1857
1793
|
}
|
|
1858
1794
|
dispose() {
|
|
1859
|
-
this._onDrop.dispose();
|
|
1860
1795
|
this.removeDropTarget();
|
|
1861
1796
|
}
|
|
1797
|
+
toggleClasses(quadrant, isSmallX, isSmallY) {
|
|
1798
|
+
if (!this.overlay) {
|
|
1799
|
+
return;
|
|
1800
|
+
}
|
|
1801
|
+
const isLeft = quadrant === 'left';
|
|
1802
|
+
const isRight = quadrant === 'right';
|
|
1803
|
+
const isTop = quadrant === 'top';
|
|
1804
|
+
const isBottom = quadrant === 'bottom';
|
|
1805
|
+
toggleClass(this.overlay, 'right', !isSmallX && isRight);
|
|
1806
|
+
toggleClass(this.overlay, 'left', !isSmallX && isLeft);
|
|
1807
|
+
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1808
|
+
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1809
|
+
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1810
|
+
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1811
|
+
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1812
|
+
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1813
|
+
}
|
|
1814
|
+
setState(quadrant) {
|
|
1815
|
+
switch (quadrant) {
|
|
1816
|
+
case 'top':
|
|
1817
|
+
this._state = Position.Top;
|
|
1818
|
+
break;
|
|
1819
|
+
case 'left':
|
|
1820
|
+
this._state = Position.Left;
|
|
1821
|
+
break;
|
|
1822
|
+
case 'bottom':
|
|
1823
|
+
this._state = Position.Bottom;
|
|
1824
|
+
break;
|
|
1825
|
+
case 'right':
|
|
1826
|
+
this._state = Position.Right;
|
|
1827
|
+
break;
|
|
1828
|
+
default:
|
|
1829
|
+
this._state = Position.Center;
|
|
1830
|
+
break;
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
calculateQuadrant(overlayType, xp, yp) {
|
|
1834
|
+
switch (overlayType) {
|
|
1835
|
+
case 'all':
|
|
1836
|
+
if (xp < 20) {
|
|
1837
|
+
return 'left';
|
|
1838
|
+
}
|
|
1839
|
+
if (xp > 80) {
|
|
1840
|
+
return 'right';
|
|
1841
|
+
}
|
|
1842
|
+
if (yp < 20) {
|
|
1843
|
+
return 'top';
|
|
1844
|
+
}
|
|
1845
|
+
if (yp > 80) {
|
|
1846
|
+
return 'bottom';
|
|
1847
|
+
}
|
|
1848
|
+
break;
|
|
1849
|
+
case 'vertical':
|
|
1850
|
+
if (yp < 50) {
|
|
1851
|
+
return 'top';
|
|
1852
|
+
}
|
|
1853
|
+
return 'bottom';
|
|
1854
|
+
case 'horizontal':
|
|
1855
|
+
if (xp < 50) {
|
|
1856
|
+
return 'left';
|
|
1857
|
+
}
|
|
1858
|
+
return 'right';
|
|
1859
|
+
}
|
|
1860
|
+
return null;
|
|
1861
|
+
}
|
|
1862
1862
|
removeDropTarget() {
|
|
1863
1863
|
if (this.target) {
|
|
1864
1864
|
this._state = undefined;
|
|
@@ -1961,6 +1961,7 @@ class LeafNode {
|
|
|
1961
1961
|
this.view.layout(this.width, this.height);
|
|
1962
1962
|
}
|
|
1963
1963
|
dispose() {
|
|
1964
|
+
this._onDidChange.dispose();
|
|
1964
1965
|
this._disposable.dispose();
|
|
1965
1966
|
}
|
|
1966
1967
|
}
|
|
@@ -2003,7 +2004,7 @@ class BranchNode extends CompositeDisposable {
|
|
|
2003
2004
|
: true,
|
|
2004
2005
|
};
|
|
2005
2006
|
}),
|
|
2006
|
-
size: this.
|
|
2007
|
+
size: this.size,
|
|
2007
2008
|
};
|
|
2008
2009
|
this.children = childDescriptors.map((c) => c.node);
|
|
2009
2010
|
this.splitview = new Splitview(this.element, {
|
|
@@ -2012,7 +2013,7 @@ class BranchNode extends CompositeDisposable {
|
|
|
2012
2013
|
proportionalLayout,
|
|
2013
2014
|
});
|
|
2014
2015
|
}
|
|
2015
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
2016
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
2016
2017
|
this._onDidChange.fire(undefined);
|
|
2017
2018
|
}));
|
|
2018
2019
|
this.setupChildrenEvents();
|
|
@@ -2164,7 +2165,7 @@ class BranchNode extends CompositeDisposable {
|
|
|
2164
2165
|
}
|
|
2165
2166
|
setupChildrenEvents() {
|
|
2166
2167
|
this._childrenDisposable.dispose();
|
|
2167
|
-
this._childrenDisposable = Event.any(...this.children.map((c) => c.onDidChange))((
|
|
2168
|
+
this._childrenDisposable = Event.any(...this.children.map((c) => c.onDidChange))(() => {
|
|
2168
2169
|
/**
|
|
2169
2170
|
* indicate a change has occured to allows any re-rendering but don't bubble
|
|
2170
2171
|
* event because that was specific to this branch
|
|
@@ -2184,6 +2185,15 @@ class BranchNode extends CompositeDisposable {
|
|
|
2184
2185
|
* Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
|
|
2185
2186
|
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
|
|
2186
2187
|
*--------------------------------------------------------------------------------------------*/
|
|
2188
|
+
function findLeaf(candiateNode, last) {
|
|
2189
|
+
if (candiateNode instanceof LeafNode) {
|
|
2190
|
+
return candiateNode;
|
|
2191
|
+
}
|
|
2192
|
+
if (candiateNode instanceof BranchNode) {
|
|
2193
|
+
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2194
|
+
}
|
|
2195
|
+
throw new Error('invalid node');
|
|
2196
|
+
}
|
|
2187
2197
|
function flipNode(node, size, orthogonalSize) {
|
|
2188
2198
|
if (node instanceof BranchNode) {
|
|
2189
2199
|
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize);
|
|
@@ -2315,6 +2325,7 @@ class Gridview {
|
|
|
2315
2325
|
this.disposable.dispose();
|
|
2316
2326
|
this._onDidChange.dispose();
|
|
2317
2327
|
this.root.dispose();
|
|
2328
|
+
this.element.remove();
|
|
2318
2329
|
}
|
|
2319
2330
|
clear() {
|
|
2320
2331
|
const orientation = this.root.orientation;
|
|
@@ -2322,13 +2333,13 @@ class Gridview {
|
|
|
2322
2333
|
}
|
|
2323
2334
|
deserialize(json, deserializer) {
|
|
2324
2335
|
const orientation = json.orientation;
|
|
2325
|
-
const height = json.height;
|
|
2336
|
+
const height = orientation === Orientation.VERTICAL ? json.height : json.width;
|
|
2326
2337
|
this._deserialize(json.root, orientation, deserializer, height);
|
|
2327
2338
|
}
|
|
2328
2339
|
_deserialize(root, orientation, deserializer, orthogonalSize) {
|
|
2329
|
-
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize);
|
|
2340
|
+
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize, true);
|
|
2330
2341
|
}
|
|
2331
|
-
_deserializeNode(node, orientation, deserializer, orthogonalSize) {
|
|
2342
|
+
_deserializeNode(node, orientation, deserializer, orthogonalSize, isRoot = false) {
|
|
2332
2343
|
let result;
|
|
2333
2344
|
if (node.type === 'branch') {
|
|
2334
2345
|
const serializedChildren = node.data;
|
|
@@ -2338,7 +2349,9 @@ class Gridview {
|
|
|
2338
2349
|
visible: serializedChild.visible,
|
|
2339
2350
|
};
|
|
2340
2351
|
});
|
|
2341
|
-
|
|
2352
|
+
// HORIZONTAL => height=orthogonalsize width=size
|
|
2353
|
+
// VERTICAL => height=size width=orthogonalsize
|
|
2354
|
+
result = new BranchNode(orientation, this.proportionalLayout, this.styles, isRoot ? orthogonalSize : node.size, isRoot ? node.size : orthogonalSize, children);
|
|
2342
2355
|
}
|
|
2343
2356
|
else {
|
|
2344
2357
|
result = new LeafNode(deserializer.fromJSON(node), orientation, orthogonalSize, node.size);
|
|
@@ -2399,15 +2412,6 @@ class Gridview {
|
|
|
2399
2412
|
if (!(node instanceof LeafNode)) {
|
|
2400
2413
|
throw new Error('invalid location');
|
|
2401
2414
|
}
|
|
2402
|
-
const findLeaf = (candiateNode, last) => {
|
|
2403
|
-
if (candiateNode instanceof LeafNode) {
|
|
2404
|
-
return candiateNode;
|
|
2405
|
-
}
|
|
2406
|
-
if (candiateNode instanceof BranchNode) {
|
|
2407
|
-
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2408
|
-
}
|
|
2409
|
-
throw new Error('invalid node');
|
|
2410
|
-
};
|
|
2411
2415
|
for (let i = path.length - 1; i > -1; i--) {
|
|
2412
2416
|
const n = path[i];
|
|
2413
2417
|
const l = location[i] || 0;
|
|
@@ -2509,9 +2513,9 @@ class Gridview {
|
|
|
2509
2513
|
if (parent.children.length > 1) {
|
|
2510
2514
|
return node.view;
|
|
2511
2515
|
}
|
|
2516
|
+
const sibling = parent.children[0];
|
|
2512
2517
|
if (pathToParent.length === 0) {
|
|
2513
2518
|
// parent is root
|
|
2514
|
-
const sibling = parent.children[0];
|
|
2515
2519
|
if (sibling instanceof LeafNode) {
|
|
2516
2520
|
return node.view;
|
|
2517
2521
|
}
|
|
@@ -2522,10 +2526,9 @@ class Gridview {
|
|
|
2522
2526
|
}
|
|
2523
2527
|
const [grandParent, ..._] = [...pathToParent].reverse();
|
|
2524
2528
|
const [parentIndex, ...__] = [...rest].reverse();
|
|
2525
|
-
const sibling = parent.children[0];
|
|
2526
2529
|
const isSiblingVisible = parent.isChildVisible(0);
|
|
2527
2530
|
parent.removeChild(0, sizing);
|
|
2528
|
-
const sizes = grandParent.children.map((
|
|
2531
|
+
const sizes = grandParent.children.map((_size, i) => grandParent.getChildSize(i));
|
|
2529
2532
|
grandParent.removeChild(parentIndex, sizing);
|
|
2530
2533
|
if (sibling instanceof BranchNode) {
|
|
2531
2534
|
sizes.splice(parentIndex, 1, ...sibling.children.map((c) => c.size));
|
|
@@ -2569,31 +2572,6 @@ class Gridview {
|
|
|
2569
2572
|
}
|
|
2570
2573
|
}
|
|
2571
2574
|
|
|
2572
|
-
/*! *****************************************************************************
|
|
2573
|
-
Copyright (c) Microsoft Corporation.
|
|
2574
|
-
|
|
2575
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2576
|
-
purpose with or without fee is hereby granted.
|
|
2577
|
-
|
|
2578
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2579
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2580
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2581
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2582
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2583
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2584
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2585
|
-
***************************************************************************** */
|
|
2586
|
-
|
|
2587
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
2588
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2589
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2590
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2591
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2592
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2593
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2594
|
-
});
|
|
2595
|
-
}
|
|
2596
|
-
|
|
2597
2575
|
class ContentContainer extends CompositeDisposable {
|
|
2598
2576
|
constructor() {
|
|
2599
2577
|
super();
|
|
@@ -2605,6 +2583,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
2605
2583
|
this._element = document.createElement('div');
|
|
2606
2584
|
this._element.className = 'content-container';
|
|
2607
2585
|
this._element.tabIndex = -1;
|
|
2586
|
+
this.addDisposables(this._onDidFocus, this._onDidBlur);
|
|
2608
2587
|
// for hosted containers
|
|
2609
2588
|
// 1) register a drop target on the host
|
|
2610
2589
|
// 2) register window dragStart events to disable pointer events
|
|
@@ -2648,7 +2627,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
2648
2627
|
}
|
|
2649
2628
|
this.disposable.value = disposable;
|
|
2650
2629
|
}
|
|
2651
|
-
layout(
|
|
2630
|
+
layout(_width, _height) {
|
|
2652
2631
|
// noop
|
|
2653
2632
|
}
|
|
2654
2633
|
closePanel() {
|
|
@@ -2671,6 +2650,41 @@ var DockviewDropTargets;
|
|
|
2671
2650
|
DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
|
|
2672
2651
|
})(DockviewDropTargets || (DockviewDropTargets = {}));
|
|
2673
2652
|
|
|
2653
|
+
class DragHandler extends CompositeDisposable {
|
|
2654
|
+
constructor(el) {
|
|
2655
|
+
super();
|
|
2656
|
+
this.el = el;
|
|
2657
|
+
this.disposable = new MutableDisposable();
|
|
2658
|
+
this._onDragStart = new Emitter();
|
|
2659
|
+
this.onDragStart = this._onDragStart.event;
|
|
2660
|
+
this.iframes = [];
|
|
2661
|
+
this.configure();
|
|
2662
|
+
}
|
|
2663
|
+
configure() {
|
|
2664
|
+
this.addDisposables(this._onDragStart, addDisposableListener(this.el, 'dragstart', (event) => {
|
|
2665
|
+
this.iframes = [
|
|
2666
|
+
...getElementsByTagName('iframe'),
|
|
2667
|
+
...getElementsByTagName('webview'),
|
|
2668
|
+
];
|
|
2669
|
+
for (const iframe of this.iframes) {
|
|
2670
|
+
iframe.style.pointerEvents = 'none';
|
|
2671
|
+
}
|
|
2672
|
+
this.el.classList.add('dragged');
|
|
2673
|
+
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
2674
|
+
this.disposable.value = this.getData();
|
|
2675
|
+
if (event.dataTransfer) {
|
|
2676
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
2677
|
+
}
|
|
2678
|
+
}), addDisposableListener(this.el, 'dragend', () => {
|
|
2679
|
+
for (const iframe of this.iframes) {
|
|
2680
|
+
iframe.style.pointerEvents = 'auto';
|
|
2681
|
+
}
|
|
2682
|
+
this.iframes = [];
|
|
2683
|
+
this.disposable.dispose();
|
|
2684
|
+
}));
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2674
2688
|
var MouseEventKind;
|
|
2675
2689
|
(function (MouseEventKind) {
|
|
2676
2690
|
MouseEventKind["CLICK"] = "CLICK";
|
|
@@ -2680,42 +2694,34 @@ class Tab$1 extends CompositeDisposable {
|
|
|
2680
2694
|
constructor(panelId, accessor, group) {
|
|
2681
2695
|
super();
|
|
2682
2696
|
this.panelId = panelId;
|
|
2683
|
-
this.accessor = accessor;
|
|
2684
2697
|
this.group = group;
|
|
2685
2698
|
this._onChanged = new Emitter();
|
|
2686
2699
|
this.onChanged = this._onChanged.event;
|
|
2687
2700
|
this._onDropped = new Emitter();
|
|
2688
2701
|
this.onDrop = this._onDropped.event;
|
|
2689
|
-
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2690
|
-
this.iframes = [];
|
|
2691
2702
|
this.addDisposables(this._onChanged, this._onDropped);
|
|
2692
2703
|
this._element = document.createElement('div');
|
|
2693
2704
|
this._element.className = 'tab';
|
|
2694
2705
|
this._element.tabIndex = 0;
|
|
2695
2706
|
this._element.draggable = true;
|
|
2696
|
-
this.addDisposables(
|
|
2697
|
-
|
|
2698
|
-
...
|
|
2699
|
-
|
|
2700
|
-
];
|
|
2701
|
-
for (const iframe of this.iframes) {
|
|
2702
|
-
iframe.style.pointerEvents = 'none';
|
|
2707
|
+
this.addDisposables(new (class Handler extends DragHandler {
|
|
2708
|
+
constructor() {
|
|
2709
|
+
super(...arguments);
|
|
2710
|
+
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2703
2711
|
}
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2712
|
+
getData() {
|
|
2713
|
+
this.panelTransfer.setData([new PanelTransfer(accessor.id, group.id, panelId)], PanelTransfer.prototype);
|
|
2714
|
+
return {
|
|
2715
|
+
dispose: () => {
|
|
2716
|
+
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
2717
|
+
},
|
|
2718
|
+
};
|
|
2711
2719
|
}
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
iframe.style.pointerEvents = 'auto';
|
|
2720
|
+
dispose() {
|
|
2721
|
+
//
|
|
2715
2722
|
}
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
}), addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2723
|
+
})(this._element));
|
|
2724
|
+
this.addDisposables(addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2719
2725
|
if (event.defaultPrevented) {
|
|
2720
2726
|
return;
|
|
2721
2727
|
}
|
|
@@ -2917,12 +2923,10 @@ class TabsContainer extends CompositeDisposable {
|
|
|
2917
2923
|
if (!isLeftClick || event.event.defaultPrevented) {
|
|
2918
2924
|
return;
|
|
2919
2925
|
}
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
});
|
|
2925
|
-
break;
|
|
2926
|
+
if (event.kind === MouseEventKind.CLICK) {
|
|
2927
|
+
this.group.model.openPanel(panel, {
|
|
2928
|
+
skipFocus: alreadyFocused,
|
|
2929
|
+
});
|
|
2926
2930
|
}
|
|
2927
2931
|
}), tabToAdd.onDrop((event) => {
|
|
2928
2932
|
this._onDrop.fire({
|
|
@@ -2951,7 +2955,6 @@ var GroupChangeKind2;
|
|
|
2951
2955
|
GroupChangeKind2["ADD_PANEL"] = "ADD_PANEL";
|
|
2952
2956
|
GroupChangeKind2["REMOVE_PANEL"] = "REMOVE_PANEL";
|
|
2953
2957
|
GroupChangeKind2["PANEL_ACTIVE"] = "PANEL_ACTIVE";
|
|
2954
|
-
GroupChangeKind2["GROUP_ACTIVE"] = "GROUP_ACTIVE";
|
|
2955
2958
|
})(GroupChangeKind2 || (GroupChangeKind2 = {}));
|
|
2956
2959
|
class Groupview extends CompositeDisposable {
|
|
2957
2960
|
constructor(container, accessor, id, options, parent) {
|
|
@@ -2972,15 +2975,10 @@ class Groupview extends CompositeDisposable {
|
|
|
2972
2975
|
this.onMove = this._onMove.event;
|
|
2973
2976
|
this._onDidGroupChange = new Emitter();
|
|
2974
2977
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
2975
|
-
this.
|
|
2976
|
-
|
|
2977
|
-
return false;
|
|
2978
|
-
}
|
|
2979
|
-
this.doClose(panel);
|
|
2980
|
-
return true;
|
|
2981
|
-
});
|
|
2978
|
+
this._onDidDrop = new Emitter();
|
|
2979
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
2982
2980
|
this.container.classList.add('groupview');
|
|
2983
|
-
this.addDisposables(this._onMove, this._onDidGroupChange);
|
|
2981
|
+
this.addDisposables(this._onMove, this._onDidGroupChange, this._onDidChange, this._onDidDrop);
|
|
2984
2982
|
this.tabsContainer = new TabsContainer(this.accessor, this.parent, {
|
|
2985
2983
|
tabHeight: options.tabHeight,
|
|
2986
2984
|
});
|
|
@@ -3044,6 +3042,9 @@ class Groupview extends CompositeDisposable {
|
|
|
3044
3042
|
get maximumWidth() {
|
|
3045
3043
|
return Number.MAX_SAFE_INTEGER;
|
|
3046
3044
|
}
|
|
3045
|
+
get hasWatermark() {
|
|
3046
|
+
return !!(this.watermark && this.container.contains(this.watermark.element));
|
|
3047
|
+
}
|
|
3047
3048
|
initialize() {
|
|
3048
3049
|
var _a, _b;
|
|
3049
3050
|
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.panels) {
|
|
@@ -3122,10 +3123,10 @@ class Groupview extends CompositeDisposable {
|
|
|
3122
3123
|
containsPanel(panel) {
|
|
3123
3124
|
return this.panels.includes(panel);
|
|
3124
3125
|
}
|
|
3125
|
-
init(
|
|
3126
|
+
init(_params) {
|
|
3126
3127
|
//noop
|
|
3127
3128
|
}
|
|
3128
|
-
update(
|
|
3129
|
+
update(_params) {
|
|
3129
3130
|
//noop
|
|
3130
3131
|
}
|
|
3131
3132
|
focus() {
|
|
@@ -3137,6 +3138,8 @@ class Groupview extends CompositeDisposable {
|
|
|
3137
3138
|
options.index > this.panels.length) {
|
|
3138
3139
|
options.index = this.panels.length;
|
|
3139
3140
|
}
|
|
3141
|
+
// ensure the group is updated before we fire any events
|
|
3142
|
+
panel.updateParentGroup(this.parent, true);
|
|
3140
3143
|
if (this._activePanel === panel) {
|
|
3141
3144
|
this.accessor.doSetGroupActive(this.parent);
|
|
3142
3145
|
return;
|
|
@@ -3157,43 +3160,19 @@ class Groupview extends CompositeDisposable {
|
|
|
3157
3160
|
return this._removePanel(panelToRemove);
|
|
3158
3161
|
}
|
|
3159
3162
|
closeAllPanels() {
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
const
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
if (this._activePanel && index > -1) {
|
|
3166
|
-
if (this.panels.indexOf(this._activePanel) < 0) {
|
|
3167
|
-
console.warn('active panel not tracked');
|
|
3168
|
-
}
|
|
3169
|
-
const canClose = !((_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.close) || (yield this._activePanel.close());
|
|
3170
|
-
if (!canClose) {
|
|
3171
|
-
return false;
|
|
3172
|
-
}
|
|
3173
|
-
}
|
|
3174
|
-
for (let i = 0; i < this.panels.length; i++) {
|
|
3175
|
-
if (i === index) {
|
|
3176
|
-
continue;
|
|
3177
|
-
}
|
|
3178
|
-
const panel = this.panels[i];
|
|
3179
|
-
this.openPanel(panel);
|
|
3180
|
-
if (panel.close) {
|
|
3181
|
-
const canClose = yield panel.close();
|
|
3182
|
-
if (!canClose) {
|
|
3183
|
-
return false;
|
|
3184
|
-
}
|
|
3185
|
-
}
|
|
3186
|
-
}
|
|
3187
|
-
if (this.panels.length > 0) {
|
|
3188
|
-
// take a copy since we will be edting the array as we iterate through
|
|
3189
|
-
const arrPanelCpy = [...this.panels];
|
|
3190
|
-
yield Promise.all(arrPanelCpy.map((p) => this.doClose(p)));
|
|
3163
|
+
if (this.panels.length > 0) {
|
|
3164
|
+
// take a copy since we will be edting the array as we iterate through
|
|
3165
|
+
const arrPanelCpy = [...this.panels];
|
|
3166
|
+
for (const panel of arrPanelCpy) {
|
|
3167
|
+
this.doClose(panel);
|
|
3191
3168
|
}
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3169
|
+
}
|
|
3170
|
+
else {
|
|
3171
|
+
this.accessor.removeGroup(this.parent);
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
closePanel(panel) {
|
|
3175
|
+
this.doClose(panel);
|
|
3197
3176
|
}
|
|
3198
3177
|
doClose(panel) {
|
|
3199
3178
|
this.accessor.removePanel(panel);
|
|
@@ -3336,8 +3315,11 @@ class Groupview extends CompositeDisposable {
|
|
|
3336
3315
|
this.tabsContainer.show();
|
|
3337
3316
|
}
|
|
3338
3317
|
}
|
|
3339
|
-
canDisplayOverlay(
|
|
3318
|
+
canDisplayOverlay(event, target) {
|
|
3340
3319
|
// custom overlay handler
|
|
3320
|
+
if (this.accessor.options.showDndOverlay) {
|
|
3321
|
+
return this.accessor.options.showDndOverlay(event, target);
|
|
3322
|
+
}
|
|
3341
3323
|
return false;
|
|
3342
3324
|
}
|
|
3343
3325
|
handleDropEvent(event, position, index) {
|
|
@@ -3362,31 +3344,23 @@ class Groupview extends CompositeDisposable {
|
|
|
3362
3344
|
index,
|
|
3363
3345
|
});
|
|
3364
3346
|
}
|
|
3347
|
+
else {
|
|
3348
|
+
this._onDidDrop.fire({ nativeEvent: event, position, index });
|
|
3349
|
+
}
|
|
3365
3350
|
}
|
|
3366
3351
|
dispose() {
|
|
3352
|
+
var _a;
|
|
3353
|
+
super.dispose();
|
|
3354
|
+
(_a = this.watermark) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
3367
3355
|
for (const panel of this.panels) {
|
|
3368
3356
|
panel.dispose();
|
|
3369
3357
|
}
|
|
3370
|
-
super.dispose();
|
|
3371
3358
|
this.dropTarget.dispose();
|
|
3372
3359
|
this.tabsContainer.dispose();
|
|
3373
3360
|
this.contentContainer.dispose();
|
|
3374
3361
|
}
|
|
3375
3362
|
}
|
|
3376
3363
|
|
|
3377
|
-
var GroupChangeKind;
|
|
3378
|
-
(function (GroupChangeKind) {
|
|
3379
|
-
GroupChangeKind["ADD_PANEL"] = "ADD_PANEL";
|
|
3380
|
-
GroupChangeKind["REMOVE_PANEL"] = "REMOVE_PANEL";
|
|
3381
|
-
GroupChangeKind["PANEL_ACTIVE"] = "PANEL_ACTIVE";
|
|
3382
|
-
//
|
|
3383
|
-
GroupChangeKind["GROUP_ACTIVE"] = "GROUP_ACTIVE";
|
|
3384
|
-
GroupChangeKind["ADD_GROUP"] = "ADD_GROUP";
|
|
3385
|
-
GroupChangeKind["REMOVE_GROUP"] = "REMOVE_GROUP";
|
|
3386
|
-
//
|
|
3387
|
-
GroupChangeKind["LAYOUT_FROM_JSON"] = "LAYOUT_FROM_JSON";
|
|
3388
|
-
GroupChangeKind["LAYOUT"] = "LAYOUT";
|
|
3389
|
-
})(GroupChangeKind || (GroupChangeKind = {}));
|
|
3390
3364
|
const nextLayoutId = sequentialNumberGenerator();
|
|
3391
3365
|
function toTarget(direction) {
|
|
3392
3366
|
switch (direction) {
|
|
@@ -3409,36 +3383,26 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3409
3383
|
this._element = _element;
|
|
3410
3384
|
this._id = nextLayoutId.next();
|
|
3411
3385
|
this._groups = new Map();
|
|
3412
|
-
//
|
|
3413
|
-
this._onGridEvent = new Emitter();
|
|
3414
|
-
this.onGridEvent = this._onGridEvent.event;
|
|
3415
3386
|
this._onDidLayoutChange = new Emitter();
|
|
3416
3387
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
3388
|
+
this._onDidRemoveGroup = new Emitter();
|
|
3389
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
3390
|
+
this._onDidAddGroup = new Emitter();
|
|
3391
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
3392
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3393
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3394
|
+
this._bufferOnDidLayoutChange = new TickDelayedEvent();
|
|
3417
3395
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
|
|
3418
3396
|
this.element.appendChild(this.gridview.element);
|
|
3419
|
-
|
|
3420
|
-
this.layout(0, 0, true);
|
|
3397
|
+
this.layout(0, 0, true); // set some elements height/widths
|
|
3421
3398
|
this.addDisposables(this.gridview.onDidChange(() => {
|
|
3422
|
-
this.
|
|
3399
|
+
this._onDidLayoutChange.fire();
|
|
3423
3400
|
}));
|
|
3424
|
-
this.addDisposables((() => {
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
GroupChangeKind.REMOVE_GROUP,
|
|
3430
|
-
GroupChangeKind.ADD_PANEL,
|
|
3431
|
-
GroupChangeKind.REMOVE_PANEL,
|
|
3432
|
-
GroupChangeKind.GROUP_ACTIVE,
|
|
3433
|
-
GroupChangeKind.PANEL_ACTIVE,
|
|
3434
|
-
GroupChangeKind.LAYOUT,
|
|
3435
|
-
].includes(event.kind)) {
|
|
3436
|
-
tickDelayedEvent.fire();
|
|
3437
|
-
}
|
|
3438
|
-
}), tickDelayedEvent.onEvent(() => {
|
|
3439
|
-
this._onDidLayoutChange.fire();
|
|
3440
|
-
}), tickDelayedEvent);
|
|
3441
|
-
})());
|
|
3401
|
+
this.addDisposables(Event.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
|
|
3402
|
+
this._bufferOnDidLayoutChange.fire();
|
|
3403
|
+
}), this._bufferOnDidLayoutChange.onEvent(() => {
|
|
3404
|
+
this._onDidLayoutChange.fire();
|
|
3405
|
+
}), this._bufferOnDidLayoutChange);
|
|
3442
3406
|
}
|
|
3443
3407
|
get id() {
|
|
3444
3408
|
return this._id;
|
|
@@ -3475,14 +3439,14 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3475
3439
|
}
|
|
3476
3440
|
setVisible(panel, visible) {
|
|
3477
3441
|
this.gridview.setViewVisible(getGridLocation(panel.element), visible);
|
|
3478
|
-
this.
|
|
3442
|
+
this._onDidLayoutChange.fire();
|
|
3479
3443
|
}
|
|
3480
3444
|
isVisible(panel) {
|
|
3481
3445
|
return this.gridview.isViewVisible(getGridLocation(panel.element));
|
|
3482
3446
|
}
|
|
3483
3447
|
doAddGroup(group, location = [0], size) {
|
|
3484
3448
|
this.gridview.addView(group, size !== null && size !== void 0 ? size : Sizing.Distribute, location);
|
|
3485
|
-
this.
|
|
3449
|
+
this._onDidAddGroup.fire(group);
|
|
3486
3450
|
this.doSetGroupActive(group);
|
|
3487
3451
|
}
|
|
3488
3452
|
doRemoveGroup(group, options) {
|
|
@@ -3493,9 +3457,10 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3493
3457
|
const view = this.gridview.remove(group, Sizing.Distribute);
|
|
3494
3458
|
if (item && !(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
3495
3459
|
item.disposable.dispose();
|
|
3460
|
+
item.value.dispose();
|
|
3496
3461
|
this._groups.delete(group.id);
|
|
3497
3462
|
}
|
|
3498
|
-
this.
|
|
3463
|
+
this._onDidRemoveGroup.fire(group);
|
|
3499
3464
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
3500
3465
|
const groups = Array.from(this._groups.values());
|
|
3501
3466
|
this.doSetGroupActive(groups.length > 0 ? groups[0].value : undefined);
|
|
@@ -3523,9 +3488,7 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3523
3488
|
}
|
|
3524
3489
|
}
|
|
3525
3490
|
this._activeGroup = group;
|
|
3526
|
-
this.
|
|
3527
|
-
kind: GroupChangeKind.GROUP_ACTIVE,
|
|
3528
|
-
});
|
|
3491
|
+
this._onDidActiveGroupChange.fire(group);
|
|
3529
3492
|
}
|
|
3530
3493
|
removeGroup(group) {
|
|
3531
3494
|
this.doRemoveGroup(group);
|
|
@@ -3581,7 +3544,13 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3581
3544
|
}
|
|
3582
3545
|
dispose() {
|
|
3583
3546
|
super.dispose();
|
|
3584
|
-
this.
|
|
3547
|
+
this._onDidActiveGroupChange.dispose();
|
|
3548
|
+
this._onDidAddGroup.dispose();
|
|
3549
|
+
this._onDidRemoveGroup.dispose();
|
|
3550
|
+
this._onDidLayoutChange.dispose();
|
|
3551
|
+
for (const group of this.groups) {
|
|
3552
|
+
group.dispose();
|
|
3553
|
+
}
|
|
3585
3554
|
this.gridview.dispose();
|
|
3586
3555
|
}
|
|
3587
3556
|
}
|
|
@@ -3593,15 +3562,11 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3593
3562
|
constructor(id) {
|
|
3594
3563
|
super();
|
|
3595
3564
|
this.id = id;
|
|
3596
|
-
this._state = {};
|
|
3597
3565
|
this._isFocused = false;
|
|
3598
3566
|
this._isActive = false;
|
|
3599
3567
|
this._isVisible = true;
|
|
3600
3568
|
this._width = 0;
|
|
3601
3569
|
this._height = 0;
|
|
3602
|
-
this._onDidStateChange = new Emitter();
|
|
3603
|
-
this.onDidStateChange = this._onDidStateChange.event;
|
|
3604
|
-
//
|
|
3605
3570
|
this._onDidPanelDimensionChange = new Emitter({
|
|
3606
3571
|
replay: true,
|
|
3607
3572
|
});
|
|
@@ -3630,7 +3595,7 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3630
3595
|
//
|
|
3631
3596
|
this._onActiveChange = new Emitter();
|
|
3632
3597
|
this.onActiveChange = this._onActiveChange.event;
|
|
3633
|
-
this.addDisposables(this.
|
|
3598
|
+
this.addDisposables(this._onDidPanelDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3634
3599
|
this._isFocused = event.isFocused;
|
|
3635
3600
|
}), this.onDidActiveChange((event) => {
|
|
3636
3601
|
this._isActive = event.isActive;
|
|
@@ -3663,21 +3628,6 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3663
3628
|
setActive() {
|
|
3664
3629
|
this._onActiveChange.fire();
|
|
3665
3630
|
}
|
|
3666
|
-
setState(key, value) {
|
|
3667
|
-
if (typeof key === 'object') {
|
|
3668
|
-
this._state = key;
|
|
3669
|
-
}
|
|
3670
|
-
else if (typeof value !== undefined) {
|
|
3671
|
-
this._state[key] = value;
|
|
3672
|
-
}
|
|
3673
|
-
this._onDidStateChange.fire(undefined);
|
|
3674
|
-
}
|
|
3675
|
-
getState() {
|
|
3676
|
-
return this._state;
|
|
3677
|
-
}
|
|
3678
|
-
getStateKey(key) {
|
|
3679
|
-
return this._state[key];
|
|
3680
|
-
}
|
|
3681
3631
|
dispose() {
|
|
3682
3632
|
super.dispose();
|
|
3683
3633
|
}
|
|
@@ -3697,6 +3647,7 @@ class GridviewPanelApiImpl extends PanelApiImpl {
|
|
|
3697
3647
|
//
|
|
3698
3648
|
this._onDidSizeChange = new Emitter();
|
|
3699
3649
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
3650
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
3700
3651
|
}
|
|
3701
3652
|
setConstraints(value) {
|
|
3702
3653
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -3710,19 +3661,19 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3710
3661
|
constructor(panel, group) {
|
|
3711
3662
|
super(panel.id);
|
|
3712
3663
|
this.panel = panel;
|
|
3713
|
-
this._onDidDirtyChange = new Emitter();
|
|
3714
|
-
this.onDidDirtyChange = this._onDidDirtyChange.event;
|
|
3715
3664
|
this._onDidTitleChange = new Emitter();
|
|
3716
3665
|
this.onDidTitleChange = this._onDidTitleChange.event;
|
|
3717
3666
|
this._titleChanged = new Emitter();
|
|
3718
3667
|
this.titleChanged = this._titleChanged.event;
|
|
3719
3668
|
this._suppressClosableChanged = new Emitter();
|
|
3720
3669
|
this.suppressClosableChanged = this._suppressClosableChanged.event;
|
|
3721
|
-
this.
|
|
3722
|
-
this.
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3670
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3671
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3672
|
+
this._onDidGroupChange = new Emitter();
|
|
3673
|
+
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
3674
|
+
this.disposable = new MutableDisposable();
|
|
3675
|
+
this.group = group;
|
|
3676
|
+
this.addDisposables(this.disposable, this._onDidTitleChange, this._titleChanged, this._suppressClosableChanged, this._onDidGroupChange, this._onDidActiveGroupChange);
|
|
3726
3677
|
}
|
|
3727
3678
|
get title() {
|
|
3728
3679
|
return this.panel.title;
|
|
@@ -3735,7 +3686,17 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3735
3686
|
return !!((_a = this.group) === null || _a === void 0 ? void 0 : _a.isActive);
|
|
3736
3687
|
}
|
|
3737
3688
|
set group(value) {
|
|
3689
|
+
const isOldGroupActive = this.isGroupActive;
|
|
3738
3690
|
this._group = value;
|
|
3691
|
+
this._onDidGroupChange.fire();
|
|
3692
|
+
if (this._group) {
|
|
3693
|
+
this.disposable.value = this._group.api.onDidActiveChange(() => {
|
|
3694
|
+
this._onDidActiveGroupChange.fire();
|
|
3695
|
+
});
|
|
3696
|
+
if (this.isGroupActive !== isOldGroupActive) {
|
|
3697
|
+
this._onDidActiveGroupChange.fire();
|
|
3698
|
+
}
|
|
3699
|
+
}
|
|
3739
3700
|
}
|
|
3740
3701
|
get group() {
|
|
3741
3702
|
return this._group;
|
|
@@ -3749,16 +3710,10 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3749
3710
|
}
|
|
3750
3711
|
return this.group.model.closePanel(this.panel);
|
|
3751
3712
|
}
|
|
3752
|
-
interceptOnCloseAction(interceptor) {
|
|
3753
|
-
this._interceptor = interceptor;
|
|
3754
|
-
}
|
|
3755
|
-
dispose() {
|
|
3756
|
-
super.dispose();
|
|
3757
|
-
}
|
|
3758
3713
|
}
|
|
3759
3714
|
|
|
3760
3715
|
class DockviewGroupPanel extends CompositeDisposable {
|
|
3761
|
-
constructor(id, containerApi) {
|
|
3716
|
+
constructor(id, accessor, containerApi) {
|
|
3762
3717
|
super();
|
|
3763
3718
|
this.id = id;
|
|
3764
3719
|
this.containerApi = containerApi;
|
|
@@ -3766,14 +3721,17 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3766
3721
|
this._suppressClosable = false;
|
|
3767
3722
|
this._title = '';
|
|
3768
3723
|
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
3769
|
-
this.onDidStateChange = this.api.onDidStateChange;
|
|
3770
3724
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
3771
|
-
|
|
3725
|
+
accessor.setActivePanel(this);
|
|
3772
3726
|
}), this.api.onDidTitleChange((event) => {
|
|
3773
3727
|
const title = event.title;
|
|
3774
3728
|
this.update({ params: { title } });
|
|
3775
3729
|
}));
|
|
3776
3730
|
}
|
|
3731
|
+
get params() {
|
|
3732
|
+
var _a;
|
|
3733
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
3734
|
+
}
|
|
3777
3735
|
get title() {
|
|
3778
3736
|
return this._title;
|
|
3779
3737
|
}
|
|
@@ -3792,32 +3750,18 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3792
3750
|
this._view = params.view;
|
|
3793
3751
|
this.setTitle(params.title);
|
|
3794
3752
|
this.setSuppressClosable(params.suppressClosable || false);
|
|
3795
|
-
if (params.state) {
|
|
3796
|
-
this.api.setState(params.state);
|
|
3797
|
-
}
|
|
3798
3753
|
(_a = this.view) === null || _a === void 0 ? void 0 : _a.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
3799
3754
|
}
|
|
3800
3755
|
focus() {
|
|
3801
3756
|
this.api._onFocusEvent.fire();
|
|
3802
3757
|
}
|
|
3803
|
-
setDirty(isDirty) {
|
|
3804
|
-
this.api._onDidDirtyChange.fire(isDirty);
|
|
3805
|
-
}
|
|
3806
|
-
close() {
|
|
3807
|
-
if (this.api.tryClose) {
|
|
3808
|
-
return this.api.tryClose();
|
|
3809
|
-
}
|
|
3810
|
-
return Promise.resolve(true);
|
|
3811
|
-
}
|
|
3812
3758
|
toJSON() {
|
|
3813
|
-
const state = this.api.getState();
|
|
3814
3759
|
return {
|
|
3815
3760
|
id: this.id,
|
|
3816
3761
|
view: this.view.toJSON(),
|
|
3817
3762
|
params: Object.keys(this._params || {}).length > 0
|
|
3818
3763
|
? this._params
|
|
3819
3764
|
: undefined,
|
|
3820
|
-
state: state && Object.keys(state).length > 0 ? state : undefined,
|
|
3821
3765
|
suppressClosable: this.suppressClosable || undefined,
|
|
3822
3766
|
title: this.title,
|
|
3823
3767
|
};
|
|
@@ -3862,18 +3806,6 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3862
3806
|
var _a;
|
|
3863
3807
|
this._group = group;
|
|
3864
3808
|
this.api.group = group;
|
|
3865
|
-
this.mutableDisposable.value = this._group.model.onDidGroupChange((ev) => {
|
|
3866
|
-
var _a;
|
|
3867
|
-
if (ev.kind === GroupChangeKind2.GROUP_ACTIVE) {
|
|
3868
|
-
const isVisible = !!((_a = this._group) === null || _a === void 0 ? void 0 : _a.model.isPanelActive(this));
|
|
3869
|
-
this.api._onDidActiveChange.fire({
|
|
3870
|
-
isActive: isGroupActive && isVisible,
|
|
3871
|
-
});
|
|
3872
|
-
this.api._onDidVisibilityChange.fire({
|
|
3873
|
-
isVisible,
|
|
3874
|
-
});
|
|
3875
|
-
}
|
|
3876
|
-
});
|
|
3877
3809
|
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
3878
3810
|
this.api._onDidActiveChange.fire({
|
|
3879
3811
|
isActive: isGroupActive && isPanelVisible,
|
|
@@ -3948,7 +3880,7 @@ class Watermark extends CompositeDisposable {
|
|
|
3948
3880
|
get id() {
|
|
3949
3881
|
return 'watermark';
|
|
3950
3882
|
}
|
|
3951
|
-
update(
|
|
3883
|
+
update(_event) {
|
|
3952
3884
|
// noop
|
|
3953
3885
|
}
|
|
3954
3886
|
focus() {
|
|
@@ -3957,17 +3889,17 @@ class Watermark extends CompositeDisposable {
|
|
|
3957
3889
|
toJSON() {
|
|
3958
3890
|
return {};
|
|
3959
3891
|
}
|
|
3960
|
-
layout(
|
|
3892
|
+
layout(_width, _height) {
|
|
3961
3893
|
// noop
|
|
3962
3894
|
}
|
|
3963
3895
|
init(params) {
|
|
3964
3896
|
this.params = params;
|
|
3965
|
-
this.addDisposables(this.params.containerApi.onDidLayoutChange((
|
|
3897
|
+
this.addDisposables(this.params.containerApi.onDidLayoutChange(() => {
|
|
3966
3898
|
this.render();
|
|
3967
3899
|
}));
|
|
3968
3900
|
this.render();
|
|
3969
3901
|
}
|
|
3970
|
-
updateParentGroup(group,
|
|
3902
|
+
updateParentGroup(group, _visible) {
|
|
3971
3903
|
this.group = group;
|
|
3972
3904
|
this.render();
|
|
3973
3905
|
}
|
|
@@ -3983,15 +3915,6 @@ class Watermark extends CompositeDisposable {
|
|
|
3983
3915
|
}
|
|
3984
3916
|
}
|
|
3985
3917
|
|
|
3986
|
-
function debounce(cb, wait) {
|
|
3987
|
-
let timeout;
|
|
3988
|
-
const callable = (...args) => {
|
|
3989
|
-
clearTimeout(timeout);
|
|
3990
|
-
timeout = setTimeout(() => cb(...args), wait);
|
|
3991
|
-
};
|
|
3992
|
-
return callable;
|
|
3993
|
-
}
|
|
3994
|
-
|
|
3995
3918
|
class DefaultDeserializer {
|
|
3996
3919
|
constructor(layout, panelDeserializer) {
|
|
3997
3920
|
this.layout = layout;
|
|
@@ -4092,9 +4015,6 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4092
4015
|
this._isGroupActive = false;
|
|
4093
4016
|
//
|
|
4094
4017
|
this.params = {};
|
|
4095
|
-
//
|
|
4096
|
-
this.isDirtyDisposable = new MutableDisposable();
|
|
4097
|
-
this.addDisposables(this.isDirtyDisposable);
|
|
4098
4018
|
this._element = document.createElement('div');
|
|
4099
4019
|
this._element.className = 'default-tab';
|
|
4100
4020
|
//
|
|
@@ -4139,10 +4059,6 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4139
4059
|
init(params) {
|
|
4140
4060
|
this.params = params;
|
|
4141
4061
|
this._content.textContent = params.title;
|
|
4142
|
-
this.isDirtyDisposable.value = this.params.api.onDidDirtyChange((event) => {
|
|
4143
|
-
const isDirty = event;
|
|
4144
|
-
toggleClass(this.action, 'dirty', isDirty);
|
|
4145
|
-
});
|
|
4146
4062
|
if (!this.params.suppressClosable) {
|
|
4147
4063
|
addDisposableListener(this.action, 'click', (ev) => {
|
|
4148
4064
|
ev.preventDefault(); //
|
|
@@ -4158,7 +4074,7 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4158
4074
|
this._isGroupActive = group.isActive;
|
|
4159
4075
|
this.render();
|
|
4160
4076
|
}
|
|
4161
|
-
layout(
|
|
4077
|
+
layout(_width, _height) {
|
|
4162
4078
|
// noop
|
|
4163
4079
|
}
|
|
4164
4080
|
render() {
|
|
@@ -4196,6 +4112,10 @@ class BasePanelView extends CompositeDisposable {
|
|
|
4196
4112
|
get height() {
|
|
4197
4113
|
return this._height;
|
|
4198
4114
|
}
|
|
4115
|
+
get params() {
|
|
4116
|
+
var _a;
|
|
4117
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
4118
|
+
}
|
|
4199
4119
|
focus() {
|
|
4200
4120
|
this.api._onFocusEvent.fire();
|
|
4201
4121
|
}
|
|
@@ -4204,34 +4124,34 @@ class BasePanelView extends CompositeDisposable {
|
|
|
4204
4124
|
this._height = height;
|
|
4205
4125
|
this.api._onDidPanelDimensionChange.fire({ width, height });
|
|
4206
4126
|
if (this.part) {
|
|
4207
|
-
if (this.
|
|
4208
|
-
this.part.update(this.
|
|
4127
|
+
if (this._params) {
|
|
4128
|
+
this.part.update(this._params.params);
|
|
4209
4129
|
}
|
|
4210
4130
|
}
|
|
4211
4131
|
}
|
|
4212
4132
|
init(parameters) {
|
|
4213
|
-
this.
|
|
4133
|
+
this._params = parameters;
|
|
4214
4134
|
this.part = this.getComponent();
|
|
4215
4135
|
}
|
|
4216
4136
|
update(event) {
|
|
4217
4137
|
var _a, _b;
|
|
4218
|
-
this.
|
|
4219
|
-
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this.
|
|
4138
|
+
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) });
|
|
4139
|
+
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this._params.params });
|
|
4220
4140
|
}
|
|
4221
4141
|
toJSON() {
|
|
4222
4142
|
var _a, _b;
|
|
4223
|
-
const
|
|
4224
|
-
const params = (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4143
|
+
const params = (_b = (_a = this._params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4225
4144
|
return {
|
|
4226
4145
|
id: this.id,
|
|
4227
4146
|
component: this.component,
|
|
4228
4147
|
params: Object.keys(params).length > 0 ? params : undefined,
|
|
4229
|
-
state: Object.keys(state).length === 0 ? undefined : state,
|
|
4230
4148
|
};
|
|
4231
4149
|
}
|
|
4232
4150
|
dispose() {
|
|
4151
|
+
var _a;
|
|
4233
4152
|
super.dispose();
|
|
4234
4153
|
this.api.dispose();
|
|
4154
|
+
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
4235
4155
|
}
|
|
4236
4156
|
}
|
|
4237
4157
|
|
|
@@ -4249,12 +4169,12 @@ class GridviewPanel extends BasePanelView {
|
|
|
4249
4169
|
this._snap = false;
|
|
4250
4170
|
this._onDidChange = new Emitter();
|
|
4251
4171
|
this.onDidChange = this._onDidChange.event;
|
|
4252
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
4172
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4253
4173
|
const { isVisible } = event;
|
|
4254
|
-
const { containerApi } = this.
|
|
4174
|
+
const { containerApi } = this._params;
|
|
4255
4175
|
containerApi.setVisible(this, isVisible);
|
|
4256
4176
|
}), this.api.onActiveChange(() => {
|
|
4257
|
-
const { containerApi } = this.
|
|
4177
|
+
const { containerApi } = this._params;
|
|
4258
4178
|
containerApi.setActive(this);
|
|
4259
4179
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4260
4180
|
if (typeof event.minimumWidth === 'number' ||
|
|
@@ -4369,9 +4289,6 @@ class GridviewPanel extends BasePanelView {
|
|
|
4369
4289
|
const minimum = (value) => (value <= 0 ? undefined : value);
|
|
4370
4290
|
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 });
|
|
4371
4291
|
}
|
|
4372
|
-
dispose() {
|
|
4373
|
-
super.dispose();
|
|
4374
|
-
}
|
|
4375
4292
|
}
|
|
4376
4293
|
|
|
4377
4294
|
class GroupviewPanel extends GridviewPanel {
|
|
@@ -4478,15 +4395,24 @@ class DockviewComponent extends BaseGrid {
|
|
|
4478
4395
|
orientation: options.orientation || Orientation.HORIZONTAL,
|
|
4479
4396
|
styles: options.styles,
|
|
4480
4397
|
});
|
|
4481
|
-
this._panels = new Map();
|
|
4482
|
-
this.dirtyPanels = new Set();
|
|
4483
|
-
this.debouncedDeque = debounce(this.syncConfigs.bind(this), 5000);
|
|
4484
4398
|
// events
|
|
4485
4399
|
this._onTabInteractionEvent = new Emitter();
|
|
4486
4400
|
this.onTabInteractionEvent = this._onTabInteractionEvent.event;
|
|
4487
4401
|
this._onTabContextMenu = new Emitter();
|
|
4488
4402
|
this.onTabContextMenu = this._onTabContextMenu.event;
|
|
4489
|
-
this.
|
|
4403
|
+
this._onDidDrop = new Emitter();
|
|
4404
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
4405
|
+
this._onDidRemovePanel = new Emitter();
|
|
4406
|
+
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4407
|
+
this._onDidAddPanel = new Emitter();
|
|
4408
|
+
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
4409
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4410
|
+
this.onDidLayoutfromJSON = this._onDidLayoutfromJSON.event;
|
|
4411
|
+
this._onDidActivePanelChange = new Emitter();
|
|
4412
|
+
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4413
|
+
this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop, Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
4414
|
+
this._bufferOnDidLayoutChange.fire();
|
|
4415
|
+
}));
|
|
4490
4416
|
this._options = options;
|
|
4491
4417
|
if (!this.options.components) {
|
|
4492
4418
|
this.options.components = {};
|
|
@@ -4507,10 +4433,10 @@ class DockviewComponent extends BaseGrid {
|
|
|
4507
4433
|
this._api = new DockviewApi(this);
|
|
4508
4434
|
}
|
|
4509
4435
|
get totalPanels() {
|
|
4510
|
-
return this.
|
|
4436
|
+
return this.panels.length;
|
|
4511
4437
|
}
|
|
4512
4438
|
get panels() {
|
|
4513
|
-
return
|
|
4439
|
+
return this.groups.flatMap((group) => group.model.panels);
|
|
4514
4440
|
}
|
|
4515
4441
|
get deserializer() {
|
|
4516
4442
|
return this._deserializer;
|
|
@@ -4540,10 +4466,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
4540
4466
|
updateOptions(options) {
|
|
4541
4467
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
4542
4468
|
this.options.orientation !== options.orientation;
|
|
4543
|
-
// TODO support style update
|
|
4544
|
-
// const hasStylesChanged =
|
|
4545
|
-
// typeof options.styles === 'object' &&
|
|
4546
|
-
// this.options.styles !== options.styles;
|
|
4547
4469
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
4548
4470
|
if (hasOrientationChanged) {
|
|
4549
4471
|
this.gridview.orientation = options.orientation;
|
|
@@ -4555,8 +4477,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4555
4477
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4556
4478
|
}
|
|
4557
4479
|
getGroupPanel(id) {
|
|
4558
|
-
|
|
4559
|
-
return (_a = this._panels.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
4480
|
+
return this.panels.find((panel) => panel.id === id);
|
|
4560
4481
|
}
|
|
4561
4482
|
setActivePanel(panel) {
|
|
4562
4483
|
if (!panel.group) {
|
|
@@ -4605,24 +4526,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
4605
4526
|
this.doSetGroupActive(next);
|
|
4606
4527
|
}
|
|
4607
4528
|
}
|
|
4608
|
-
registerPanel(panel) {
|
|
4609
|
-
if (this._panels.has(panel.id)) {
|
|
4610
|
-
throw new Error(`panel ${panel.id} already exists`);
|
|
4611
|
-
}
|
|
4612
|
-
const disposable = new CompositeDisposable(panel.onDidStateChange(() => this.addDirtyPanel(panel)));
|
|
4613
|
-
this._panels.set(panel.id, { value: panel, disposable });
|
|
4614
|
-
}
|
|
4615
|
-
unregisterPanel(panel) {
|
|
4616
|
-
if (!this._panels.has(panel.id)) {
|
|
4617
|
-
throw new Error(`panel ${panel.id} doesn't exist`);
|
|
4618
|
-
}
|
|
4619
|
-
const item = this._panels.get(panel.id);
|
|
4620
|
-
if (item) {
|
|
4621
|
-
item.disposable.dispose();
|
|
4622
|
-
item.value.dispose();
|
|
4623
|
-
}
|
|
4624
|
-
this._panels.delete(panel.id);
|
|
4625
|
-
}
|
|
4626
4529
|
/**
|
|
4627
4530
|
* Serialize the current state of the layout
|
|
4628
4531
|
*
|
|
@@ -4630,12 +4533,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
4630
4533
|
*/
|
|
4631
4534
|
toJSON() {
|
|
4632
4535
|
var _a;
|
|
4633
|
-
this.syncConfigs();
|
|
4634
4536
|
const data = this.gridview.serialize();
|
|
4635
|
-
const panels =
|
|
4636
|
-
|
|
4637
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4638
|
-
}
|
|
4537
|
+
const panels = this.panels.reduce((collection, panel) => {
|
|
4538
|
+
collection[panel.id] = panel.toJSON();
|
|
4639
4539
|
return collection;
|
|
4640
4540
|
}, {});
|
|
4641
4541
|
return {
|
|
@@ -4646,13 +4546,12 @@ class DockviewComponent extends BaseGrid {
|
|
|
4646
4546
|
};
|
|
4647
4547
|
}
|
|
4648
4548
|
fromJSON(data) {
|
|
4549
|
+
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
4550
|
+
for (const group of groups) {
|
|
4551
|
+
// remove the group will automatically remove the panels
|
|
4552
|
+
this.removeGroup(group, true);
|
|
4553
|
+
}
|
|
4649
4554
|
this.gridview.clear();
|
|
4650
|
-
this._panels.forEach((panel) => {
|
|
4651
|
-
panel.disposable.dispose();
|
|
4652
|
-
panel.value.dispose();
|
|
4653
|
-
});
|
|
4654
|
-
this._panels.clear();
|
|
4655
|
-
this._groups.clear();
|
|
4656
4555
|
if (!this.deserializer) {
|
|
4657
4556
|
throw new Error('invalid deserializer');
|
|
4658
4557
|
}
|
|
@@ -4666,9 +4565,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4666
4565
|
this.gridview.deserialize(grid, new DefaultDeserializer(this, {
|
|
4667
4566
|
createPanel: (id) => {
|
|
4668
4567
|
const panelData = panels[id];
|
|
4669
|
-
|
|
4670
|
-
this.registerPanel(panel);
|
|
4671
|
-
return panel;
|
|
4568
|
+
return this.deserializer.fromJSON(panelData);
|
|
4672
4569
|
},
|
|
4673
4570
|
}));
|
|
4674
4571
|
if (typeof activeGroup === 'string') {
|
|
@@ -4678,36 +4575,31 @@ class DockviewComponent extends BaseGrid {
|
|
|
4678
4575
|
}
|
|
4679
4576
|
}
|
|
4680
4577
|
this.gridview.layout(this.width, this.height);
|
|
4681
|
-
this.
|
|
4578
|
+
this._onDidLayoutfromJSON.fire();
|
|
4682
4579
|
}
|
|
4683
4580
|
closeAllGroups() {
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
if (!didCloseAll) {
|
|
4689
|
-
return false;
|
|
4690
|
-
}
|
|
4691
|
-
}
|
|
4692
|
-
return true;
|
|
4693
|
-
});
|
|
4581
|
+
for (const entry of this._groups.entries()) {
|
|
4582
|
+
const [_, group] = entry;
|
|
4583
|
+
group.value.model.closeAllPanels();
|
|
4584
|
+
}
|
|
4694
4585
|
}
|
|
4695
4586
|
fireMouseEvent(event) {
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
}
|
|
4705
|
-
break;
|
|
4587
|
+
if (event.kind === MouseEventKind.CONTEXT_MENU) {
|
|
4588
|
+
if (event.tab && event.panel) {
|
|
4589
|
+
this._onTabContextMenu.fire({
|
|
4590
|
+
event: event.event,
|
|
4591
|
+
api: this._api,
|
|
4592
|
+
panel: event.panel,
|
|
4593
|
+
});
|
|
4594
|
+
}
|
|
4706
4595
|
}
|
|
4707
4596
|
}
|
|
4708
4597
|
addPanel(options) {
|
|
4709
4598
|
var _a, _b;
|
|
4710
|
-
|
|
4599
|
+
if (this.panels.find((_) => _.id === options.id)) {
|
|
4600
|
+
throw new Error(`panel with id ${options.id} already exists`);
|
|
4601
|
+
}
|
|
4602
|
+
const panel = this.createPanel(options);
|
|
4711
4603
|
let referenceGroup;
|
|
4712
4604
|
if ((_a = options.position) === null || _a === void 0 ? void 0 : _a.referencePanel) {
|
|
4713
4605
|
const referencePanel = this.getGroupPanel(options.position.referencePanel);
|
|
@@ -4735,14 +4627,20 @@ class DockviewComponent extends BaseGrid {
|
|
|
4735
4627
|
}
|
|
4736
4628
|
return panel;
|
|
4737
4629
|
}
|
|
4738
|
-
removePanel(panel
|
|
4739
|
-
|
|
4630
|
+
removePanel(panel, options = {
|
|
4631
|
+
removeEmptyGroup: true,
|
|
4632
|
+
skipDispose: false,
|
|
4633
|
+
}) {
|
|
4740
4634
|
const group = panel.group;
|
|
4741
4635
|
if (!group) {
|
|
4742
4636
|
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
4743
4637
|
}
|
|
4744
4638
|
group.model.removePanel(panel);
|
|
4745
|
-
|
|
4639
|
+
panel.dispose();
|
|
4640
|
+
const retainGroupForWatermark = this.size === 1;
|
|
4641
|
+
if (!retainGroupForWatermark &&
|
|
4642
|
+
group.model.size === 0 &&
|
|
4643
|
+
options.removeEmptyGroup) {
|
|
4746
4644
|
this.removeGroup(group);
|
|
4747
4645
|
}
|
|
4748
4646
|
}
|
|
@@ -4755,10 +4653,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
4755
4653
|
: {}, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.watermark);
|
|
4756
4654
|
}
|
|
4757
4655
|
addEmptyGroup(options) {
|
|
4758
|
-
var _a;
|
|
4759
4656
|
const group = this.createGroup();
|
|
4760
4657
|
if (options) {
|
|
4761
|
-
const referencePanel =
|
|
4658
|
+
const referencePanel = this.panels.find((panel) => panel.id === options.referencePanel);
|
|
4762
4659
|
if (!referencePanel) {
|
|
4763
4660
|
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
4764
4661
|
}
|
|
@@ -4775,25 +4672,24 @@ class DockviewComponent extends BaseGrid {
|
|
|
4775
4672
|
this.doAddGroup(group);
|
|
4776
4673
|
}
|
|
4777
4674
|
}
|
|
4778
|
-
removeGroup(group) {
|
|
4675
|
+
removeGroup(group, skipActive = false) {
|
|
4779
4676
|
const panels = [...group.model.panels]; // reassign since group panels will mutate
|
|
4780
|
-
|
|
4781
|
-
this.removePanel(panel
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
return;
|
|
4677
|
+
for (const panel of panels) {
|
|
4678
|
+
this.removePanel(panel, {
|
|
4679
|
+
removeEmptyGroup: false,
|
|
4680
|
+
skipDispose: false,
|
|
4681
|
+
});
|
|
4786
4682
|
}
|
|
4787
|
-
super.
|
|
4683
|
+
super.doRemoveGroup(group, { skipActive });
|
|
4788
4684
|
}
|
|
4789
4685
|
moveGroupOrPanel(referenceGroup, groupId, itemId, target, index) {
|
|
4790
|
-
var _a
|
|
4686
|
+
var _a;
|
|
4791
4687
|
const sourceGroup = groupId
|
|
4792
4688
|
? (_a = this._groups.get(groupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
4793
4689
|
: undefined;
|
|
4794
4690
|
if (!target || target === Position.Center) {
|
|
4795
4691
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4796
|
-
|
|
4692
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4797
4693
|
if (!groupItem) {
|
|
4798
4694
|
throw new Error(`No panel with id ${itemId}`);
|
|
4799
4695
|
}
|
|
@@ -4829,7 +4725,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4829
4725
|
}
|
|
4830
4726
|
else {
|
|
4831
4727
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4832
|
-
|
|
4728
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4833
4729
|
if (!groupItem) {
|
|
4834
4730
|
throw new Error(`No panel with id ${itemId}`);
|
|
4835
4731
|
}
|
|
@@ -4843,10 +4739,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4843
4739
|
const isGroupAlreadyFocused = this._activeGroup === group;
|
|
4844
4740
|
super.doSetGroupActive(group, skipFocus);
|
|
4845
4741
|
if (!isGroupAlreadyFocused && ((_a = this._activeGroup) === null || _a === void 0 ? void 0 : _a.model.activePanel)) {
|
|
4846
|
-
this.
|
|
4847
|
-
kind: GroupChangeKind.PANEL_ACTIVE,
|
|
4848
|
-
panel: (_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel,
|
|
4849
|
-
});
|
|
4742
|
+
this._onDidActivePanelChange.fire((_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel);
|
|
4850
4743
|
}
|
|
4851
4744
|
}
|
|
4852
4745
|
createGroup(options) {
|
|
@@ -4868,35 +4761,27 @@ class DockviewComponent extends BaseGrid {
|
|
|
4868
4761
|
}
|
|
4869
4762
|
}
|
|
4870
4763
|
const view = new GroupviewPanel(this, id, options);
|
|
4764
|
+
view.init({ params: {}, containerApi: null }); // required to initialized .part and allow for correct disposal of group
|
|
4871
4765
|
if (!this._groups.has(view.id)) {
|
|
4872
4766
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4873
4767
|
const { groupId, itemId, target, index } = event;
|
|
4874
4768
|
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
4769
|
+
}), view.model.onDidDrop((event) => {
|
|
4770
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api }));
|
|
4875
4771
|
}), view.model.onDidGroupChange((event) => {
|
|
4876
4772
|
switch (event.kind) {
|
|
4877
4773
|
case GroupChangeKind2.ADD_PANEL:
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
});
|
|
4882
|
-
break;
|
|
4883
|
-
case GroupChangeKind2.GROUP_ACTIVE:
|
|
4884
|
-
this._onGridEvent.fire({
|
|
4885
|
-
kind: GroupChangeKind.GROUP_ACTIVE,
|
|
4886
|
-
panel: event.panel,
|
|
4887
|
-
});
|
|
4774
|
+
if (event.panel) {
|
|
4775
|
+
this._onDidAddPanel.fire(event.panel);
|
|
4776
|
+
}
|
|
4888
4777
|
break;
|
|
4889
4778
|
case GroupChangeKind2.REMOVE_PANEL:
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
});
|
|
4779
|
+
if (event.panel) {
|
|
4780
|
+
this._onDidRemovePanel.fire(event.panel);
|
|
4781
|
+
}
|
|
4894
4782
|
break;
|
|
4895
4783
|
case GroupChangeKind2.PANEL_ACTIVE:
|
|
4896
|
-
this.
|
|
4897
|
-
kind: GroupChangeKind.PANEL_ACTIVE,
|
|
4898
|
-
panel: event.panel,
|
|
4899
|
-
});
|
|
4784
|
+
this._onDidActivePanelChange.fire(event.panel);
|
|
4900
4785
|
break;
|
|
4901
4786
|
}
|
|
4902
4787
|
}));
|
|
@@ -4910,44 +4795,18 @@ class DockviewComponent extends BaseGrid {
|
|
|
4910
4795
|
}
|
|
4911
4796
|
return view;
|
|
4912
4797
|
}
|
|
4913
|
-
|
|
4914
|
-
super.dispose();
|
|
4915
|
-
this._onGridEvent.dispose();
|
|
4916
|
-
}
|
|
4917
|
-
/**
|
|
4918
|
-
* Ensure the local copy of the layout state is up-to-date
|
|
4919
|
-
*/
|
|
4920
|
-
syncConfigs() {
|
|
4921
|
-
const dirtyPanels = Array.from(this.dirtyPanels);
|
|
4922
|
-
if (dirtyPanels.length === 0) ;
|
|
4923
|
-
this.dirtyPanels.clear();
|
|
4924
|
-
const partialPanelState = dirtyPanels
|
|
4925
|
-
.map((panel) => this._panels.get(panel.id))
|
|
4926
|
-
.filter((_) => !!_)
|
|
4927
|
-
.reduce((collection, panel) => {
|
|
4928
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4929
|
-
return collection;
|
|
4930
|
-
}, {});
|
|
4931
|
-
this.panelState = Object.assign(Object.assign({}, this.panelState), partialPanelState);
|
|
4932
|
-
dirtyPanels
|
|
4933
|
-
.filter((p) => this._panels.has(p.id))
|
|
4934
|
-
.forEach((panel) => {
|
|
4935
|
-
panel.setDirty(false);
|
|
4936
|
-
});
|
|
4937
|
-
}
|
|
4938
|
-
_addPanel(options) {
|
|
4798
|
+
createPanel(options) {
|
|
4939
4799
|
const view = new DefaultGroupPanelView({
|
|
4940
4800
|
content: this.createContentComponent(options.id, options.component),
|
|
4941
4801
|
tab: this.createTabComponent(options.id, options.tabComponent),
|
|
4942
4802
|
});
|
|
4943
|
-
const panel = new DockviewGroupPanel(options.id, this._api);
|
|
4803
|
+
const panel = new DockviewGroupPanel(options.id, this, this._api);
|
|
4944
4804
|
panel.init({
|
|
4945
4805
|
view,
|
|
4946
4806
|
title: options.title || options.id,
|
|
4947
4807
|
suppressClosable: options === null || options === void 0 ? void 0 : options.suppressClosable,
|
|
4948
4808
|
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
4949
4809
|
});
|
|
4950
|
-
this.registerPanel(panel);
|
|
4951
4810
|
return panel;
|
|
4952
4811
|
}
|
|
4953
4812
|
createContentComponent(id, componentName) {
|
|
@@ -4967,10 +4826,12 @@ class DockviewComponent extends BaseGrid {
|
|
|
4967
4826
|
var _a;
|
|
4968
4827
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
4969
4828
|
}
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
this.
|
|
4829
|
+
dispose() {
|
|
4830
|
+
super.dispose();
|
|
4831
|
+
this._onDidActivePanelChange.dispose();
|
|
4832
|
+
this._onDidAddPanel.dispose();
|
|
4833
|
+
this._onDidRemovePanel.dispose();
|
|
4834
|
+
this._onDidLayoutfromJSON.dispose();
|
|
4974
4835
|
}
|
|
4975
4836
|
}
|
|
4976
4837
|
|
|
@@ -4981,6 +4842,8 @@ class GridviewComponent extends BaseGrid {
|
|
|
4981
4842
|
orientation: options.orientation,
|
|
4982
4843
|
styles: options.styles,
|
|
4983
4844
|
});
|
|
4845
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4846
|
+
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
4984
4847
|
this._options = options;
|
|
4985
4848
|
if (!this.options.components) {
|
|
4986
4849
|
this.options.components = {};
|
|
@@ -5033,7 +4896,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
5033
4896
|
this.gridview.setViewVisible(getGridLocation(panel.element), visible);
|
|
5034
4897
|
}
|
|
5035
4898
|
setActive(panel) {
|
|
5036
|
-
this._groups.forEach((value,
|
|
4899
|
+
this._groups.forEach((value, _key) => {
|
|
5037
4900
|
value.value.setActive(panel === value.value);
|
|
5038
4901
|
});
|
|
5039
4902
|
}
|
|
@@ -5046,8 +4909,12 @@ class GridviewComponent extends BaseGrid {
|
|
|
5046
4909
|
}
|
|
5047
4910
|
fromJSON(serializedGridview, deferComponentLayout) {
|
|
5048
4911
|
const { grid, activePanel } = serializedGridview;
|
|
4912
|
+
const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
|
|
4913
|
+
for (const group of groups) {
|
|
4914
|
+
group.disposable.dispose();
|
|
4915
|
+
this.doRemoveGroup(group.value, { skipActive: true });
|
|
4916
|
+
}
|
|
5049
4917
|
this.gridview.clear();
|
|
5050
|
-
this._groups.clear();
|
|
5051
4918
|
const queue = [];
|
|
5052
4919
|
this.gridview.deserialize(grid, {
|
|
5053
4920
|
fromJSON: (node) => {
|
|
@@ -5088,7 +4955,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
5088
4955
|
this.doSetGroupActive(panel);
|
|
5089
4956
|
}
|
|
5090
4957
|
}
|
|
5091
|
-
this.
|
|
4958
|
+
this._onDidLayoutfromJSON.fire();
|
|
5092
4959
|
}
|
|
5093
4960
|
movePanel(panel, options) {
|
|
5094
4961
|
var _a;
|
|
@@ -5144,7 +5011,6 @@ class GridviewComponent extends BaseGrid {
|
|
|
5144
5011
|
});
|
|
5145
5012
|
this.registerPanel(view);
|
|
5146
5013
|
this.doAddGroup(view, relativeLocation, options.size);
|
|
5147
|
-
return { api: view.api };
|
|
5148
5014
|
}
|
|
5149
5015
|
registerPanel(panel) {
|
|
5150
5016
|
const disposable = new CompositeDisposable(panel.api.onDidFocusChange((event) => {
|
|
@@ -5195,14 +5061,10 @@ class GridviewComponent extends BaseGrid {
|
|
|
5195
5061
|
}
|
|
5196
5062
|
removeGroup(group) {
|
|
5197
5063
|
super.removeGroup(group);
|
|
5198
|
-
const panel = this._groups.get(group.id);
|
|
5199
|
-
if (panel) {
|
|
5200
|
-
panel.disposable.dispose();
|
|
5201
|
-
this._groups.delete(group.id);
|
|
5202
|
-
}
|
|
5203
5064
|
}
|
|
5204
5065
|
dispose() {
|
|
5205
5066
|
super.dispose();
|
|
5067
|
+
this._onDidLayoutfromJSON.dispose();
|
|
5206
5068
|
}
|
|
5207
5069
|
}
|
|
5208
5070
|
|
|
@@ -5229,7 +5091,7 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5229
5091
|
options.frameworkComponents = {};
|
|
5230
5092
|
}
|
|
5231
5093
|
this.splitview = new Splitview(this.element, options);
|
|
5232
|
-
this.addDisposables(this._disposable);
|
|
5094
|
+
this.addDisposables(this._disposable, this._onDidAddView, this._onDidRemoveView, this._onDidLayoutChange);
|
|
5233
5095
|
}
|
|
5234
5096
|
get options() {
|
|
5235
5097
|
return this._options;
|
|
@@ -5305,7 +5167,11 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5305
5167
|
}
|
|
5306
5168
|
removePanel(panel, sizing) {
|
|
5307
5169
|
const disposable = this.panels.get(panel.id);
|
|
5308
|
-
|
|
5170
|
+
if (!disposable) {
|
|
5171
|
+
throw new Error(`unknown splitview panel ${panel.id}`);
|
|
5172
|
+
}
|
|
5173
|
+
disposable.disposable.dispose();
|
|
5174
|
+
disposable.value.dispose();
|
|
5309
5175
|
this.panels.delete(panel.id);
|
|
5310
5176
|
const index = this.getPanels().findIndex((_) => _ === panel);
|
|
5311
5177
|
this.splitview.removeView(index, sizing);
|
|
@@ -5364,7 +5230,7 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5364
5230
|
}
|
|
5365
5231
|
this.setActive(view, true);
|
|
5366
5232
|
});
|
|
5367
|
-
this.panels.set(view.id, disposable);
|
|
5233
|
+
this.panels.set(view.id, { disposable, value: view });
|
|
5368
5234
|
}
|
|
5369
5235
|
toJSON() {
|
|
5370
5236
|
var _a;
|
|
@@ -5388,6 +5254,11 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5388
5254
|
}
|
|
5389
5255
|
fromJSON(serializedSplitview, deferComponentLayout = false) {
|
|
5390
5256
|
const { views, orientation, size, activeView } = serializedSplitview;
|
|
5257
|
+
for (const [_, value] of this.panels.entries()) {
|
|
5258
|
+
value.disposable.dispose();
|
|
5259
|
+
value.value.dispose();
|
|
5260
|
+
}
|
|
5261
|
+
this.panels.clear();
|
|
5391
5262
|
this.splitview.dispose();
|
|
5392
5263
|
const queue = [];
|
|
5393
5264
|
this.splitview = new Splitview(this.element, {
|
|
@@ -5443,49 +5314,16 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5443
5314
|
}
|
|
5444
5315
|
}
|
|
5445
5316
|
dispose() {
|
|
5446
|
-
|
|
5447
|
-
value.dispose();
|
|
5448
|
-
|
|
5317
|
+
for (const [_, value] of this.panels.entries()) {
|
|
5318
|
+
value.disposable.dispose();
|
|
5319
|
+
value.value.dispose();
|
|
5320
|
+
}
|
|
5449
5321
|
this.panels.clear();
|
|
5322
|
+
this.splitview.dispose();
|
|
5450
5323
|
super.dispose();
|
|
5451
5324
|
}
|
|
5452
5325
|
}
|
|
5453
5326
|
|
|
5454
|
-
class DragHandler extends CompositeDisposable {
|
|
5455
|
-
constructor(el) {
|
|
5456
|
-
super();
|
|
5457
|
-
this.el = el;
|
|
5458
|
-
this.iframes = [];
|
|
5459
|
-
this._onDragStart = new Emitter();
|
|
5460
|
-
this.onDragStart = this._onDragStart.event;
|
|
5461
|
-
this.configure();
|
|
5462
|
-
}
|
|
5463
|
-
configure() {
|
|
5464
|
-
this.addDisposables(addDisposableListener(this.el, 'dragstart', (event) => {
|
|
5465
|
-
var _a;
|
|
5466
|
-
this.iframes = [
|
|
5467
|
-
...getElementsByTagName('iframe'),
|
|
5468
|
-
...getElementsByTagName('webview'),
|
|
5469
|
-
];
|
|
5470
|
-
for (const iframe of this.iframes) {
|
|
5471
|
-
iframe.style.pointerEvents = 'none';
|
|
5472
|
-
}
|
|
5473
|
-
this.el.classList.add('dragged');
|
|
5474
|
-
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
5475
|
-
(_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5476
|
-
this.disposable = this.getData();
|
|
5477
|
-
}), addDisposableListener(this.el, 'dragend', (ev) => {
|
|
5478
|
-
var _a;
|
|
5479
|
-
for (const iframe of this.iframes) {
|
|
5480
|
-
iframe.style.pointerEvents = 'auto';
|
|
5481
|
-
}
|
|
5482
|
-
this.iframes = [];
|
|
5483
|
-
(_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5484
|
-
this.disposable = undefined;
|
|
5485
|
-
}));
|
|
5486
|
-
}
|
|
5487
|
-
}
|
|
5488
|
-
|
|
5489
5327
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
5490
5328
|
//
|
|
5491
5329
|
constructor(id) {
|
|
@@ -5500,6 +5338,7 @@ class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
|
5500
5338
|
//
|
|
5501
5339
|
this._onDidSizeChange = new Emitter();
|
|
5502
5340
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
5341
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
5503
5342
|
}
|
|
5504
5343
|
setConstraints(value) {
|
|
5505
5344
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -5507,11 +5346,6 @@ class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
|
5507
5346
|
setSize(event) {
|
|
5508
5347
|
this._onDidSizeChange.fire(event);
|
|
5509
5348
|
}
|
|
5510
|
-
dispose() {
|
|
5511
|
-
super.dispose();
|
|
5512
|
-
this._onDidConstraintsChange.dispose();
|
|
5513
|
-
this._onDidSizeChange.dispose();
|
|
5514
|
-
}
|
|
5515
5349
|
}
|
|
5516
5350
|
|
|
5517
5351
|
class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
@@ -5525,6 +5359,7 @@ class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
|
5525
5359
|
this.onMouseEnter = this._onMouseEnter.event;
|
|
5526
5360
|
this._onMouseLeave = new Emitter({});
|
|
5527
5361
|
this.onMouseLeave = this._onMouseLeave.event;
|
|
5362
|
+
this.addDisposables(this._onDidExpansionChange, this._onMouseEnter, this._onMouseLeave);
|
|
5528
5363
|
}
|
|
5529
5364
|
set pane(pane) {
|
|
5530
5365
|
this._pane = pane;
|
|
@@ -5693,7 +5528,7 @@ class PaneviewPanel extends BasePanelView {
|
|
|
5693
5528
|
}
|
|
5694
5529
|
}
|
|
5695
5530
|
toJSON() {
|
|
5696
|
-
const params = this.
|
|
5531
|
+
const params = this._params;
|
|
5697
5532
|
return Object.assign(Object.assign({}, super.toJSON()), { headerComponent: this.headerComponent, title: params.title });
|
|
5698
5533
|
}
|
|
5699
5534
|
renderOnce() {
|
|
@@ -5753,7 +5588,7 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
5753
5588
|
})(this.header);
|
|
5754
5589
|
this.target = new Droptarget(this.element, {
|
|
5755
5590
|
validOverlays: 'vertical',
|
|
5756
|
-
canDisplayOverlay: (
|
|
5591
|
+
canDisplayOverlay: () => {
|
|
5757
5592
|
const data = getPaneData();
|
|
5758
5593
|
if (!data) {
|
|
5759
5594
|
return true;
|
|
@@ -5762,36 +5597,39 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
5762
5597
|
},
|
|
5763
5598
|
});
|
|
5764
5599
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
5765
|
-
|
|
5766
|
-
if (!data) {
|
|
5767
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5768
|
-
return;
|
|
5769
|
-
}
|
|
5770
|
-
const containerApi = this.params
|
|
5771
|
-
.containerApi;
|
|
5772
|
-
const panelId = data.paneId;
|
|
5773
|
-
const existingPanel = containerApi.getPanel(panelId);
|
|
5774
|
-
if (!existingPanel) {
|
|
5775
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5776
|
-
return;
|
|
5777
|
-
}
|
|
5778
|
-
const allPanels = containerApi.getPanels();
|
|
5779
|
-
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5780
|
-
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5781
|
-
if (event.position === Position.Left ||
|
|
5782
|
-
event.position === Position.Top) {
|
|
5783
|
-
toIndex = Math.max(0, toIndex - 1);
|
|
5784
|
-
}
|
|
5785
|
-
if (event.position === Position.Right ||
|
|
5786
|
-
event.position === Position.Bottom) {
|
|
5787
|
-
if (fromIndex > toIndex) {
|
|
5788
|
-
toIndex++;
|
|
5789
|
-
}
|
|
5790
|
-
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5791
|
-
}
|
|
5792
|
-
containerApi.movePanel(fromIndex, toIndex);
|
|
5600
|
+
this.onDrop(event);
|
|
5793
5601
|
}));
|
|
5794
5602
|
}
|
|
5603
|
+
onDrop(event) {
|
|
5604
|
+
const data = getPaneData();
|
|
5605
|
+
if (!data) {
|
|
5606
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5607
|
+
return;
|
|
5608
|
+
}
|
|
5609
|
+
const containerApi = this._params
|
|
5610
|
+
.containerApi;
|
|
5611
|
+
const panelId = data.paneId;
|
|
5612
|
+
const existingPanel = containerApi.getPanel(panelId);
|
|
5613
|
+
if (!existingPanel) {
|
|
5614
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5615
|
+
return;
|
|
5616
|
+
}
|
|
5617
|
+
const allPanels = containerApi.getPanels();
|
|
5618
|
+
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5619
|
+
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5620
|
+
if (event.position === Position.Left ||
|
|
5621
|
+
event.position === Position.Top) {
|
|
5622
|
+
toIndex = Math.max(0, toIndex - 1);
|
|
5623
|
+
}
|
|
5624
|
+
if (event.position === Position.Right ||
|
|
5625
|
+
event.position === Position.Bottom) {
|
|
5626
|
+
if (fromIndex > toIndex) {
|
|
5627
|
+
toIndex++;
|
|
5628
|
+
}
|
|
5629
|
+
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5630
|
+
}
|
|
5631
|
+
containerApi.movePanel(fromIndex, toIndex);
|
|
5632
|
+
}
|
|
5795
5633
|
}
|
|
5796
5634
|
|
|
5797
5635
|
class DefaultHeader extends CompositeDisposable {
|
|
@@ -5821,7 +5659,7 @@ class DefaultHeader extends CompositeDisposable {
|
|
|
5821
5659
|
this._expander.textContent = e.isExpanded ? '<' : '>';
|
|
5822
5660
|
});
|
|
5823
5661
|
}
|
|
5824
|
-
update(
|
|
5662
|
+
update(_params) {
|
|
5825
5663
|
//
|
|
5826
5664
|
}
|
|
5827
5665
|
dispose() {
|
|
@@ -5847,6 +5685,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5847
5685
|
super();
|
|
5848
5686
|
this.element = element;
|
|
5849
5687
|
this._disposable = new MutableDisposable();
|
|
5688
|
+
this._viewDisposables = new Map();
|
|
5850
5689
|
this._onDidLayoutChange = new Emitter();
|
|
5851
5690
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
5852
5691
|
this._onDidDrop = new Emitter();
|
|
@@ -5855,6 +5694,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5855
5694
|
this.onDidAddView = this._onDidAddView.event;
|
|
5856
5695
|
this._onDidRemoveView = new Emitter();
|
|
5857
5696
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
5697
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
|
|
5858
5698
|
this._options = options;
|
|
5859
5699
|
if (!options.components) {
|
|
5860
5700
|
options.components = {};
|
|
@@ -5930,9 +5770,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5930
5770
|
isExpanded: !!options.isExpanded,
|
|
5931
5771
|
disableDnd: !!this.options.disableDnd,
|
|
5932
5772
|
});
|
|
5933
|
-
|
|
5934
|
-
this._onDidDrop.fire(event);
|
|
5935
|
-
}));
|
|
5773
|
+
this.doAddPanel(view);
|
|
5936
5774
|
const size = typeof options.size === 'number' ? options.size : Sizing.Distribute;
|
|
5937
5775
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
5938
5776
|
view.init({
|
|
@@ -5945,7 +5783,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5945
5783
|
});
|
|
5946
5784
|
this.paneview.addPane(view, size, index);
|
|
5947
5785
|
view.orientation = this.paneview.orientation;
|
|
5948
|
-
return
|
|
5786
|
+
return view;
|
|
5949
5787
|
}
|
|
5950
5788
|
getPanels() {
|
|
5951
5789
|
return this.paneview.getPanes();
|
|
@@ -5954,6 +5792,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5954
5792
|
const views = this.getPanels();
|
|
5955
5793
|
const index = views.findIndex((_) => _ === panel);
|
|
5956
5794
|
this.paneview.removePane(index);
|
|
5795
|
+
this.doRemovePanel(panel);
|
|
5957
5796
|
}
|
|
5958
5797
|
movePanel(from, to) {
|
|
5959
5798
|
this.paneview.moveView(from, to);
|
|
@@ -6003,6 +5842,10 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
6003
5842
|
fromJSON(serializedPaneview, deferComponentLayout) {
|
|
6004
5843
|
const { views, size } = serializedPaneview;
|
|
6005
5844
|
const queue = [];
|
|
5845
|
+
for (const [_, value] of this._viewDisposables.entries()) {
|
|
5846
|
+
value.dispose();
|
|
5847
|
+
}
|
|
5848
|
+
this._viewDisposables.clear();
|
|
6006
5849
|
this.paneview.dispose();
|
|
6007
5850
|
this.paneview = new Paneview(this.element, {
|
|
6008
5851
|
orientation: Orientation.VERTICAL,
|
|
@@ -6038,9 +5881,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
6038
5881
|
isExpanded: !!view.expanded,
|
|
6039
5882
|
disableDnd: !!this.options.disableDnd,
|
|
6040
5883
|
});
|
|
6041
|
-
|
|
6042
|
-
this._onDidDrop.fire(event);
|
|
6043
|
-
});
|
|
5884
|
+
this.doAddPanel(panel);
|
|
6044
5885
|
queue.push(() => {
|
|
6045
5886
|
panel.init({
|
|
6046
5887
|
params: data.params || {},
|
|
@@ -6070,6 +5911,27 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
6070
5911
|
queue.forEach((f) => f());
|
|
6071
5912
|
}
|
|
6072
5913
|
}
|
|
5914
|
+
doAddPanel(panel) {
|
|
5915
|
+
const disposable = panel.onDidDrop((event) => {
|
|
5916
|
+
this._onDidDrop.fire(event);
|
|
5917
|
+
});
|
|
5918
|
+
this._viewDisposables.set(panel.id, disposable);
|
|
5919
|
+
}
|
|
5920
|
+
doRemovePanel(panel) {
|
|
5921
|
+
const disposable = this._viewDisposables.get(panel.id);
|
|
5922
|
+
if (disposable) {
|
|
5923
|
+
disposable.dispose();
|
|
5924
|
+
this._viewDisposables.delete(panel.id);
|
|
5925
|
+
}
|
|
5926
|
+
}
|
|
5927
|
+
dispose() {
|
|
5928
|
+
super.dispose();
|
|
5929
|
+
for (const [_, value] of this._viewDisposables.entries()) {
|
|
5930
|
+
value.dispose();
|
|
5931
|
+
}
|
|
5932
|
+
this._viewDisposables.clear();
|
|
5933
|
+
this.paneview.dispose();
|
|
5934
|
+
}
|
|
6073
5935
|
}
|
|
6074
5936
|
|
|
6075
5937
|
class SplitviewPanel extends BasePanelView {
|
|
@@ -6082,12 +5944,14 @@ class SplitviewPanel extends BasePanelView {
|
|
|
6082
5944
|
this._snap = false;
|
|
6083
5945
|
this._onDidChange = new Emitter();
|
|
6084
5946
|
this.onDidChange = this._onDidChange.event;
|
|
6085
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
5947
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
6086
5948
|
const { isVisible } = event;
|
|
6087
|
-
const { containerApi } = this
|
|
5949
|
+
const { containerApi } = this
|
|
5950
|
+
._params;
|
|
6088
5951
|
containerApi.setVisible(this, isVisible);
|
|
6089
5952
|
}), this.api.onActiveChange(() => {
|
|
6090
|
-
const { containerApi } = this
|
|
5953
|
+
const { containerApi } = this
|
|
5954
|
+
._params;
|
|
6091
5955
|
containerApi.setActive(this);
|
|
6092
5956
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
6093
5957
|
if (typeof event.minimumSize === 'number' ||
|
|
@@ -6230,14 +6094,13 @@ class ReactPart {
|
|
|
6230
6094
|
if (this.disposed) {
|
|
6231
6095
|
throw new Error('invalid operation: resource is already disposed');
|
|
6232
6096
|
}
|
|
6233
|
-
// TODO use a better check for isReactFunctionalComponent
|
|
6234
6097
|
if (typeof this.component !== 'function') {
|
|
6235
6098
|
/**
|
|
6236
6099
|
* we know this isn't a React.FunctionComponent so throw an error here.
|
|
6237
6100
|
* if we do not intercept this the React library will throw a very obsure error
|
|
6238
6101
|
* for the same reason, at least at this point we will emit a sensible stacktrace.
|
|
6239
6102
|
*/
|
|
6240
|
-
throw new Error('
|
|
6103
|
+
throw new Error('Invalid Operation. dockview only supports React Functional Components.');
|
|
6241
6104
|
}
|
|
6242
6105
|
const bridgeComponent = React.createElement(React.forwardRef(ReactComponentBridge), {
|
|
6243
6106
|
component: this
|
|
@@ -6295,22 +6158,14 @@ class ReactPanelContentPart {
|
|
|
6295
6158
|
this.id = id;
|
|
6296
6159
|
this.component = component;
|
|
6297
6160
|
this.reactPortalStore = reactPortalStore;
|
|
6298
|
-
// private hostedContainer: HostedContainer;
|
|
6299
6161
|
this._onDidFocus = new Emitter();
|
|
6300
6162
|
this.onDidFocus = this._onDidFocus.event;
|
|
6301
6163
|
this._onDidBlur = new Emitter();
|
|
6302
6164
|
this.onDidBlur = this._onDidBlur.event;
|
|
6303
6165
|
this._element = document.createElement('div');
|
|
6304
|
-
this._element.
|
|
6305
|
-
this._element.style.width = '100%';
|
|
6306
|
-
// this.hostedContainer = new HostedContainer({
|
|
6307
|
-
// id,
|
|
6308
|
-
// });
|
|
6309
|
-
// this.hostedContainer.onDidFocus(() => this._onDidFocus.fire());
|
|
6310
|
-
// this.hostedContainer.onDidBlur(() => this._onDidBlur.fire());
|
|
6166
|
+
this._element.className = 'dockview-react-part';
|
|
6311
6167
|
this._actionsElement = document.createElement('div');
|
|
6312
|
-
this._actionsElement.
|
|
6313
|
-
this._actionsElement.style.width = '100%';
|
|
6168
|
+
this._actionsElement.className = 'dockview-react-part';
|
|
6314
6169
|
}
|
|
6315
6170
|
get element() {
|
|
6316
6171
|
return this._element;
|
|
@@ -6343,23 +6198,20 @@ class ReactPanelContentPart {
|
|
|
6343
6198
|
var _a;
|
|
6344
6199
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
6345
6200
|
}
|
|
6346
|
-
updateParentGroup(group,
|
|
6201
|
+
updateParentGroup(group, _isPanelVisible) {
|
|
6347
6202
|
this._group = group;
|
|
6348
6203
|
}
|
|
6349
|
-
layout(
|
|
6204
|
+
layout(_width, _height) {
|
|
6350
6205
|
// noop
|
|
6351
|
-
// this.hostedContainer.layout(
|
|
6352
|
-
// this.element
|
|
6353
|
-
// // { width, height }
|
|
6354
|
-
// );
|
|
6355
6206
|
}
|
|
6356
6207
|
close() {
|
|
6357
6208
|
return Promise.resolve(true);
|
|
6358
6209
|
}
|
|
6359
6210
|
dispose() {
|
|
6360
6211
|
var _a, _b;
|
|
6212
|
+
this._onDidFocus.dispose();
|
|
6213
|
+
this._onDidBlur.dispose();
|
|
6361
6214
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
6362
|
-
// this.hostedContainer?.dispose();
|
|
6363
6215
|
(_b = this.actionsPart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
6364
6216
|
}
|
|
6365
6217
|
}
|
|
@@ -6370,6 +6222,7 @@ class ReactPanelHeaderPart {
|
|
|
6370
6222
|
this.component = component;
|
|
6371
6223
|
this.reactPortalStore = reactPortalStore;
|
|
6372
6224
|
this._element = document.createElement('div');
|
|
6225
|
+
this._element.className = 'dockview-react-part';
|
|
6373
6226
|
}
|
|
6374
6227
|
get element() {
|
|
6375
6228
|
return this._element;
|
|
@@ -6393,10 +6246,10 @@ class ReactPanelHeaderPart {
|
|
|
6393
6246
|
id: this.id,
|
|
6394
6247
|
};
|
|
6395
6248
|
}
|
|
6396
|
-
layout(
|
|
6249
|
+
layout(_width, _height) {
|
|
6397
6250
|
// noop - retrieval from api
|
|
6398
6251
|
}
|
|
6399
|
-
updateParentGroup(
|
|
6252
|
+
updateParentGroup(_group, _isPanelVisible) {
|
|
6400
6253
|
// noop - retrieval from api
|
|
6401
6254
|
}
|
|
6402
6255
|
dispose() {
|
|
@@ -6414,7 +6267,6 @@ class ReactPanelDeserialzier {
|
|
|
6414
6267
|
const panelId = panelData.id;
|
|
6415
6268
|
const params = panelData.params;
|
|
6416
6269
|
const title = panelData.title;
|
|
6417
|
-
const state = panelData.state;
|
|
6418
6270
|
const suppressClosable = panelData.suppressClosable;
|
|
6419
6271
|
const viewData = panelData.view;
|
|
6420
6272
|
const view = new DefaultGroupPanelView({
|
|
@@ -6423,13 +6275,12 @@ class ReactPanelDeserialzier {
|
|
|
6423
6275
|
? 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)
|
|
6424
6276
|
: new DefaultTab(),
|
|
6425
6277
|
});
|
|
6426
|
-
const panel = new DockviewGroupPanel(panelId, new DockviewApi(this.layout));
|
|
6278
|
+
const panel = new DockviewGroupPanel(panelId, this.layout, new DockviewApi(this.layout));
|
|
6427
6279
|
panel.init({
|
|
6428
6280
|
view,
|
|
6429
6281
|
title,
|
|
6430
6282
|
suppressClosable,
|
|
6431
6283
|
params: params || {},
|
|
6432
|
-
state: state || {},
|
|
6433
6284
|
});
|
|
6434
6285
|
return panel;
|
|
6435
6286
|
}
|
|
@@ -6444,8 +6295,7 @@ class ReactWatermarkPart {
|
|
|
6444
6295
|
value: undefined,
|
|
6445
6296
|
};
|
|
6446
6297
|
this._element = document.createElement('div');
|
|
6447
|
-
this._element.
|
|
6448
|
-
this._element.style.width = '100%';
|
|
6298
|
+
this._element.className = 'dockview-react-part';
|
|
6449
6299
|
}
|
|
6450
6300
|
get element() {
|
|
6451
6301
|
return this._element;
|
|
@@ -6478,10 +6328,10 @@ class ReactWatermarkPart {
|
|
|
6478
6328
|
id: this.id,
|
|
6479
6329
|
};
|
|
6480
6330
|
}
|
|
6481
|
-
layout(
|
|
6331
|
+
layout(_width, _height) {
|
|
6482
6332
|
// noop - retrieval from api
|
|
6483
6333
|
}
|
|
6484
|
-
updateParentGroup(group,
|
|
6334
|
+
updateParentGroup(group, _isPanelVisible) {
|
|
6485
6335
|
// noop - retrieval from api
|
|
6486
6336
|
this._groupRef.value = group;
|
|
6487
6337
|
}
|
|
@@ -6515,21 +6365,21 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
6515
6365
|
var _a;
|
|
6516
6366
|
const factory = {
|
|
6517
6367
|
content: {
|
|
6518
|
-
createComponent: (
|
|
6368
|
+
createComponent: (_id, componentId, component) => {
|
|
6519
6369
|
return new ReactPanelContentPart(componentId, component, {
|
|
6520
6370
|
addPortal,
|
|
6521
6371
|
});
|
|
6522
6372
|
},
|
|
6523
6373
|
},
|
|
6524
6374
|
tab: {
|
|
6525
|
-
createComponent: (
|
|
6375
|
+
createComponent: (_id, componentId, component) => {
|
|
6526
6376
|
return new ReactPanelHeaderPart(componentId, component, {
|
|
6527
6377
|
addPortal,
|
|
6528
6378
|
});
|
|
6529
6379
|
},
|
|
6530
6380
|
},
|
|
6531
6381
|
watermark: {
|
|
6532
|
-
createComponent: (
|
|
6382
|
+
createComponent: (_id, componentId, component) => {
|
|
6533
6383
|
return new ReactWatermarkPart(componentId, component, {
|
|
6534
6384
|
addPortal,
|
|
6535
6385
|
});
|
|
@@ -6543,7 +6393,6 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
6543
6393
|
frameworkTabComponents: props.tabComponents,
|
|
6544
6394
|
tabHeight: props.tabHeight,
|
|
6545
6395
|
debug: props.debug,
|
|
6546
|
-
enableExternalDragEvents: props.enableExternalDragEvents,
|
|
6547
6396
|
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6548
6397
|
styles: props.hideBorders
|
|
6549
6398
|
? { separatorBorder: 'transparent' }
|
|
@@ -6559,8 +6408,24 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
6559
6408
|
dockviewRef.current = dockview;
|
|
6560
6409
|
return () => {
|
|
6561
6410
|
dockview.dispose();
|
|
6411
|
+
element.remove();
|
|
6562
6412
|
};
|
|
6563
6413
|
}, []);
|
|
6414
|
+
React.useEffect(() => {
|
|
6415
|
+
if (!dockviewRef.current) {
|
|
6416
|
+
return () => {
|
|
6417
|
+
// noop
|
|
6418
|
+
};
|
|
6419
|
+
}
|
|
6420
|
+
const disposable = dockviewRef.current.onDidDrop((event) => {
|
|
6421
|
+
if (props.onDidDrop) {
|
|
6422
|
+
props.onDidDrop(event);
|
|
6423
|
+
}
|
|
6424
|
+
});
|
|
6425
|
+
return () => {
|
|
6426
|
+
disposable.dispose();
|
|
6427
|
+
};
|
|
6428
|
+
}, [props.onDidDrop]);
|
|
6564
6429
|
React.useEffect(() => {
|
|
6565
6430
|
if (!dockviewRef.current) {
|
|
6566
6431
|
return;
|
|
@@ -6569,6 +6434,22 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
6569
6434
|
frameworkComponents: props.components,
|
|
6570
6435
|
});
|
|
6571
6436
|
}, [props.components]);
|
|
6437
|
+
React.useEffect(() => {
|
|
6438
|
+
if (!dockviewRef.current) {
|
|
6439
|
+
return;
|
|
6440
|
+
}
|
|
6441
|
+
dockviewRef.current.updateOptions({
|
|
6442
|
+
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6443
|
+
});
|
|
6444
|
+
}, [props.watermarkComponent]);
|
|
6445
|
+
React.useEffect(() => {
|
|
6446
|
+
if (!dockviewRef.current) {
|
|
6447
|
+
return;
|
|
6448
|
+
}
|
|
6449
|
+
dockviewRef.current.updateOptions({
|
|
6450
|
+
showDndOverlay: props.showDndOverlay,
|
|
6451
|
+
});
|
|
6452
|
+
}, [props.showDndOverlay]);
|
|
6572
6453
|
React.useEffect(() => {
|
|
6573
6454
|
if (!dockviewRef.current) {
|
|
6574
6455
|
return;
|
|
@@ -6657,9 +6538,9 @@ class ReactPanelView extends SplitviewPanel {
|
|
|
6657
6538
|
getComponent() {
|
|
6658
6539
|
var _a;
|
|
6659
6540
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6660
|
-
params: ((_a = this.
|
|
6541
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6661
6542
|
api: this.api,
|
|
6662
|
-
containerApi: this.
|
|
6543
|
+
containerApi: this._params
|
|
6663
6544
|
.containerApi,
|
|
6664
6545
|
});
|
|
6665
6546
|
}
|
|
@@ -6696,7 +6577,9 @@ const SplitviewReact = React.forwardRef((props, ref) => {
|
|
|
6696
6577
|
});
|
|
6697
6578
|
},
|
|
6698
6579
|
},
|
|
6699
|
-
proportionalLayout: props.proportionalLayout
|
|
6580
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
6581
|
+
? props.proportionalLayout
|
|
6582
|
+
: true,
|
|
6700
6583
|
styles: props.hideBorders
|
|
6701
6584
|
? { separatorBorder: 'transparent' }
|
|
6702
6585
|
: undefined,
|
|
@@ -6732,9 +6615,9 @@ class ReactGridPanelView extends GridviewPanel {
|
|
|
6732
6615
|
getComponent() {
|
|
6733
6616
|
var _a;
|
|
6734
6617
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6735
|
-
params: ((_a = this.
|
|
6618
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6736
6619
|
api: this.api,
|
|
6737
|
-
containerApi: this.
|
|
6620
|
+
containerApi: this._params
|
|
6738
6621
|
.containerApi,
|
|
6739
6622
|
});
|
|
6740
6623
|
}
|
|
@@ -6764,7 +6647,9 @@ const GridviewReact = React.forwardRef((props, ref) => {
|
|
|
6764
6647
|
var _a;
|
|
6765
6648
|
const element = document.createElement('div');
|
|
6766
6649
|
const gridview = new GridviewComponent(element, {
|
|
6767
|
-
proportionalLayout:
|
|
6650
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
6651
|
+
? props.proportionalLayout
|
|
6652
|
+
: true,
|
|
6768
6653
|
orientation: props.orientation,
|
|
6769
6654
|
frameworkComponents: props.components,
|
|
6770
6655
|
frameworkComponentFactory: {
|
|
@@ -6787,6 +6672,7 @@ const GridviewReact = React.forwardRef((props, ref) => {
|
|
|
6787
6672
|
gridviewRef.current = gridview;
|
|
6788
6673
|
return () => {
|
|
6789
6674
|
gridview.dispose();
|
|
6675
|
+
element.remove();
|
|
6790
6676
|
};
|
|
6791
6677
|
}, []);
|
|
6792
6678
|
React.useEffect(() => {
|
|
@@ -6857,7 +6743,7 @@ const PaneviewReact = React.forwardRef((props, ref) => {
|
|
|
6857
6743
|
};
|
|
6858
6744
|
}, [props.disableAutoResizing]);
|
|
6859
6745
|
React.useEffect(() => {
|
|
6860
|
-
const createComponent = (id,
|
|
6746
|
+
const createComponent = (id, _componentId, component) => new PanePanelSection(id, component, {
|
|
6861
6747
|
addPortal,
|
|
6862
6748
|
});
|
|
6863
6749
|
const paneview = new PaneviewComponent(domRef.current, {
|
|
@@ -6922,4 +6808,4 @@ const PaneviewReact = React.forwardRef((props, ref) => {
|
|
|
6922
6808
|
});
|
|
6923
6809
|
PaneviewReact.displayName = 'PaneviewComponent';
|
|
6924
6810
|
|
|
6925
|
-
export { BaseGrid,
|
|
6811
|
+
export { BaseGrid, ContentContainer, DockviewApi, DockviewComponent, DockviewComponents, DockviewReact, Event, Gridview, GridviewApi, GridviewComponent, GridviewPanel, GridviewReact, GroupChangeKind2, Groupview, LayoutPriority, LocalSelectionTransfer, MouseEventKind, Orientation, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewReact, Position, ReactPanelContentPart, ReactPanelHeaderPart, ReactPart, ReactPartContext, SashState, Sizing, Splitview, SplitviewApi, SplitviewComponent, SplitviewPanel, SplitviewReact, Tab$1 as Tab, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isReactElement, orthogonal, toTarget, usePortalsLifecycle };
|