dockview 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +243 -186
- package/dist/cjs/api/component.api.d.ts +28 -19
- package/dist/cjs/api/component.api.js +104 -33
- package/dist/cjs/api/component.api.js.map +1 -1
- package/dist/cjs/api/gridviewPanelApi.js +1 -0
- package/dist/cjs/api/gridviewPanelApi.js.map +1 -1
- package/dist/cjs/api/groupPanelApi.d.ts +11 -14
- package/dist/cjs/api/groupPanelApi.js +19 -17
- package/dist/cjs/api/groupPanelApi.js.map +1 -1
- package/dist/cjs/api/panelApi.d.ts +0 -25
- package/dist/cjs/api/panelApi.js +1 -20
- package/dist/cjs/api/panelApi.js.map +1 -1
- package/dist/cjs/api/paneviewPanelApi.js +1 -0
- package/dist/cjs/api/paneviewPanelApi.js.map +1 -1
- package/dist/cjs/api/splitviewPanelApi.d.ts +0 -1
- package/dist/cjs/api/splitviewPanelApi.js +1 -5
- package/dist/cjs/api/splitviewPanelApi.js.map +1 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts +3 -3
- package/dist/cjs/dnd/abstractDragHandler.js +15 -14
- package/dist/cjs/dnd/abstractDragHandler.js.map +1 -1
- package/dist/cjs/dnd/dataTransfer.d.ts +0 -25
- package/dist/cjs/dnd/dataTransfer.js +1 -45
- package/dist/cjs/dnd/dataTransfer.js.map +1 -1
- package/dist/cjs/dnd/dnd.d.ts +1 -14
- package/dist/cjs/dnd/dnd.js +1 -79
- package/dist/cjs/dnd/dnd.js.map +1 -1
- package/dist/cjs/dnd/droptarget.d.ts +3 -0
- package/dist/cjs/dnd/droptarget.js +69 -45
- package/dist/cjs/dnd/droptarget.js.map +1 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +0 -1
- package/dist/cjs/dockview/components/tab/defaultTab.js +0 -8
- package/dist/cjs/dockview/components/tab/defaultTab.js.map +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +27 -19
- package/dist/cjs/dockview/dockviewComponent.js +67 -178
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +2 -5
- package/dist/cjs/dockview/dockviewGroupPanel.js +2 -31
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +1 -1
- package/dist/cjs/dockview/options.d.ts +2 -1
- package/dist/cjs/events.js +25 -4
- package/dist/cjs/events.js.map +1 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +9 -0
- package/dist/cjs/gridview/baseComponentGridview.js +14 -2
- package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
- package/dist/cjs/gridview/basePanelView.d.ts +5 -8
- package/dist/cjs/gridview/basePanelView.js +14 -8
- package/dist/cjs/gridview/basePanelView.js.map +1 -1
- package/dist/cjs/gridview/branchNode.js +1 -1
- package/dist/cjs/gridview/branchNode.js.map +1 -1
- package/dist/cjs/gridview/gridview.js +19 -17
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +4 -0
- package/dist/cjs/gridview/gridviewComponent.js +5 -0
- package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts +0 -1
- package/dist/cjs/gridview/gridviewPanel.js +3 -6
- package/dist/cjs/gridview/gridviewPanel.js.map +1 -1
- package/dist/cjs/gridview/leafNode.js +1 -0
- package/dist/cjs/gridview/leafNode.js.map +1 -1
- package/dist/cjs/groupview/groupPanel.d.ts +0 -7
- package/dist/cjs/groupview/groupview.d.ts +15 -8
- package/dist/cjs/groupview/groupview.js +36 -123
- package/dist/cjs/groupview/groupview.js.map +1 -1
- package/dist/cjs/groupview/groupviewPanel.d.ts +5 -2
- package/dist/cjs/groupview/groupviewPanel.js.map +1 -1
- package/dist/cjs/groupview/panel/content.js +1 -0
- package/dist/cjs/groupview/panel/content.js.map +1 -1
- package/dist/cjs/groupview/tab.d.ts +10 -13
- package/dist/cjs/groupview/tab.js +22 -80
- package/dist/cjs/groupview/tab.js.map +1 -1
- package/dist/cjs/groupview/titlebar/tabsContainer.js +4 -6
- package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/lifecycle.js +2 -1
- package/dist/cjs/lifecycle.js.map +1 -1
- package/dist/cjs/panel/types.d.ts +0 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.js +31 -28
- package/dist/cjs/paneview/draggablePaneviewPanel.js.map +1 -1
- package/dist/cjs/paneview/paneview.js +1 -1
- package/dist/cjs/paneview/paneview.js.map +1 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +0 -3
- package/dist/cjs/paneview/paneviewComponent.js +1 -0
- package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
- package/dist/cjs/paneview/paneviewPanel.js +1 -1
- package/dist/cjs/paneview/paneviewPanel.js.map +1 -1
- package/dist/cjs/react/deserializer.js +1 -3
- package/dist/cjs/react/deserializer.js.map +1 -1
- package/dist/cjs/react/dockview/dockview.d.ts +9 -9
- package/dist/cjs/react/dockview/dockview.js +14 -1
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/cjs/react/dockview/reactContentPart.js +4 -4
- package/dist/cjs/react/dockview/reactContentPart.js.map +1 -1
- package/dist/cjs/react/dockview/reactHeaderPart.js +1 -0
- package/dist/cjs/react/dockview/reactHeaderPart.js.map +1 -1
- package/dist/cjs/react/dockview/reactWatermarkPart.d.ts +1 -2
- package/dist/cjs/react/dockview/reactWatermarkPart.js +1 -2
- package/dist/cjs/react/dockview/reactWatermarkPart.js.map +1 -1
- package/dist/cjs/react/gridview/view.js +2 -2
- package/dist/cjs/react/gridview/view.js.map +1 -1
- package/dist/cjs/react/index.d.ts +1 -0
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/react/react.js +1 -2
- package/dist/cjs/react/react.js.map +1 -1
- package/dist/cjs/react/splitview/view.js +2 -2
- package/dist/cjs/react/splitview/view.js.map +1 -1
- package/dist/cjs/splitview/splitviewComponent.d.ts +0 -3
- package/dist/cjs/splitview/splitviewComponent.js +1 -1
- package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
- package/dist/cjs/splitview/splitviewPanel.d.ts +1 -6
- package/dist/cjs/splitview/splitviewPanel.js +5 -3
- package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
- package/dist/dockview.amd.js +394 -532
- package/dist/dockview.amd.min.js +2 -16
- package/dist/dockview.amd.min.noStyle.js +2 -16
- package/dist/dockview.amd.noStyle.js +393 -531
- package/dist/dockview.cjs.js +394 -532
- package/dist/dockview.esm.js +395 -528
- package/dist/dockview.esm.min.js +2 -16
- package/dist/dockview.js +394 -532
- package/dist/dockview.min.js +2 -16
- package/dist/dockview.min.noStyle.js +2 -16
- package/dist/dockview.noStyle.js +393 -531
- package/dist/esm/api/component.api.d.ts +28 -19
- package/dist/esm/api/component.api.js +48 -21
- package/dist/esm/api/gridviewPanelApi.js +1 -0
- package/dist/esm/api/groupPanelApi.d.ts +11 -14
- package/dist/esm/api/groupPanelApi.js +18 -13
- package/dist/esm/api/panelApi.d.ts +0 -25
- package/dist/esm/api/panelApi.js +1 -20
- package/dist/esm/api/paneviewPanelApi.js +1 -0
- package/dist/esm/api/splitviewPanelApi.d.ts +0 -1
- package/dist/esm/api/splitviewPanelApi.js +1 -5
- package/dist/esm/dnd/abstractDragHandler.d.ts +3 -3
- package/dist/esm/dnd/abstractDragHandler.js +9 -8
- package/dist/esm/dnd/dataTransfer.d.ts +0 -25
- package/dist/esm/dnd/dataTransfer.js +0 -40
- package/dist/esm/dnd/dnd.d.ts +1 -14
- package/dist/esm/dnd/dnd.js +1 -69
- package/dist/esm/dnd/droptarget.d.ts +3 -0
- package/dist/esm/dnd/droptarget.js +69 -45
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +0 -1
- package/dist/esm/dockview/components/tab/defaultTab.js +1 -9
- package/dist/esm/dockview/dockviewComponent.d.ts +27 -19
- package/dist/esm/dockview/dockviewComponent.js +54 -118
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +2 -5
- package/dist/esm/dockview/dockviewGroupPanel.js +2 -30
- package/dist/esm/dockview/options.d.ts +2 -1
- package/dist/esm/events.js +2 -3
- package/dist/esm/gridview/baseComponentGridview.d.ts +9 -0
- package/dist/esm/gridview/baseComponentGridview.js +14 -2
- package/dist/esm/gridview/basePanelView.d.ts +5 -8
- package/dist/esm/gridview/basePanelView.js +10 -8
- package/dist/esm/gridview/branchNode.js +1 -1
- package/dist/esm/gridview/gridview.js +16 -15
- package/dist/esm/gridview/gridviewComponent.d.ts +4 -0
- package/dist/esm/gridview/gridviewComponent.js +5 -0
- package/dist/esm/gridview/gridviewPanel.d.ts +0 -1
- package/dist/esm/gridview/gridviewPanel.js +3 -6
- package/dist/esm/gridview/leafNode.js +1 -0
- package/dist/esm/groupview/groupPanel.d.ts +0 -7
- package/dist/esm/groupview/groupview.d.ts +15 -8
- package/dist/esm/groupview/groupview.js +22 -56
- package/dist/esm/groupview/groupviewPanel.d.ts +5 -2
- package/dist/esm/groupview/panel/content.js +1 -0
- package/dist/esm/groupview/tab.d.ts +10 -13
- package/dist/esm/groupview/tab.js +17 -24
- package/dist/esm/groupview/titlebar/tabsContainer.js +4 -6
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/lifecycle.js +2 -1
- package/dist/esm/panel/types.d.ts +0 -2
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/esm/paneview/draggablePaneviewPanel.js +31 -28
- package/dist/esm/paneview/paneview.js +1 -1
- package/dist/esm/paneview/paneviewComponent.d.ts +0 -3
- package/dist/esm/paneview/paneviewComponent.js +1 -0
- package/dist/esm/paneview/paneviewPanel.js +1 -1
- package/dist/esm/react/deserializer.js +1 -3
- package/dist/esm/react/dockview/dockview.d.ts +9 -9
- package/dist/esm/react/dockview/dockview.js +15 -2
- package/dist/esm/react/dockview/reactContentPart.js +4 -4
- package/dist/esm/react/dockview/reactHeaderPart.js +1 -0
- package/dist/esm/react/dockview/reactWatermarkPart.d.ts +1 -2
- package/dist/esm/react/dockview/reactWatermarkPart.js +1 -2
- package/dist/esm/react/gridview/view.js +2 -2
- package/dist/esm/react/index.d.ts +1 -0
- package/dist/esm/react/react.js +1 -2
- package/dist/esm/react/splitview/view.js +2 -2
- package/dist/esm/splitview/splitviewComponent.d.ts +0 -3
- package/dist/esm/splitview/splitviewComponent.js +1 -1
- package/dist/esm/splitview/splitviewPanel.d.ts +1 -6
- package/dist/esm/splitview/splitviewPanel.js +5 -3
- package/dist/styles/dockview.css +5 -9
- package/package.json +2 -2
- package/dist/cjs/functions.d.ts +0 -1
- package/dist/cjs/functions.js +0 -42
- package/dist/cjs/functions.js.map +0 -1
- package/dist/cjs/groupview/panel/hostedPanel.d.ts +0 -22
- package/dist/cjs/groupview/panel/hostedPanel.js +0 -57
- package/dist/cjs/groupview/panel/hostedPanel.js.map +0 -1
- package/dist/cjs/json.d.ts +0 -1
- package/dist/cjs/json.js +0 -14
- package/dist/cjs/json.js.map +0 -1
- package/dist/esm/functions.d.ts +0 -1
- package/dist/esm/functions.js +0 -8
- package/dist/esm/groupview/panel/hostedPanel.d.ts +0 -22
- package/dist/esm/groupview/panel/hostedPanel.js +0 -43
- package/dist/esm/json.d.ts +0 -1
- package/dist/esm/json.js +0 -9
package/dist/dockview.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -34,7 +34,7 @@ function styleInject(css, ref) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
var css_248z = ".dockview-theme-dark {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n}\n\n.dockview-theme-light {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: white;\n --dv-tabs-and-actions-container-background-color: #f3f3f3;\n --dv-activegroup-visiblepanel-tab-background-color: white;\n --dv-activegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-inactivegroup-visiblepanel-tab-background-color: white;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-tab-divider-color: white;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.35);\n --dv-separator-border: rgba(128, 128, 128, 0.35);\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n}\n\n.dockview-theme-vs {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n --dv-activegroup-visiblepanel-tab-background-color: dodgerblue;\n --dv-tabs-and-actions-container-height: 18px;\n --dv-tabs-and-actions-container-font-size: 11px;\n}\n.dockview-theme-vs .groupview.active-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.inactive-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.actions-bar {\n text-align: right;\n width: 28px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n.actions-bar .actions-container {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.actions-bar .actions-container a:active {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.actions-bar .actions-container .close-action {\n background-color: white;\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n cursor: pointer;\n}\n.drop-target {\n position: relative;\n}\n.drop-target > .drop-target-dropzone {\n position: absolute;\n left: 0px;\n top: 0px;\n height: 100%;\n width: 100%;\n z-index: 10000;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection {\n position: relative;\n pointer-events: none;\n box-sizing: border-box;\n height: 100%;\n width: 100%;\n background-color: var(--dv-drag-over-background-color);\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.left, .drop-target > .drop-target-dropzone > .drop-target-selection.right {\n width: 50%;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.right {\n transform: translate(100%, 0%);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.bottom {\n transform: translate(0%, 100%);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.top, .drop-target > .drop-target-dropzone > .drop-target-selection.bottom {\n height: 50%;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-top {\n border-top: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-bottom {\n border-bottom: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-left {\n border-left: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-right {\n border-right: 1px solid var(--dv-drag-over-border-color);\n}\n.custom-dragging {\n height: 24px;\n line-height: 24px;\n font-size: 11px;\n width: 100px;\n background-color: dodgerblue;\n color: ghostwhite;\n border-radius: 11px;\n position: absolute;\n padding-left: 10px;\n}\n\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab .tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {\n background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab .tab-action {\n background-color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-background-color);\n color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab .tab-action {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-background-color);\n color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab .tab-action {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n\n/**\n * when a tab is dragged we lose the above stylings because they are conditional on parent elements\n * therefore we also set some stylings for the dragging event\n **/\n.tab.dragging {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.grid-view,\n.branch-node {\n height: 100%;\n width: 100%;\n}\n.groupview {\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: var(--dv-group-view-background-color);\n overflow: hidden;\n}\n.groupview:focus {\n outline: none;\n}\n.groupview.empty > .tabs-and-actions-container {\n display: none;\n}\n.groupview > .content-container {\n flex-grow: 1;\n overflow: hidden;\n outline: none;\n}\n.pane-container {\n height: 100%;\n width: 100%;\n}\n.pane-container.animated .view {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.pane-container .view {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n padding: 0px !important;\n}\n.pane-container .view:not(:first-child)::before {\n background-color: transparent !important;\n}\n.pane-container .view:not(:first-child) .pane > .pane-header {\n border-top: 1px solid var(--dv-paneview-header-border-color);\n}\n.pane-container .view .default-header {\n background-color: var(--dv-group-view-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n display: flex;\n padding: 0px 8px;\n}\n.pane-container .view .default-header > span {\n flex-grow: 1;\n}\n.pane-container:first-of-type > .pane > .pane-header {\n border-top: none !important;\n}\n.pane-container .pane {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n height: 100%;\n}\n.pane-container .pane .pane-header {\n box-sizing: border-box;\n user-select: none;\n position: relative;\n outline: none;\n}\n.pane-container .pane .pane-header.pane-draggable {\n cursor: pointer;\n}\n.pane-container .pane .pane-header:focus:before, .pane-container .pane .pane-header:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: \"\";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.pane-container .pane .pane-body {\n overflow-y: auto;\n overflow-x: hidden;\n flex-grow: 1;\n position: relative;\n outline: none;\n}\n.pane-container .pane .pane-body:focus:before, .pane-container .pane .pane-body:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: \"\";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.tabs-and-actions-container {\n display: flex;\n background-color: var(--dv-tabs-and-actions-container-background-color);\n flex-shrink: 0;\n box-sizing: border-box;\n height: var(--dv-tabs-and-actions-container-height);\n font-size: var(--dv-tabs-and-actions-container-font-size);\n}\n.tabs-and-actions-container.hidden {\n display: none;\n}\n.tabs-and-actions-container .void-container {\n display: flex;\n flex-grow: 1;\n}\n.tabs-and-actions-container .tabs-container {\n display: flex;\n overflow-x: overlay;\n overflow-y: hidden;\n scrollbar-width: thin;\n /* Track */\n /* Handle */\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar {\n height: 3px;\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar-track {\n background: transparent;\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar-thumb {\n background: var(--dv-tabs-container-scrollbar-color);\n}\n.tabs-and-actions-container .tabs-container .tab {\n -webkit-user-drag: element;\n outline: none;\n min-width: 75px;\n cursor: pointer;\n position: relative;\n box-sizing: border-box;\n}\n.tabs-and-actions-container .tabs-container .tab:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-tab-divider-color);\n width: 1px;\n height: 100%;\n}\n.split-view-container {\n position: relative;\n overflow: hidden;\n height: 100%;\n width: 100%;\n}\n.split-view-container.animation .view,\n.split-view-container.animation .sash {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.split-view-container.horizontal {\n height: 100%;\n}\n.split-view-container.horizontal > .sash-container > .sash {\n height: 100%;\n width: 4px;\n}\n.split-view-container.horizontal > .sash-container > .sash.enabled {\n cursor: ew-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.horizontal > .sash-container > .sash.maximum {\n cursor: w-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.minimum {\n cursor: e-resize;\n}\n.split-view-container.horizontal > .view-container > .view:not(:first-child)::before {\n height: 100%;\n width: 1px;\n}\n.split-view-container.vertical {\n width: 100%;\n}\n.split-view-container.vertical > .sash-container > .sash {\n width: 100%;\n height: 4px;\n}\n.split-view-container.vertical > .sash-container > .sash.enabled {\n cursor: ns-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.vertical > .sash-container > .sash.maximum {\n cursor: n-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.minimum {\n cursor: s-resize;\n}\n.split-view-container.vertical > .view-container > .view {\n width: 100%;\n}\n.split-view-container.vertical > .view-container > .view:not(:first-child)::before {\n height: 1px;\n width: 100%;\n}\n.split-view-container .sash-container {\n height: 100%;\n width: 100%;\n position: absolute;\n}\n.split-view-container .sash-container .sash {\n position: absolute;\n z-index: 99;\n outline: none;\n}\n.split-view-container .sash-container .sash:active {\n transition: background-color 0.1s ease-in-out;\n background-color: var(--dv-active-sash-color, transparent);\n}\n.split-view-container .sash-container .sash:hover {\n background-color: var(--dv-active-sash-color, transparent);\n transition: background-color 0.1s ease-in-out;\n transition-delay: 0.5s;\n}\n.split-view-container .view-container {\n position: relative;\n height: 100%;\n width: 100%;\n}\n.split-view-container .view-container .view {\n height: 100%;\n box-sizing: border-box;\n overflow: auto;\n position: absolute;\n}\n.split-view-container.separator-border .view:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-separator-border);\n}\n.dragged {\n transform: translate3d(0px, 0px, 0px);\n /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */\n}\n\n.tab {\n flex-shrink: 0;\n}\n.tab.dragging .tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.tab.active-tab > .default-tab .tab-action {\n visibility: visible;\n}\n.tab.inactive-tab > .default-tab .tab-action:not(.dirty) {\n visibility: hidden;\n}\n.tab.inactive-tab > .default-tab:hover .tab-action {\n visibility: visible;\n}\n.tab .default-tab {\n position: relative;\n height: 100%;\n display: flex;\n min-width: 80px;\n align-items: center;\n padding-left: 10px;\n white-space: nowrap;\n text-overflow: elipsis;\n}\n.tab .default-tab .tab-content {\n flex-grow: 1;\n}\n.tab .default-tab .action-container {\n text-align: right;\n width: 28px;\n display: flex;\n}\n.tab .default-tab .action-container .tab-list {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.tab .default-tab .action-container .tab-list a:active:hover {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.tab .default-tab .action-container .tab-list .tab-action {\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n}\n.tab .default-tab .action-container .tab-list .tab-action.disable-close {\n display: none;\n}\n.tab .default-tab .action-container .tab-list .tab-action.dirty:not(:hover) {\n display: block;\n -webkit-mask: var(--dv-tab-dirty-icon) 50% 50%/60% 60% no-repeat;\n mask: var(--dv-tab-dirty-icon) 50% 50%/60% 60% no-repeat;\n}\n.watermark {\n display: flex;\n width: 100%;\n}\n.watermark.has-actions .watermark-title .actions-bar {\n display: none;\n}\n.watermark .watermark-title {\n height: 35px;\n width: 100%;\n display: flex;\n}\n.watermark .watermark-content {\n flex-grow: 1;\n}";
|
|
37
|
+
var css_248z = ".dockview-theme-dark {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n}\n\n.dockview-theme-light {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: white;\n --dv-tabs-and-actions-container-background-color: #f3f3f3;\n --dv-activegroup-visiblepanel-tab-background-color: white;\n --dv-activegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-inactivegroup-visiblepanel-tab-background-color: white;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-tab-divider-color: white;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.35);\n --dv-separator-border: rgba(128, 128, 128, 0.35);\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n}\n\n.dockview-theme-vs {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n --dv-activegroup-visiblepanel-tab-background-color: dodgerblue;\n --dv-tabs-and-actions-container-height: 18px;\n --dv-tabs-and-actions-container-font-size: 11px;\n}\n.dockview-theme-vs .groupview.active-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.inactive-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.actions-bar {\n text-align: right;\n width: 28px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n.actions-bar .actions-container {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.actions-bar .actions-container a:active {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.actions-bar .actions-container .close-action {\n background-color: white;\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n cursor: pointer;\n}\n.drop-target {\n position: relative;\n}\n.drop-target > .drop-target-dropzone {\n position: absolute;\n left: 0px;\n top: 0px;\n height: 100%;\n width: 100%;\n z-index: 10000;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection {\n position: relative;\n 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.dockview-react-part {\n height: 100%;\n width: 100%;\n}\n.split-view-container {\n position: relative;\n overflow: hidden;\n height: 100%;\n width: 100%;\n}\n.split-view-container.animation .view,\n.split-view-container.animation .sash {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.split-view-container.horizontal {\n height: 100%;\n}\n.split-view-container.horizontal > .sash-container > .sash {\n height: 100%;\n width: 4px;\n}\n.split-view-container.horizontal > .sash-container > .sash.enabled {\n cursor: ew-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.horizontal > .sash-container > .sash.maximum {\n cursor: w-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.minimum {\n cursor: e-resize;\n}\n.split-view-container.horizontal > .view-container > .view:not(:first-child)::before {\n height: 100%;\n width: 1px;\n}\n.split-view-container.vertical {\n width: 100%;\n}\n.split-view-container.vertical > .sash-container > .sash {\n width: 100%;\n height: 4px;\n}\n.split-view-container.vertical > .sash-container > .sash.enabled {\n cursor: ns-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.vertical > .sash-container > .sash.maximum {\n cursor: n-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.minimum {\n cursor: s-resize;\n}\n.split-view-container.vertical > .view-container > .view {\n width: 100%;\n}\n.split-view-container.vertical > .view-container > .view:not(:first-child)::before {\n height: 1px;\n width: 100%;\n}\n.split-view-container .sash-container {\n height: 100%;\n width: 100%;\n position: absolute;\n}\n.split-view-container .sash-container .sash {\n position: absolute;\n z-index: 99;\n outline: none;\n}\n.split-view-container .sash-container .sash:active {\n transition: background-color 0.1s ease-in-out;\n background-color: var(--dv-active-sash-color, transparent);\n}\n.split-view-container .sash-container .sash:hover {\n background-color: var(--dv-active-sash-color, transparent);\n transition: background-color 0.1s ease-in-out;\n transition-delay: 0.5s;\n}\n.split-view-container .view-container {\n position: relative;\n height: 100%;\n width: 100%;\n}\n.split-view-container .view-container .view {\n height: 100%;\n box-sizing: border-box;\n overflow: auto;\n position: absolute;\n}\n.split-view-container.separator-border .view:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-separator-border);\n}\n.dragged {\n transform: translate3d(0px, 0px, 0px);\n /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */\n}\n\n.tab {\n flex-shrink: 0;\n}\n.tab.dragging .tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.tab.active-tab > .default-tab .tab-action {\n visibility: visible;\n}\n.tab.inactive-tab > .default-tab .tab-action {\n visibility: hidden;\n}\n.tab.inactive-tab > .default-tab:hover .tab-action {\n visibility: visible;\n}\n.tab .default-tab {\n position: relative;\n height: 100%;\n display: flex;\n min-width: 80px;\n align-items: center;\n padding-left: 10px;\n white-space: nowrap;\n text-overflow: elipsis;\n}\n.tab .default-tab .tab-content {\n flex-grow: 1;\n}\n.tab .default-tab .action-container {\n text-align: right;\n width: 28px;\n display: flex;\n}\n.tab .default-tab .action-container .tab-list {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.tab .default-tab .action-container .tab-list a:active:hover {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.tab .default-tab .action-container .tab-list .tab-action {\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n}\n.tab .default-tab .action-container .tab-list .tab-action.disable-close {\n display: none;\n}\n.watermark {\n display: flex;\n width: 100%;\n}\n.watermark.has-actions .watermark-title .actions-bar {\n display: none;\n}\n.watermark .watermark-title {\n height: 35px;\n width: 100%;\n display: flex;\n}\n.watermark .watermark-content {\n flex-grow: 1;\n}";
|
|
38
38
|
styleInject(css_248z);
|
|
39
39
|
|
|
40
40
|
var Event;
|
|
@@ -67,7 +67,6 @@ class Emitter {
|
|
|
67
67
|
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.replay) && this._last !== undefined) {
|
|
68
68
|
listener(this._last);
|
|
69
69
|
}
|
|
70
|
-
this._listeners.length === 0;
|
|
71
70
|
this._listeners.push(listener);
|
|
72
71
|
return {
|
|
73
72
|
dispose: () => {
|
|
@@ -83,9 +82,9 @@ class Emitter {
|
|
|
83
82
|
}
|
|
84
83
|
fire(e) {
|
|
85
84
|
this._last = e;
|
|
86
|
-
this._listeners
|
|
85
|
+
for (const listener of this._listeners) {
|
|
87
86
|
listener(e);
|
|
88
|
-
}
|
|
87
|
+
}
|
|
89
88
|
}
|
|
90
89
|
dispose() {
|
|
91
90
|
this._listeners = [];
|
|
@@ -143,7 +142,7 @@ class CompositeDisposable {
|
|
|
143
142
|
return new CompositeDisposable(...args);
|
|
144
143
|
}
|
|
145
144
|
addDisposables(...args) {
|
|
146
|
-
args
|
|
145
|
+
args.forEach((arg) => this.disposables.push(arg));
|
|
147
146
|
}
|
|
148
147
|
dispose() {
|
|
149
148
|
this.disposables.forEach((arg) => arg.dispose());
|
|
@@ -162,20 +161,11 @@ class MutableDisposable {
|
|
|
162
161
|
dispose() {
|
|
163
162
|
if (this._disposable) {
|
|
164
163
|
this._disposable.dispose();
|
|
164
|
+
this._disposable = Disposable.NONE;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
function tryParseJSON(text, reviver) {
|
|
170
|
-
try {
|
|
171
|
-
return JSON.parse(text, reviver);
|
|
172
|
-
}
|
|
173
|
-
catch (err) {
|
|
174
|
-
console.warn('failed to parse JSON');
|
|
175
|
-
return undefined;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
169
|
class TransferObject {
|
|
180
170
|
constructor() {
|
|
181
171
|
//
|
|
@@ -196,45 +186,6 @@ class PaneTransfer extends TransferObject {
|
|
|
196
186
|
this.paneId = paneId;
|
|
197
187
|
}
|
|
198
188
|
}
|
|
199
|
-
const DATA_KEY = 'splitview/transfer';
|
|
200
|
-
const isPanelTransferEvent = (event) => {
|
|
201
|
-
if (!event.dataTransfer) {
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
return event.dataTransfer.types.includes(DATA_KEY);
|
|
205
|
-
};
|
|
206
|
-
var DragType;
|
|
207
|
-
(function (DragType) {
|
|
208
|
-
DragType["DOCKVIEW_TAB"] = "dockview_tab";
|
|
209
|
-
DragType["EXTERNAL"] = "external_group_drag";
|
|
210
|
-
})(DragType || (DragType = {}));
|
|
211
|
-
/**
|
|
212
|
-
* Determine whether this data belong to that of an event that was started by
|
|
213
|
-
* dragging a tab component
|
|
214
|
-
*/
|
|
215
|
-
const isTabDragEvent = (data) => {
|
|
216
|
-
return data.type === DragType.DOCKVIEW_TAB;
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* Determine whether this data belong to that of an event that was started by
|
|
220
|
-
* a custom drag-enable component
|
|
221
|
-
*/
|
|
222
|
-
const isCustomDragEvent = (data) => {
|
|
223
|
-
return data.type === DragType.EXTERNAL;
|
|
224
|
-
};
|
|
225
|
-
const extractData = (event) => {
|
|
226
|
-
if (!event.dataTransfer) {
|
|
227
|
-
return null;
|
|
228
|
-
}
|
|
229
|
-
const data = tryParseJSON(event.dataTransfer.getData(DATA_KEY));
|
|
230
|
-
if (!data) {
|
|
231
|
-
console.warn(`[dragEvent] ${DATA_KEY} data is missing`);
|
|
232
|
-
}
|
|
233
|
-
if (typeof data.type !== 'string') {
|
|
234
|
-
console.warn(`[dragEvent] invalid type ${data.type}`);
|
|
235
|
-
}
|
|
236
|
-
return data;
|
|
237
|
-
};
|
|
238
189
|
/**
|
|
239
190
|
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
240
191
|
*/
|
|
@@ -304,6 +255,9 @@ class SplitviewApi {
|
|
|
304
255
|
get length() {
|
|
305
256
|
return this.component.length;
|
|
306
257
|
}
|
|
258
|
+
get orientation() {
|
|
259
|
+
return this.component.orientation;
|
|
260
|
+
}
|
|
307
261
|
get onDidLayoutChange() {
|
|
308
262
|
return this.component.onDidLayoutChange;
|
|
309
263
|
}
|
|
@@ -313,9 +267,6 @@ class SplitviewApi {
|
|
|
313
267
|
get onDidRemoveView() {
|
|
314
268
|
return this.component.onDidRemoveView;
|
|
315
269
|
}
|
|
316
|
-
get orientation() {
|
|
317
|
-
return this.component.orientation;
|
|
318
|
-
}
|
|
319
270
|
updateOptions(options) {
|
|
320
271
|
this.component.updateOptions(options);
|
|
321
272
|
}
|
|
@@ -360,18 +311,18 @@ class PaneviewApi {
|
|
|
360
311
|
constructor(component) {
|
|
361
312
|
this.component = component;
|
|
362
313
|
}
|
|
363
|
-
get width() {
|
|
364
|
-
return this.component.width;
|
|
365
|
-
}
|
|
366
|
-
get height() {
|
|
367
|
-
return this.component.height;
|
|
368
|
-
}
|
|
369
314
|
get minimumSize() {
|
|
370
315
|
return this.component.minimumSize;
|
|
371
316
|
}
|
|
372
317
|
get maximumSize() {
|
|
373
318
|
return this.component.maximumSize;
|
|
374
319
|
}
|
|
320
|
+
get height() {
|
|
321
|
+
return this.component.height;
|
|
322
|
+
}
|
|
323
|
+
get width() {
|
|
324
|
+
return this.component.width;
|
|
325
|
+
}
|
|
375
326
|
get onDidLayoutChange() {
|
|
376
327
|
return this.component.onDidLayoutChange;
|
|
377
328
|
}
|
|
@@ -427,12 +378,6 @@ class GridviewApi {
|
|
|
427
378
|
constructor(component) {
|
|
428
379
|
this.component = component;
|
|
429
380
|
}
|
|
430
|
-
get width() {
|
|
431
|
-
return this.component.width;
|
|
432
|
-
}
|
|
433
|
-
get height() {
|
|
434
|
-
return this.component.height;
|
|
435
|
-
}
|
|
436
381
|
get minimumHeight() {
|
|
437
382
|
return this.component.minimumHeight;
|
|
438
383
|
}
|
|
@@ -445,12 +390,30 @@ class GridviewApi {
|
|
|
445
390
|
get maximumWidth() {
|
|
446
391
|
return this.component.maximumWidth;
|
|
447
392
|
}
|
|
393
|
+
get width() {
|
|
394
|
+
return this.component.width;
|
|
395
|
+
}
|
|
396
|
+
get height() {
|
|
397
|
+
return this.component.height;
|
|
398
|
+
}
|
|
448
399
|
get onGridEvent() {
|
|
449
400
|
return this.component.onGridEvent;
|
|
450
401
|
}
|
|
451
402
|
get onDidLayoutChange() {
|
|
452
403
|
return this.component.onDidLayoutChange;
|
|
453
404
|
}
|
|
405
|
+
get onDidAddGroup() {
|
|
406
|
+
return this.component.onDidAddGroup;
|
|
407
|
+
}
|
|
408
|
+
get onDidRemoveGroup() {
|
|
409
|
+
return this.component.onDidRemoveGroup;
|
|
410
|
+
}
|
|
411
|
+
get onDidActiveGroupChange() {
|
|
412
|
+
return this.component.onDidActiveGroupChange;
|
|
413
|
+
}
|
|
414
|
+
get onDidLayoutFromJSON() {
|
|
415
|
+
return this.component.onDidLayoutFromJSON;
|
|
416
|
+
}
|
|
454
417
|
get panels() {
|
|
455
418
|
return this.component.groups;
|
|
456
419
|
}
|
|
@@ -528,6 +491,27 @@ class DockviewApi {
|
|
|
528
491
|
get onGridEvent() {
|
|
529
492
|
return this.component.onGridEvent;
|
|
530
493
|
}
|
|
494
|
+
get onDidActiveGroupChange() {
|
|
495
|
+
return this.component.onDidActiveGroupChange;
|
|
496
|
+
}
|
|
497
|
+
get onDidAddGroup() {
|
|
498
|
+
return this.component.onDidAddGroup;
|
|
499
|
+
}
|
|
500
|
+
get onDidRemoveGroup() {
|
|
501
|
+
return this.component.onDidRemoveGroup;
|
|
502
|
+
}
|
|
503
|
+
get onDidActivePanelChange() {
|
|
504
|
+
return this.component.onDidActivePanelChange;
|
|
505
|
+
}
|
|
506
|
+
get onDidAddPanel() {
|
|
507
|
+
return this.component.onDidAddPanel;
|
|
508
|
+
}
|
|
509
|
+
get onDidRemovePanel() {
|
|
510
|
+
return this.component.onDidRemovePanel;
|
|
511
|
+
}
|
|
512
|
+
get onDidLayoutfromJSON() {
|
|
513
|
+
return this.component.onDidLayoutfromJSON;
|
|
514
|
+
}
|
|
531
515
|
get onDidLayoutChange() {
|
|
532
516
|
return this.component.onDidLayoutChange;
|
|
533
517
|
}
|
|
@@ -555,18 +539,12 @@ class DockviewApi {
|
|
|
555
539
|
getPanel(id) {
|
|
556
540
|
return this.component.getGroupPanel(id);
|
|
557
541
|
}
|
|
558
|
-
setActivePanel(panel) {
|
|
559
|
-
this.component.setActivePanel(panel);
|
|
560
|
-
}
|
|
561
542
|
layout(width, height, force = false) {
|
|
562
543
|
this.component.layout(width, height, force);
|
|
563
544
|
}
|
|
564
545
|
addPanel(options) {
|
|
565
546
|
return this.component.addPanel(options);
|
|
566
547
|
}
|
|
567
|
-
removePanel(panel) {
|
|
568
|
-
this.component.removePanel(panel);
|
|
569
|
-
}
|
|
570
548
|
addEmptyGroup(options) {
|
|
571
549
|
this.component.addEmptyGroup(options);
|
|
572
550
|
}
|
|
@@ -1586,7 +1564,7 @@ class Paneview extends CompositeDisposable {
|
|
|
1586
1564
|
this.paneItems.push(paneItem);
|
|
1587
1565
|
pane.orthogonalSize = this.splitview.orthogonalSize;
|
|
1588
1566
|
});
|
|
1589
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
1567
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
1590
1568
|
this._onDidChange.fire(undefined);
|
|
1591
1569
|
}), this.splitview.onDidAddView(() => {
|
|
1592
1570
|
this._onDidChange.fire();
|
|
@@ -1747,7 +1725,7 @@ class Droptarget extends CompositeDisposable {
|
|
|
1747
1725
|
this.options = options;
|
|
1748
1726
|
this._onDrop = new Emitter();
|
|
1749
1727
|
this.onDrop = this._onDrop.event;
|
|
1750
|
-
this.addDisposables(new DragAndDropObserver(this.element, {
|
|
1728
|
+
this.addDisposables(this._onDrop, new DragAndDropObserver(this.element, {
|
|
1751
1729
|
onDragEnter: (e) => undefined,
|
|
1752
1730
|
onDragOver: (e) => {
|
|
1753
1731
|
if (isBooleanValue(this.options.canDisplayOverlay)) {
|
|
@@ -1783,51 +1761,11 @@ class Droptarget extends CompositeDisposable {
|
|
|
1783
1761
|
const y = e.offsetY;
|
|
1784
1762
|
const xp = (100 * x) / width;
|
|
1785
1763
|
const yp = (100 * y) / height;
|
|
1786
|
-
|
|
1787
|
-
let isLeft = false;
|
|
1788
|
-
let isTop = false;
|
|
1789
|
-
let isBottom = false;
|
|
1790
|
-
switch (this.options.validOverlays) {
|
|
1791
|
-
case 'all':
|
|
1792
|
-
isRight = xp > 80;
|
|
1793
|
-
isLeft = xp < 20;
|
|
1794
|
-
isTop = !isRight && !isLeft && yp < 20;
|
|
1795
|
-
isBottom = !isRight && !isLeft && yp > 80;
|
|
1796
|
-
break;
|
|
1797
|
-
case 'vertical':
|
|
1798
|
-
isTop = yp < 50;
|
|
1799
|
-
isBottom = yp >= 50;
|
|
1800
|
-
break;
|
|
1801
|
-
case 'horizontal':
|
|
1802
|
-
isLeft = xp < 50;
|
|
1803
|
-
isRight = xp >= 50;
|
|
1804
|
-
break;
|
|
1805
|
-
}
|
|
1764
|
+
const quadrant = this.calculateQuadrant(this.options.validOverlays, xp, yp);
|
|
1806
1765
|
const isSmallX = width < 100;
|
|
1807
1766
|
const isSmallY = height < 100;
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1811
|
-
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1812
|
-
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1813
|
-
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1814
|
-
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1815
|
-
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1816
|
-
if (isRight) {
|
|
1817
|
-
this._state = Position.Right;
|
|
1818
|
-
}
|
|
1819
|
-
else if (isLeft) {
|
|
1820
|
-
this._state = Position.Left;
|
|
1821
|
-
}
|
|
1822
|
-
else if (isTop) {
|
|
1823
|
-
this._state = Position.Top;
|
|
1824
|
-
}
|
|
1825
|
-
else if (isBottom) {
|
|
1826
|
-
this._state = Position.Bottom;
|
|
1827
|
-
}
|
|
1828
|
-
else {
|
|
1829
|
-
this._state = Position.Center;
|
|
1830
|
-
}
|
|
1767
|
+
this.toggleClasses(quadrant, isSmallX, isSmallY);
|
|
1768
|
+
this.setState(quadrant);
|
|
1831
1769
|
},
|
|
1832
1770
|
onDragLeave: (e) => {
|
|
1833
1771
|
this.removeDropTarget();
|
|
@@ -1856,9 +1794,73 @@ class Droptarget extends CompositeDisposable {
|
|
|
1856
1794
|
this.options.canDisplayOverlay = value;
|
|
1857
1795
|
}
|
|
1858
1796
|
dispose() {
|
|
1859
|
-
this._onDrop.dispose();
|
|
1860
1797
|
this.removeDropTarget();
|
|
1861
1798
|
}
|
|
1799
|
+
toggleClasses(quadrant, isSmallX, isSmallY) {
|
|
1800
|
+
if (!this.overlay) {
|
|
1801
|
+
return;
|
|
1802
|
+
}
|
|
1803
|
+
const isLeft = quadrant === 'left';
|
|
1804
|
+
const isRight = quadrant === 'right';
|
|
1805
|
+
const isTop = quadrant === 'top';
|
|
1806
|
+
const isBottom = quadrant === 'bottom';
|
|
1807
|
+
toggleClass(this.overlay, 'right', !isSmallX && isRight);
|
|
1808
|
+
toggleClass(this.overlay, 'left', !isSmallX && isLeft);
|
|
1809
|
+
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1810
|
+
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1811
|
+
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1812
|
+
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1813
|
+
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1814
|
+
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1815
|
+
}
|
|
1816
|
+
setState(quadrant) {
|
|
1817
|
+
switch (quadrant) {
|
|
1818
|
+
case 'top':
|
|
1819
|
+
this._state = Position.Top;
|
|
1820
|
+
break;
|
|
1821
|
+
case 'left':
|
|
1822
|
+
this._state = Position.Left;
|
|
1823
|
+
break;
|
|
1824
|
+
case 'bottom':
|
|
1825
|
+
this._state = Position.Bottom;
|
|
1826
|
+
break;
|
|
1827
|
+
case 'right':
|
|
1828
|
+
this._state = Position.Right;
|
|
1829
|
+
break;
|
|
1830
|
+
default:
|
|
1831
|
+
this._state = Position.Center;
|
|
1832
|
+
break;
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
calculateQuadrant(overlayType, xp, yp) {
|
|
1836
|
+
switch (overlayType) {
|
|
1837
|
+
case 'all':
|
|
1838
|
+
if (xp < 20) {
|
|
1839
|
+
return 'left';
|
|
1840
|
+
}
|
|
1841
|
+
if (xp > 80) {
|
|
1842
|
+
return 'right';
|
|
1843
|
+
}
|
|
1844
|
+
if (yp < 20) {
|
|
1845
|
+
return 'top';
|
|
1846
|
+
}
|
|
1847
|
+
if (yp > 80) {
|
|
1848
|
+
return 'bottom';
|
|
1849
|
+
}
|
|
1850
|
+
break;
|
|
1851
|
+
case 'vertical':
|
|
1852
|
+
if (yp < 50) {
|
|
1853
|
+
return 'top';
|
|
1854
|
+
}
|
|
1855
|
+
return 'bottom';
|
|
1856
|
+
case 'horizontal':
|
|
1857
|
+
if (xp < 50) {
|
|
1858
|
+
return 'left';
|
|
1859
|
+
}
|
|
1860
|
+
return 'right';
|
|
1861
|
+
}
|
|
1862
|
+
return null;
|
|
1863
|
+
}
|
|
1862
1864
|
removeDropTarget() {
|
|
1863
1865
|
if (this.target) {
|
|
1864
1866
|
this._state = undefined;
|
|
@@ -1961,6 +1963,7 @@ class LeafNode {
|
|
|
1961
1963
|
this.view.layout(this.width, this.height);
|
|
1962
1964
|
}
|
|
1963
1965
|
dispose() {
|
|
1966
|
+
this._onDidChange.dispose();
|
|
1964
1967
|
this._disposable.dispose();
|
|
1965
1968
|
}
|
|
1966
1969
|
}
|
|
@@ -2012,7 +2015,7 @@ class BranchNode extends CompositeDisposable {
|
|
|
2012
2015
|
proportionalLayout,
|
|
2013
2016
|
});
|
|
2014
2017
|
}
|
|
2015
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
2018
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
2016
2019
|
this._onDidChange.fire(undefined);
|
|
2017
2020
|
}));
|
|
2018
2021
|
this.setupChildrenEvents();
|
|
@@ -2184,6 +2187,15 @@ class BranchNode extends CompositeDisposable {
|
|
|
2184
2187
|
* Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
|
|
2185
2188
|
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
|
|
2186
2189
|
*--------------------------------------------------------------------------------------------*/
|
|
2190
|
+
function findLeaf(candiateNode, last) {
|
|
2191
|
+
if (candiateNode instanceof LeafNode) {
|
|
2192
|
+
return candiateNode;
|
|
2193
|
+
}
|
|
2194
|
+
if (candiateNode instanceof BranchNode) {
|
|
2195
|
+
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2196
|
+
}
|
|
2197
|
+
throw new Error('invalid node');
|
|
2198
|
+
}
|
|
2187
2199
|
function flipNode(node, size, orthogonalSize) {
|
|
2188
2200
|
if (node instanceof BranchNode) {
|
|
2189
2201
|
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize);
|
|
@@ -2322,13 +2334,13 @@ class Gridview {
|
|
|
2322
2334
|
}
|
|
2323
2335
|
deserialize(json, deserializer) {
|
|
2324
2336
|
const orientation = json.orientation;
|
|
2325
|
-
const height = json.height;
|
|
2337
|
+
const height = orientation === Orientation.VERTICAL ? json.height : json.width;
|
|
2326
2338
|
this._deserialize(json.root, orientation, deserializer, height);
|
|
2327
2339
|
}
|
|
2328
2340
|
_deserialize(root, orientation, deserializer, orthogonalSize) {
|
|
2329
|
-
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize);
|
|
2341
|
+
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize, true);
|
|
2330
2342
|
}
|
|
2331
|
-
_deserializeNode(node, orientation, deserializer, orthogonalSize) {
|
|
2343
|
+
_deserializeNode(node, orientation, deserializer, orthogonalSize, isRoot = false) {
|
|
2332
2344
|
let result;
|
|
2333
2345
|
if (node.type === 'branch') {
|
|
2334
2346
|
const serializedChildren = node.data;
|
|
@@ -2338,7 +2350,9 @@ class Gridview {
|
|
|
2338
2350
|
visible: serializedChild.visible,
|
|
2339
2351
|
};
|
|
2340
2352
|
});
|
|
2341
|
-
|
|
2353
|
+
// HORIZONTAL => height=orthogonalsize width=size
|
|
2354
|
+
// VERTICAL => height=size width=orthogonalsize
|
|
2355
|
+
result = new BranchNode(orientation, this.proportionalLayout, this.styles, isRoot ? orthogonalSize : node.size, isRoot ? node.size : orthogonalSize, children);
|
|
2342
2356
|
}
|
|
2343
2357
|
else {
|
|
2344
2358
|
result = new LeafNode(deserializer.fromJSON(node), orientation, orthogonalSize, node.size);
|
|
@@ -2399,15 +2413,6 @@ class Gridview {
|
|
|
2399
2413
|
if (!(node instanceof LeafNode)) {
|
|
2400
2414
|
throw new Error('invalid location');
|
|
2401
2415
|
}
|
|
2402
|
-
const findLeaf = (candiateNode, last) => {
|
|
2403
|
-
if (candiateNode instanceof LeafNode) {
|
|
2404
|
-
return candiateNode;
|
|
2405
|
-
}
|
|
2406
|
-
if (candiateNode instanceof BranchNode) {
|
|
2407
|
-
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2408
|
-
}
|
|
2409
|
-
throw new Error('invalid node');
|
|
2410
|
-
};
|
|
2411
2416
|
for (let i = path.length - 1; i > -1; i--) {
|
|
2412
2417
|
const n = path[i];
|
|
2413
2418
|
const l = location[i] || 0;
|
|
@@ -2509,9 +2514,9 @@ class Gridview {
|
|
|
2509
2514
|
if (parent.children.length > 1) {
|
|
2510
2515
|
return node.view;
|
|
2511
2516
|
}
|
|
2517
|
+
const sibling = parent.children[0];
|
|
2512
2518
|
if (pathToParent.length === 0) {
|
|
2513
2519
|
// parent is root
|
|
2514
|
-
const sibling = parent.children[0];
|
|
2515
2520
|
if (sibling instanceof LeafNode) {
|
|
2516
2521
|
return node.view;
|
|
2517
2522
|
}
|
|
@@ -2522,7 +2527,6 @@ class Gridview {
|
|
|
2522
2527
|
}
|
|
2523
2528
|
const [grandParent, ..._] = [...pathToParent].reverse();
|
|
2524
2529
|
const [parentIndex, ...__] = [...rest].reverse();
|
|
2525
|
-
const sibling = parent.children[0];
|
|
2526
2530
|
const isSiblingVisible = parent.isChildVisible(0);
|
|
2527
2531
|
parent.removeChild(0, sizing);
|
|
2528
2532
|
const sizes = grandParent.children.map((size, i) => grandParent.getChildSize(i));
|
|
@@ -2569,31 +2573,6 @@ class Gridview {
|
|
|
2569
2573
|
}
|
|
2570
2574
|
}
|
|
2571
2575
|
|
|
2572
|
-
/*! *****************************************************************************
|
|
2573
|
-
Copyright (c) Microsoft Corporation.
|
|
2574
|
-
|
|
2575
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2576
|
-
purpose with or without fee is hereby granted.
|
|
2577
|
-
|
|
2578
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2579
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2580
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2581
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2582
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2583
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2584
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2585
|
-
***************************************************************************** */
|
|
2586
|
-
|
|
2587
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
2588
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2589
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2590
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2591
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2592
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2593
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2594
|
-
});
|
|
2595
|
-
}
|
|
2596
|
-
|
|
2597
2576
|
class ContentContainer extends CompositeDisposable {
|
|
2598
2577
|
constructor() {
|
|
2599
2578
|
super();
|
|
@@ -2605,6 +2584,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
2605
2584
|
this._element = document.createElement('div');
|
|
2606
2585
|
this._element.className = 'content-container';
|
|
2607
2586
|
this._element.tabIndex = -1;
|
|
2587
|
+
this.addDisposables(this._onDidFocus, this._onDidBlur);
|
|
2608
2588
|
// for hosted containers
|
|
2609
2589
|
// 1) register a drop target on the host
|
|
2610
2590
|
// 2) register window dragStart events to disable pointer events
|
|
@@ -2671,6 +2651,41 @@ var DockviewDropTargets;
|
|
|
2671
2651
|
DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
|
|
2672
2652
|
})(DockviewDropTargets || (DockviewDropTargets = {}));
|
|
2673
2653
|
|
|
2654
|
+
class DragHandler extends CompositeDisposable {
|
|
2655
|
+
constructor(el) {
|
|
2656
|
+
super();
|
|
2657
|
+
this.el = el;
|
|
2658
|
+
this.disposable = new MutableDisposable();
|
|
2659
|
+
this._onDragStart = new Emitter();
|
|
2660
|
+
this.onDragStart = this._onDragStart.event;
|
|
2661
|
+
this.iframes = [];
|
|
2662
|
+
this.configure();
|
|
2663
|
+
}
|
|
2664
|
+
configure() {
|
|
2665
|
+
this.addDisposables(this._onDragStart, addDisposableListener(this.el, 'dragstart', (event) => {
|
|
2666
|
+
this.iframes = [
|
|
2667
|
+
...getElementsByTagName('iframe'),
|
|
2668
|
+
...getElementsByTagName('webview'),
|
|
2669
|
+
];
|
|
2670
|
+
for (const iframe of this.iframes) {
|
|
2671
|
+
iframe.style.pointerEvents = 'none';
|
|
2672
|
+
}
|
|
2673
|
+
this.el.classList.add('dragged');
|
|
2674
|
+
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
2675
|
+
this.disposable.value = this.getData();
|
|
2676
|
+
if (event.dataTransfer) {
|
|
2677
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
2678
|
+
}
|
|
2679
|
+
}), addDisposableListener(this.el, 'dragend', (ev) => {
|
|
2680
|
+
for (const iframe of this.iframes) {
|
|
2681
|
+
iframe.style.pointerEvents = 'auto';
|
|
2682
|
+
}
|
|
2683
|
+
this.iframes = [];
|
|
2684
|
+
this.disposable.dispose();
|
|
2685
|
+
}));
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2674
2689
|
var MouseEventKind;
|
|
2675
2690
|
(function (MouseEventKind) {
|
|
2676
2691
|
MouseEventKind["CLICK"] = "CLICK";
|
|
@@ -2680,42 +2695,34 @@ class Tab$1 extends CompositeDisposable {
|
|
|
2680
2695
|
constructor(panelId, accessor, group) {
|
|
2681
2696
|
super();
|
|
2682
2697
|
this.panelId = panelId;
|
|
2683
|
-
this.accessor = accessor;
|
|
2684
2698
|
this.group = group;
|
|
2685
2699
|
this._onChanged = new Emitter();
|
|
2686
2700
|
this.onChanged = this._onChanged.event;
|
|
2687
2701
|
this._onDropped = new Emitter();
|
|
2688
2702
|
this.onDrop = this._onDropped.event;
|
|
2689
|
-
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2690
|
-
this.iframes = [];
|
|
2691
2703
|
this.addDisposables(this._onChanged, this._onDropped);
|
|
2692
2704
|
this._element = document.createElement('div');
|
|
2693
2705
|
this._element.className = 'tab';
|
|
2694
2706
|
this._element.tabIndex = 0;
|
|
2695
2707
|
this._element.draggable = true;
|
|
2696
|
-
this.addDisposables(
|
|
2697
|
-
|
|
2698
|
-
...
|
|
2699
|
-
|
|
2700
|
-
];
|
|
2701
|
-
for (const iframe of this.iframes) {
|
|
2702
|
-
iframe.style.pointerEvents = 'none';
|
|
2708
|
+
this.addDisposables(new (class Handler extends DragHandler {
|
|
2709
|
+
constructor() {
|
|
2710
|
+
super(...arguments);
|
|
2711
|
+
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2703
2712
|
}
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2713
|
+
getData() {
|
|
2714
|
+
this.panelTransfer.setData([new PanelTransfer(accessor.id, group.id, panelId)], PanelTransfer.prototype);
|
|
2715
|
+
return {
|
|
2716
|
+
dispose: () => {
|
|
2717
|
+
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
2718
|
+
},
|
|
2719
|
+
};
|
|
2711
2720
|
}
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
iframe.style.pointerEvents = 'auto';
|
|
2721
|
+
dispose() {
|
|
2722
|
+
//
|
|
2715
2723
|
}
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
}), addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2724
|
+
})(this._element));
|
|
2725
|
+
this.addDisposables(addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2719
2726
|
if (event.defaultPrevented) {
|
|
2720
2727
|
return;
|
|
2721
2728
|
}
|
|
@@ -2917,12 +2924,10 @@ class TabsContainer extends CompositeDisposable {
|
|
|
2917
2924
|
if (!isLeftClick || event.event.defaultPrevented) {
|
|
2918
2925
|
return;
|
|
2919
2926
|
}
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
});
|
|
2925
|
-
break;
|
|
2927
|
+
if (event.kind === MouseEventKind.CLICK) {
|
|
2928
|
+
this.group.model.openPanel(panel, {
|
|
2929
|
+
skipFocus: alreadyFocused,
|
|
2930
|
+
});
|
|
2926
2931
|
}
|
|
2927
2932
|
}), tabToAdd.onDrop((event) => {
|
|
2928
2933
|
this._onDrop.fire({
|
|
@@ -2951,7 +2956,6 @@ var GroupChangeKind2;
|
|
|
2951
2956
|
GroupChangeKind2["ADD_PANEL"] = "ADD_PANEL";
|
|
2952
2957
|
GroupChangeKind2["REMOVE_PANEL"] = "REMOVE_PANEL";
|
|
2953
2958
|
GroupChangeKind2["PANEL_ACTIVE"] = "PANEL_ACTIVE";
|
|
2954
|
-
GroupChangeKind2["GROUP_ACTIVE"] = "GROUP_ACTIVE";
|
|
2955
2959
|
})(GroupChangeKind2 || (GroupChangeKind2 = {}));
|
|
2956
2960
|
class Groupview extends CompositeDisposable {
|
|
2957
2961
|
constructor(container, accessor, id, options, parent) {
|
|
@@ -2972,15 +2976,10 @@ class Groupview extends CompositeDisposable {
|
|
|
2972
2976
|
this.onMove = this._onMove.event;
|
|
2973
2977
|
this._onDidGroupChange = new Emitter();
|
|
2974
2978
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
2975
|
-
this.
|
|
2976
|
-
|
|
2977
|
-
return false;
|
|
2978
|
-
}
|
|
2979
|
-
this.doClose(panel);
|
|
2980
|
-
return true;
|
|
2981
|
-
});
|
|
2979
|
+
this._onDidDrop = new Emitter();
|
|
2980
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
2982
2981
|
this.container.classList.add('groupview');
|
|
2983
|
-
this.addDisposables(this._onMove, this._onDidGroupChange);
|
|
2982
|
+
this.addDisposables(this._onMove, this._onDidGroupChange, this._onDidChange, this._onDidDrop);
|
|
2984
2983
|
this.tabsContainer = new TabsContainer(this.accessor, this.parent, {
|
|
2985
2984
|
tabHeight: options.tabHeight,
|
|
2986
2985
|
});
|
|
@@ -3137,6 +3136,8 @@ class Groupview extends CompositeDisposable {
|
|
|
3137
3136
|
options.index > this.panels.length) {
|
|
3138
3137
|
options.index = this.panels.length;
|
|
3139
3138
|
}
|
|
3139
|
+
// ensure the group is updated before we fire any events
|
|
3140
|
+
panel.updateParentGroup(this.parent, true);
|
|
3140
3141
|
if (this._activePanel === panel) {
|
|
3141
3142
|
this.accessor.doSetGroupActive(this.parent);
|
|
3142
3143
|
return;
|
|
@@ -3157,43 +3158,19 @@ class Groupview extends CompositeDisposable {
|
|
|
3157
3158
|
return this._removePanel(panelToRemove);
|
|
3158
3159
|
}
|
|
3159
3160
|
closeAllPanels() {
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
const
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
if (this._activePanel && index > -1) {
|
|
3166
|
-
if (this.panels.indexOf(this._activePanel) < 0) {
|
|
3167
|
-
console.warn('active panel not tracked');
|
|
3168
|
-
}
|
|
3169
|
-
const canClose = !((_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.close) || (yield this._activePanel.close());
|
|
3170
|
-
if (!canClose) {
|
|
3171
|
-
return false;
|
|
3172
|
-
}
|
|
3173
|
-
}
|
|
3174
|
-
for (let i = 0; i < this.panels.length; i++) {
|
|
3175
|
-
if (i === index) {
|
|
3176
|
-
continue;
|
|
3177
|
-
}
|
|
3178
|
-
const panel = this.panels[i];
|
|
3179
|
-
this.openPanel(panel);
|
|
3180
|
-
if (panel.close) {
|
|
3181
|
-
const canClose = yield panel.close();
|
|
3182
|
-
if (!canClose) {
|
|
3183
|
-
return false;
|
|
3184
|
-
}
|
|
3185
|
-
}
|
|
3186
|
-
}
|
|
3187
|
-
if (this.panels.length > 0) {
|
|
3188
|
-
// take a copy since we will be edting the array as we iterate through
|
|
3189
|
-
const arrPanelCpy = [...this.panels];
|
|
3190
|
-
yield Promise.all(arrPanelCpy.map((p) => this.doClose(p)));
|
|
3161
|
+
if (this.panels.length > 0) {
|
|
3162
|
+
// take a copy since we will be edting the array as we iterate through
|
|
3163
|
+
const arrPanelCpy = [...this.panels];
|
|
3164
|
+
for (const panel of arrPanelCpy) {
|
|
3165
|
+
this.doClose(panel);
|
|
3191
3166
|
}
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3167
|
+
}
|
|
3168
|
+
else {
|
|
3169
|
+
this.accessor.removeGroup(this.parent);
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
closePanel(panel) {
|
|
3173
|
+
this.doClose(panel);
|
|
3197
3174
|
}
|
|
3198
3175
|
doClose(panel) {
|
|
3199
3176
|
this.accessor.removePanel(panel);
|
|
@@ -3336,8 +3313,11 @@ class Groupview extends CompositeDisposable {
|
|
|
3336
3313
|
this.tabsContainer.show();
|
|
3337
3314
|
}
|
|
3338
3315
|
}
|
|
3339
|
-
canDisplayOverlay(
|
|
3316
|
+
canDisplayOverlay(event, target) {
|
|
3340
3317
|
// custom overlay handler
|
|
3318
|
+
if (this.accessor.options.showDndOverlay) {
|
|
3319
|
+
return this.accessor.options.showDndOverlay(event, target);
|
|
3320
|
+
}
|
|
3341
3321
|
return false;
|
|
3342
3322
|
}
|
|
3343
3323
|
handleDropEvent(event, position, index) {
|
|
@@ -3362,6 +3342,9 @@ class Groupview extends CompositeDisposable {
|
|
|
3362
3342
|
index,
|
|
3363
3343
|
});
|
|
3364
3344
|
}
|
|
3345
|
+
else {
|
|
3346
|
+
this._onDidDrop.fire({ nativeEvent: event, position, index });
|
|
3347
|
+
}
|
|
3365
3348
|
}
|
|
3366
3349
|
dispose() {
|
|
3367
3350
|
for (const panel of this.panels) {
|
|
@@ -3414,10 +3397,15 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3414
3397
|
this.onGridEvent = this._onGridEvent.event;
|
|
3415
3398
|
this._onDidLayoutChange = new Emitter();
|
|
3416
3399
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
3400
|
+
this._onDidRemoveGroup = new Emitter();
|
|
3401
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
3402
|
+
this._onDidAddGroup = new Emitter();
|
|
3403
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
3404
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3405
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3417
3406
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
|
|
3418
3407
|
this.element.appendChild(this.gridview.element);
|
|
3419
|
-
|
|
3420
|
-
this.layout(0, 0, true);
|
|
3408
|
+
this.layout(0, 0, true); // set some elements height/widths
|
|
3421
3409
|
this.addDisposables(this.gridview.onDidChange(() => {
|
|
3422
3410
|
this._onGridEvent.fire({ kind: GroupChangeKind.LAYOUT });
|
|
3423
3411
|
}));
|
|
@@ -3483,6 +3471,7 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3483
3471
|
doAddGroup(group, location = [0], size) {
|
|
3484
3472
|
this.gridview.addView(group, size !== null && size !== void 0 ? size : Sizing.Distribute, location);
|
|
3485
3473
|
this._onGridEvent.fire({ kind: GroupChangeKind.ADD_GROUP });
|
|
3474
|
+
this._onDidAddGroup.fire(group);
|
|
3486
3475
|
this.doSetGroupActive(group);
|
|
3487
3476
|
}
|
|
3488
3477
|
doRemoveGroup(group, options) {
|
|
@@ -3496,6 +3485,7 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3496
3485
|
this._groups.delete(group.id);
|
|
3497
3486
|
}
|
|
3498
3487
|
this._onGridEvent.fire({ kind: GroupChangeKind.REMOVE_GROUP });
|
|
3488
|
+
this._onDidRemoveGroup.fire(group);
|
|
3499
3489
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
3500
3490
|
const groups = Array.from(this._groups.values());
|
|
3501
3491
|
this.doSetGroupActive(groups.length > 0 ? groups[0].value : undefined);
|
|
@@ -3526,6 +3516,7 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3526
3516
|
this._onGridEvent.fire({
|
|
3527
3517
|
kind: GroupChangeKind.GROUP_ACTIVE,
|
|
3528
3518
|
});
|
|
3519
|
+
this._onDidActiveGroupChange.fire(group);
|
|
3529
3520
|
}
|
|
3530
3521
|
removeGroup(group) {
|
|
3531
3522
|
this.doRemoveGroup(group);
|
|
@@ -3582,6 +3573,10 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3582
3573
|
dispose() {
|
|
3583
3574
|
super.dispose();
|
|
3584
3575
|
this._onGridEvent.dispose();
|
|
3576
|
+
this._onDidActiveGroupChange.dispose();
|
|
3577
|
+
this._onDidAddGroup.dispose();
|
|
3578
|
+
this._onDidRemoveGroup.dispose();
|
|
3579
|
+
this._onDidLayoutChange.dispose();
|
|
3585
3580
|
this.gridview.dispose();
|
|
3586
3581
|
}
|
|
3587
3582
|
}
|
|
@@ -3593,15 +3588,11 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3593
3588
|
constructor(id) {
|
|
3594
3589
|
super();
|
|
3595
3590
|
this.id = id;
|
|
3596
|
-
this._state = {};
|
|
3597
3591
|
this._isFocused = false;
|
|
3598
3592
|
this._isActive = false;
|
|
3599
3593
|
this._isVisible = true;
|
|
3600
3594
|
this._width = 0;
|
|
3601
3595
|
this._height = 0;
|
|
3602
|
-
this._onDidStateChange = new Emitter();
|
|
3603
|
-
this.onDidStateChange = this._onDidStateChange.event;
|
|
3604
|
-
//
|
|
3605
3596
|
this._onDidPanelDimensionChange = new Emitter({
|
|
3606
3597
|
replay: true,
|
|
3607
3598
|
});
|
|
@@ -3630,7 +3621,7 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3630
3621
|
//
|
|
3631
3622
|
this._onActiveChange = new Emitter();
|
|
3632
3623
|
this.onActiveChange = this._onActiveChange.event;
|
|
3633
|
-
this.addDisposables(this.
|
|
3624
|
+
this.addDisposables(this._onDidPanelDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3634
3625
|
this._isFocused = event.isFocused;
|
|
3635
3626
|
}), this.onDidActiveChange((event) => {
|
|
3636
3627
|
this._isActive = event.isActive;
|
|
@@ -3663,21 +3654,6 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3663
3654
|
setActive() {
|
|
3664
3655
|
this._onActiveChange.fire();
|
|
3665
3656
|
}
|
|
3666
|
-
setState(key, value) {
|
|
3667
|
-
if (typeof key === 'object') {
|
|
3668
|
-
this._state = key;
|
|
3669
|
-
}
|
|
3670
|
-
else if (typeof value !== undefined) {
|
|
3671
|
-
this._state[key] = value;
|
|
3672
|
-
}
|
|
3673
|
-
this._onDidStateChange.fire(undefined);
|
|
3674
|
-
}
|
|
3675
|
-
getState() {
|
|
3676
|
-
return this._state;
|
|
3677
|
-
}
|
|
3678
|
-
getStateKey(key) {
|
|
3679
|
-
return this._state[key];
|
|
3680
|
-
}
|
|
3681
3657
|
dispose() {
|
|
3682
3658
|
super.dispose();
|
|
3683
3659
|
}
|
|
@@ -3697,6 +3673,7 @@ class GridviewPanelApiImpl extends PanelApiImpl {
|
|
|
3697
3673
|
//
|
|
3698
3674
|
this._onDidSizeChange = new Emitter();
|
|
3699
3675
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
3676
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
3700
3677
|
}
|
|
3701
3678
|
setConstraints(value) {
|
|
3702
3679
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -3710,19 +3687,19 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3710
3687
|
constructor(panel, group) {
|
|
3711
3688
|
super(panel.id);
|
|
3712
3689
|
this.panel = panel;
|
|
3713
|
-
this._onDidDirtyChange = new Emitter();
|
|
3714
|
-
this.onDidDirtyChange = this._onDidDirtyChange.event;
|
|
3715
3690
|
this._onDidTitleChange = new Emitter();
|
|
3716
3691
|
this.onDidTitleChange = this._onDidTitleChange.event;
|
|
3717
3692
|
this._titleChanged = new Emitter();
|
|
3718
3693
|
this.titleChanged = this._titleChanged.event;
|
|
3719
3694
|
this._suppressClosableChanged = new Emitter();
|
|
3720
3695
|
this.suppressClosableChanged = this._suppressClosableChanged.event;
|
|
3721
|
-
this.
|
|
3722
|
-
this.
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3696
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3697
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3698
|
+
this._onDidGroupChange = new Emitter();
|
|
3699
|
+
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
3700
|
+
this.disposable = new MutableDisposable();
|
|
3701
|
+
this.group = group;
|
|
3702
|
+
this.addDisposables(this.disposable, this._onDidTitleChange, this._titleChanged, this._suppressClosableChanged, this._onDidGroupChange, this._onDidActiveGroupChange);
|
|
3726
3703
|
}
|
|
3727
3704
|
get title() {
|
|
3728
3705
|
return this.panel.title;
|
|
@@ -3735,7 +3712,17 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3735
3712
|
return !!((_a = this.group) === null || _a === void 0 ? void 0 : _a.isActive);
|
|
3736
3713
|
}
|
|
3737
3714
|
set group(value) {
|
|
3715
|
+
const isOldGroupActive = this.isGroupActive;
|
|
3738
3716
|
this._group = value;
|
|
3717
|
+
this._onDidGroupChange.fire();
|
|
3718
|
+
if (this._group) {
|
|
3719
|
+
this.disposable.value = this._group.api.onDidActiveChange(() => {
|
|
3720
|
+
this._onDidActiveGroupChange.fire();
|
|
3721
|
+
});
|
|
3722
|
+
if (this.isGroupActive !== isOldGroupActive) {
|
|
3723
|
+
this._onDidActiveGroupChange.fire();
|
|
3724
|
+
}
|
|
3725
|
+
}
|
|
3739
3726
|
}
|
|
3740
3727
|
get group() {
|
|
3741
3728
|
return this._group;
|
|
@@ -3749,16 +3736,10 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3749
3736
|
}
|
|
3750
3737
|
return this.group.model.closePanel(this.panel);
|
|
3751
3738
|
}
|
|
3752
|
-
interceptOnCloseAction(interceptor) {
|
|
3753
|
-
this._interceptor = interceptor;
|
|
3754
|
-
}
|
|
3755
|
-
dispose() {
|
|
3756
|
-
super.dispose();
|
|
3757
|
-
}
|
|
3758
3739
|
}
|
|
3759
3740
|
|
|
3760
3741
|
class DockviewGroupPanel extends CompositeDisposable {
|
|
3761
|
-
constructor(id, containerApi) {
|
|
3742
|
+
constructor(id, accessor, containerApi) {
|
|
3762
3743
|
super();
|
|
3763
3744
|
this.id = id;
|
|
3764
3745
|
this.containerApi = containerApi;
|
|
@@ -3766,9 +3747,8 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3766
3747
|
this._suppressClosable = false;
|
|
3767
3748
|
this._title = '';
|
|
3768
3749
|
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
3769
|
-
this.onDidStateChange = this.api.onDidStateChange;
|
|
3770
3750
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
3771
|
-
|
|
3751
|
+
accessor.setActivePanel(this);
|
|
3772
3752
|
}), this.api.onDidTitleChange((event) => {
|
|
3773
3753
|
const title = event.title;
|
|
3774
3754
|
this.update({ params: { title } });
|
|
@@ -3792,32 +3772,18 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3792
3772
|
this._view = params.view;
|
|
3793
3773
|
this.setTitle(params.title);
|
|
3794
3774
|
this.setSuppressClosable(params.suppressClosable || false);
|
|
3795
|
-
if (params.state) {
|
|
3796
|
-
this.api.setState(params.state);
|
|
3797
|
-
}
|
|
3798
3775
|
(_a = this.view) === null || _a === void 0 ? void 0 : _a.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
3799
3776
|
}
|
|
3800
3777
|
focus() {
|
|
3801
3778
|
this.api._onFocusEvent.fire();
|
|
3802
3779
|
}
|
|
3803
|
-
setDirty(isDirty) {
|
|
3804
|
-
this.api._onDidDirtyChange.fire(isDirty);
|
|
3805
|
-
}
|
|
3806
|
-
close() {
|
|
3807
|
-
if (this.api.tryClose) {
|
|
3808
|
-
return this.api.tryClose();
|
|
3809
|
-
}
|
|
3810
|
-
return Promise.resolve(true);
|
|
3811
|
-
}
|
|
3812
3780
|
toJSON() {
|
|
3813
|
-
const state = this.api.getState();
|
|
3814
3781
|
return {
|
|
3815
3782
|
id: this.id,
|
|
3816
3783
|
view: this.view.toJSON(),
|
|
3817
3784
|
params: Object.keys(this._params || {}).length > 0
|
|
3818
3785
|
? this._params
|
|
3819
3786
|
: undefined,
|
|
3820
|
-
state: state && Object.keys(state).length > 0 ? state : undefined,
|
|
3821
3787
|
suppressClosable: this.suppressClosable || undefined,
|
|
3822
3788
|
title: this.title,
|
|
3823
3789
|
};
|
|
@@ -3862,18 +3828,6 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3862
3828
|
var _a;
|
|
3863
3829
|
this._group = group;
|
|
3864
3830
|
this.api.group = group;
|
|
3865
|
-
this.mutableDisposable.value = this._group.model.onDidGroupChange((ev) => {
|
|
3866
|
-
var _a;
|
|
3867
|
-
if (ev.kind === GroupChangeKind2.GROUP_ACTIVE) {
|
|
3868
|
-
const isVisible = !!((_a = this._group) === null || _a === void 0 ? void 0 : _a.model.isPanelActive(this));
|
|
3869
|
-
this.api._onDidActiveChange.fire({
|
|
3870
|
-
isActive: isGroupActive && isVisible,
|
|
3871
|
-
});
|
|
3872
|
-
this.api._onDidVisibilityChange.fire({
|
|
3873
|
-
isVisible,
|
|
3874
|
-
});
|
|
3875
|
-
}
|
|
3876
|
-
});
|
|
3877
3831
|
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
3878
3832
|
this.api._onDidActiveChange.fire({
|
|
3879
3833
|
isActive: isGroupActive && isPanelVisible,
|
|
@@ -3983,15 +3937,6 @@ class Watermark extends CompositeDisposable {
|
|
|
3983
3937
|
}
|
|
3984
3938
|
}
|
|
3985
3939
|
|
|
3986
|
-
function debounce(cb, wait) {
|
|
3987
|
-
let timeout;
|
|
3988
|
-
const callable = (...args) => {
|
|
3989
|
-
clearTimeout(timeout);
|
|
3990
|
-
timeout = setTimeout(() => cb(...args), wait);
|
|
3991
|
-
};
|
|
3992
|
-
return callable;
|
|
3993
|
-
}
|
|
3994
|
-
|
|
3995
3940
|
class DefaultDeserializer {
|
|
3996
3941
|
constructor(layout, panelDeserializer) {
|
|
3997
3942
|
this.layout = layout;
|
|
@@ -4092,9 +4037,6 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4092
4037
|
this._isGroupActive = false;
|
|
4093
4038
|
//
|
|
4094
4039
|
this.params = {};
|
|
4095
|
-
//
|
|
4096
|
-
this.isDirtyDisposable = new MutableDisposable();
|
|
4097
|
-
this.addDisposables(this.isDirtyDisposable);
|
|
4098
4040
|
this._element = document.createElement('div');
|
|
4099
4041
|
this._element.className = 'default-tab';
|
|
4100
4042
|
//
|
|
@@ -4139,10 +4081,6 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4139
4081
|
init(params) {
|
|
4140
4082
|
this.params = params;
|
|
4141
4083
|
this._content.textContent = params.title;
|
|
4142
|
-
this.isDirtyDisposable.value = this.params.api.onDidDirtyChange((event) => {
|
|
4143
|
-
const isDirty = event;
|
|
4144
|
-
toggleClass(this.action, 'dirty', isDirty);
|
|
4145
|
-
});
|
|
4146
4084
|
if (!this.params.suppressClosable) {
|
|
4147
4085
|
addDisposableListener(this.action, 'click', (ev) => {
|
|
4148
4086
|
ev.preventDefault(); //
|
|
@@ -4196,6 +4134,10 @@ class BasePanelView extends CompositeDisposable {
|
|
|
4196
4134
|
get height() {
|
|
4197
4135
|
return this._height;
|
|
4198
4136
|
}
|
|
4137
|
+
get params() {
|
|
4138
|
+
var _a;
|
|
4139
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
4140
|
+
}
|
|
4199
4141
|
focus() {
|
|
4200
4142
|
this.api._onFocusEvent.fire();
|
|
4201
4143
|
}
|
|
@@ -4204,29 +4146,27 @@ class BasePanelView extends CompositeDisposable {
|
|
|
4204
4146
|
this._height = height;
|
|
4205
4147
|
this.api._onDidPanelDimensionChange.fire({ width, height });
|
|
4206
4148
|
if (this.part) {
|
|
4207
|
-
if (this.
|
|
4208
|
-
this.part.update(this.
|
|
4149
|
+
if (this._params) {
|
|
4150
|
+
this.part.update(this._params.params);
|
|
4209
4151
|
}
|
|
4210
4152
|
}
|
|
4211
4153
|
}
|
|
4212
4154
|
init(parameters) {
|
|
4213
|
-
this.
|
|
4155
|
+
this._params = parameters;
|
|
4214
4156
|
this.part = this.getComponent();
|
|
4215
4157
|
}
|
|
4216
4158
|
update(event) {
|
|
4217
4159
|
var _a, _b;
|
|
4218
|
-
this.
|
|
4219
|
-
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this.
|
|
4160
|
+
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) });
|
|
4161
|
+
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this._params.params });
|
|
4220
4162
|
}
|
|
4221
4163
|
toJSON() {
|
|
4222
4164
|
var _a, _b;
|
|
4223
|
-
const
|
|
4224
|
-
const params = (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4165
|
+
const params = (_b = (_a = this._params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4225
4166
|
return {
|
|
4226
4167
|
id: this.id,
|
|
4227
4168
|
component: this.component,
|
|
4228
4169
|
params: Object.keys(params).length > 0 ? params : undefined,
|
|
4229
|
-
state: Object.keys(state).length === 0 ? undefined : state,
|
|
4230
4170
|
};
|
|
4231
4171
|
}
|
|
4232
4172
|
dispose() {
|
|
@@ -4249,12 +4189,12 @@ class GridviewPanel extends BasePanelView {
|
|
|
4249
4189
|
this._snap = false;
|
|
4250
4190
|
this._onDidChange = new Emitter();
|
|
4251
4191
|
this.onDidChange = this._onDidChange.event;
|
|
4252
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
4192
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4253
4193
|
const { isVisible } = event;
|
|
4254
|
-
const { containerApi } = this.
|
|
4194
|
+
const { containerApi } = this._params;
|
|
4255
4195
|
containerApi.setVisible(this, isVisible);
|
|
4256
4196
|
}), this.api.onActiveChange(() => {
|
|
4257
|
-
const { containerApi } = this.
|
|
4197
|
+
const { containerApi } = this._params;
|
|
4258
4198
|
containerApi.setActive(this);
|
|
4259
4199
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4260
4200
|
if (typeof event.minimumWidth === 'number' ||
|
|
@@ -4369,9 +4309,6 @@ class GridviewPanel extends BasePanelView {
|
|
|
4369
4309
|
const minimum = (value) => (value <= 0 ? undefined : value);
|
|
4370
4310
|
return Object.assign(Object.assign({}, state), { minimumHeight: minimum(this.minimumHeight), maximumHeight: maximum(this.maximumHeight), minimumWidth: minimum(this.minimumWidth), maximumWidth: maximum(this.maximumWidth), snap: this.snap, priority: this.priority });
|
|
4371
4311
|
}
|
|
4372
|
-
dispose() {
|
|
4373
|
-
super.dispose();
|
|
4374
|
-
}
|
|
4375
4312
|
}
|
|
4376
4313
|
|
|
4377
4314
|
class GroupviewPanel extends GridviewPanel {
|
|
@@ -4478,15 +4415,22 @@ class DockviewComponent extends BaseGrid {
|
|
|
4478
4415
|
orientation: options.orientation || Orientation.HORIZONTAL,
|
|
4479
4416
|
styles: options.styles,
|
|
4480
4417
|
});
|
|
4481
|
-
this._panels = new Map();
|
|
4482
|
-
this.dirtyPanels = new Set();
|
|
4483
|
-
this.debouncedDeque = debounce(this.syncConfigs.bind(this), 5000);
|
|
4484
4418
|
// events
|
|
4485
4419
|
this._onTabInteractionEvent = new Emitter();
|
|
4486
4420
|
this.onTabInteractionEvent = this._onTabInteractionEvent.event;
|
|
4487
4421
|
this._onTabContextMenu = new Emitter();
|
|
4488
4422
|
this.onTabContextMenu = this._onTabContextMenu.event;
|
|
4489
|
-
this.
|
|
4423
|
+
this._onDidDrop = new Emitter();
|
|
4424
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
4425
|
+
this._onDidRemovePanel = new Emitter();
|
|
4426
|
+
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4427
|
+
this._onDidAddPanel = new Emitter();
|
|
4428
|
+
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
4429
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4430
|
+
this.onDidLayoutfromJSON = this._onDidLayoutfromJSON.event;
|
|
4431
|
+
this._onDidActivePanelChange = new Emitter();
|
|
4432
|
+
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4433
|
+
this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop);
|
|
4490
4434
|
this._options = options;
|
|
4491
4435
|
if (!this.options.components) {
|
|
4492
4436
|
this.options.components = {};
|
|
@@ -4507,10 +4451,10 @@ class DockviewComponent extends BaseGrid {
|
|
|
4507
4451
|
this._api = new DockviewApi(this);
|
|
4508
4452
|
}
|
|
4509
4453
|
get totalPanels() {
|
|
4510
|
-
return this.
|
|
4454
|
+
return this.panels.length;
|
|
4511
4455
|
}
|
|
4512
4456
|
get panels() {
|
|
4513
|
-
return
|
|
4457
|
+
return this.groups.flatMap((group) => group.model.panels);
|
|
4514
4458
|
}
|
|
4515
4459
|
get deserializer() {
|
|
4516
4460
|
return this._deserializer;
|
|
@@ -4540,10 +4484,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
4540
4484
|
updateOptions(options) {
|
|
4541
4485
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
4542
4486
|
this.options.orientation !== options.orientation;
|
|
4543
|
-
// TODO support style update
|
|
4544
|
-
// const hasStylesChanged =
|
|
4545
|
-
// typeof options.styles === 'object' &&
|
|
4546
|
-
// this.options.styles !== options.styles;
|
|
4547
4487
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
4548
4488
|
if (hasOrientationChanged) {
|
|
4549
4489
|
this.gridview.orientation = options.orientation;
|
|
@@ -4555,8 +4495,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4555
4495
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4556
4496
|
}
|
|
4557
4497
|
getGroupPanel(id) {
|
|
4558
|
-
|
|
4559
|
-
return (_a = this._panels.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
4498
|
+
return this.panels.find((panel) => panel.id === id);
|
|
4560
4499
|
}
|
|
4561
4500
|
setActivePanel(panel) {
|
|
4562
4501
|
if (!panel.group) {
|
|
@@ -4605,24 +4544,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
4605
4544
|
this.doSetGroupActive(next);
|
|
4606
4545
|
}
|
|
4607
4546
|
}
|
|
4608
|
-
registerPanel(panel) {
|
|
4609
|
-
if (this._panels.has(panel.id)) {
|
|
4610
|
-
throw new Error(`panel ${panel.id} already exists`);
|
|
4611
|
-
}
|
|
4612
|
-
const disposable = new CompositeDisposable(panel.onDidStateChange(() => this.addDirtyPanel(panel)));
|
|
4613
|
-
this._panels.set(panel.id, { value: panel, disposable });
|
|
4614
|
-
}
|
|
4615
|
-
unregisterPanel(panel) {
|
|
4616
|
-
if (!this._panels.has(panel.id)) {
|
|
4617
|
-
throw new Error(`panel ${panel.id} doesn't exist`);
|
|
4618
|
-
}
|
|
4619
|
-
const item = this._panels.get(panel.id);
|
|
4620
|
-
if (item) {
|
|
4621
|
-
item.disposable.dispose();
|
|
4622
|
-
item.value.dispose();
|
|
4623
|
-
}
|
|
4624
|
-
this._panels.delete(panel.id);
|
|
4625
|
-
}
|
|
4626
4547
|
/**
|
|
4627
4548
|
* Serialize the current state of the layout
|
|
4628
4549
|
*
|
|
@@ -4630,12 +4551,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
4630
4551
|
*/
|
|
4631
4552
|
toJSON() {
|
|
4632
4553
|
var _a;
|
|
4633
|
-
this.syncConfigs();
|
|
4634
4554
|
const data = this.gridview.serialize();
|
|
4635
|
-
const panels =
|
|
4636
|
-
|
|
4637
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4638
|
-
}
|
|
4555
|
+
const panels = this.panels.reduce((collection, panel) => {
|
|
4556
|
+
collection[panel.id] = panel.toJSON();
|
|
4639
4557
|
return collection;
|
|
4640
4558
|
}, {});
|
|
4641
4559
|
return {
|
|
@@ -4647,11 +4565,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
4647
4565
|
}
|
|
4648
4566
|
fromJSON(data) {
|
|
4649
4567
|
this.gridview.clear();
|
|
4650
|
-
this.
|
|
4651
|
-
panel.
|
|
4652
|
-
panel.value.dispose();
|
|
4568
|
+
this.panels.forEach((panel) => {
|
|
4569
|
+
panel.dispose();
|
|
4653
4570
|
});
|
|
4654
|
-
this._panels.clear();
|
|
4655
4571
|
this._groups.clear();
|
|
4656
4572
|
if (!this.deserializer) {
|
|
4657
4573
|
throw new Error('invalid deserializer');
|
|
@@ -4666,9 +4582,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4666
4582
|
this.gridview.deserialize(grid, new DefaultDeserializer(this, {
|
|
4667
4583
|
createPanel: (id) => {
|
|
4668
4584
|
const panelData = panels[id];
|
|
4669
|
-
|
|
4670
|
-
this.registerPanel(panel);
|
|
4671
|
-
return panel;
|
|
4585
|
+
return this.deserializer.fromJSON(panelData);
|
|
4672
4586
|
},
|
|
4673
4587
|
}));
|
|
4674
4588
|
if (typeof activeGroup === 'string') {
|
|
@@ -4679,30 +4593,23 @@ class DockviewComponent extends BaseGrid {
|
|
|
4679
4593
|
}
|
|
4680
4594
|
this.gridview.layout(this.width, this.height);
|
|
4681
4595
|
this._onGridEvent.fire({ kind: GroupChangeKind.LAYOUT_FROM_JSON });
|
|
4596
|
+
this._onDidLayoutfromJSON.fire();
|
|
4682
4597
|
}
|
|
4683
4598
|
closeAllGroups() {
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
if (!didCloseAll) {
|
|
4689
|
-
return false;
|
|
4690
|
-
}
|
|
4691
|
-
}
|
|
4692
|
-
return true;
|
|
4693
|
-
});
|
|
4599
|
+
for (const entry of this._groups.entries()) {
|
|
4600
|
+
const [_, group] = entry;
|
|
4601
|
+
group.value.model.closeAllPanels();
|
|
4602
|
+
}
|
|
4694
4603
|
}
|
|
4695
4604
|
fireMouseEvent(event) {
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
}
|
|
4705
|
-
break;
|
|
4605
|
+
if (event.kind === MouseEventKind.CONTEXT_MENU) {
|
|
4606
|
+
if (event.tab && event.panel) {
|
|
4607
|
+
this._onTabContextMenu.fire({
|
|
4608
|
+
event: event.event,
|
|
4609
|
+
api: this._api,
|
|
4610
|
+
panel: event.panel,
|
|
4611
|
+
});
|
|
4612
|
+
}
|
|
4706
4613
|
}
|
|
4707
4614
|
}
|
|
4708
4615
|
addPanel(options) {
|
|
@@ -4736,7 +4643,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
4736
4643
|
return panel;
|
|
4737
4644
|
}
|
|
4738
4645
|
removePanel(panel) {
|
|
4739
|
-
this.unregisterPanel(panel);
|
|
4740
4646
|
const group = panel.group;
|
|
4741
4647
|
if (!group) {
|
|
4742
4648
|
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
@@ -4755,10 +4661,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
4755
4661
|
: {}, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.watermark);
|
|
4756
4662
|
}
|
|
4757
4663
|
addEmptyGroup(options) {
|
|
4758
|
-
var _a;
|
|
4759
4664
|
const group = this.createGroup();
|
|
4760
4665
|
if (options) {
|
|
4761
|
-
const referencePanel =
|
|
4666
|
+
const referencePanel = this.panels.find((panel) => panel.id === options.referencePanel);
|
|
4762
4667
|
if (!referencePanel) {
|
|
4763
4668
|
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
4764
4669
|
}
|
|
@@ -4787,13 +4692,13 @@ class DockviewComponent extends BaseGrid {
|
|
|
4787
4692
|
super.removeGroup(group);
|
|
4788
4693
|
}
|
|
4789
4694
|
moveGroupOrPanel(referenceGroup, groupId, itemId, target, index) {
|
|
4790
|
-
var _a
|
|
4695
|
+
var _a;
|
|
4791
4696
|
const sourceGroup = groupId
|
|
4792
4697
|
? (_a = this._groups.get(groupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
4793
4698
|
: undefined;
|
|
4794
4699
|
if (!target || target === Position.Center) {
|
|
4795
4700
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4796
|
-
|
|
4701
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4797
4702
|
if (!groupItem) {
|
|
4798
4703
|
throw new Error(`No panel with id ${itemId}`);
|
|
4799
4704
|
}
|
|
@@ -4829,7 +4734,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4829
4734
|
}
|
|
4830
4735
|
else {
|
|
4831
4736
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4832
|
-
|
|
4737
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4833
4738
|
if (!groupItem) {
|
|
4834
4739
|
throw new Error(`No panel with id ${itemId}`);
|
|
4835
4740
|
}
|
|
@@ -4839,7 +4744,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4839
4744
|
}
|
|
4840
4745
|
}
|
|
4841
4746
|
doSetGroupActive(group, skipFocus) {
|
|
4842
|
-
var _a, _b;
|
|
4747
|
+
var _a, _b, _c;
|
|
4843
4748
|
const isGroupAlreadyFocused = this._activeGroup === group;
|
|
4844
4749
|
super.doSetGroupActive(group, skipFocus);
|
|
4845
4750
|
if (!isGroupAlreadyFocused && ((_a = this._activeGroup) === null || _a === void 0 ? void 0 : _a.model.activePanel)) {
|
|
@@ -4847,6 +4752,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4847
4752
|
kind: GroupChangeKind.PANEL_ACTIVE,
|
|
4848
4753
|
panel: (_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel,
|
|
4849
4754
|
});
|
|
4755
|
+
this._onDidActivePanelChange.fire((_c = this._activeGroup) === null || _c === void 0 ? void 0 : _c.model.activePanel);
|
|
4850
4756
|
}
|
|
4851
4757
|
}
|
|
4852
4758
|
createGroup(options) {
|
|
@@ -4872,6 +4778,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
4872
4778
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4873
4779
|
const { groupId, itemId, target, index } = event;
|
|
4874
4780
|
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
4781
|
+
}), view.model.onDidDrop((event) => {
|
|
4782
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api }));
|
|
4875
4783
|
}), view.model.onDidGroupChange((event) => {
|
|
4876
4784
|
switch (event.kind) {
|
|
4877
4785
|
case GroupChangeKind2.ADD_PANEL:
|
|
@@ -4879,24 +4787,25 @@ class DockviewComponent extends BaseGrid {
|
|
|
4879
4787
|
kind: GroupChangeKind.ADD_PANEL,
|
|
4880
4788
|
panel: event.panel,
|
|
4881
4789
|
});
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
kind: GroupChangeKind.GROUP_ACTIVE,
|
|
4886
|
-
panel: event.panel,
|
|
4887
|
-
});
|
|
4790
|
+
if (event.panel) {
|
|
4791
|
+
this._onDidAddPanel.fire(event.panel);
|
|
4792
|
+
}
|
|
4888
4793
|
break;
|
|
4889
4794
|
case GroupChangeKind2.REMOVE_PANEL:
|
|
4890
4795
|
this._onGridEvent.fire({
|
|
4891
4796
|
kind: GroupChangeKind.REMOVE_PANEL,
|
|
4892
4797
|
panel: event.panel,
|
|
4893
4798
|
});
|
|
4799
|
+
if (event.panel) {
|
|
4800
|
+
this._onDidRemovePanel.fire(event.panel);
|
|
4801
|
+
}
|
|
4894
4802
|
break;
|
|
4895
4803
|
case GroupChangeKind2.PANEL_ACTIVE:
|
|
4896
4804
|
this._onGridEvent.fire({
|
|
4897
4805
|
kind: GroupChangeKind.PANEL_ACTIVE,
|
|
4898
4806
|
panel: event.panel,
|
|
4899
4807
|
});
|
|
4808
|
+
this._onDidActivePanelChange.fire(event.panel);
|
|
4900
4809
|
break;
|
|
4901
4810
|
}
|
|
4902
4811
|
}));
|
|
@@ -4910,44 +4819,18 @@ class DockviewComponent extends BaseGrid {
|
|
|
4910
4819
|
}
|
|
4911
4820
|
return view;
|
|
4912
4821
|
}
|
|
4913
|
-
dispose() {
|
|
4914
|
-
super.dispose();
|
|
4915
|
-
this._onGridEvent.dispose();
|
|
4916
|
-
}
|
|
4917
|
-
/**
|
|
4918
|
-
* Ensure the local copy of the layout state is up-to-date
|
|
4919
|
-
*/
|
|
4920
|
-
syncConfigs() {
|
|
4921
|
-
const dirtyPanels = Array.from(this.dirtyPanels);
|
|
4922
|
-
if (dirtyPanels.length === 0) ;
|
|
4923
|
-
this.dirtyPanels.clear();
|
|
4924
|
-
const partialPanelState = dirtyPanels
|
|
4925
|
-
.map((panel) => this._panels.get(panel.id))
|
|
4926
|
-
.filter((_) => !!_)
|
|
4927
|
-
.reduce((collection, panel) => {
|
|
4928
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4929
|
-
return collection;
|
|
4930
|
-
}, {});
|
|
4931
|
-
this.panelState = Object.assign(Object.assign({}, this.panelState), partialPanelState);
|
|
4932
|
-
dirtyPanels
|
|
4933
|
-
.filter((p) => this._panels.has(p.id))
|
|
4934
|
-
.forEach((panel) => {
|
|
4935
|
-
panel.setDirty(false);
|
|
4936
|
-
});
|
|
4937
|
-
}
|
|
4938
4822
|
_addPanel(options) {
|
|
4939
4823
|
const view = new DefaultGroupPanelView({
|
|
4940
4824
|
content: this.createContentComponent(options.id, options.component),
|
|
4941
4825
|
tab: this.createTabComponent(options.id, options.tabComponent),
|
|
4942
4826
|
});
|
|
4943
|
-
const panel = new DockviewGroupPanel(options.id, this._api);
|
|
4827
|
+
const panel = new DockviewGroupPanel(options.id, this, this._api);
|
|
4944
4828
|
panel.init({
|
|
4945
4829
|
view,
|
|
4946
4830
|
title: options.title || options.id,
|
|
4947
4831
|
suppressClosable: options === null || options === void 0 ? void 0 : options.suppressClosable,
|
|
4948
4832
|
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
4949
4833
|
});
|
|
4950
|
-
this.registerPanel(panel);
|
|
4951
4834
|
return panel;
|
|
4952
4835
|
}
|
|
4953
4836
|
createContentComponent(id, componentName) {
|
|
@@ -4967,10 +4850,12 @@ class DockviewComponent extends BaseGrid {
|
|
|
4967
4850
|
var _a;
|
|
4968
4851
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
4969
4852
|
}
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
this.
|
|
4853
|
+
dispose() {
|
|
4854
|
+
super.dispose();
|
|
4855
|
+
this._onDidActivePanelChange.dispose();
|
|
4856
|
+
this._onDidAddPanel.dispose();
|
|
4857
|
+
this._onDidRemovePanel.dispose();
|
|
4858
|
+
this._onDidLayoutfromJSON.dispose();
|
|
4974
4859
|
}
|
|
4975
4860
|
}
|
|
4976
4861
|
|
|
@@ -4981,6 +4866,8 @@ class GridviewComponent extends BaseGrid {
|
|
|
4981
4866
|
orientation: options.orientation,
|
|
4982
4867
|
styles: options.styles,
|
|
4983
4868
|
});
|
|
4869
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4870
|
+
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
4984
4871
|
this._options = options;
|
|
4985
4872
|
if (!this.options.components) {
|
|
4986
4873
|
this.options.components = {};
|
|
@@ -5089,6 +4976,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
5089
4976
|
}
|
|
5090
4977
|
}
|
|
5091
4978
|
this._onGridEvent.fire({ kind: GroupChangeKind.LAYOUT_FROM_JSON });
|
|
4979
|
+
this._onDidLayoutfromJSON.fire();
|
|
5092
4980
|
}
|
|
5093
4981
|
movePanel(panel, options) {
|
|
5094
4982
|
var _a;
|
|
@@ -5203,6 +5091,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
5203
5091
|
}
|
|
5204
5092
|
dispose() {
|
|
5205
5093
|
super.dispose();
|
|
5094
|
+
this._onDidLayoutfromJSON.dispose();
|
|
5206
5095
|
}
|
|
5207
5096
|
}
|
|
5208
5097
|
|
|
@@ -5229,7 +5118,7 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5229
5118
|
options.frameworkComponents = {};
|
|
5230
5119
|
}
|
|
5231
5120
|
this.splitview = new Splitview(this.element, options);
|
|
5232
|
-
this.addDisposables(this._disposable);
|
|
5121
|
+
this.addDisposables(this._disposable, this._onDidAddView, this._onDidRemoveView, this._onDidLayoutChange);
|
|
5233
5122
|
}
|
|
5234
5123
|
get options() {
|
|
5235
5124
|
return this._options;
|
|
@@ -5451,41 +5340,6 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5451
5340
|
}
|
|
5452
5341
|
}
|
|
5453
5342
|
|
|
5454
|
-
class DragHandler extends CompositeDisposable {
|
|
5455
|
-
constructor(el) {
|
|
5456
|
-
super();
|
|
5457
|
-
this.el = el;
|
|
5458
|
-
this.iframes = [];
|
|
5459
|
-
this._onDragStart = new Emitter();
|
|
5460
|
-
this.onDragStart = this._onDragStart.event;
|
|
5461
|
-
this.configure();
|
|
5462
|
-
}
|
|
5463
|
-
configure() {
|
|
5464
|
-
this.addDisposables(addDisposableListener(this.el, 'dragstart', (event) => {
|
|
5465
|
-
var _a;
|
|
5466
|
-
this.iframes = [
|
|
5467
|
-
...getElementsByTagName('iframe'),
|
|
5468
|
-
...getElementsByTagName('webview'),
|
|
5469
|
-
];
|
|
5470
|
-
for (const iframe of this.iframes) {
|
|
5471
|
-
iframe.style.pointerEvents = 'none';
|
|
5472
|
-
}
|
|
5473
|
-
this.el.classList.add('dragged');
|
|
5474
|
-
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
5475
|
-
(_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5476
|
-
this.disposable = this.getData();
|
|
5477
|
-
}), addDisposableListener(this.el, 'dragend', (ev) => {
|
|
5478
|
-
var _a;
|
|
5479
|
-
for (const iframe of this.iframes) {
|
|
5480
|
-
iframe.style.pointerEvents = 'auto';
|
|
5481
|
-
}
|
|
5482
|
-
this.iframes = [];
|
|
5483
|
-
(_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5484
|
-
this.disposable = undefined;
|
|
5485
|
-
}));
|
|
5486
|
-
}
|
|
5487
|
-
}
|
|
5488
|
-
|
|
5489
5343
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
5490
5344
|
//
|
|
5491
5345
|
constructor(id) {
|
|
@@ -5500,6 +5354,7 @@ class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
|
5500
5354
|
//
|
|
5501
5355
|
this._onDidSizeChange = new Emitter();
|
|
5502
5356
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
5357
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
5503
5358
|
}
|
|
5504
5359
|
setConstraints(value) {
|
|
5505
5360
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -5507,11 +5362,6 @@ class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
|
5507
5362
|
setSize(event) {
|
|
5508
5363
|
this._onDidSizeChange.fire(event);
|
|
5509
5364
|
}
|
|
5510
|
-
dispose() {
|
|
5511
|
-
super.dispose();
|
|
5512
|
-
this._onDidConstraintsChange.dispose();
|
|
5513
|
-
this._onDidSizeChange.dispose();
|
|
5514
|
-
}
|
|
5515
5365
|
}
|
|
5516
5366
|
|
|
5517
5367
|
class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
@@ -5525,6 +5375,7 @@ class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
|
5525
5375
|
this.onMouseEnter = this._onMouseEnter.event;
|
|
5526
5376
|
this._onMouseLeave = new Emitter({});
|
|
5527
5377
|
this.onMouseLeave = this._onMouseLeave.event;
|
|
5378
|
+
this.addDisposables(this._onDidExpansionChange, this._onMouseEnter, this._onMouseLeave);
|
|
5528
5379
|
}
|
|
5529
5380
|
set pane(pane) {
|
|
5530
5381
|
this._pane = pane;
|
|
@@ -5693,7 +5544,7 @@ class PaneviewPanel extends BasePanelView {
|
|
|
5693
5544
|
}
|
|
5694
5545
|
}
|
|
5695
5546
|
toJSON() {
|
|
5696
|
-
const params = this.
|
|
5547
|
+
const params = this._params;
|
|
5697
5548
|
return Object.assign(Object.assign({}, super.toJSON()), { headerComponent: this.headerComponent, title: params.title });
|
|
5698
5549
|
}
|
|
5699
5550
|
renderOnce() {
|
|
@@ -5762,36 +5613,39 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
5762
5613
|
},
|
|
5763
5614
|
});
|
|
5764
5615
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
5765
|
-
|
|
5766
|
-
if (!data) {
|
|
5767
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5768
|
-
return;
|
|
5769
|
-
}
|
|
5770
|
-
const containerApi = this.params
|
|
5771
|
-
.containerApi;
|
|
5772
|
-
const panelId = data.paneId;
|
|
5773
|
-
const existingPanel = containerApi.getPanel(panelId);
|
|
5774
|
-
if (!existingPanel) {
|
|
5775
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5776
|
-
return;
|
|
5777
|
-
}
|
|
5778
|
-
const allPanels = containerApi.getPanels();
|
|
5779
|
-
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5780
|
-
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5781
|
-
if (event.position === Position.Left ||
|
|
5782
|
-
event.position === Position.Top) {
|
|
5783
|
-
toIndex = Math.max(0, toIndex - 1);
|
|
5784
|
-
}
|
|
5785
|
-
if (event.position === Position.Right ||
|
|
5786
|
-
event.position === Position.Bottom) {
|
|
5787
|
-
if (fromIndex > toIndex) {
|
|
5788
|
-
toIndex++;
|
|
5789
|
-
}
|
|
5790
|
-
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5791
|
-
}
|
|
5792
|
-
containerApi.movePanel(fromIndex, toIndex);
|
|
5616
|
+
this.onDrop(event);
|
|
5793
5617
|
}));
|
|
5794
5618
|
}
|
|
5619
|
+
onDrop(event) {
|
|
5620
|
+
const data = getPaneData();
|
|
5621
|
+
if (!data) {
|
|
5622
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5623
|
+
return;
|
|
5624
|
+
}
|
|
5625
|
+
const containerApi = this._params
|
|
5626
|
+
.containerApi;
|
|
5627
|
+
const panelId = data.paneId;
|
|
5628
|
+
const existingPanel = containerApi.getPanel(panelId);
|
|
5629
|
+
if (!existingPanel) {
|
|
5630
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5631
|
+
return;
|
|
5632
|
+
}
|
|
5633
|
+
const allPanels = containerApi.getPanels();
|
|
5634
|
+
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5635
|
+
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5636
|
+
if (event.position === Position.Left ||
|
|
5637
|
+
event.position === Position.Top) {
|
|
5638
|
+
toIndex = Math.max(0, toIndex - 1);
|
|
5639
|
+
}
|
|
5640
|
+
if (event.position === Position.Right ||
|
|
5641
|
+
event.position === Position.Bottom) {
|
|
5642
|
+
if (fromIndex > toIndex) {
|
|
5643
|
+
toIndex++;
|
|
5644
|
+
}
|
|
5645
|
+
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5646
|
+
}
|
|
5647
|
+
containerApi.movePanel(fromIndex, toIndex);
|
|
5648
|
+
}
|
|
5795
5649
|
}
|
|
5796
5650
|
|
|
5797
5651
|
class DefaultHeader extends CompositeDisposable {
|
|
@@ -5855,6 +5709,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5855
5709
|
this.onDidAddView = this._onDidAddView.event;
|
|
5856
5710
|
this._onDidRemoveView = new Emitter();
|
|
5857
5711
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
5712
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
|
|
5858
5713
|
this._options = options;
|
|
5859
5714
|
if (!options.components) {
|
|
5860
5715
|
options.components = {};
|
|
@@ -6082,12 +5937,14 @@ class SplitviewPanel extends BasePanelView {
|
|
|
6082
5937
|
this._snap = false;
|
|
6083
5938
|
this._onDidChange = new Emitter();
|
|
6084
5939
|
this.onDidChange = this._onDidChange.event;
|
|
6085
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
5940
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
6086
5941
|
const { isVisible } = event;
|
|
6087
|
-
const { containerApi } = this
|
|
5942
|
+
const { containerApi } = this
|
|
5943
|
+
._params;
|
|
6088
5944
|
containerApi.setVisible(this, isVisible);
|
|
6089
5945
|
}), this.api.onActiveChange(() => {
|
|
6090
|
-
const { containerApi } = this
|
|
5946
|
+
const { containerApi } = this
|
|
5947
|
+
._params;
|
|
6091
5948
|
containerApi.setActive(this);
|
|
6092
5949
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
6093
5950
|
if (typeof event.minimumSize === 'number' ||
|
|
@@ -6230,14 +6087,13 @@ class ReactPart {
|
|
|
6230
6087
|
if (this.disposed) {
|
|
6231
6088
|
throw new Error('invalid operation: resource is already disposed');
|
|
6232
6089
|
}
|
|
6233
|
-
// TODO use a better check for isReactFunctionalComponent
|
|
6234
6090
|
if (typeof this.component !== 'function') {
|
|
6235
6091
|
/**
|
|
6236
6092
|
* we know this isn't a React.FunctionComponent so throw an error here.
|
|
6237
6093
|
* if we do not intercept this the React library will throw a very obsure error
|
|
6238
6094
|
* for the same reason, at least at this point we will emit a sensible stacktrace.
|
|
6239
6095
|
*/
|
|
6240
|
-
throw new Error('
|
|
6096
|
+
throw new Error('Invalid Operation. dockview only supports React Functional Components.');
|
|
6241
6097
|
}
|
|
6242
6098
|
const bridgeComponent = React.createElement(React.forwardRef(ReactComponentBridge), {
|
|
6243
6099
|
component: this
|
|
@@ -6301,16 +6157,14 @@ class ReactPanelContentPart {
|
|
|
6301
6157
|
this._onDidBlur = new Emitter();
|
|
6302
6158
|
this.onDidBlur = this._onDidBlur.event;
|
|
6303
6159
|
this._element = document.createElement('div');
|
|
6304
|
-
this._element.
|
|
6305
|
-
this._element.style.width = '100%';
|
|
6160
|
+
this._element.className = 'dockview-react-part';
|
|
6306
6161
|
// this.hostedContainer = new HostedContainer({
|
|
6307
6162
|
// id,
|
|
6308
6163
|
// });
|
|
6309
6164
|
// this.hostedContainer.onDidFocus(() => this._onDidFocus.fire());
|
|
6310
6165
|
// this.hostedContainer.onDidBlur(() => this._onDidBlur.fire());
|
|
6311
6166
|
this._actionsElement = document.createElement('div');
|
|
6312
|
-
this._actionsElement.
|
|
6313
|
-
this._actionsElement.style.width = '100%';
|
|
6167
|
+
this._actionsElement.className = 'dockview-react-part';
|
|
6314
6168
|
}
|
|
6315
6169
|
get element() {
|
|
6316
6170
|
return this._element;
|
|
@@ -6358,6 +6212,8 @@ class ReactPanelContentPart {
|
|
|
6358
6212
|
}
|
|
6359
6213
|
dispose() {
|
|
6360
6214
|
var _a, _b;
|
|
6215
|
+
this._onDidFocus.dispose();
|
|
6216
|
+
this._onDidBlur.dispose();
|
|
6361
6217
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
6362
6218
|
// this.hostedContainer?.dispose();
|
|
6363
6219
|
(_b = this.actionsPart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
@@ -6370,6 +6226,7 @@ class ReactPanelHeaderPart {
|
|
|
6370
6226
|
this.component = component;
|
|
6371
6227
|
this.reactPortalStore = reactPortalStore;
|
|
6372
6228
|
this._element = document.createElement('div');
|
|
6229
|
+
this._element.className = 'dockview-react-part';
|
|
6373
6230
|
}
|
|
6374
6231
|
get element() {
|
|
6375
6232
|
return this._element;
|
|
@@ -6414,7 +6271,6 @@ class ReactPanelDeserialzier {
|
|
|
6414
6271
|
const panelId = panelData.id;
|
|
6415
6272
|
const params = panelData.params;
|
|
6416
6273
|
const title = panelData.title;
|
|
6417
|
-
const state = panelData.state;
|
|
6418
6274
|
const suppressClosable = panelData.suppressClosable;
|
|
6419
6275
|
const viewData = panelData.view;
|
|
6420
6276
|
const view = new DefaultGroupPanelView({
|
|
@@ -6423,13 +6279,12 @@ class ReactPanelDeserialzier {
|
|
|
6423
6279
|
? createComponent(viewData.tab.id, viewData.tab.id, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab)
|
|
6424
6280
|
: new DefaultTab(),
|
|
6425
6281
|
});
|
|
6426
|
-
const panel = new DockviewGroupPanel(panelId, new DockviewApi(this.layout));
|
|
6282
|
+
const panel = new DockviewGroupPanel(panelId, this.layout, new DockviewApi(this.layout));
|
|
6427
6283
|
panel.init({
|
|
6428
6284
|
view,
|
|
6429
6285
|
title,
|
|
6430
6286
|
suppressClosable,
|
|
6431
6287
|
params: params || {},
|
|
6432
|
-
state: state || {},
|
|
6433
6288
|
});
|
|
6434
6289
|
return panel;
|
|
6435
6290
|
}
|
|
@@ -6444,8 +6299,7 @@ class ReactWatermarkPart {
|
|
|
6444
6299
|
value: undefined,
|
|
6445
6300
|
};
|
|
6446
6301
|
this._element = document.createElement('div');
|
|
6447
|
-
this._element.
|
|
6448
|
-
this._element.style.width = '100%';
|
|
6302
|
+
this._element.className = 'dockview-react-part';
|
|
6449
6303
|
}
|
|
6450
6304
|
get element() {
|
|
6451
6305
|
return this._element;
|
|
@@ -6543,12 +6397,16 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
6543
6397
|
frameworkTabComponents: props.tabComponents,
|
|
6544
6398
|
tabHeight: props.tabHeight,
|
|
6545
6399
|
debug: props.debug,
|
|
6546
|
-
enableExternalDragEvents: props.enableExternalDragEvents,
|
|
6547
6400
|
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6548
6401
|
styles: props.hideBorders
|
|
6549
6402
|
? { separatorBorder: 'transparent' }
|
|
6550
6403
|
: undefined,
|
|
6551
6404
|
});
|
|
6405
|
+
const disposable = dockview.onDidDrop((event) => {
|
|
6406
|
+
if (props.onDidDrop) {
|
|
6407
|
+
props.onDidDrop(event);
|
|
6408
|
+
}
|
|
6409
|
+
});
|
|
6552
6410
|
(_a = domRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(dockview.element);
|
|
6553
6411
|
dockview.deserializer = new ReactPanelDeserialzier(dockview);
|
|
6554
6412
|
const { clientWidth, clientHeight } = domRef.current;
|
|
@@ -6558,6 +6416,7 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
6558
6416
|
}
|
|
6559
6417
|
dockviewRef.current = dockview;
|
|
6560
6418
|
return () => {
|
|
6419
|
+
disposable.dispose();
|
|
6561
6420
|
dockview.dispose();
|
|
6562
6421
|
};
|
|
6563
6422
|
}, []);
|
|
@@ -6569,6 +6428,14 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
6569
6428
|
frameworkComponents: props.components,
|
|
6570
6429
|
});
|
|
6571
6430
|
}, [props.components]);
|
|
6431
|
+
React.useEffect(() => {
|
|
6432
|
+
if (!dockviewRef.current) {
|
|
6433
|
+
return;
|
|
6434
|
+
}
|
|
6435
|
+
dockviewRef.current.updateOptions({
|
|
6436
|
+
showDndOverlay: props.showDndOverlay,
|
|
6437
|
+
});
|
|
6438
|
+
}, [props.showDndOverlay]);
|
|
6572
6439
|
React.useEffect(() => {
|
|
6573
6440
|
if (!dockviewRef.current) {
|
|
6574
6441
|
return;
|
|
@@ -6657,9 +6524,9 @@ class ReactPanelView extends SplitviewPanel {
|
|
|
6657
6524
|
getComponent() {
|
|
6658
6525
|
var _a;
|
|
6659
6526
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6660
|
-
params: ((_a = this.
|
|
6527
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6661
6528
|
api: this.api,
|
|
6662
|
-
containerApi: this.
|
|
6529
|
+
containerApi: this._params
|
|
6663
6530
|
.containerApi,
|
|
6664
6531
|
});
|
|
6665
6532
|
}
|
|
@@ -6732,9 +6599,9 @@ class ReactGridPanelView extends GridviewPanel {
|
|
|
6732
6599
|
getComponent() {
|
|
6733
6600
|
var _a;
|
|
6734
6601
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6735
|
-
params: ((_a = this.
|
|
6602
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6736
6603
|
api: this.api,
|
|
6737
|
-
containerApi: this.
|
|
6604
|
+
containerApi: this._params
|
|
6738
6605
|
.containerApi,
|
|
6739
6606
|
});
|
|
6740
6607
|
}
|
|
@@ -6922,4 +6789,4 @@ const PaneviewReact = React.forwardRef((props, ref) => {
|
|
|
6922
6789
|
});
|
|
6923
6790
|
PaneviewReact.displayName = 'PaneviewComponent';
|
|
6924
6791
|
|
|
6925
|
-
export { BaseGrid, CompositeDisposable, ContentContainer,
|
|
6792
|
+
export { BaseGrid, CompositeDisposable, ContentContainer, Disposable, DockviewApi, DockviewComponent, DockviewComponents, DockviewReact, Emitter, Event, Gridview, GridviewApi, GridviewComponent, GridviewPanel, GridviewReact, GroupChangeKind, GroupChangeKind2, Groupview, LayoutPriority, LocalSelectionTransfer, MouseEventKind, MutableDisposable, Orientation, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewReact, Position, ReactPanelContentPart, ReactPanelHeaderPart, ReactPart, ReactPartContext, SashState, Sizing, Splitview, SplitviewApi, SplitviewComponent, SplitviewPanel, SplitviewReact, Tab$1 as Tab, TickDelayedEvent, addDisposableListener, addDisposableWindowListener, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isReactElement, orthogonal, toTarget, usePortalsLifecycle };
|