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.cjs.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
|
*/
|
|
@@ -59,9 +59,79 @@ function styleInject(css, ref) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
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}";
|
|
62
|
+
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}";
|
|
63
63
|
styleInject(css_248z);
|
|
64
64
|
|
|
65
|
+
class TransferObject {
|
|
66
|
+
constructor() {
|
|
67
|
+
//
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
class PanelTransfer extends TransferObject {
|
|
71
|
+
constructor(viewId, groupId, panelId) {
|
|
72
|
+
super();
|
|
73
|
+
this.viewId = viewId;
|
|
74
|
+
this.groupId = groupId;
|
|
75
|
+
this.panelId = panelId;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
class PaneTransfer extends TransferObject {
|
|
79
|
+
constructor(viewId, paneId) {
|
|
80
|
+
super();
|
|
81
|
+
this.viewId = viewId;
|
|
82
|
+
this.paneId = paneId;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
87
|
+
*/
|
|
88
|
+
class LocalSelectionTransfer {
|
|
89
|
+
constructor() {
|
|
90
|
+
// protect against external instantiation
|
|
91
|
+
}
|
|
92
|
+
static getInstance() {
|
|
93
|
+
return LocalSelectionTransfer.INSTANCE;
|
|
94
|
+
}
|
|
95
|
+
hasData(proto) {
|
|
96
|
+
return proto && proto === this.proto;
|
|
97
|
+
}
|
|
98
|
+
clearData(proto) {
|
|
99
|
+
if (this.hasData(proto)) {
|
|
100
|
+
this.proto = undefined;
|
|
101
|
+
this.data = undefined;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
getData(proto) {
|
|
105
|
+
if (this.hasData(proto)) {
|
|
106
|
+
return this.data;
|
|
107
|
+
}
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
setData(data, proto) {
|
|
111
|
+
if (proto) {
|
|
112
|
+
this.data = data;
|
|
113
|
+
this.proto = proto;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
LocalSelectionTransfer.INSTANCE = new LocalSelectionTransfer();
|
|
118
|
+
function getPanelData() {
|
|
119
|
+
const panelTransfer = LocalSelectionTransfer.getInstance();
|
|
120
|
+
const isPanelEvent = panelTransfer.hasData(PanelTransfer.prototype);
|
|
121
|
+
if (!isPanelEvent) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return panelTransfer.getData(PanelTransfer.prototype)[0];
|
|
125
|
+
}
|
|
126
|
+
function getPaneData() {
|
|
127
|
+
const paneTransfer = LocalSelectionTransfer.getInstance();
|
|
128
|
+
const isPanelEvent = paneTransfer.hasData(PaneTransfer.prototype);
|
|
129
|
+
if (!isPanelEvent) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
return paneTransfer.getData(PaneTransfer.prototype)[0];
|
|
133
|
+
}
|
|
134
|
+
|
|
65
135
|
exports.Event = void 0;
|
|
66
136
|
(function (Event) {
|
|
67
137
|
Event.any = (...children) => {
|
|
@@ -92,7 +162,6 @@ class Emitter {
|
|
|
92
162
|
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.replay) && this._last !== undefined) {
|
|
93
163
|
listener(this._last);
|
|
94
164
|
}
|
|
95
|
-
this._listeners.length === 0;
|
|
96
165
|
this._listeners.push(listener);
|
|
97
166
|
return {
|
|
98
167
|
dispose: () => {
|
|
@@ -108,9 +177,9 @@ class Emitter {
|
|
|
108
177
|
}
|
|
109
178
|
fire(e) {
|
|
110
179
|
this._last = e;
|
|
111
|
-
this._listeners
|
|
180
|
+
for (const listener of this._listeners) {
|
|
112
181
|
listener(e);
|
|
113
|
-
}
|
|
182
|
+
}
|
|
114
183
|
}
|
|
115
184
|
dispose() {
|
|
116
185
|
this._listeners = [];
|
|
@@ -152,164 +221,6 @@ class TickDelayedEvent {
|
|
|
152
221
|
}
|
|
153
222
|
}
|
|
154
223
|
|
|
155
|
-
exports.Disposable = void 0;
|
|
156
|
-
(function (Disposable) {
|
|
157
|
-
Disposable.NONE = {
|
|
158
|
-
dispose: () => {
|
|
159
|
-
// noop
|
|
160
|
-
},
|
|
161
|
-
};
|
|
162
|
-
})(exports.Disposable || (exports.Disposable = {}));
|
|
163
|
-
class CompositeDisposable {
|
|
164
|
-
constructor(...args) {
|
|
165
|
-
this.disposables = args;
|
|
166
|
-
}
|
|
167
|
-
static from(...args) {
|
|
168
|
-
return new CompositeDisposable(...args);
|
|
169
|
-
}
|
|
170
|
-
addDisposables(...args) {
|
|
171
|
-
args === null || args === void 0 ? void 0 : args.forEach((arg) => this.disposables.push(arg));
|
|
172
|
-
}
|
|
173
|
-
dispose() {
|
|
174
|
-
this.disposables.forEach((arg) => arg.dispose());
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
class MutableDisposable {
|
|
178
|
-
constructor() {
|
|
179
|
-
this._disposable = exports.Disposable.NONE;
|
|
180
|
-
}
|
|
181
|
-
set value(disposable) {
|
|
182
|
-
if (this._disposable) {
|
|
183
|
-
this._disposable.dispose();
|
|
184
|
-
}
|
|
185
|
-
this._disposable = disposable;
|
|
186
|
-
}
|
|
187
|
-
dispose() {
|
|
188
|
-
if (this._disposable) {
|
|
189
|
-
this._disposable.dispose();
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function tryParseJSON(text, reviver) {
|
|
195
|
-
try {
|
|
196
|
-
return JSON.parse(text, reviver);
|
|
197
|
-
}
|
|
198
|
-
catch (err) {
|
|
199
|
-
console.warn('failed to parse JSON');
|
|
200
|
-
return undefined;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
class TransferObject {
|
|
205
|
-
constructor() {
|
|
206
|
-
//
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
class PanelTransfer extends TransferObject {
|
|
210
|
-
constructor(viewId, groupId, panelId) {
|
|
211
|
-
super();
|
|
212
|
-
this.viewId = viewId;
|
|
213
|
-
this.groupId = groupId;
|
|
214
|
-
this.panelId = panelId;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
class PaneTransfer extends TransferObject {
|
|
218
|
-
constructor(viewId, paneId) {
|
|
219
|
-
super();
|
|
220
|
-
this.viewId = viewId;
|
|
221
|
-
this.paneId = paneId;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
const DATA_KEY = 'splitview/transfer';
|
|
225
|
-
const isPanelTransferEvent = (event) => {
|
|
226
|
-
if (!event.dataTransfer) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
return event.dataTransfer.types.includes(DATA_KEY);
|
|
230
|
-
};
|
|
231
|
-
exports.DragType = void 0;
|
|
232
|
-
(function (DragType) {
|
|
233
|
-
DragType["DOCKVIEW_TAB"] = "dockview_tab";
|
|
234
|
-
DragType["EXTERNAL"] = "external_group_drag";
|
|
235
|
-
})(exports.DragType || (exports.DragType = {}));
|
|
236
|
-
/**
|
|
237
|
-
* Determine whether this data belong to that of an event that was started by
|
|
238
|
-
* dragging a tab component
|
|
239
|
-
*/
|
|
240
|
-
const isTabDragEvent = (data) => {
|
|
241
|
-
return data.type === exports.DragType.DOCKVIEW_TAB;
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* Determine whether this data belong to that of an event that was started by
|
|
245
|
-
* a custom drag-enable component
|
|
246
|
-
*/
|
|
247
|
-
const isCustomDragEvent = (data) => {
|
|
248
|
-
return data.type === exports.DragType.EXTERNAL;
|
|
249
|
-
};
|
|
250
|
-
const extractData = (event) => {
|
|
251
|
-
if (!event.dataTransfer) {
|
|
252
|
-
return null;
|
|
253
|
-
}
|
|
254
|
-
const data = tryParseJSON(event.dataTransfer.getData(DATA_KEY));
|
|
255
|
-
if (!data) {
|
|
256
|
-
console.warn(`[dragEvent] ${DATA_KEY} data is missing`);
|
|
257
|
-
}
|
|
258
|
-
if (typeof data.type !== 'string') {
|
|
259
|
-
console.warn(`[dragEvent] invalid type ${data.type}`);
|
|
260
|
-
}
|
|
261
|
-
return data;
|
|
262
|
-
};
|
|
263
|
-
/**
|
|
264
|
-
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
265
|
-
*/
|
|
266
|
-
class LocalSelectionTransfer {
|
|
267
|
-
constructor() {
|
|
268
|
-
// protect against external instantiation
|
|
269
|
-
}
|
|
270
|
-
static getInstance() {
|
|
271
|
-
return LocalSelectionTransfer.INSTANCE;
|
|
272
|
-
}
|
|
273
|
-
hasData(proto) {
|
|
274
|
-
return proto && proto === this.proto;
|
|
275
|
-
}
|
|
276
|
-
clearData(proto) {
|
|
277
|
-
if (this.hasData(proto)) {
|
|
278
|
-
this.proto = undefined;
|
|
279
|
-
this.data = undefined;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
getData(proto) {
|
|
283
|
-
if (this.hasData(proto)) {
|
|
284
|
-
return this.data;
|
|
285
|
-
}
|
|
286
|
-
return undefined;
|
|
287
|
-
}
|
|
288
|
-
setData(data, proto) {
|
|
289
|
-
if (proto) {
|
|
290
|
-
this.data = data;
|
|
291
|
-
this.proto = proto;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
LocalSelectionTransfer.INSTANCE = new LocalSelectionTransfer();
|
|
296
|
-
function getPanelData() {
|
|
297
|
-
const panelTransfer = LocalSelectionTransfer.getInstance();
|
|
298
|
-
const isPanelEvent = panelTransfer.hasData(PanelTransfer.prototype);
|
|
299
|
-
if (!isPanelEvent) {
|
|
300
|
-
return undefined;
|
|
301
|
-
}
|
|
302
|
-
return panelTransfer.getData(PanelTransfer.prototype)[0];
|
|
303
|
-
}
|
|
304
|
-
function getPaneData() {
|
|
305
|
-
const paneTransfer = LocalSelectionTransfer.getInstance();
|
|
306
|
-
const isPanelEvent = paneTransfer.hasData(PaneTransfer.prototype);
|
|
307
|
-
if (!isPanelEvent) {
|
|
308
|
-
return undefined;
|
|
309
|
-
}
|
|
310
|
-
return paneTransfer.getData(PaneTransfer.prototype)[0];
|
|
311
|
-
}
|
|
312
|
-
|
|
313
224
|
class SplitviewApi {
|
|
314
225
|
constructor(component) {
|
|
315
226
|
this.component = component;
|
|
@@ -329,6 +240,9 @@ class SplitviewApi {
|
|
|
329
240
|
get length() {
|
|
330
241
|
return this.component.length;
|
|
331
242
|
}
|
|
243
|
+
get orientation() {
|
|
244
|
+
return this.component.orientation;
|
|
245
|
+
}
|
|
332
246
|
get onDidLayoutChange() {
|
|
333
247
|
return this.component.onDidLayoutChange;
|
|
334
248
|
}
|
|
@@ -338,9 +252,6 @@ class SplitviewApi {
|
|
|
338
252
|
get onDidRemoveView() {
|
|
339
253
|
return this.component.onDidRemoveView;
|
|
340
254
|
}
|
|
341
|
-
get orientation() {
|
|
342
|
-
return this.component.orientation;
|
|
343
|
-
}
|
|
344
255
|
updateOptions(options) {
|
|
345
256
|
this.component.updateOptions(options);
|
|
346
257
|
}
|
|
@@ -385,18 +296,18 @@ class PaneviewApi {
|
|
|
385
296
|
constructor(component) {
|
|
386
297
|
this.component = component;
|
|
387
298
|
}
|
|
388
|
-
get width() {
|
|
389
|
-
return this.component.width;
|
|
390
|
-
}
|
|
391
|
-
get height() {
|
|
392
|
-
return this.component.height;
|
|
393
|
-
}
|
|
394
299
|
get minimumSize() {
|
|
395
300
|
return this.component.minimumSize;
|
|
396
301
|
}
|
|
397
302
|
get maximumSize() {
|
|
398
303
|
return this.component.maximumSize;
|
|
399
304
|
}
|
|
305
|
+
get height() {
|
|
306
|
+
return this.component.height;
|
|
307
|
+
}
|
|
308
|
+
get width() {
|
|
309
|
+
return this.component.width;
|
|
310
|
+
}
|
|
400
311
|
get onDidLayoutChange() {
|
|
401
312
|
return this.component.onDidLayoutChange;
|
|
402
313
|
}
|
|
@@ -436,7 +347,7 @@ class PaneviewApi {
|
|
|
436
347
|
this.component.layout(width, height);
|
|
437
348
|
}
|
|
438
349
|
addPanel(options) {
|
|
439
|
-
|
|
350
|
+
this.component.addPanel(options);
|
|
440
351
|
}
|
|
441
352
|
resizeToFit() {
|
|
442
353
|
this.component.resizeToFit();
|
|
@@ -452,12 +363,6 @@ class GridviewApi {
|
|
|
452
363
|
constructor(component) {
|
|
453
364
|
this.component = component;
|
|
454
365
|
}
|
|
455
|
-
get width() {
|
|
456
|
-
return this.component.width;
|
|
457
|
-
}
|
|
458
|
-
get height() {
|
|
459
|
-
return this.component.height;
|
|
460
|
-
}
|
|
461
366
|
get minimumHeight() {
|
|
462
367
|
return this.component.minimumHeight;
|
|
463
368
|
}
|
|
@@ -470,12 +375,27 @@ class GridviewApi {
|
|
|
470
375
|
get maximumWidth() {
|
|
471
376
|
return this.component.maximumWidth;
|
|
472
377
|
}
|
|
473
|
-
get
|
|
474
|
-
return this.component.
|
|
378
|
+
get width() {
|
|
379
|
+
return this.component.width;
|
|
380
|
+
}
|
|
381
|
+
get height() {
|
|
382
|
+
return this.component.height;
|
|
475
383
|
}
|
|
476
384
|
get onDidLayoutChange() {
|
|
477
385
|
return this.component.onDidLayoutChange;
|
|
478
386
|
}
|
|
387
|
+
get onDidAddGroup() {
|
|
388
|
+
return this.component.onDidAddGroup;
|
|
389
|
+
}
|
|
390
|
+
get onDidRemoveGroup() {
|
|
391
|
+
return this.component.onDidRemoveGroup;
|
|
392
|
+
}
|
|
393
|
+
get onDidActiveGroupChange() {
|
|
394
|
+
return this.component.onDidActiveGroupChange;
|
|
395
|
+
}
|
|
396
|
+
get onDidLayoutFromJSON() {
|
|
397
|
+
return this.component.onDidLayoutFromJSON;
|
|
398
|
+
}
|
|
479
399
|
get panels() {
|
|
480
400
|
return this.component.groups;
|
|
481
401
|
}
|
|
@@ -550,8 +470,26 @@ class DockviewApi {
|
|
|
550
470
|
get totalPanels() {
|
|
551
471
|
return this.component.totalPanels;
|
|
552
472
|
}
|
|
553
|
-
get
|
|
554
|
-
return this.component.
|
|
473
|
+
get onDidActiveGroupChange() {
|
|
474
|
+
return this.component.onDidActiveGroupChange;
|
|
475
|
+
}
|
|
476
|
+
get onDidAddGroup() {
|
|
477
|
+
return this.component.onDidAddGroup;
|
|
478
|
+
}
|
|
479
|
+
get onDidRemoveGroup() {
|
|
480
|
+
return this.component.onDidRemoveGroup;
|
|
481
|
+
}
|
|
482
|
+
get onDidActivePanelChange() {
|
|
483
|
+
return this.component.onDidActivePanelChange;
|
|
484
|
+
}
|
|
485
|
+
get onDidAddPanel() {
|
|
486
|
+
return this.component.onDidAddPanel;
|
|
487
|
+
}
|
|
488
|
+
get onDidRemovePanel() {
|
|
489
|
+
return this.component.onDidRemovePanel;
|
|
490
|
+
}
|
|
491
|
+
get onDidLayoutfromJSON() {
|
|
492
|
+
return this.component.onDidLayoutfromJSON;
|
|
555
493
|
}
|
|
556
494
|
get onDidLayoutChange() {
|
|
557
495
|
return this.component.onDidLayoutChange;
|
|
@@ -580,18 +518,12 @@ class DockviewApi {
|
|
|
580
518
|
getPanel(id) {
|
|
581
519
|
return this.component.getGroupPanel(id);
|
|
582
520
|
}
|
|
583
|
-
setActivePanel(panel) {
|
|
584
|
-
this.component.setActivePanel(panel);
|
|
585
|
-
}
|
|
586
521
|
layout(width, height, force = false) {
|
|
587
522
|
this.component.layout(width, height, force);
|
|
588
523
|
}
|
|
589
524
|
addPanel(options) {
|
|
590
525
|
return this.component.addPanel(options);
|
|
591
526
|
}
|
|
592
|
-
removePanel(panel) {
|
|
593
|
-
this.component.removePanel(panel);
|
|
594
|
-
}
|
|
595
527
|
addEmptyGroup(options) {
|
|
596
528
|
this.component.addEmptyGroup(options);
|
|
597
529
|
}
|
|
@@ -621,6 +553,46 @@ class DockviewApi {
|
|
|
621
553
|
}
|
|
622
554
|
}
|
|
623
555
|
|
|
556
|
+
var Disposable;
|
|
557
|
+
(function (Disposable) {
|
|
558
|
+
Disposable.NONE = {
|
|
559
|
+
dispose: () => {
|
|
560
|
+
// noop
|
|
561
|
+
},
|
|
562
|
+
};
|
|
563
|
+
})(Disposable || (Disposable = {}));
|
|
564
|
+
class CompositeDisposable {
|
|
565
|
+
constructor(...args) {
|
|
566
|
+
this.disposables = args;
|
|
567
|
+
}
|
|
568
|
+
static from(...args) {
|
|
569
|
+
return new CompositeDisposable(...args);
|
|
570
|
+
}
|
|
571
|
+
addDisposables(...args) {
|
|
572
|
+
args.forEach((arg) => this.disposables.push(arg));
|
|
573
|
+
}
|
|
574
|
+
dispose() {
|
|
575
|
+
this.disposables.forEach((arg) => arg.dispose());
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
class MutableDisposable {
|
|
579
|
+
constructor() {
|
|
580
|
+
this._disposable = Disposable.NONE;
|
|
581
|
+
}
|
|
582
|
+
set value(disposable) {
|
|
583
|
+
if (this._disposable) {
|
|
584
|
+
this._disposable.dispose();
|
|
585
|
+
}
|
|
586
|
+
this._disposable = disposable;
|
|
587
|
+
}
|
|
588
|
+
dispose() {
|
|
589
|
+
if (this._disposable) {
|
|
590
|
+
this._disposable.dispose();
|
|
591
|
+
this._disposable = Disposable.NONE;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
624
596
|
function watchElementResize(element, cb) {
|
|
625
597
|
const observer = new ResizeObserver((entires) => {
|
|
626
598
|
const firstEntry = entires[0];
|
|
@@ -1566,13 +1538,13 @@ class Splitview {
|
|
|
1566
1538
|
this._onDidSashEnd.dispose();
|
|
1567
1539
|
this._onDidAddView.dispose();
|
|
1568
1540
|
this._onDidRemoveView.dispose();
|
|
1569
|
-
this.element.remove();
|
|
1570
1541
|
for (let i = 0; i < this.element.children.length; i++) {
|
|
1571
1542
|
if (this.element.children.item(i) === this.element) {
|
|
1572
1543
|
this.element.removeChild(this.element);
|
|
1573
1544
|
break;
|
|
1574
1545
|
}
|
|
1575
1546
|
}
|
|
1547
|
+
this.element.remove();
|
|
1576
1548
|
}
|
|
1577
1549
|
}
|
|
1578
1550
|
|
|
@@ -1595,7 +1567,7 @@ class Paneview extends CompositeDisposable {
|
|
|
1595
1567
|
});
|
|
1596
1568
|
// if we've added views from the descriptor we need to
|
|
1597
1569
|
// add the panes to our Pane array and setup animation
|
|
1598
|
-
this.getPanes().forEach((pane
|
|
1570
|
+
this.getPanes().forEach((pane) => {
|
|
1599
1571
|
const disposable = new CompositeDisposable(pane.onDidChangeExpansionState(() => {
|
|
1600
1572
|
this.setupAnimation();
|
|
1601
1573
|
this._onDidChange.fire(undefined);
|
|
@@ -1611,7 +1583,7 @@ class Paneview extends CompositeDisposable {
|
|
|
1611
1583
|
this.paneItems.push(paneItem);
|
|
1612
1584
|
pane.orthogonalSize = this.splitview.orthogonalSize;
|
|
1613
1585
|
});
|
|
1614
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
1586
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
1615
1587
|
this._onDidChange.fire(undefined);
|
|
1616
1588
|
}), this.splitview.onDidAddView(() => {
|
|
1617
1589
|
this._onDidChange.fire();
|
|
@@ -1663,17 +1635,20 @@ class Paneview extends CompositeDisposable {
|
|
|
1663
1635
|
getPanes() {
|
|
1664
1636
|
return this.splitview.getViews();
|
|
1665
1637
|
}
|
|
1666
|
-
removePane(index) {
|
|
1638
|
+
removePane(index, options = { skipDispose: false }) {
|
|
1667
1639
|
const paneItem = this.paneItems.splice(index, 1)[0];
|
|
1668
1640
|
this.splitview.removeView(index);
|
|
1669
|
-
|
|
1641
|
+
if (!options.skipDispose) {
|
|
1642
|
+
paneItem.disposable.dispose();
|
|
1643
|
+
paneItem.pane.dispose();
|
|
1644
|
+
}
|
|
1670
1645
|
return paneItem;
|
|
1671
1646
|
}
|
|
1672
1647
|
moveView(from, to) {
|
|
1673
1648
|
if (from === to) {
|
|
1674
1649
|
return;
|
|
1675
1650
|
}
|
|
1676
|
-
const view = this.removePane(from);
|
|
1651
|
+
const view = this.removePane(from, { skipDispose: true });
|
|
1677
1652
|
this.skipAnimation = true;
|
|
1678
1653
|
try {
|
|
1679
1654
|
this.addPane(view.pane, view.pane.size, to, false);
|
|
@@ -1701,15 +1676,16 @@ class Paneview extends CompositeDisposable {
|
|
|
1701
1676
|
}
|
|
1702
1677
|
dispose() {
|
|
1703
1678
|
super.dispose();
|
|
1704
|
-
this.splitview.dispose();
|
|
1705
1679
|
if (this.animationTimer) {
|
|
1706
1680
|
clearTimeout(this.animationTimer);
|
|
1707
1681
|
this.animationTimer = undefined;
|
|
1708
1682
|
}
|
|
1709
1683
|
this.paneItems.forEach((paneItem) => {
|
|
1710
1684
|
paneItem.disposable.dispose();
|
|
1685
|
+
paneItem.pane.dispose();
|
|
1711
1686
|
});
|
|
1712
1687
|
this.paneItems = [];
|
|
1688
|
+
this.splitview.dispose();
|
|
1713
1689
|
this.element.remove();
|
|
1714
1690
|
}
|
|
1715
1691
|
}
|
|
@@ -1772,8 +1748,8 @@ class Droptarget extends CompositeDisposable {
|
|
|
1772
1748
|
this.options = options;
|
|
1773
1749
|
this._onDrop = new Emitter();
|
|
1774
1750
|
this.onDrop = this._onDrop.event;
|
|
1775
|
-
this.addDisposables(new DragAndDropObserver(this.element, {
|
|
1776
|
-
onDragEnter: (
|
|
1751
|
+
this.addDisposables(this._onDrop, new DragAndDropObserver(this.element, {
|
|
1752
|
+
onDragEnter: () => undefined,
|
|
1777
1753
|
onDragOver: (e) => {
|
|
1778
1754
|
if (isBooleanValue(this.options.canDisplayOverlay)) {
|
|
1779
1755
|
if (!this.options.canDisplayOverlay) {
|
|
@@ -1808,56 +1784,16 @@ class Droptarget extends CompositeDisposable {
|
|
|
1808
1784
|
const y = e.offsetY;
|
|
1809
1785
|
const xp = (100 * x) / width;
|
|
1810
1786
|
const yp = (100 * y) / height;
|
|
1811
|
-
|
|
1812
|
-
let isLeft = false;
|
|
1813
|
-
let isTop = false;
|
|
1814
|
-
let isBottom = false;
|
|
1815
|
-
switch (this.options.validOverlays) {
|
|
1816
|
-
case 'all':
|
|
1817
|
-
isRight = xp > 80;
|
|
1818
|
-
isLeft = xp < 20;
|
|
1819
|
-
isTop = !isRight && !isLeft && yp < 20;
|
|
1820
|
-
isBottom = !isRight && !isLeft && yp > 80;
|
|
1821
|
-
break;
|
|
1822
|
-
case 'vertical':
|
|
1823
|
-
isTop = yp < 50;
|
|
1824
|
-
isBottom = yp >= 50;
|
|
1825
|
-
break;
|
|
1826
|
-
case 'horizontal':
|
|
1827
|
-
isLeft = xp < 50;
|
|
1828
|
-
isRight = xp >= 50;
|
|
1829
|
-
break;
|
|
1830
|
-
}
|
|
1787
|
+
const quadrant = this.calculateQuadrant(this.options.validOverlays, xp, yp);
|
|
1831
1788
|
const isSmallX = width < 100;
|
|
1832
1789
|
const isSmallY = height < 100;
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1836
|
-
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1837
|
-
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1838
|
-
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1839
|
-
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1840
|
-
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1841
|
-
if (isRight) {
|
|
1842
|
-
this._state = exports.Position.Right;
|
|
1843
|
-
}
|
|
1844
|
-
else if (isLeft) {
|
|
1845
|
-
this._state = exports.Position.Left;
|
|
1846
|
-
}
|
|
1847
|
-
else if (isTop) {
|
|
1848
|
-
this._state = exports.Position.Top;
|
|
1849
|
-
}
|
|
1850
|
-
else if (isBottom) {
|
|
1851
|
-
this._state = exports.Position.Bottom;
|
|
1852
|
-
}
|
|
1853
|
-
else {
|
|
1854
|
-
this._state = exports.Position.Center;
|
|
1855
|
-
}
|
|
1790
|
+
this.toggleClasses(quadrant, isSmallX, isSmallY);
|
|
1791
|
+
this.setState(quadrant);
|
|
1856
1792
|
},
|
|
1857
|
-
onDragLeave: (
|
|
1793
|
+
onDragLeave: () => {
|
|
1858
1794
|
this.removeDropTarget();
|
|
1859
1795
|
},
|
|
1860
|
-
onDragEnd: (
|
|
1796
|
+
onDragEnd: () => {
|
|
1861
1797
|
this.removeDropTarget();
|
|
1862
1798
|
},
|
|
1863
1799
|
onDrop: (e) => {
|
|
@@ -1881,9 +1817,73 @@ class Droptarget extends CompositeDisposable {
|
|
|
1881
1817
|
this.options.canDisplayOverlay = value;
|
|
1882
1818
|
}
|
|
1883
1819
|
dispose() {
|
|
1884
|
-
this._onDrop.dispose();
|
|
1885
1820
|
this.removeDropTarget();
|
|
1886
1821
|
}
|
|
1822
|
+
toggleClasses(quadrant, isSmallX, isSmallY) {
|
|
1823
|
+
if (!this.overlay) {
|
|
1824
|
+
return;
|
|
1825
|
+
}
|
|
1826
|
+
const isLeft = quadrant === 'left';
|
|
1827
|
+
const isRight = quadrant === 'right';
|
|
1828
|
+
const isTop = quadrant === 'top';
|
|
1829
|
+
const isBottom = quadrant === 'bottom';
|
|
1830
|
+
toggleClass(this.overlay, 'right', !isSmallX && isRight);
|
|
1831
|
+
toggleClass(this.overlay, 'left', !isSmallX && isLeft);
|
|
1832
|
+
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1833
|
+
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1834
|
+
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1835
|
+
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1836
|
+
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1837
|
+
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1838
|
+
}
|
|
1839
|
+
setState(quadrant) {
|
|
1840
|
+
switch (quadrant) {
|
|
1841
|
+
case 'top':
|
|
1842
|
+
this._state = exports.Position.Top;
|
|
1843
|
+
break;
|
|
1844
|
+
case 'left':
|
|
1845
|
+
this._state = exports.Position.Left;
|
|
1846
|
+
break;
|
|
1847
|
+
case 'bottom':
|
|
1848
|
+
this._state = exports.Position.Bottom;
|
|
1849
|
+
break;
|
|
1850
|
+
case 'right':
|
|
1851
|
+
this._state = exports.Position.Right;
|
|
1852
|
+
break;
|
|
1853
|
+
default:
|
|
1854
|
+
this._state = exports.Position.Center;
|
|
1855
|
+
break;
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
calculateQuadrant(overlayType, xp, yp) {
|
|
1859
|
+
switch (overlayType) {
|
|
1860
|
+
case 'all':
|
|
1861
|
+
if (xp < 20) {
|
|
1862
|
+
return 'left';
|
|
1863
|
+
}
|
|
1864
|
+
if (xp > 80) {
|
|
1865
|
+
return 'right';
|
|
1866
|
+
}
|
|
1867
|
+
if (yp < 20) {
|
|
1868
|
+
return 'top';
|
|
1869
|
+
}
|
|
1870
|
+
if (yp > 80) {
|
|
1871
|
+
return 'bottom';
|
|
1872
|
+
}
|
|
1873
|
+
break;
|
|
1874
|
+
case 'vertical':
|
|
1875
|
+
if (yp < 50) {
|
|
1876
|
+
return 'top';
|
|
1877
|
+
}
|
|
1878
|
+
return 'bottom';
|
|
1879
|
+
case 'horizontal':
|
|
1880
|
+
if (xp < 50) {
|
|
1881
|
+
return 'left';
|
|
1882
|
+
}
|
|
1883
|
+
return 'right';
|
|
1884
|
+
}
|
|
1885
|
+
return null;
|
|
1886
|
+
}
|
|
1887
1887
|
removeDropTarget() {
|
|
1888
1888
|
if (this.target) {
|
|
1889
1889
|
this._state = undefined;
|
|
@@ -1986,6 +1986,7 @@ class LeafNode {
|
|
|
1986
1986
|
this.view.layout(this.width, this.height);
|
|
1987
1987
|
}
|
|
1988
1988
|
dispose() {
|
|
1989
|
+
this._onDidChange.dispose();
|
|
1989
1990
|
this._disposable.dispose();
|
|
1990
1991
|
}
|
|
1991
1992
|
}
|
|
@@ -2003,7 +2004,7 @@ class BranchNode extends CompositeDisposable {
|
|
|
2003
2004
|
this.children = [];
|
|
2004
2005
|
this._onDidChange = new Emitter();
|
|
2005
2006
|
this.onDidChange = this._onDidChange.event;
|
|
2006
|
-
this._childrenDisposable =
|
|
2007
|
+
this._childrenDisposable = Disposable.NONE;
|
|
2007
2008
|
this._orthogonalSize = orthogonalSize;
|
|
2008
2009
|
this._size = size;
|
|
2009
2010
|
this.element = document.createElement('div');
|
|
@@ -2028,7 +2029,7 @@ class BranchNode extends CompositeDisposable {
|
|
|
2028
2029
|
: true,
|
|
2029
2030
|
};
|
|
2030
2031
|
}),
|
|
2031
|
-
size: this.
|
|
2032
|
+
size: this.size,
|
|
2032
2033
|
};
|
|
2033
2034
|
this.children = childDescriptors.map((c) => c.node);
|
|
2034
2035
|
this.splitview = new Splitview(this.element, {
|
|
@@ -2037,7 +2038,7 @@ class BranchNode extends CompositeDisposable {
|
|
|
2037
2038
|
proportionalLayout,
|
|
2038
2039
|
});
|
|
2039
2040
|
}
|
|
2040
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
2041
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
2041
2042
|
this._onDidChange.fire(undefined);
|
|
2042
2043
|
}));
|
|
2043
2044
|
this.setupChildrenEvents();
|
|
@@ -2189,7 +2190,7 @@ class BranchNode extends CompositeDisposable {
|
|
|
2189
2190
|
}
|
|
2190
2191
|
setupChildrenEvents() {
|
|
2191
2192
|
this._childrenDisposable.dispose();
|
|
2192
|
-
this._childrenDisposable = exports.Event.any(...this.children.map((c) => c.onDidChange))((
|
|
2193
|
+
this._childrenDisposable = exports.Event.any(...this.children.map((c) => c.onDidChange))(() => {
|
|
2193
2194
|
/**
|
|
2194
2195
|
* indicate a change has occured to allows any re-rendering but don't bubble
|
|
2195
2196
|
* event because that was specific to this branch
|
|
@@ -2209,6 +2210,15 @@ class BranchNode extends CompositeDisposable {
|
|
|
2209
2210
|
* Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
|
|
2210
2211
|
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
|
|
2211
2212
|
*--------------------------------------------------------------------------------------------*/
|
|
2213
|
+
function findLeaf(candiateNode, last) {
|
|
2214
|
+
if (candiateNode instanceof LeafNode) {
|
|
2215
|
+
return candiateNode;
|
|
2216
|
+
}
|
|
2217
|
+
if (candiateNode instanceof BranchNode) {
|
|
2218
|
+
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2219
|
+
}
|
|
2220
|
+
throw new Error('invalid node');
|
|
2221
|
+
}
|
|
2212
2222
|
function flipNode(node, size, orthogonalSize) {
|
|
2213
2223
|
if (node instanceof BranchNode) {
|
|
2214
2224
|
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize);
|
|
@@ -2340,6 +2350,7 @@ class Gridview {
|
|
|
2340
2350
|
this.disposable.dispose();
|
|
2341
2351
|
this._onDidChange.dispose();
|
|
2342
2352
|
this.root.dispose();
|
|
2353
|
+
this.element.remove();
|
|
2343
2354
|
}
|
|
2344
2355
|
clear() {
|
|
2345
2356
|
const orientation = this.root.orientation;
|
|
@@ -2347,13 +2358,13 @@ class Gridview {
|
|
|
2347
2358
|
}
|
|
2348
2359
|
deserialize(json, deserializer) {
|
|
2349
2360
|
const orientation = json.orientation;
|
|
2350
|
-
const height = json.height;
|
|
2361
|
+
const height = orientation === exports.Orientation.VERTICAL ? json.height : json.width;
|
|
2351
2362
|
this._deserialize(json.root, orientation, deserializer, height);
|
|
2352
2363
|
}
|
|
2353
2364
|
_deserialize(root, orientation, deserializer, orthogonalSize) {
|
|
2354
|
-
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize);
|
|
2365
|
+
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize, true);
|
|
2355
2366
|
}
|
|
2356
|
-
_deserializeNode(node, orientation, deserializer, orthogonalSize) {
|
|
2367
|
+
_deserializeNode(node, orientation, deserializer, orthogonalSize, isRoot = false) {
|
|
2357
2368
|
let result;
|
|
2358
2369
|
if (node.type === 'branch') {
|
|
2359
2370
|
const serializedChildren = node.data;
|
|
@@ -2363,7 +2374,9 @@ class Gridview {
|
|
|
2363
2374
|
visible: serializedChild.visible,
|
|
2364
2375
|
};
|
|
2365
2376
|
});
|
|
2366
|
-
|
|
2377
|
+
// HORIZONTAL => height=orthogonalsize width=size
|
|
2378
|
+
// VERTICAL => height=size width=orthogonalsize
|
|
2379
|
+
result = new BranchNode(orientation, this.proportionalLayout, this.styles, isRoot ? orthogonalSize : node.size, isRoot ? node.size : orthogonalSize, children);
|
|
2367
2380
|
}
|
|
2368
2381
|
else {
|
|
2369
2382
|
result = new LeafNode(deserializer.fromJSON(node), orientation, orthogonalSize, node.size);
|
|
@@ -2424,15 +2437,6 @@ class Gridview {
|
|
|
2424
2437
|
if (!(node instanceof LeafNode)) {
|
|
2425
2438
|
throw new Error('invalid location');
|
|
2426
2439
|
}
|
|
2427
|
-
const findLeaf = (candiateNode, last) => {
|
|
2428
|
-
if (candiateNode instanceof LeafNode) {
|
|
2429
|
-
return candiateNode;
|
|
2430
|
-
}
|
|
2431
|
-
if (candiateNode instanceof BranchNode) {
|
|
2432
|
-
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2433
|
-
}
|
|
2434
|
-
throw new Error('invalid node');
|
|
2435
|
-
};
|
|
2436
2440
|
for (let i = path.length - 1; i > -1; i--) {
|
|
2437
2441
|
const n = path[i];
|
|
2438
2442
|
const l = location[i] || 0;
|
|
@@ -2534,9 +2538,9 @@ class Gridview {
|
|
|
2534
2538
|
if (parent.children.length > 1) {
|
|
2535
2539
|
return node.view;
|
|
2536
2540
|
}
|
|
2541
|
+
const sibling = parent.children[0];
|
|
2537
2542
|
if (pathToParent.length === 0) {
|
|
2538
2543
|
// parent is root
|
|
2539
|
-
const sibling = parent.children[0];
|
|
2540
2544
|
if (sibling instanceof LeafNode) {
|
|
2541
2545
|
return node.view;
|
|
2542
2546
|
}
|
|
@@ -2547,10 +2551,9 @@ class Gridview {
|
|
|
2547
2551
|
}
|
|
2548
2552
|
const [grandParent, ..._] = [...pathToParent].reverse();
|
|
2549
2553
|
const [parentIndex, ...__] = [...rest].reverse();
|
|
2550
|
-
const sibling = parent.children[0];
|
|
2551
2554
|
const isSiblingVisible = parent.isChildVisible(0);
|
|
2552
2555
|
parent.removeChild(0, sizing);
|
|
2553
|
-
const sizes = grandParent.children.map((
|
|
2556
|
+
const sizes = grandParent.children.map((_size, i) => grandParent.getChildSize(i));
|
|
2554
2557
|
grandParent.removeChild(parentIndex, sizing);
|
|
2555
2558
|
if (sibling instanceof BranchNode) {
|
|
2556
2559
|
sizes.splice(parentIndex, 1, ...sibling.children.map((c) => c.size));
|
|
@@ -2594,31 +2597,6 @@ class Gridview {
|
|
|
2594
2597
|
}
|
|
2595
2598
|
}
|
|
2596
2599
|
|
|
2597
|
-
/*! *****************************************************************************
|
|
2598
|
-
Copyright (c) Microsoft Corporation.
|
|
2599
|
-
|
|
2600
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2601
|
-
purpose with or without fee is hereby granted.
|
|
2602
|
-
|
|
2603
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2604
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2605
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2606
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2607
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2608
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2609
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2610
|
-
***************************************************************************** */
|
|
2611
|
-
|
|
2612
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
2613
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2614
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2615
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2616
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2617
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2618
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2619
|
-
});
|
|
2620
|
-
}
|
|
2621
|
-
|
|
2622
2600
|
class ContentContainer extends CompositeDisposable {
|
|
2623
2601
|
constructor() {
|
|
2624
2602
|
super();
|
|
@@ -2630,6 +2608,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
2630
2608
|
this._element = document.createElement('div');
|
|
2631
2609
|
this._element.className = 'content-container';
|
|
2632
2610
|
this._element.tabIndex = -1;
|
|
2611
|
+
this.addDisposables(this._onDidFocus, this._onDidBlur);
|
|
2633
2612
|
// for hosted containers
|
|
2634
2613
|
// 1) register a drop target on the host
|
|
2635
2614
|
// 2) register window dragStart events to disable pointer events
|
|
@@ -2673,7 +2652,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
2673
2652
|
}
|
|
2674
2653
|
this.disposable.value = disposable;
|
|
2675
2654
|
}
|
|
2676
|
-
layout(
|
|
2655
|
+
layout(_width, _height) {
|
|
2677
2656
|
// noop
|
|
2678
2657
|
}
|
|
2679
2658
|
closePanel() {
|
|
@@ -2696,6 +2675,41 @@ var DockviewDropTargets;
|
|
|
2696
2675
|
DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
|
|
2697
2676
|
})(DockviewDropTargets || (DockviewDropTargets = {}));
|
|
2698
2677
|
|
|
2678
|
+
class DragHandler extends CompositeDisposable {
|
|
2679
|
+
constructor(el) {
|
|
2680
|
+
super();
|
|
2681
|
+
this.el = el;
|
|
2682
|
+
this.disposable = new MutableDisposable();
|
|
2683
|
+
this._onDragStart = new Emitter();
|
|
2684
|
+
this.onDragStart = this._onDragStart.event;
|
|
2685
|
+
this.iframes = [];
|
|
2686
|
+
this.configure();
|
|
2687
|
+
}
|
|
2688
|
+
configure() {
|
|
2689
|
+
this.addDisposables(this._onDragStart, addDisposableListener(this.el, 'dragstart', (event) => {
|
|
2690
|
+
this.iframes = [
|
|
2691
|
+
...getElementsByTagName('iframe'),
|
|
2692
|
+
...getElementsByTagName('webview'),
|
|
2693
|
+
];
|
|
2694
|
+
for (const iframe of this.iframes) {
|
|
2695
|
+
iframe.style.pointerEvents = 'none';
|
|
2696
|
+
}
|
|
2697
|
+
this.el.classList.add('dragged');
|
|
2698
|
+
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
2699
|
+
this.disposable.value = this.getData();
|
|
2700
|
+
if (event.dataTransfer) {
|
|
2701
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
2702
|
+
}
|
|
2703
|
+
}), addDisposableListener(this.el, 'dragend', () => {
|
|
2704
|
+
for (const iframe of this.iframes) {
|
|
2705
|
+
iframe.style.pointerEvents = 'auto';
|
|
2706
|
+
}
|
|
2707
|
+
this.iframes = [];
|
|
2708
|
+
this.disposable.dispose();
|
|
2709
|
+
}));
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2699
2713
|
exports.MouseEventKind = void 0;
|
|
2700
2714
|
(function (MouseEventKind) {
|
|
2701
2715
|
MouseEventKind["CLICK"] = "CLICK";
|
|
@@ -2705,42 +2719,34 @@ class Tab$1 extends CompositeDisposable {
|
|
|
2705
2719
|
constructor(panelId, accessor, group) {
|
|
2706
2720
|
super();
|
|
2707
2721
|
this.panelId = panelId;
|
|
2708
|
-
this.accessor = accessor;
|
|
2709
2722
|
this.group = group;
|
|
2710
2723
|
this._onChanged = new Emitter();
|
|
2711
2724
|
this.onChanged = this._onChanged.event;
|
|
2712
2725
|
this._onDropped = new Emitter();
|
|
2713
2726
|
this.onDrop = this._onDropped.event;
|
|
2714
|
-
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2715
|
-
this.iframes = [];
|
|
2716
2727
|
this.addDisposables(this._onChanged, this._onDropped);
|
|
2717
2728
|
this._element = document.createElement('div');
|
|
2718
2729
|
this._element.className = 'tab';
|
|
2719
2730
|
this._element.tabIndex = 0;
|
|
2720
2731
|
this._element.draggable = true;
|
|
2721
|
-
this.addDisposables(
|
|
2722
|
-
|
|
2723
|
-
...
|
|
2724
|
-
|
|
2725
|
-
];
|
|
2726
|
-
for (const iframe of this.iframes) {
|
|
2727
|
-
iframe.style.pointerEvents = 'none';
|
|
2732
|
+
this.addDisposables(new (class Handler extends DragHandler {
|
|
2733
|
+
constructor() {
|
|
2734
|
+
super(...arguments);
|
|
2735
|
+
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2728
2736
|
}
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2737
|
+
getData() {
|
|
2738
|
+
this.panelTransfer.setData([new PanelTransfer(accessor.id, group.id, panelId)], PanelTransfer.prototype);
|
|
2739
|
+
return {
|
|
2740
|
+
dispose: () => {
|
|
2741
|
+
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
2742
|
+
},
|
|
2743
|
+
};
|
|
2736
2744
|
}
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
iframe.style.pointerEvents = 'auto';
|
|
2745
|
+
dispose() {
|
|
2746
|
+
//
|
|
2740
2747
|
}
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
}), addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2748
|
+
})(this._element));
|
|
2749
|
+
this.addDisposables(addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2744
2750
|
if (event.defaultPrevented) {
|
|
2745
2751
|
return;
|
|
2746
2752
|
}
|
|
@@ -2942,12 +2948,10 @@ class TabsContainer extends CompositeDisposable {
|
|
|
2942
2948
|
if (!isLeftClick || event.event.defaultPrevented) {
|
|
2943
2949
|
return;
|
|
2944
2950
|
}
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
});
|
|
2950
|
-
break;
|
|
2951
|
+
if (event.kind === exports.MouseEventKind.CLICK) {
|
|
2952
|
+
this.group.model.openPanel(panel, {
|
|
2953
|
+
skipFocus: alreadyFocused,
|
|
2954
|
+
});
|
|
2951
2955
|
}
|
|
2952
2956
|
}), tabToAdd.onDrop((event) => {
|
|
2953
2957
|
this._onDrop.fire({
|
|
@@ -2976,7 +2980,6 @@ exports.GroupChangeKind2 = void 0;
|
|
|
2976
2980
|
GroupChangeKind2["ADD_PANEL"] = "ADD_PANEL";
|
|
2977
2981
|
GroupChangeKind2["REMOVE_PANEL"] = "REMOVE_PANEL";
|
|
2978
2982
|
GroupChangeKind2["PANEL_ACTIVE"] = "PANEL_ACTIVE";
|
|
2979
|
-
GroupChangeKind2["GROUP_ACTIVE"] = "GROUP_ACTIVE";
|
|
2980
2983
|
})(exports.GroupChangeKind2 || (exports.GroupChangeKind2 = {}));
|
|
2981
2984
|
class Groupview extends CompositeDisposable {
|
|
2982
2985
|
constructor(container, accessor, id, options, parent) {
|
|
@@ -2997,15 +3000,10 @@ class Groupview extends CompositeDisposable {
|
|
|
2997
3000
|
this.onMove = this._onMove.event;
|
|
2998
3001
|
this._onDidGroupChange = new Emitter();
|
|
2999
3002
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
3000
|
-
this.
|
|
3001
|
-
|
|
3002
|
-
return false;
|
|
3003
|
-
}
|
|
3004
|
-
this.doClose(panel);
|
|
3005
|
-
return true;
|
|
3006
|
-
});
|
|
3003
|
+
this._onDidDrop = new Emitter();
|
|
3004
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
3007
3005
|
this.container.classList.add('groupview');
|
|
3008
|
-
this.addDisposables(this._onMove, this._onDidGroupChange);
|
|
3006
|
+
this.addDisposables(this._onMove, this._onDidGroupChange, this._onDidChange, this._onDidDrop);
|
|
3009
3007
|
this.tabsContainer = new TabsContainer(this.accessor, this.parent, {
|
|
3010
3008
|
tabHeight: options.tabHeight,
|
|
3011
3009
|
});
|
|
@@ -3069,6 +3067,9 @@ class Groupview extends CompositeDisposable {
|
|
|
3069
3067
|
get maximumWidth() {
|
|
3070
3068
|
return Number.MAX_SAFE_INTEGER;
|
|
3071
3069
|
}
|
|
3070
|
+
get hasWatermark() {
|
|
3071
|
+
return !!(this.watermark && this.container.contains(this.watermark.element));
|
|
3072
|
+
}
|
|
3072
3073
|
initialize() {
|
|
3073
3074
|
var _a, _b;
|
|
3074
3075
|
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.panels) {
|
|
@@ -3147,10 +3148,10 @@ class Groupview extends CompositeDisposable {
|
|
|
3147
3148
|
containsPanel(panel) {
|
|
3148
3149
|
return this.panels.includes(panel);
|
|
3149
3150
|
}
|
|
3150
|
-
init(
|
|
3151
|
+
init(_params) {
|
|
3151
3152
|
//noop
|
|
3152
3153
|
}
|
|
3153
|
-
update(
|
|
3154
|
+
update(_params) {
|
|
3154
3155
|
//noop
|
|
3155
3156
|
}
|
|
3156
3157
|
focus() {
|
|
@@ -3162,6 +3163,8 @@ class Groupview extends CompositeDisposable {
|
|
|
3162
3163
|
options.index > this.panels.length) {
|
|
3163
3164
|
options.index = this.panels.length;
|
|
3164
3165
|
}
|
|
3166
|
+
// ensure the group is updated before we fire any events
|
|
3167
|
+
panel.updateParentGroup(this.parent, true);
|
|
3165
3168
|
if (this._activePanel === panel) {
|
|
3166
3169
|
this.accessor.doSetGroupActive(this.parent);
|
|
3167
3170
|
return;
|
|
@@ -3182,43 +3185,19 @@ class Groupview extends CompositeDisposable {
|
|
|
3182
3185
|
return this._removePanel(panelToRemove);
|
|
3183
3186
|
}
|
|
3184
3187
|
closeAllPanels() {
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
const
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
if (this._activePanel && index > -1) {
|
|
3191
|
-
if (this.panels.indexOf(this._activePanel) < 0) {
|
|
3192
|
-
console.warn('active panel not tracked');
|
|
3193
|
-
}
|
|
3194
|
-
const canClose = !((_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.close) || (yield this._activePanel.close());
|
|
3195
|
-
if (!canClose) {
|
|
3196
|
-
return false;
|
|
3197
|
-
}
|
|
3198
|
-
}
|
|
3199
|
-
for (let i = 0; i < this.panels.length; i++) {
|
|
3200
|
-
if (i === index) {
|
|
3201
|
-
continue;
|
|
3202
|
-
}
|
|
3203
|
-
const panel = this.panels[i];
|
|
3204
|
-
this.openPanel(panel);
|
|
3205
|
-
if (panel.close) {
|
|
3206
|
-
const canClose = yield panel.close();
|
|
3207
|
-
if (!canClose) {
|
|
3208
|
-
return false;
|
|
3209
|
-
}
|
|
3210
|
-
}
|
|
3211
|
-
}
|
|
3212
|
-
if (this.panels.length > 0) {
|
|
3213
|
-
// take a copy since we will be edting the array as we iterate through
|
|
3214
|
-
const arrPanelCpy = [...this.panels];
|
|
3215
|
-
yield Promise.all(arrPanelCpy.map((p) => this.doClose(p)));
|
|
3188
|
+
if (this.panels.length > 0) {
|
|
3189
|
+
// take a copy since we will be edting the array as we iterate through
|
|
3190
|
+
const arrPanelCpy = [...this.panels];
|
|
3191
|
+
for (const panel of arrPanelCpy) {
|
|
3192
|
+
this.doClose(panel);
|
|
3216
3193
|
}
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3194
|
+
}
|
|
3195
|
+
else {
|
|
3196
|
+
this.accessor.removeGroup(this.parent);
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
closePanel(panel) {
|
|
3200
|
+
this.doClose(panel);
|
|
3222
3201
|
}
|
|
3223
3202
|
doClose(panel) {
|
|
3224
3203
|
this.accessor.removePanel(panel);
|
|
@@ -3361,8 +3340,11 @@ class Groupview extends CompositeDisposable {
|
|
|
3361
3340
|
this.tabsContainer.show();
|
|
3362
3341
|
}
|
|
3363
3342
|
}
|
|
3364
|
-
canDisplayOverlay(
|
|
3343
|
+
canDisplayOverlay(event, target) {
|
|
3365
3344
|
// custom overlay handler
|
|
3345
|
+
if (this.accessor.options.showDndOverlay) {
|
|
3346
|
+
return this.accessor.options.showDndOverlay(event, target);
|
|
3347
|
+
}
|
|
3366
3348
|
return false;
|
|
3367
3349
|
}
|
|
3368
3350
|
handleDropEvent(event, position, index) {
|
|
@@ -3387,31 +3369,23 @@ class Groupview extends CompositeDisposable {
|
|
|
3387
3369
|
index,
|
|
3388
3370
|
});
|
|
3389
3371
|
}
|
|
3372
|
+
else {
|
|
3373
|
+
this._onDidDrop.fire({ nativeEvent: event, position, index });
|
|
3374
|
+
}
|
|
3390
3375
|
}
|
|
3391
3376
|
dispose() {
|
|
3377
|
+
var _a;
|
|
3378
|
+
super.dispose();
|
|
3379
|
+
(_a = this.watermark) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
3392
3380
|
for (const panel of this.panels) {
|
|
3393
3381
|
panel.dispose();
|
|
3394
3382
|
}
|
|
3395
|
-
super.dispose();
|
|
3396
3383
|
this.dropTarget.dispose();
|
|
3397
3384
|
this.tabsContainer.dispose();
|
|
3398
3385
|
this.contentContainer.dispose();
|
|
3399
3386
|
}
|
|
3400
3387
|
}
|
|
3401
3388
|
|
|
3402
|
-
exports.GroupChangeKind = void 0;
|
|
3403
|
-
(function (GroupChangeKind) {
|
|
3404
|
-
GroupChangeKind["ADD_PANEL"] = "ADD_PANEL";
|
|
3405
|
-
GroupChangeKind["REMOVE_PANEL"] = "REMOVE_PANEL";
|
|
3406
|
-
GroupChangeKind["PANEL_ACTIVE"] = "PANEL_ACTIVE";
|
|
3407
|
-
//
|
|
3408
|
-
GroupChangeKind["GROUP_ACTIVE"] = "GROUP_ACTIVE";
|
|
3409
|
-
GroupChangeKind["ADD_GROUP"] = "ADD_GROUP";
|
|
3410
|
-
GroupChangeKind["REMOVE_GROUP"] = "REMOVE_GROUP";
|
|
3411
|
-
//
|
|
3412
|
-
GroupChangeKind["LAYOUT_FROM_JSON"] = "LAYOUT_FROM_JSON";
|
|
3413
|
-
GroupChangeKind["LAYOUT"] = "LAYOUT";
|
|
3414
|
-
})(exports.GroupChangeKind || (exports.GroupChangeKind = {}));
|
|
3415
3389
|
const nextLayoutId = sequentialNumberGenerator();
|
|
3416
3390
|
function toTarget(direction) {
|
|
3417
3391
|
switch (direction) {
|
|
@@ -3434,36 +3408,26 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3434
3408
|
this._element = _element;
|
|
3435
3409
|
this._id = nextLayoutId.next();
|
|
3436
3410
|
this._groups = new Map();
|
|
3437
|
-
//
|
|
3438
|
-
this._onGridEvent = new Emitter();
|
|
3439
|
-
this.onGridEvent = this._onGridEvent.event;
|
|
3440
3411
|
this._onDidLayoutChange = new Emitter();
|
|
3441
3412
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
3413
|
+
this._onDidRemoveGroup = new Emitter();
|
|
3414
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
3415
|
+
this._onDidAddGroup = new Emitter();
|
|
3416
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
3417
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3418
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3419
|
+
this._bufferOnDidLayoutChange = new TickDelayedEvent();
|
|
3442
3420
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
|
|
3443
3421
|
this.element.appendChild(this.gridview.element);
|
|
3444
|
-
|
|
3445
|
-
this.layout(0, 0, true);
|
|
3422
|
+
this.layout(0, 0, true); // set some elements height/widths
|
|
3446
3423
|
this.addDisposables(this.gridview.onDidChange(() => {
|
|
3447
|
-
this.
|
|
3424
|
+
this._onDidLayoutChange.fire();
|
|
3448
3425
|
}));
|
|
3449
|
-
this.addDisposables((() => {
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
exports.GroupChangeKind.REMOVE_GROUP,
|
|
3455
|
-
exports.GroupChangeKind.ADD_PANEL,
|
|
3456
|
-
exports.GroupChangeKind.REMOVE_PANEL,
|
|
3457
|
-
exports.GroupChangeKind.GROUP_ACTIVE,
|
|
3458
|
-
exports.GroupChangeKind.PANEL_ACTIVE,
|
|
3459
|
-
exports.GroupChangeKind.LAYOUT,
|
|
3460
|
-
].includes(event.kind)) {
|
|
3461
|
-
tickDelayedEvent.fire();
|
|
3462
|
-
}
|
|
3463
|
-
}), tickDelayedEvent.onEvent(() => {
|
|
3464
|
-
this._onDidLayoutChange.fire();
|
|
3465
|
-
}), tickDelayedEvent);
|
|
3466
|
-
})());
|
|
3426
|
+
this.addDisposables(exports.Event.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
|
|
3427
|
+
this._bufferOnDidLayoutChange.fire();
|
|
3428
|
+
}), this._bufferOnDidLayoutChange.onEvent(() => {
|
|
3429
|
+
this._onDidLayoutChange.fire();
|
|
3430
|
+
}), this._bufferOnDidLayoutChange);
|
|
3467
3431
|
}
|
|
3468
3432
|
get id() {
|
|
3469
3433
|
return this._id;
|
|
@@ -3500,14 +3464,14 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3500
3464
|
}
|
|
3501
3465
|
setVisible(panel, visible) {
|
|
3502
3466
|
this.gridview.setViewVisible(getGridLocation(panel.element), visible);
|
|
3503
|
-
this.
|
|
3467
|
+
this._onDidLayoutChange.fire();
|
|
3504
3468
|
}
|
|
3505
3469
|
isVisible(panel) {
|
|
3506
3470
|
return this.gridview.isViewVisible(getGridLocation(panel.element));
|
|
3507
3471
|
}
|
|
3508
3472
|
doAddGroup(group, location = [0], size) {
|
|
3509
3473
|
this.gridview.addView(group, size !== null && size !== void 0 ? size : exports.Sizing.Distribute, location);
|
|
3510
|
-
this.
|
|
3474
|
+
this._onDidAddGroup.fire(group);
|
|
3511
3475
|
this.doSetGroupActive(group);
|
|
3512
3476
|
}
|
|
3513
3477
|
doRemoveGroup(group, options) {
|
|
@@ -3518,9 +3482,10 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3518
3482
|
const view = this.gridview.remove(group, exports.Sizing.Distribute);
|
|
3519
3483
|
if (item && !(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
3520
3484
|
item.disposable.dispose();
|
|
3485
|
+
item.value.dispose();
|
|
3521
3486
|
this._groups.delete(group.id);
|
|
3522
3487
|
}
|
|
3523
|
-
this.
|
|
3488
|
+
this._onDidRemoveGroup.fire(group);
|
|
3524
3489
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
3525
3490
|
const groups = Array.from(this._groups.values());
|
|
3526
3491
|
this.doSetGroupActive(groups.length > 0 ? groups[0].value : undefined);
|
|
@@ -3548,9 +3513,7 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3548
3513
|
}
|
|
3549
3514
|
}
|
|
3550
3515
|
this._activeGroup = group;
|
|
3551
|
-
this.
|
|
3552
|
-
kind: exports.GroupChangeKind.GROUP_ACTIVE,
|
|
3553
|
-
});
|
|
3516
|
+
this._onDidActiveGroupChange.fire(group);
|
|
3554
3517
|
}
|
|
3555
3518
|
removeGroup(group) {
|
|
3556
3519
|
this.doRemoveGroup(group);
|
|
@@ -3606,7 +3569,13 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3606
3569
|
}
|
|
3607
3570
|
dispose() {
|
|
3608
3571
|
super.dispose();
|
|
3609
|
-
this.
|
|
3572
|
+
this._onDidActiveGroupChange.dispose();
|
|
3573
|
+
this._onDidAddGroup.dispose();
|
|
3574
|
+
this._onDidRemoveGroup.dispose();
|
|
3575
|
+
this._onDidLayoutChange.dispose();
|
|
3576
|
+
for (const group of this.groups) {
|
|
3577
|
+
group.dispose();
|
|
3578
|
+
}
|
|
3610
3579
|
this.gridview.dispose();
|
|
3611
3580
|
}
|
|
3612
3581
|
}
|
|
@@ -3618,15 +3587,11 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3618
3587
|
constructor(id) {
|
|
3619
3588
|
super();
|
|
3620
3589
|
this.id = id;
|
|
3621
|
-
this._state = {};
|
|
3622
3590
|
this._isFocused = false;
|
|
3623
3591
|
this._isActive = false;
|
|
3624
3592
|
this._isVisible = true;
|
|
3625
3593
|
this._width = 0;
|
|
3626
3594
|
this._height = 0;
|
|
3627
|
-
this._onDidStateChange = new Emitter();
|
|
3628
|
-
this.onDidStateChange = this._onDidStateChange.event;
|
|
3629
|
-
//
|
|
3630
3595
|
this._onDidPanelDimensionChange = new Emitter({
|
|
3631
3596
|
replay: true,
|
|
3632
3597
|
});
|
|
@@ -3655,7 +3620,7 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3655
3620
|
//
|
|
3656
3621
|
this._onActiveChange = new Emitter();
|
|
3657
3622
|
this.onActiveChange = this._onActiveChange.event;
|
|
3658
|
-
this.addDisposables(this.
|
|
3623
|
+
this.addDisposables(this._onDidPanelDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3659
3624
|
this._isFocused = event.isFocused;
|
|
3660
3625
|
}), this.onDidActiveChange((event) => {
|
|
3661
3626
|
this._isActive = event.isActive;
|
|
@@ -3688,21 +3653,6 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3688
3653
|
setActive() {
|
|
3689
3654
|
this._onActiveChange.fire();
|
|
3690
3655
|
}
|
|
3691
|
-
setState(key, value) {
|
|
3692
|
-
if (typeof key === 'object') {
|
|
3693
|
-
this._state = key;
|
|
3694
|
-
}
|
|
3695
|
-
else if (typeof value !== undefined) {
|
|
3696
|
-
this._state[key] = value;
|
|
3697
|
-
}
|
|
3698
|
-
this._onDidStateChange.fire(undefined);
|
|
3699
|
-
}
|
|
3700
|
-
getState() {
|
|
3701
|
-
return this._state;
|
|
3702
|
-
}
|
|
3703
|
-
getStateKey(key) {
|
|
3704
|
-
return this._state[key];
|
|
3705
|
-
}
|
|
3706
3656
|
dispose() {
|
|
3707
3657
|
super.dispose();
|
|
3708
3658
|
}
|
|
@@ -3722,6 +3672,7 @@ class GridviewPanelApiImpl extends PanelApiImpl {
|
|
|
3722
3672
|
//
|
|
3723
3673
|
this._onDidSizeChange = new Emitter();
|
|
3724
3674
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
3675
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
3725
3676
|
}
|
|
3726
3677
|
setConstraints(value) {
|
|
3727
3678
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -3735,19 +3686,19 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3735
3686
|
constructor(panel, group) {
|
|
3736
3687
|
super(panel.id);
|
|
3737
3688
|
this.panel = panel;
|
|
3738
|
-
this._onDidDirtyChange = new Emitter();
|
|
3739
|
-
this.onDidDirtyChange = this._onDidDirtyChange.event;
|
|
3740
3689
|
this._onDidTitleChange = new Emitter();
|
|
3741
3690
|
this.onDidTitleChange = this._onDidTitleChange.event;
|
|
3742
3691
|
this._titleChanged = new Emitter();
|
|
3743
3692
|
this.titleChanged = this._titleChanged.event;
|
|
3744
3693
|
this._suppressClosableChanged = new Emitter();
|
|
3745
3694
|
this.suppressClosableChanged = this._suppressClosableChanged.event;
|
|
3746
|
-
this.
|
|
3747
|
-
this.
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3695
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3696
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3697
|
+
this._onDidGroupChange = new Emitter();
|
|
3698
|
+
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
3699
|
+
this.disposable = new MutableDisposable();
|
|
3700
|
+
this.group = group;
|
|
3701
|
+
this.addDisposables(this.disposable, this._onDidTitleChange, this._titleChanged, this._suppressClosableChanged, this._onDidGroupChange, this._onDidActiveGroupChange);
|
|
3751
3702
|
}
|
|
3752
3703
|
get title() {
|
|
3753
3704
|
return this.panel.title;
|
|
@@ -3760,7 +3711,17 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3760
3711
|
return !!((_a = this.group) === null || _a === void 0 ? void 0 : _a.isActive);
|
|
3761
3712
|
}
|
|
3762
3713
|
set group(value) {
|
|
3714
|
+
const isOldGroupActive = this.isGroupActive;
|
|
3763
3715
|
this._group = value;
|
|
3716
|
+
this._onDidGroupChange.fire();
|
|
3717
|
+
if (this._group) {
|
|
3718
|
+
this.disposable.value = this._group.api.onDidActiveChange(() => {
|
|
3719
|
+
this._onDidActiveGroupChange.fire();
|
|
3720
|
+
});
|
|
3721
|
+
if (this.isGroupActive !== isOldGroupActive) {
|
|
3722
|
+
this._onDidActiveGroupChange.fire();
|
|
3723
|
+
}
|
|
3724
|
+
}
|
|
3764
3725
|
}
|
|
3765
3726
|
get group() {
|
|
3766
3727
|
return this._group;
|
|
@@ -3774,16 +3735,10 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3774
3735
|
}
|
|
3775
3736
|
return this.group.model.closePanel(this.panel);
|
|
3776
3737
|
}
|
|
3777
|
-
interceptOnCloseAction(interceptor) {
|
|
3778
|
-
this._interceptor = interceptor;
|
|
3779
|
-
}
|
|
3780
|
-
dispose() {
|
|
3781
|
-
super.dispose();
|
|
3782
|
-
}
|
|
3783
3738
|
}
|
|
3784
3739
|
|
|
3785
3740
|
class DockviewGroupPanel extends CompositeDisposable {
|
|
3786
|
-
constructor(id, containerApi) {
|
|
3741
|
+
constructor(id, accessor, containerApi) {
|
|
3787
3742
|
super();
|
|
3788
3743
|
this.id = id;
|
|
3789
3744
|
this.containerApi = containerApi;
|
|
@@ -3791,14 +3746,17 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3791
3746
|
this._suppressClosable = false;
|
|
3792
3747
|
this._title = '';
|
|
3793
3748
|
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
3794
|
-
this.onDidStateChange = this.api.onDidStateChange;
|
|
3795
3749
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
3796
|
-
|
|
3750
|
+
accessor.setActivePanel(this);
|
|
3797
3751
|
}), this.api.onDidTitleChange((event) => {
|
|
3798
3752
|
const title = event.title;
|
|
3799
3753
|
this.update({ params: { title } });
|
|
3800
3754
|
}));
|
|
3801
3755
|
}
|
|
3756
|
+
get params() {
|
|
3757
|
+
var _a;
|
|
3758
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
3759
|
+
}
|
|
3802
3760
|
get title() {
|
|
3803
3761
|
return this._title;
|
|
3804
3762
|
}
|
|
@@ -3817,32 +3775,18 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3817
3775
|
this._view = params.view;
|
|
3818
3776
|
this.setTitle(params.title);
|
|
3819
3777
|
this.setSuppressClosable(params.suppressClosable || false);
|
|
3820
|
-
if (params.state) {
|
|
3821
|
-
this.api.setState(params.state);
|
|
3822
|
-
}
|
|
3823
3778
|
(_a = this.view) === null || _a === void 0 ? void 0 : _a.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
3824
3779
|
}
|
|
3825
3780
|
focus() {
|
|
3826
3781
|
this.api._onFocusEvent.fire();
|
|
3827
3782
|
}
|
|
3828
|
-
setDirty(isDirty) {
|
|
3829
|
-
this.api._onDidDirtyChange.fire(isDirty);
|
|
3830
|
-
}
|
|
3831
|
-
close() {
|
|
3832
|
-
if (this.api.tryClose) {
|
|
3833
|
-
return this.api.tryClose();
|
|
3834
|
-
}
|
|
3835
|
-
return Promise.resolve(true);
|
|
3836
|
-
}
|
|
3837
3783
|
toJSON() {
|
|
3838
|
-
const state = this.api.getState();
|
|
3839
3784
|
return {
|
|
3840
3785
|
id: this.id,
|
|
3841
3786
|
view: this.view.toJSON(),
|
|
3842
3787
|
params: Object.keys(this._params || {}).length > 0
|
|
3843
3788
|
? this._params
|
|
3844
3789
|
: undefined,
|
|
3845
|
-
state: state && Object.keys(state).length > 0 ? state : undefined,
|
|
3846
3790
|
suppressClosable: this.suppressClosable || undefined,
|
|
3847
3791
|
title: this.title,
|
|
3848
3792
|
};
|
|
@@ -3887,18 +3831,6 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3887
3831
|
var _a;
|
|
3888
3832
|
this._group = group;
|
|
3889
3833
|
this.api.group = group;
|
|
3890
|
-
this.mutableDisposable.value = this._group.model.onDidGroupChange((ev) => {
|
|
3891
|
-
var _a;
|
|
3892
|
-
if (ev.kind === exports.GroupChangeKind2.GROUP_ACTIVE) {
|
|
3893
|
-
const isVisible = !!((_a = this._group) === null || _a === void 0 ? void 0 : _a.model.isPanelActive(this));
|
|
3894
|
-
this.api._onDidActiveChange.fire({
|
|
3895
|
-
isActive: isGroupActive && isVisible,
|
|
3896
|
-
});
|
|
3897
|
-
this.api._onDidVisibilityChange.fire({
|
|
3898
|
-
isVisible,
|
|
3899
|
-
});
|
|
3900
|
-
}
|
|
3901
|
-
});
|
|
3902
3834
|
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
3903
3835
|
this.api._onDidActiveChange.fire({
|
|
3904
3836
|
isActive: isGroupActive && isPanelVisible,
|
|
@@ -3973,7 +3905,7 @@ class Watermark extends CompositeDisposable {
|
|
|
3973
3905
|
get id() {
|
|
3974
3906
|
return 'watermark';
|
|
3975
3907
|
}
|
|
3976
|
-
update(
|
|
3908
|
+
update(_event) {
|
|
3977
3909
|
// noop
|
|
3978
3910
|
}
|
|
3979
3911
|
focus() {
|
|
@@ -3982,17 +3914,17 @@ class Watermark extends CompositeDisposable {
|
|
|
3982
3914
|
toJSON() {
|
|
3983
3915
|
return {};
|
|
3984
3916
|
}
|
|
3985
|
-
layout(
|
|
3917
|
+
layout(_width, _height) {
|
|
3986
3918
|
// noop
|
|
3987
3919
|
}
|
|
3988
3920
|
init(params) {
|
|
3989
3921
|
this.params = params;
|
|
3990
|
-
this.addDisposables(this.params.containerApi.onDidLayoutChange((
|
|
3922
|
+
this.addDisposables(this.params.containerApi.onDidLayoutChange(() => {
|
|
3991
3923
|
this.render();
|
|
3992
3924
|
}));
|
|
3993
3925
|
this.render();
|
|
3994
3926
|
}
|
|
3995
|
-
updateParentGroup(group,
|
|
3927
|
+
updateParentGroup(group, _visible) {
|
|
3996
3928
|
this.group = group;
|
|
3997
3929
|
this.render();
|
|
3998
3930
|
}
|
|
@@ -4008,15 +3940,6 @@ class Watermark extends CompositeDisposable {
|
|
|
4008
3940
|
}
|
|
4009
3941
|
}
|
|
4010
3942
|
|
|
4011
|
-
function debounce(cb, wait) {
|
|
4012
|
-
let timeout;
|
|
4013
|
-
const callable = (...args) => {
|
|
4014
|
-
clearTimeout(timeout);
|
|
4015
|
-
timeout = setTimeout(() => cb(...args), wait);
|
|
4016
|
-
};
|
|
4017
|
-
return callable;
|
|
4018
|
-
}
|
|
4019
|
-
|
|
4020
3943
|
class DefaultDeserializer {
|
|
4021
3944
|
constructor(layout, panelDeserializer) {
|
|
4022
3945
|
this.layout = layout;
|
|
@@ -4117,9 +4040,6 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4117
4040
|
this._isGroupActive = false;
|
|
4118
4041
|
//
|
|
4119
4042
|
this.params = {};
|
|
4120
|
-
//
|
|
4121
|
-
this.isDirtyDisposable = new MutableDisposable();
|
|
4122
|
-
this.addDisposables(this.isDirtyDisposable);
|
|
4123
4043
|
this._element = document.createElement('div');
|
|
4124
4044
|
this._element.className = 'default-tab';
|
|
4125
4045
|
//
|
|
@@ -4164,10 +4084,6 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4164
4084
|
init(params) {
|
|
4165
4085
|
this.params = params;
|
|
4166
4086
|
this._content.textContent = params.title;
|
|
4167
|
-
this.isDirtyDisposable.value = this.params.api.onDidDirtyChange((event) => {
|
|
4168
|
-
const isDirty = event;
|
|
4169
|
-
toggleClass(this.action, 'dirty', isDirty);
|
|
4170
|
-
});
|
|
4171
4087
|
if (!this.params.suppressClosable) {
|
|
4172
4088
|
addDisposableListener(this.action, 'click', (ev) => {
|
|
4173
4089
|
ev.preventDefault(); //
|
|
@@ -4183,7 +4099,7 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4183
4099
|
this._isGroupActive = group.isActive;
|
|
4184
4100
|
this.render();
|
|
4185
4101
|
}
|
|
4186
|
-
layout(
|
|
4102
|
+
layout(_width, _height) {
|
|
4187
4103
|
// noop
|
|
4188
4104
|
}
|
|
4189
4105
|
render() {
|
|
@@ -4221,6 +4137,10 @@ class BasePanelView extends CompositeDisposable {
|
|
|
4221
4137
|
get height() {
|
|
4222
4138
|
return this._height;
|
|
4223
4139
|
}
|
|
4140
|
+
get params() {
|
|
4141
|
+
var _a;
|
|
4142
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
4143
|
+
}
|
|
4224
4144
|
focus() {
|
|
4225
4145
|
this.api._onFocusEvent.fire();
|
|
4226
4146
|
}
|
|
@@ -4229,34 +4149,34 @@ class BasePanelView extends CompositeDisposable {
|
|
|
4229
4149
|
this._height = height;
|
|
4230
4150
|
this.api._onDidPanelDimensionChange.fire({ width, height });
|
|
4231
4151
|
if (this.part) {
|
|
4232
|
-
if (this.
|
|
4233
|
-
this.part.update(this.
|
|
4152
|
+
if (this._params) {
|
|
4153
|
+
this.part.update(this._params.params);
|
|
4234
4154
|
}
|
|
4235
4155
|
}
|
|
4236
4156
|
}
|
|
4237
4157
|
init(parameters) {
|
|
4238
|
-
this.
|
|
4158
|
+
this._params = parameters;
|
|
4239
4159
|
this.part = this.getComponent();
|
|
4240
4160
|
}
|
|
4241
4161
|
update(event) {
|
|
4242
4162
|
var _a, _b;
|
|
4243
|
-
this.
|
|
4244
|
-
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this.
|
|
4163
|
+
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) });
|
|
4164
|
+
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this._params.params });
|
|
4245
4165
|
}
|
|
4246
4166
|
toJSON() {
|
|
4247
4167
|
var _a, _b;
|
|
4248
|
-
const
|
|
4249
|
-
const params = (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4168
|
+
const params = (_b = (_a = this._params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4250
4169
|
return {
|
|
4251
4170
|
id: this.id,
|
|
4252
4171
|
component: this.component,
|
|
4253
4172
|
params: Object.keys(params).length > 0 ? params : undefined,
|
|
4254
|
-
state: Object.keys(state).length === 0 ? undefined : state,
|
|
4255
4173
|
};
|
|
4256
4174
|
}
|
|
4257
4175
|
dispose() {
|
|
4176
|
+
var _a;
|
|
4258
4177
|
super.dispose();
|
|
4259
4178
|
this.api.dispose();
|
|
4179
|
+
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
4260
4180
|
}
|
|
4261
4181
|
}
|
|
4262
4182
|
|
|
@@ -4274,12 +4194,12 @@ class GridviewPanel extends BasePanelView {
|
|
|
4274
4194
|
this._snap = false;
|
|
4275
4195
|
this._onDidChange = new Emitter();
|
|
4276
4196
|
this.onDidChange = this._onDidChange.event;
|
|
4277
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
4197
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4278
4198
|
const { isVisible } = event;
|
|
4279
|
-
const { containerApi } = this.
|
|
4199
|
+
const { containerApi } = this._params;
|
|
4280
4200
|
containerApi.setVisible(this, isVisible);
|
|
4281
4201
|
}), this.api.onActiveChange(() => {
|
|
4282
|
-
const { containerApi } = this.
|
|
4202
|
+
const { containerApi } = this._params;
|
|
4283
4203
|
containerApi.setActive(this);
|
|
4284
4204
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4285
4205
|
if (typeof event.minimumWidth === 'number' ||
|
|
@@ -4394,9 +4314,6 @@ class GridviewPanel extends BasePanelView {
|
|
|
4394
4314
|
const minimum = (value) => (value <= 0 ? undefined : value);
|
|
4395
4315
|
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 });
|
|
4396
4316
|
}
|
|
4397
|
-
dispose() {
|
|
4398
|
-
super.dispose();
|
|
4399
|
-
}
|
|
4400
4317
|
}
|
|
4401
4318
|
|
|
4402
4319
|
class GroupviewPanel extends GridviewPanel {
|
|
@@ -4503,15 +4420,24 @@ class DockviewComponent extends BaseGrid {
|
|
|
4503
4420
|
orientation: options.orientation || exports.Orientation.HORIZONTAL,
|
|
4504
4421
|
styles: options.styles,
|
|
4505
4422
|
});
|
|
4506
|
-
this._panels = new Map();
|
|
4507
|
-
this.dirtyPanels = new Set();
|
|
4508
|
-
this.debouncedDeque = debounce(this.syncConfigs.bind(this), 5000);
|
|
4509
4423
|
// events
|
|
4510
4424
|
this._onTabInteractionEvent = new Emitter();
|
|
4511
4425
|
this.onTabInteractionEvent = this._onTabInteractionEvent.event;
|
|
4512
4426
|
this._onTabContextMenu = new Emitter();
|
|
4513
4427
|
this.onTabContextMenu = this._onTabContextMenu.event;
|
|
4514
|
-
this.
|
|
4428
|
+
this._onDidDrop = new Emitter();
|
|
4429
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
4430
|
+
this._onDidRemovePanel = new Emitter();
|
|
4431
|
+
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4432
|
+
this._onDidAddPanel = new Emitter();
|
|
4433
|
+
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
4434
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4435
|
+
this.onDidLayoutfromJSON = this._onDidLayoutfromJSON.event;
|
|
4436
|
+
this._onDidActivePanelChange = new Emitter();
|
|
4437
|
+
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4438
|
+
this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
4439
|
+
this._bufferOnDidLayoutChange.fire();
|
|
4440
|
+
}));
|
|
4515
4441
|
this._options = options;
|
|
4516
4442
|
if (!this.options.components) {
|
|
4517
4443
|
this.options.components = {};
|
|
@@ -4532,10 +4458,10 @@ class DockviewComponent extends BaseGrid {
|
|
|
4532
4458
|
this._api = new DockviewApi(this);
|
|
4533
4459
|
}
|
|
4534
4460
|
get totalPanels() {
|
|
4535
|
-
return this.
|
|
4461
|
+
return this.panels.length;
|
|
4536
4462
|
}
|
|
4537
4463
|
get panels() {
|
|
4538
|
-
return
|
|
4464
|
+
return this.groups.flatMap((group) => group.model.panels);
|
|
4539
4465
|
}
|
|
4540
4466
|
get deserializer() {
|
|
4541
4467
|
return this._deserializer;
|
|
@@ -4565,10 +4491,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
4565
4491
|
updateOptions(options) {
|
|
4566
4492
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
4567
4493
|
this.options.orientation !== options.orientation;
|
|
4568
|
-
// TODO support style update
|
|
4569
|
-
// const hasStylesChanged =
|
|
4570
|
-
// typeof options.styles === 'object' &&
|
|
4571
|
-
// this.options.styles !== options.styles;
|
|
4572
4494
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
4573
4495
|
if (hasOrientationChanged) {
|
|
4574
4496
|
this.gridview.orientation = options.orientation;
|
|
@@ -4580,8 +4502,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4580
4502
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4581
4503
|
}
|
|
4582
4504
|
getGroupPanel(id) {
|
|
4583
|
-
|
|
4584
|
-
return (_a = this._panels.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
4505
|
+
return this.panels.find((panel) => panel.id === id);
|
|
4585
4506
|
}
|
|
4586
4507
|
setActivePanel(panel) {
|
|
4587
4508
|
if (!panel.group) {
|
|
@@ -4630,24 +4551,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
4630
4551
|
this.doSetGroupActive(next);
|
|
4631
4552
|
}
|
|
4632
4553
|
}
|
|
4633
|
-
registerPanel(panel) {
|
|
4634
|
-
if (this._panels.has(panel.id)) {
|
|
4635
|
-
throw new Error(`panel ${panel.id} already exists`);
|
|
4636
|
-
}
|
|
4637
|
-
const disposable = new CompositeDisposable(panel.onDidStateChange(() => this.addDirtyPanel(panel)));
|
|
4638
|
-
this._panels.set(panel.id, { value: panel, disposable });
|
|
4639
|
-
}
|
|
4640
|
-
unregisterPanel(panel) {
|
|
4641
|
-
if (!this._panels.has(panel.id)) {
|
|
4642
|
-
throw new Error(`panel ${panel.id} doesn't exist`);
|
|
4643
|
-
}
|
|
4644
|
-
const item = this._panels.get(panel.id);
|
|
4645
|
-
if (item) {
|
|
4646
|
-
item.disposable.dispose();
|
|
4647
|
-
item.value.dispose();
|
|
4648
|
-
}
|
|
4649
|
-
this._panels.delete(panel.id);
|
|
4650
|
-
}
|
|
4651
4554
|
/**
|
|
4652
4555
|
* Serialize the current state of the layout
|
|
4653
4556
|
*
|
|
@@ -4655,12 +4558,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
4655
4558
|
*/
|
|
4656
4559
|
toJSON() {
|
|
4657
4560
|
var _a;
|
|
4658
|
-
this.syncConfigs();
|
|
4659
4561
|
const data = this.gridview.serialize();
|
|
4660
|
-
const panels =
|
|
4661
|
-
|
|
4662
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4663
|
-
}
|
|
4562
|
+
const panels = this.panels.reduce((collection, panel) => {
|
|
4563
|
+
collection[panel.id] = panel.toJSON();
|
|
4664
4564
|
return collection;
|
|
4665
4565
|
}, {});
|
|
4666
4566
|
return {
|
|
@@ -4671,13 +4571,12 @@ class DockviewComponent extends BaseGrid {
|
|
|
4671
4571
|
};
|
|
4672
4572
|
}
|
|
4673
4573
|
fromJSON(data) {
|
|
4574
|
+
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
4575
|
+
for (const group of groups) {
|
|
4576
|
+
// remove the group will automatically remove the panels
|
|
4577
|
+
this.removeGroup(group, true);
|
|
4578
|
+
}
|
|
4674
4579
|
this.gridview.clear();
|
|
4675
|
-
this._panels.forEach((panel) => {
|
|
4676
|
-
panel.disposable.dispose();
|
|
4677
|
-
panel.value.dispose();
|
|
4678
|
-
});
|
|
4679
|
-
this._panels.clear();
|
|
4680
|
-
this._groups.clear();
|
|
4681
4580
|
if (!this.deserializer) {
|
|
4682
4581
|
throw new Error('invalid deserializer');
|
|
4683
4582
|
}
|
|
@@ -4691,9 +4590,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4691
4590
|
this.gridview.deserialize(grid, new DefaultDeserializer(this, {
|
|
4692
4591
|
createPanel: (id) => {
|
|
4693
4592
|
const panelData = panels[id];
|
|
4694
|
-
|
|
4695
|
-
this.registerPanel(panel);
|
|
4696
|
-
return panel;
|
|
4593
|
+
return this.deserializer.fromJSON(panelData);
|
|
4697
4594
|
},
|
|
4698
4595
|
}));
|
|
4699
4596
|
if (typeof activeGroup === 'string') {
|
|
@@ -4703,36 +4600,31 @@ class DockviewComponent extends BaseGrid {
|
|
|
4703
4600
|
}
|
|
4704
4601
|
}
|
|
4705
4602
|
this.gridview.layout(this.width, this.height);
|
|
4706
|
-
this.
|
|
4603
|
+
this._onDidLayoutfromJSON.fire();
|
|
4707
4604
|
}
|
|
4708
4605
|
closeAllGroups() {
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
if (!didCloseAll) {
|
|
4714
|
-
return false;
|
|
4715
|
-
}
|
|
4716
|
-
}
|
|
4717
|
-
return true;
|
|
4718
|
-
});
|
|
4606
|
+
for (const entry of this._groups.entries()) {
|
|
4607
|
+
const [_, group] = entry;
|
|
4608
|
+
group.value.model.closeAllPanels();
|
|
4609
|
+
}
|
|
4719
4610
|
}
|
|
4720
4611
|
fireMouseEvent(event) {
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
}
|
|
4730
|
-
break;
|
|
4612
|
+
if (event.kind === exports.MouseEventKind.CONTEXT_MENU) {
|
|
4613
|
+
if (event.tab && event.panel) {
|
|
4614
|
+
this._onTabContextMenu.fire({
|
|
4615
|
+
event: event.event,
|
|
4616
|
+
api: this._api,
|
|
4617
|
+
panel: event.panel,
|
|
4618
|
+
});
|
|
4619
|
+
}
|
|
4731
4620
|
}
|
|
4732
4621
|
}
|
|
4733
4622
|
addPanel(options) {
|
|
4734
4623
|
var _a, _b;
|
|
4735
|
-
|
|
4624
|
+
if (this.panels.find((_) => _.id === options.id)) {
|
|
4625
|
+
throw new Error(`panel with id ${options.id} already exists`);
|
|
4626
|
+
}
|
|
4627
|
+
const panel = this.createPanel(options);
|
|
4736
4628
|
let referenceGroup;
|
|
4737
4629
|
if ((_a = options.position) === null || _a === void 0 ? void 0 : _a.referencePanel) {
|
|
4738
4630
|
const referencePanel = this.getGroupPanel(options.position.referencePanel);
|
|
@@ -4760,14 +4652,20 @@ class DockviewComponent extends BaseGrid {
|
|
|
4760
4652
|
}
|
|
4761
4653
|
return panel;
|
|
4762
4654
|
}
|
|
4763
|
-
removePanel(panel
|
|
4764
|
-
|
|
4655
|
+
removePanel(panel, options = {
|
|
4656
|
+
removeEmptyGroup: true,
|
|
4657
|
+
skipDispose: false,
|
|
4658
|
+
}) {
|
|
4765
4659
|
const group = panel.group;
|
|
4766
4660
|
if (!group) {
|
|
4767
4661
|
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
4768
4662
|
}
|
|
4769
4663
|
group.model.removePanel(panel);
|
|
4770
|
-
|
|
4664
|
+
panel.dispose();
|
|
4665
|
+
const retainGroupForWatermark = this.size === 1;
|
|
4666
|
+
if (!retainGroupForWatermark &&
|
|
4667
|
+
group.model.size === 0 &&
|
|
4668
|
+
options.removeEmptyGroup) {
|
|
4771
4669
|
this.removeGroup(group);
|
|
4772
4670
|
}
|
|
4773
4671
|
}
|
|
@@ -4780,10 +4678,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
4780
4678
|
: {}, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.watermark);
|
|
4781
4679
|
}
|
|
4782
4680
|
addEmptyGroup(options) {
|
|
4783
|
-
var _a;
|
|
4784
4681
|
const group = this.createGroup();
|
|
4785
4682
|
if (options) {
|
|
4786
|
-
const referencePanel =
|
|
4683
|
+
const referencePanel = this.panels.find((panel) => panel.id === options.referencePanel);
|
|
4787
4684
|
if (!referencePanel) {
|
|
4788
4685
|
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
4789
4686
|
}
|
|
@@ -4800,25 +4697,24 @@ class DockviewComponent extends BaseGrid {
|
|
|
4800
4697
|
this.doAddGroup(group);
|
|
4801
4698
|
}
|
|
4802
4699
|
}
|
|
4803
|
-
removeGroup(group) {
|
|
4700
|
+
removeGroup(group, skipActive = false) {
|
|
4804
4701
|
const panels = [...group.model.panels]; // reassign since group panels will mutate
|
|
4805
|
-
|
|
4806
|
-
this.removePanel(panel
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
return;
|
|
4702
|
+
for (const panel of panels) {
|
|
4703
|
+
this.removePanel(panel, {
|
|
4704
|
+
removeEmptyGroup: false,
|
|
4705
|
+
skipDispose: false,
|
|
4706
|
+
});
|
|
4811
4707
|
}
|
|
4812
|
-
super.
|
|
4708
|
+
super.doRemoveGroup(group, { skipActive });
|
|
4813
4709
|
}
|
|
4814
4710
|
moveGroupOrPanel(referenceGroup, groupId, itemId, target, index) {
|
|
4815
|
-
var _a
|
|
4711
|
+
var _a;
|
|
4816
4712
|
const sourceGroup = groupId
|
|
4817
4713
|
? (_a = this._groups.get(groupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
4818
4714
|
: undefined;
|
|
4819
4715
|
if (!target || target === exports.Position.Center) {
|
|
4820
4716
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4821
|
-
|
|
4717
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4822
4718
|
if (!groupItem) {
|
|
4823
4719
|
throw new Error(`No panel with id ${itemId}`);
|
|
4824
4720
|
}
|
|
@@ -4854,7 +4750,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4854
4750
|
}
|
|
4855
4751
|
else {
|
|
4856
4752
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4857
|
-
|
|
4753
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4858
4754
|
if (!groupItem) {
|
|
4859
4755
|
throw new Error(`No panel with id ${itemId}`);
|
|
4860
4756
|
}
|
|
@@ -4868,10 +4764,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4868
4764
|
const isGroupAlreadyFocused = this._activeGroup === group;
|
|
4869
4765
|
super.doSetGroupActive(group, skipFocus);
|
|
4870
4766
|
if (!isGroupAlreadyFocused && ((_a = this._activeGroup) === null || _a === void 0 ? void 0 : _a.model.activePanel)) {
|
|
4871
|
-
this.
|
|
4872
|
-
kind: exports.GroupChangeKind.PANEL_ACTIVE,
|
|
4873
|
-
panel: (_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel,
|
|
4874
|
-
});
|
|
4767
|
+
this._onDidActivePanelChange.fire((_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel);
|
|
4875
4768
|
}
|
|
4876
4769
|
}
|
|
4877
4770
|
createGroup(options) {
|
|
@@ -4893,35 +4786,27 @@ class DockviewComponent extends BaseGrid {
|
|
|
4893
4786
|
}
|
|
4894
4787
|
}
|
|
4895
4788
|
const view = new GroupviewPanel(this, id, options);
|
|
4789
|
+
view.init({ params: {}, containerApi: null }); // required to initialized .part and allow for correct disposal of group
|
|
4896
4790
|
if (!this._groups.has(view.id)) {
|
|
4897
4791
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4898
4792
|
const { groupId, itemId, target, index } = event;
|
|
4899
4793
|
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
4794
|
+
}), view.model.onDidDrop((event) => {
|
|
4795
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api }));
|
|
4900
4796
|
}), view.model.onDidGroupChange((event) => {
|
|
4901
4797
|
switch (event.kind) {
|
|
4902
4798
|
case exports.GroupChangeKind2.ADD_PANEL:
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
});
|
|
4907
|
-
break;
|
|
4908
|
-
case exports.GroupChangeKind2.GROUP_ACTIVE:
|
|
4909
|
-
this._onGridEvent.fire({
|
|
4910
|
-
kind: exports.GroupChangeKind.GROUP_ACTIVE,
|
|
4911
|
-
panel: event.panel,
|
|
4912
|
-
});
|
|
4799
|
+
if (event.panel) {
|
|
4800
|
+
this._onDidAddPanel.fire(event.panel);
|
|
4801
|
+
}
|
|
4913
4802
|
break;
|
|
4914
4803
|
case exports.GroupChangeKind2.REMOVE_PANEL:
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
});
|
|
4804
|
+
if (event.panel) {
|
|
4805
|
+
this._onDidRemovePanel.fire(event.panel);
|
|
4806
|
+
}
|
|
4919
4807
|
break;
|
|
4920
4808
|
case exports.GroupChangeKind2.PANEL_ACTIVE:
|
|
4921
|
-
this.
|
|
4922
|
-
kind: exports.GroupChangeKind.PANEL_ACTIVE,
|
|
4923
|
-
panel: event.panel,
|
|
4924
|
-
});
|
|
4809
|
+
this._onDidActivePanelChange.fire(event.panel);
|
|
4925
4810
|
break;
|
|
4926
4811
|
}
|
|
4927
4812
|
}));
|
|
@@ -4935,44 +4820,18 @@ class DockviewComponent extends BaseGrid {
|
|
|
4935
4820
|
}
|
|
4936
4821
|
return view;
|
|
4937
4822
|
}
|
|
4938
|
-
|
|
4939
|
-
super.dispose();
|
|
4940
|
-
this._onGridEvent.dispose();
|
|
4941
|
-
}
|
|
4942
|
-
/**
|
|
4943
|
-
* Ensure the local copy of the layout state is up-to-date
|
|
4944
|
-
*/
|
|
4945
|
-
syncConfigs() {
|
|
4946
|
-
const dirtyPanels = Array.from(this.dirtyPanels);
|
|
4947
|
-
if (dirtyPanels.length === 0) ;
|
|
4948
|
-
this.dirtyPanels.clear();
|
|
4949
|
-
const partialPanelState = dirtyPanels
|
|
4950
|
-
.map((panel) => this._panels.get(panel.id))
|
|
4951
|
-
.filter((_) => !!_)
|
|
4952
|
-
.reduce((collection, panel) => {
|
|
4953
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4954
|
-
return collection;
|
|
4955
|
-
}, {});
|
|
4956
|
-
this.panelState = Object.assign(Object.assign({}, this.panelState), partialPanelState);
|
|
4957
|
-
dirtyPanels
|
|
4958
|
-
.filter((p) => this._panels.has(p.id))
|
|
4959
|
-
.forEach((panel) => {
|
|
4960
|
-
panel.setDirty(false);
|
|
4961
|
-
});
|
|
4962
|
-
}
|
|
4963
|
-
_addPanel(options) {
|
|
4823
|
+
createPanel(options) {
|
|
4964
4824
|
const view = new DefaultGroupPanelView({
|
|
4965
4825
|
content: this.createContentComponent(options.id, options.component),
|
|
4966
4826
|
tab: this.createTabComponent(options.id, options.tabComponent),
|
|
4967
4827
|
});
|
|
4968
|
-
const panel = new DockviewGroupPanel(options.id, this._api);
|
|
4828
|
+
const panel = new DockviewGroupPanel(options.id, this, this._api);
|
|
4969
4829
|
panel.init({
|
|
4970
4830
|
view,
|
|
4971
4831
|
title: options.title || options.id,
|
|
4972
4832
|
suppressClosable: options === null || options === void 0 ? void 0 : options.suppressClosable,
|
|
4973
4833
|
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
4974
4834
|
});
|
|
4975
|
-
this.registerPanel(panel);
|
|
4976
4835
|
return panel;
|
|
4977
4836
|
}
|
|
4978
4837
|
createContentComponent(id, componentName) {
|
|
@@ -4992,10 +4851,12 @@ class DockviewComponent extends BaseGrid {
|
|
|
4992
4851
|
var _a;
|
|
4993
4852
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
4994
4853
|
}
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
this.
|
|
4854
|
+
dispose() {
|
|
4855
|
+
super.dispose();
|
|
4856
|
+
this._onDidActivePanelChange.dispose();
|
|
4857
|
+
this._onDidAddPanel.dispose();
|
|
4858
|
+
this._onDidRemovePanel.dispose();
|
|
4859
|
+
this._onDidLayoutfromJSON.dispose();
|
|
4999
4860
|
}
|
|
5000
4861
|
}
|
|
5001
4862
|
|
|
@@ -5006,6 +4867,8 @@ class GridviewComponent extends BaseGrid {
|
|
|
5006
4867
|
orientation: options.orientation,
|
|
5007
4868
|
styles: options.styles,
|
|
5008
4869
|
});
|
|
4870
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4871
|
+
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
5009
4872
|
this._options = options;
|
|
5010
4873
|
if (!this.options.components) {
|
|
5011
4874
|
this.options.components = {};
|
|
@@ -5058,7 +4921,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
5058
4921
|
this.gridview.setViewVisible(getGridLocation(panel.element), visible);
|
|
5059
4922
|
}
|
|
5060
4923
|
setActive(panel) {
|
|
5061
|
-
this._groups.forEach((value,
|
|
4924
|
+
this._groups.forEach((value, _key) => {
|
|
5062
4925
|
value.value.setActive(panel === value.value);
|
|
5063
4926
|
});
|
|
5064
4927
|
}
|
|
@@ -5071,8 +4934,12 @@ class GridviewComponent extends BaseGrid {
|
|
|
5071
4934
|
}
|
|
5072
4935
|
fromJSON(serializedGridview, deferComponentLayout) {
|
|
5073
4936
|
const { grid, activePanel } = serializedGridview;
|
|
4937
|
+
const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
|
|
4938
|
+
for (const group of groups) {
|
|
4939
|
+
group.disposable.dispose();
|
|
4940
|
+
this.doRemoveGroup(group.value, { skipActive: true });
|
|
4941
|
+
}
|
|
5074
4942
|
this.gridview.clear();
|
|
5075
|
-
this._groups.clear();
|
|
5076
4943
|
const queue = [];
|
|
5077
4944
|
this.gridview.deserialize(grid, {
|
|
5078
4945
|
fromJSON: (node) => {
|
|
@@ -5113,7 +4980,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
5113
4980
|
this.doSetGroupActive(panel);
|
|
5114
4981
|
}
|
|
5115
4982
|
}
|
|
5116
|
-
this.
|
|
4983
|
+
this._onDidLayoutfromJSON.fire();
|
|
5117
4984
|
}
|
|
5118
4985
|
movePanel(panel, options) {
|
|
5119
4986
|
var _a;
|
|
@@ -5169,7 +5036,6 @@ class GridviewComponent extends BaseGrid {
|
|
|
5169
5036
|
});
|
|
5170
5037
|
this.registerPanel(view);
|
|
5171
5038
|
this.doAddGroup(view, relativeLocation, options.size);
|
|
5172
|
-
return { api: view.api };
|
|
5173
5039
|
}
|
|
5174
5040
|
registerPanel(panel) {
|
|
5175
5041
|
const disposable = new CompositeDisposable(panel.api.onDidFocusChange((event) => {
|
|
@@ -5220,14 +5086,10 @@ class GridviewComponent extends BaseGrid {
|
|
|
5220
5086
|
}
|
|
5221
5087
|
removeGroup(group) {
|
|
5222
5088
|
super.removeGroup(group);
|
|
5223
|
-
const panel = this._groups.get(group.id);
|
|
5224
|
-
if (panel) {
|
|
5225
|
-
panel.disposable.dispose();
|
|
5226
|
-
this._groups.delete(group.id);
|
|
5227
|
-
}
|
|
5228
5089
|
}
|
|
5229
5090
|
dispose() {
|
|
5230
5091
|
super.dispose();
|
|
5092
|
+
this._onDidLayoutfromJSON.dispose();
|
|
5231
5093
|
}
|
|
5232
5094
|
}
|
|
5233
5095
|
|
|
@@ -5254,7 +5116,7 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5254
5116
|
options.frameworkComponents = {};
|
|
5255
5117
|
}
|
|
5256
5118
|
this.splitview = new Splitview(this.element, options);
|
|
5257
|
-
this.addDisposables(this._disposable);
|
|
5119
|
+
this.addDisposables(this._disposable, this._onDidAddView, this._onDidRemoveView, this._onDidLayoutChange);
|
|
5258
5120
|
}
|
|
5259
5121
|
get options() {
|
|
5260
5122
|
return this._options;
|
|
@@ -5330,7 +5192,11 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5330
5192
|
}
|
|
5331
5193
|
removePanel(panel, sizing) {
|
|
5332
5194
|
const disposable = this.panels.get(panel.id);
|
|
5333
|
-
|
|
5195
|
+
if (!disposable) {
|
|
5196
|
+
throw new Error(`unknown splitview panel ${panel.id}`);
|
|
5197
|
+
}
|
|
5198
|
+
disposable.disposable.dispose();
|
|
5199
|
+
disposable.value.dispose();
|
|
5334
5200
|
this.panels.delete(panel.id);
|
|
5335
5201
|
const index = this.getPanels().findIndex((_) => _ === panel);
|
|
5336
5202
|
this.splitview.removeView(index, sizing);
|
|
@@ -5389,7 +5255,7 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5389
5255
|
}
|
|
5390
5256
|
this.setActive(view, true);
|
|
5391
5257
|
});
|
|
5392
|
-
this.panels.set(view.id, disposable);
|
|
5258
|
+
this.panels.set(view.id, { disposable, value: view });
|
|
5393
5259
|
}
|
|
5394
5260
|
toJSON() {
|
|
5395
5261
|
var _a;
|
|
@@ -5413,6 +5279,11 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5413
5279
|
}
|
|
5414
5280
|
fromJSON(serializedSplitview, deferComponentLayout = false) {
|
|
5415
5281
|
const { views, orientation, size, activeView } = serializedSplitview;
|
|
5282
|
+
for (const [_, value] of this.panels.entries()) {
|
|
5283
|
+
value.disposable.dispose();
|
|
5284
|
+
value.value.dispose();
|
|
5285
|
+
}
|
|
5286
|
+
this.panels.clear();
|
|
5416
5287
|
this.splitview.dispose();
|
|
5417
5288
|
const queue = [];
|
|
5418
5289
|
this.splitview = new Splitview(this.element, {
|
|
@@ -5468,49 +5339,16 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5468
5339
|
}
|
|
5469
5340
|
}
|
|
5470
5341
|
dispose() {
|
|
5471
|
-
|
|
5472
|
-
value.dispose();
|
|
5473
|
-
|
|
5342
|
+
for (const [_, value] of this.panels.entries()) {
|
|
5343
|
+
value.disposable.dispose();
|
|
5344
|
+
value.value.dispose();
|
|
5345
|
+
}
|
|
5474
5346
|
this.panels.clear();
|
|
5347
|
+
this.splitview.dispose();
|
|
5475
5348
|
super.dispose();
|
|
5476
5349
|
}
|
|
5477
5350
|
}
|
|
5478
5351
|
|
|
5479
|
-
class DragHandler extends CompositeDisposable {
|
|
5480
|
-
constructor(el) {
|
|
5481
|
-
super();
|
|
5482
|
-
this.el = el;
|
|
5483
|
-
this.iframes = [];
|
|
5484
|
-
this._onDragStart = new Emitter();
|
|
5485
|
-
this.onDragStart = this._onDragStart.event;
|
|
5486
|
-
this.configure();
|
|
5487
|
-
}
|
|
5488
|
-
configure() {
|
|
5489
|
-
this.addDisposables(addDisposableListener(this.el, 'dragstart', (event) => {
|
|
5490
|
-
var _a;
|
|
5491
|
-
this.iframes = [
|
|
5492
|
-
...getElementsByTagName('iframe'),
|
|
5493
|
-
...getElementsByTagName('webview'),
|
|
5494
|
-
];
|
|
5495
|
-
for (const iframe of this.iframes) {
|
|
5496
|
-
iframe.style.pointerEvents = 'none';
|
|
5497
|
-
}
|
|
5498
|
-
this.el.classList.add('dragged');
|
|
5499
|
-
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
5500
|
-
(_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5501
|
-
this.disposable = this.getData();
|
|
5502
|
-
}), addDisposableListener(this.el, 'dragend', (ev) => {
|
|
5503
|
-
var _a;
|
|
5504
|
-
for (const iframe of this.iframes) {
|
|
5505
|
-
iframe.style.pointerEvents = 'auto';
|
|
5506
|
-
}
|
|
5507
|
-
this.iframes = [];
|
|
5508
|
-
(_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5509
|
-
this.disposable = undefined;
|
|
5510
|
-
}));
|
|
5511
|
-
}
|
|
5512
|
-
}
|
|
5513
|
-
|
|
5514
5352
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
5515
5353
|
//
|
|
5516
5354
|
constructor(id) {
|
|
@@ -5525,6 +5363,7 @@ class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
|
5525
5363
|
//
|
|
5526
5364
|
this._onDidSizeChange = new Emitter();
|
|
5527
5365
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
5366
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
5528
5367
|
}
|
|
5529
5368
|
setConstraints(value) {
|
|
5530
5369
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -5532,11 +5371,6 @@ class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
|
5532
5371
|
setSize(event) {
|
|
5533
5372
|
this._onDidSizeChange.fire(event);
|
|
5534
5373
|
}
|
|
5535
|
-
dispose() {
|
|
5536
|
-
super.dispose();
|
|
5537
|
-
this._onDidConstraintsChange.dispose();
|
|
5538
|
-
this._onDidSizeChange.dispose();
|
|
5539
|
-
}
|
|
5540
5374
|
}
|
|
5541
5375
|
|
|
5542
5376
|
class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
@@ -5550,6 +5384,7 @@ class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
|
5550
5384
|
this.onMouseEnter = this._onMouseEnter.event;
|
|
5551
5385
|
this._onMouseLeave = new Emitter({});
|
|
5552
5386
|
this.onMouseLeave = this._onMouseLeave.event;
|
|
5387
|
+
this.addDisposables(this._onDidExpansionChange, this._onMouseEnter, this._onMouseLeave);
|
|
5553
5388
|
}
|
|
5554
5389
|
set pane(pane) {
|
|
5555
5390
|
this._pane = pane;
|
|
@@ -5718,7 +5553,7 @@ class PaneviewPanel extends BasePanelView {
|
|
|
5718
5553
|
}
|
|
5719
5554
|
}
|
|
5720
5555
|
toJSON() {
|
|
5721
|
-
const params = this.
|
|
5556
|
+
const params = this._params;
|
|
5722
5557
|
return Object.assign(Object.assign({}, super.toJSON()), { headerComponent: this.headerComponent, title: params.title });
|
|
5723
5558
|
}
|
|
5724
5559
|
renderOnce() {
|
|
@@ -5778,7 +5613,7 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
5778
5613
|
})(this.header);
|
|
5779
5614
|
this.target = new Droptarget(this.element, {
|
|
5780
5615
|
validOverlays: 'vertical',
|
|
5781
|
-
canDisplayOverlay: (
|
|
5616
|
+
canDisplayOverlay: () => {
|
|
5782
5617
|
const data = getPaneData();
|
|
5783
5618
|
if (!data) {
|
|
5784
5619
|
return true;
|
|
@@ -5787,36 +5622,39 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
5787
5622
|
},
|
|
5788
5623
|
});
|
|
5789
5624
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
5790
|
-
|
|
5791
|
-
if (!data) {
|
|
5792
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5793
|
-
return;
|
|
5794
|
-
}
|
|
5795
|
-
const containerApi = this.params
|
|
5796
|
-
.containerApi;
|
|
5797
|
-
const panelId = data.paneId;
|
|
5798
|
-
const existingPanel = containerApi.getPanel(panelId);
|
|
5799
|
-
if (!existingPanel) {
|
|
5800
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5801
|
-
return;
|
|
5802
|
-
}
|
|
5803
|
-
const allPanels = containerApi.getPanels();
|
|
5804
|
-
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5805
|
-
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5806
|
-
if (event.position === exports.Position.Left ||
|
|
5807
|
-
event.position === exports.Position.Top) {
|
|
5808
|
-
toIndex = Math.max(0, toIndex - 1);
|
|
5809
|
-
}
|
|
5810
|
-
if (event.position === exports.Position.Right ||
|
|
5811
|
-
event.position === exports.Position.Bottom) {
|
|
5812
|
-
if (fromIndex > toIndex) {
|
|
5813
|
-
toIndex++;
|
|
5814
|
-
}
|
|
5815
|
-
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5816
|
-
}
|
|
5817
|
-
containerApi.movePanel(fromIndex, toIndex);
|
|
5625
|
+
this.onDrop(event);
|
|
5818
5626
|
}));
|
|
5819
5627
|
}
|
|
5628
|
+
onDrop(event) {
|
|
5629
|
+
const data = getPaneData();
|
|
5630
|
+
if (!data) {
|
|
5631
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5632
|
+
return;
|
|
5633
|
+
}
|
|
5634
|
+
const containerApi = this._params
|
|
5635
|
+
.containerApi;
|
|
5636
|
+
const panelId = data.paneId;
|
|
5637
|
+
const existingPanel = containerApi.getPanel(panelId);
|
|
5638
|
+
if (!existingPanel) {
|
|
5639
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5640
|
+
return;
|
|
5641
|
+
}
|
|
5642
|
+
const allPanels = containerApi.getPanels();
|
|
5643
|
+
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5644
|
+
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5645
|
+
if (event.position === exports.Position.Left ||
|
|
5646
|
+
event.position === exports.Position.Top) {
|
|
5647
|
+
toIndex = Math.max(0, toIndex - 1);
|
|
5648
|
+
}
|
|
5649
|
+
if (event.position === exports.Position.Right ||
|
|
5650
|
+
event.position === exports.Position.Bottom) {
|
|
5651
|
+
if (fromIndex > toIndex) {
|
|
5652
|
+
toIndex++;
|
|
5653
|
+
}
|
|
5654
|
+
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5655
|
+
}
|
|
5656
|
+
containerApi.movePanel(fromIndex, toIndex);
|
|
5657
|
+
}
|
|
5820
5658
|
}
|
|
5821
5659
|
|
|
5822
5660
|
class DefaultHeader extends CompositeDisposable {
|
|
@@ -5846,7 +5684,7 @@ class DefaultHeader extends CompositeDisposable {
|
|
|
5846
5684
|
this._expander.textContent = e.isExpanded ? '<' : '>';
|
|
5847
5685
|
});
|
|
5848
5686
|
}
|
|
5849
|
-
update(
|
|
5687
|
+
update(_params) {
|
|
5850
5688
|
//
|
|
5851
5689
|
}
|
|
5852
5690
|
dispose() {
|
|
@@ -5872,6 +5710,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5872
5710
|
super();
|
|
5873
5711
|
this.element = element;
|
|
5874
5712
|
this._disposable = new MutableDisposable();
|
|
5713
|
+
this._viewDisposables = new Map();
|
|
5875
5714
|
this._onDidLayoutChange = new Emitter();
|
|
5876
5715
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
5877
5716
|
this._onDidDrop = new Emitter();
|
|
@@ -5880,6 +5719,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5880
5719
|
this.onDidAddView = this._onDidAddView.event;
|
|
5881
5720
|
this._onDidRemoveView = new Emitter();
|
|
5882
5721
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
5722
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
|
|
5883
5723
|
this._options = options;
|
|
5884
5724
|
if (!options.components) {
|
|
5885
5725
|
options.components = {};
|
|
@@ -5955,9 +5795,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5955
5795
|
isExpanded: !!options.isExpanded,
|
|
5956
5796
|
disableDnd: !!this.options.disableDnd,
|
|
5957
5797
|
});
|
|
5958
|
-
|
|
5959
|
-
this._onDidDrop.fire(event);
|
|
5960
|
-
}));
|
|
5798
|
+
this.doAddPanel(view);
|
|
5961
5799
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
5962
5800
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
5963
5801
|
view.init({
|
|
@@ -5970,7 +5808,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5970
5808
|
});
|
|
5971
5809
|
this.paneview.addPane(view, size, index);
|
|
5972
5810
|
view.orientation = this.paneview.orientation;
|
|
5973
|
-
return
|
|
5811
|
+
return view;
|
|
5974
5812
|
}
|
|
5975
5813
|
getPanels() {
|
|
5976
5814
|
return this.paneview.getPanes();
|
|
@@ -5979,6 +5817,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5979
5817
|
const views = this.getPanels();
|
|
5980
5818
|
const index = views.findIndex((_) => _ === panel);
|
|
5981
5819
|
this.paneview.removePane(index);
|
|
5820
|
+
this.doRemovePanel(panel);
|
|
5982
5821
|
}
|
|
5983
5822
|
movePanel(from, to) {
|
|
5984
5823
|
this.paneview.moveView(from, to);
|
|
@@ -6028,6 +5867,10 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
6028
5867
|
fromJSON(serializedPaneview, deferComponentLayout) {
|
|
6029
5868
|
const { views, size } = serializedPaneview;
|
|
6030
5869
|
const queue = [];
|
|
5870
|
+
for (const [_, value] of this._viewDisposables.entries()) {
|
|
5871
|
+
value.dispose();
|
|
5872
|
+
}
|
|
5873
|
+
this._viewDisposables.clear();
|
|
6031
5874
|
this.paneview.dispose();
|
|
6032
5875
|
this.paneview = new Paneview(this.element, {
|
|
6033
5876
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -6063,9 +5906,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
6063
5906
|
isExpanded: !!view.expanded,
|
|
6064
5907
|
disableDnd: !!this.options.disableDnd,
|
|
6065
5908
|
});
|
|
6066
|
-
|
|
6067
|
-
this._onDidDrop.fire(event);
|
|
6068
|
-
});
|
|
5909
|
+
this.doAddPanel(panel);
|
|
6069
5910
|
queue.push(() => {
|
|
6070
5911
|
panel.init({
|
|
6071
5912
|
params: data.params || {},
|
|
@@ -6095,6 +5936,27 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
6095
5936
|
queue.forEach((f) => f());
|
|
6096
5937
|
}
|
|
6097
5938
|
}
|
|
5939
|
+
doAddPanel(panel) {
|
|
5940
|
+
const disposable = panel.onDidDrop((event) => {
|
|
5941
|
+
this._onDidDrop.fire(event);
|
|
5942
|
+
});
|
|
5943
|
+
this._viewDisposables.set(panel.id, disposable);
|
|
5944
|
+
}
|
|
5945
|
+
doRemovePanel(panel) {
|
|
5946
|
+
const disposable = this._viewDisposables.get(panel.id);
|
|
5947
|
+
if (disposable) {
|
|
5948
|
+
disposable.dispose();
|
|
5949
|
+
this._viewDisposables.delete(panel.id);
|
|
5950
|
+
}
|
|
5951
|
+
}
|
|
5952
|
+
dispose() {
|
|
5953
|
+
super.dispose();
|
|
5954
|
+
for (const [_, value] of this._viewDisposables.entries()) {
|
|
5955
|
+
value.dispose();
|
|
5956
|
+
}
|
|
5957
|
+
this._viewDisposables.clear();
|
|
5958
|
+
this.paneview.dispose();
|
|
5959
|
+
}
|
|
6098
5960
|
}
|
|
6099
5961
|
|
|
6100
5962
|
class SplitviewPanel extends BasePanelView {
|
|
@@ -6107,12 +5969,14 @@ class SplitviewPanel extends BasePanelView {
|
|
|
6107
5969
|
this._snap = false;
|
|
6108
5970
|
this._onDidChange = new Emitter();
|
|
6109
5971
|
this.onDidChange = this._onDidChange.event;
|
|
6110
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
5972
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
6111
5973
|
const { isVisible } = event;
|
|
6112
|
-
const { containerApi } = this
|
|
5974
|
+
const { containerApi } = this
|
|
5975
|
+
._params;
|
|
6113
5976
|
containerApi.setVisible(this, isVisible);
|
|
6114
5977
|
}), this.api.onActiveChange(() => {
|
|
6115
|
-
const { containerApi } = this
|
|
5978
|
+
const { containerApi } = this
|
|
5979
|
+
._params;
|
|
6116
5980
|
containerApi.setActive(this);
|
|
6117
5981
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
6118
5982
|
if (typeof event.minimumSize === 'number' ||
|
|
@@ -6255,14 +6119,13 @@ class ReactPart {
|
|
|
6255
6119
|
if (this.disposed) {
|
|
6256
6120
|
throw new Error('invalid operation: resource is already disposed');
|
|
6257
6121
|
}
|
|
6258
|
-
// TODO use a better check for isReactFunctionalComponent
|
|
6259
6122
|
if (typeof this.component !== 'function') {
|
|
6260
6123
|
/**
|
|
6261
6124
|
* we know this isn't a React.FunctionComponent so throw an error here.
|
|
6262
6125
|
* if we do not intercept this the React library will throw a very obsure error
|
|
6263
6126
|
* for the same reason, at least at this point we will emit a sensible stacktrace.
|
|
6264
6127
|
*/
|
|
6265
|
-
throw new Error('
|
|
6128
|
+
throw new Error('Invalid Operation. dockview only supports React Functional Components.');
|
|
6266
6129
|
}
|
|
6267
6130
|
const bridgeComponent = React__namespace.createElement(React__namespace.forwardRef(ReactComponentBridge), {
|
|
6268
6131
|
component: this
|
|
@@ -6320,22 +6183,14 @@ class ReactPanelContentPart {
|
|
|
6320
6183
|
this.id = id;
|
|
6321
6184
|
this.component = component;
|
|
6322
6185
|
this.reactPortalStore = reactPortalStore;
|
|
6323
|
-
// private hostedContainer: HostedContainer;
|
|
6324
6186
|
this._onDidFocus = new Emitter();
|
|
6325
6187
|
this.onDidFocus = this._onDidFocus.event;
|
|
6326
6188
|
this._onDidBlur = new Emitter();
|
|
6327
6189
|
this.onDidBlur = this._onDidBlur.event;
|
|
6328
6190
|
this._element = document.createElement('div');
|
|
6329
|
-
this._element.
|
|
6330
|
-
this._element.style.width = '100%';
|
|
6331
|
-
// this.hostedContainer = new HostedContainer({
|
|
6332
|
-
// id,
|
|
6333
|
-
// });
|
|
6334
|
-
// this.hostedContainer.onDidFocus(() => this._onDidFocus.fire());
|
|
6335
|
-
// this.hostedContainer.onDidBlur(() => this._onDidBlur.fire());
|
|
6191
|
+
this._element.className = 'dockview-react-part';
|
|
6336
6192
|
this._actionsElement = document.createElement('div');
|
|
6337
|
-
this._actionsElement.
|
|
6338
|
-
this._actionsElement.style.width = '100%';
|
|
6193
|
+
this._actionsElement.className = 'dockview-react-part';
|
|
6339
6194
|
}
|
|
6340
6195
|
get element() {
|
|
6341
6196
|
return this._element;
|
|
@@ -6368,23 +6223,20 @@ class ReactPanelContentPart {
|
|
|
6368
6223
|
var _a;
|
|
6369
6224
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
6370
6225
|
}
|
|
6371
|
-
updateParentGroup(group,
|
|
6226
|
+
updateParentGroup(group, _isPanelVisible) {
|
|
6372
6227
|
this._group = group;
|
|
6373
6228
|
}
|
|
6374
|
-
layout(
|
|
6229
|
+
layout(_width, _height) {
|
|
6375
6230
|
// noop
|
|
6376
|
-
// this.hostedContainer.layout(
|
|
6377
|
-
// this.element
|
|
6378
|
-
// // { width, height }
|
|
6379
|
-
// );
|
|
6380
6231
|
}
|
|
6381
6232
|
close() {
|
|
6382
6233
|
return Promise.resolve(true);
|
|
6383
6234
|
}
|
|
6384
6235
|
dispose() {
|
|
6385
6236
|
var _a, _b;
|
|
6237
|
+
this._onDidFocus.dispose();
|
|
6238
|
+
this._onDidBlur.dispose();
|
|
6386
6239
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
6387
|
-
// this.hostedContainer?.dispose();
|
|
6388
6240
|
(_b = this.actionsPart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
6389
6241
|
}
|
|
6390
6242
|
}
|
|
@@ -6395,6 +6247,7 @@ class ReactPanelHeaderPart {
|
|
|
6395
6247
|
this.component = component;
|
|
6396
6248
|
this.reactPortalStore = reactPortalStore;
|
|
6397
6249
|
this._element = document.createElement('div');
|
|
6250
|
+
this._element.className = 'dockview-react-part';
|
|
6398
6251
|
}
|
|
6399
6252
|
get element() {
|
|
6400
6253
|
return this._element;
|
|
@@ -6418,10 +6271,10 @@ class ReactPanelHeaderPart {
|
|
|
6418
6271
|
id: this.id,
|
|
6419
6272
|
};
|
|
6420
6273
|
}
|
|
6421
|
-
layout(
|
|
6274
|
+
layout(_width, _height) {
|
|
6422
6275
|
// noop - retrieval from api
|
|
6423
6276
|
}
|
|
6424
|
-
updateParentGroup(
|
|
6277
|
+
updateParentGroup(_group, _isPanelVisible) {
|
|
6425
6278
|
// noop - retrieval from api
|
|
6426
6279
|
}
|
|
6427
6280
|
dispose() {
|
|
@@ -6439,7 +6292,6 @@ class ReactPanelDeserialzier {
|
|
|
6439
6292
|
const panelId = panelData.id;
|
|
6440
6293
|
const params = panelData.params;
|
|
6441
6294
|
const title = panelData.title;
|
|
6442
|
-
const state = panelData.state;
|
|
6443
6295
|
const suppressClosable = panelData.suppressClosable;
|
|
6444
6296
|
const viewData = panelData.view;
|
|
6445
6297
|
const view = new DefaultGroupPanelView({
|
|
@@ -6448,13 +6300,12 @@ class ReactPanelDeserialzier {
|
|
|
6448
6300
|
? 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)
|
|
6449
6301
|
: new DefaultTab(),
|
|
6450
6302
|
});
|
|
6451
|
-
const panel = new DockviewGroupPanel(panelId, new DockviewApi(this.layout));
|
|
6303
|
+
const panel = new DockviewGroupPanel(panelId, this.layout, new DockviewApi(this.layout));
|
|
6452
6304
|
panel.init({
|
|
6453
6305
|
view,
|
|
6454
6306
|
title,
|
|
6455
6307
|
suppressClosable,
|
|
6456
6308
|
params: params || {},
|
|
6457
|
-
state: state || {},
|
|
6458
6309
|
});
|
|
6459
6310
|
return panel;
|
|
6460
6311
|
}
|
|
@@ -6469,8 +6320,7 @@ class ReactWatermarkPart {
|
|
|
6469
6320
|
value: undefined,
|
|
6470
6321
|
};
|
|
6471
6322
|
this._element = document.createElement('div');
|
|
6472
|
-
this._element.
|
|
6473
|
-
this._element.style.width = '100%';
|
|
6323
|
+
this._element.className = 'dockview-react-part';
|
|
6474
6324
|
}
|
|
6475
6325
|
get element() {
|
|
6476
6326
|
return this._element;
|
|
@@ -6503,10 +6353,10 @@ class ReactWatermarkPart {
|
|
|
6503
6353
|
id: this.id,
|
|
6504
6354
|
};
|
|
6505
6355
|
}
|
|
6506
|
-
layout(
|
|
6356
|
+
layout(_width, _height) {
|
|
6507
6357
|
// noop - retrieval from api
|
|
6508
6358
|
}
|
|
6509
|
-
updateParentGroup(group,
|
|
6359
|
+
updateParentGroup(group, _isPanelVisible) {
|
|
6510
6360
|
// noop - retrieval from api
|
|
6511
6361
|
this._groupRef.value = group;
|
|
6512
6362
|
}
|
|
@@ -6540,21 +6390,21 @@ const DockviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6540
6390
|
var _a;
|
|
6541
6391
|
const factory = {
|
|
6542
6392
|
content: {
|
|
6543
|
-
createComponent: (
|
|
6393
|
+
createComponent: (_id, componentId, component) => {
|
|
6544
6394
|
return new ReactPanelContentPart(componentId, component, {
|
|
6545
6395
|
addPortal,
|
|
6546
6396
|
});
|
|
6547
6397
|
},
|
|
6548
6398
|
},
|
|
6549
6399
|
tab: {
|
|
6550
|
-
createComponent: (
|
|
6400
|
+
createComponent: (_id, componentId, component) => {
|
|
6551
6401
|
return new ReactPanelHeaderPart(componentId, component, {
|
|
6552
6402
|
addPortal,
|
|
6553
6403
|
});
|
|
6554
6404
|
},
|
|
6555
6405
|
},
|
|
6556
6406
|
watermark: {
|
|
6557
|
-
createComponent: (
|
|
6407
|
+
createComponent: (_id, componentId, component) => {
|
|
6558
6408
|
return new ReactWatermarkPart(componentId, component, {
|
|
6559
6409
|
addPortal,
|
|
6560
6410
|
});
|
|
@@ -6568,7 +6418,6 @@ const DockviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6568
6418
|
frameworkTabComponents: props.tabComponents,
|
|
6569
6419
|
tabHeight: props.tabHeight,
|
|
6570
6420
|
debug: props.debug,
|
|
6571
|
-
enableExternalDragEvents: props.enableExternalDragEvents,
|
|
6572
6421
|
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6573
6422
|
styles: props.hideBorders
|
|
6574
6423
|
? { separatorBorder: 'transparent' }
|
|
@@ -6584,8 +6433,24 @@ const DockviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6584
6433
|
dockviewRef.current = dockview;
|
|
6585
6434
|
return () => {
|
|
6586
6435
|
dockview.dispose();
|
|
6436
|
+
element.remove();
|
|
6587
6437
|
};
|
|
6588
6438
|
}, []);
|
|
6439
|
+
React__namespace.useEffect(() => {
|
|
6440
|
+
if (!dockviewRef.current) {
|
|
6441
|
+
return () => {
|
|
6442
|
+
// noop
|
|
6443
|
+
};
|
|
6444
|
+
}
|
|
6445
|
+
const disposable = dockviewRef.current.onDidDrop((event) => {
|
|
6446
|
+
if (props.onDidDrop) {
|
|
6447
|
+
props.onDidDrop(event);
|
|
6448
|
+
}
|
|
6449
|
+
});
|
|
6450
|
+
return () => {
|
|
6451
|
+
disposable.dispose();
|
|
6452
|
+
};
|
|
6453
|
+
}, [props.onDidDrop]);
|
|
6589
6454
|
React__namespace.useEffect(() => {
|
|
6590
6455
|
if (!dockviewRef.current) {
|
|
6591
6456
|
return;
|
|
@@ -6594,6 +6459,22 @@ const DockviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6594
6459
|
frameworkComponents: props.components,
|
|
6595
6460
|
});
|
|
6596
6461
|
}, [props.components]);
|
|
6462
|
+
React__namespace.useEffect(() => {
|
|
6463
|
+
if (!dockviewRef.current) {
|
|
6464
|
+
return;
|
|
6465
|
+
}
|
|
6466
|
+
dockviewRef.current.updateOptions({
|
|
6467
|
+
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6468
|
+
});
|
|
6469
|
+
}, [props.watermarkComponent]);
|
|
6470
|
+
React__namespace.useEffect(() => {
|
|
6471
|
+
if (!dockviewRef.current) {
|
|
6472
|
+
return;
|
|
6473
|
+
}
|
|
6474
|
+
dockviewRef.current.updateOptions({
|
|
6475
|
+
showDndOverlay: props.showDndOverlay,
|
|
6476
|
+
});
|
|
6477
|
+
}, [props.showDndOverlay]);
|
|
6597
6478
|
React__namespace.useEffect(() => {
|
|
6598
6479
|
if (!dockviewRef.current) {
|
|
6599
6480
|
return;
|
|
@@ -6682,9 +6563,9 @@ class ReactPanelView extends SplitviewPanel {
|
|
|
6682
6563
|
getComponent() {
|
|
6683
6564
|
var _a;
|
|
6684
6565
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6685
|
-
params: ((_a = this.
|
|
6566
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6686
6567
|
api: this.api,
|
|
6687
|
-
containerApi: this.
|
|
6568
|
+
containerApi: this._params
|
|
6688
6569
|
.containerApi,
|
|
6689
6570
|
});
|
|
6690
6571
|
}
|
|
@@ -6721,7 +6602,9 @@ const SplitviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6721
6602
|
});
|
|
6722
6603
|
},
|
|
6723
6604
|
},
|
|
6724
|
-
proportionalLayout: props.proportionalLayout
|
|
6605
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
6606
|
+
? props.proportionalLayout
|
|
6607
|
+
: true,
|
|
6725
6608
|
styles: props.hideBorders
|
|
6726
6609
|
? { separatorBorder: 'transparent' }
|
|
6727
6610
|
: undefined,
|
|
@@ -6757,9 +6640,9 @@ class ReactGridPanelView extends GridviewPanel {
|
|
|
6757
6640
|
getComponent() {
|
|
6758
6641
|
var _a;
|
|
6759
6642
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6760
|
-
params: ((_a = this.
|
|
6643
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6761
6644
|
api: this.api,
|
|
6762
|
-
containerApi: this.
|
|
6645
|
+
containerApi: this._params
|
|
6763
6646
|
.containerApi,
|
|
6764
6647
|
});
|
|
6765
6648
|
}
|
|
@@ -6789,7 +6672,9 @@ const GridviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6789
6672
|
var _a;
|
|
6790
6673
|
const element = document.createElement('div');
|
|
6791
6674
|
const gridview = new GridviewComponent(element, {
|
|
6792
|
-
proportionalLayout:
|
|
6675
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
6676
|
+
? props.proportionalLayout
|
|
6677
|
+
: true,
|
|
6793
6678
|
orientation: props.orientation,
|
|
6794
6679
|
frameworkComponents: props.components,
|
|
6795
6680
|
frameworkComponentFactory: {
|
|
@@ -6812,6 +6697,7 @@ const GridviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6812
6697
|
gridviewRef.current = gridview;
|
|
6813
6698
|
return () => {
|
|
6814
6699
|
gridview.dispose();
|
|
6700
|
+
element.remove();
|
|
6815
6701
|
};
|
|
6816
6702
|
}, []);
|
|
6817
6703
|
React__namespace.useEffect(() => {
|
|
@@ -6882,7 +6768,7 @@ const PaneviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6882
6768
|
};
|
|
6883
6769
|
}, [props.disableAutoResizing]);
|
|
6884
6770
|
React__namespace.useEffect(() => {
|
|
6885
|
-
const createComponent = (id,
|
|
6771
|
+
const createComponent = (id, _componentId, component) => new PanePanelSection(id, component, {
|
|
6886
6772
|
addPortal,
|
|
6887
6773
|
});
|
|
6888
6774
|
const paneview = new PaneviewComponent(domRef.current, {
|
|
@@ -6948,14 +6834,11 @@ const PaneviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6948
6834
|
PaneviewReact.displayName = 'PaneviewComponent';
|
|
6949
6835
|
|
|
6950
6836
|
exports.BaseGrid = BaseGrid;
|
|
6951
|
-
exports.CompositeDisposable = CompositeDisposable;
|
|
6952
6837
|
exports.ContentContainer = ContentContainer;
|
|
6953
|
-
exports.DATA_KEY = DATA_KEY;
|
|
6954
6838
|
exports.DockviewApi = DockviewApi;
|
|
6955
6839
|
exports.DockviewComponent = DockviewComponent;
|
|
6956
6840
|
exports.DockviewComponents = DockviewComponents;
|
|
6957
6841
|
exports.DockviewReact = DockviewReact;
|
|
6958
|
-
exports.Emitter = Emitter;
|
|
6959
6842
|
exports.Gridview = Gridview;
|
|
6960
6843
|
exports.GridviewApi = GridviewApi;
|
|
6961
6844
|
exports.GridviewComponent = GridviewComponent;
|
|
@@ -6963,7 +6846,6 @@ exports.GridviewPanel = GridviewPanel;
|
|
|
6963
6846
|
exports.GridviewReact = GridviewReact;
|
|
6964
6847
|
exports.Groupview = Groupview;
|
|
6965
6848
|
exports.LocalSelectionTransfer = LocalSelectionTransfer;
|
|
6966
|
-
exports.MutableDisposable = MutableDisposable;
|
|
6967
6849
|
exports.PaneFramework = PaneFramework;
|
|
6968
6850
|
exports.PaneTransfer = PaneTransfer;
|
|
6969
6851
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -6982,10 +6864,6 @@ exports.SplitviewComponent = SplitviewComponent;
|
|
|
6982
6864
|
exports.SplitviewPanel = SplitviewPanel;
|
|
6983
6865
|
exports.SplitviewReact = SplitviewReact;
|
|
6984
6866
|
exports.Tab = Tab$1;
|
|
6985
|
-
exports.TickDelayedEvent = TickDelayedEvent;
|
|
6986
|
-
exports.addDisposableListener = addDisposableListener;
|
|
6987
|
-
exports.addDisposableWindowListener = addDisposableWindowListener;
|
|
6988
|
-
exports.extractData = extractData;
|
|
6989
6867
|
exports.getDirectionOrientation = getDirectionOrientation;
|
|
6990
6868
|
exports.getGridLocation = getGridLocation;
|
|
6991
6869
|
exports.getLocationOrientation = getLocationOrientation;
|
|
@@ -6993,11 +6871,8 @@ exports.getPaneData = getPaneData;
|
|
|
6993
6871
|
exports.getPanelData = getPanelData;
|
|
6994
6872
|
exports.getRelativeLocation = getRelativeLocation;
|
|
6995
6873
|
exports.indexInParent = indexInParent;
|
|
6996
|
-
exports.isCustomDragEvent = isCustomDragEvent;
|
|
6997
6874
|
exports.isGridBranchNode = isGridBranchNode;
|
|
6998
|
-
exports.isPanelTransferEvent = isPanelTransferEvent;
|
|
6999
6875
|
exports.isReactElement = isReactElement;
|
|
7000
|
-
exports.isTabDragEvent = isTabDragEvent;
|
|
7001
6876
|
exports.orthogonal = orthogonal;
|
|
7002
6877
|
exports.toTarget = toTarget;
|
|
7003
6878
|
exports.usePortalsLifecycle = usePortalsLifecycle;
|