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.cjs.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
|
*/
|
|
@@ -59,7 +59,7 @@ function styleInject(css, ref) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
var css_248z = ".dockview-theme-dark {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n}\n\n.dockview-theme-light {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: white;\n --dv-tabs-and-actions-container-background-color: #f3f3f3;\n --dv-activegroup-visiblepanel-tab-background-color: white;\n --dv-activegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-inactivegroup-visiblepanel-tab-background-color: white;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-tab-divider-color: white;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.35);\n --dv-separator-border: rgba(128, 128, 128, 0.35);\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n}\n\n.dockview-theme-vs {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n --dv-activegroup-visiblepanel-tab-background-color: dodgerblue;\n --dv-tabs-and-actions-container-height: 18px;\n --dv-tabs-and-actions-container-font-size: 11px;\n}\n.dockview-theme-vs .groupview.active-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.inactive-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.actions-bar {\n text-align: right;\n width: 28px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n.actions-bar .actions-container {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.actions-bar .actions-container a:active {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.actions-bar .actions-container .close-action {\n background-color: white;\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n cursor: pointer;\n}\n.drop-target {\n position: relative;\n}\n.drop-target > .drop-target-dropzone {\n position: absolute;\n left: 0px;\n top: 0px;\n height: 100%;\n width: 100%;\n z-index: 10000;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection {\n position: relative;\n pointer-events: none;\n box-sizing: border-box;\n height: 100%;\n width: 100%;\n background-color: var(--dv-drag-over-background-color);\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.left, .drop-target > .drop-target-dropzone > .drop-target-selection.right {\n width: 50%;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.right {\n transform: translate(100%, 0%);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.bottom {\n transform: translate(0%, 100%);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.top, .drop-target > .drop-target-dropzone > .drop-target-selection.bottom {\n height: 50%;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-top {\n border-top: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-bottom {\n border-bottom: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-left {\n border-left: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-right {\n border-right: 1px solid var(--dv-drag-over-border-color);\n}\n.custom-dragging {\n height: 24px;\n line-height: 24px;\n font-size: 11px;\n width: 100px;\n background-color: dodgerblue;\n color: ghostwhite;\n border-radius: 11px;\n position: absolute;\n padding-left: 10px;\n}\n\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab .tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {\n background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab .tab-action {\n background-color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-background-color);\n color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab .tab-action {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-background-color);\n color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab .tab-action {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n\n/**\n * when a tab is dragged we lose the above stylings because they are conditional on parent elements\n * therefore we also set some stylings for the dragging event\n **/\n.tab.dragging {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.grid-view,\n.branch-node {\n height: 100%;\n width: 100%;\n}\n.groupview {\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: var(--dv-group-view-background-color);\n overflow: hidden;\n}\n.groupview:focus {\n outline: none;\n}\n.groupview.empty > .tabs-and-actions-container {\n display: none;\n}\n.groupview > .content-container {\n flex-grow: 1;\n overflow: hidden;\n outline: none;\n}\n.pane-container {\n height: 100%;\n width: 100%;\n}\n.pane-container.animated .view {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.pane-container .view {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n padding: 0px !important;\n}\n.pane-container .view:not(:first-child)::before {\n background-color: transparent !important;\n}\n.pane-container .view:not(:first-child) .pane > .pane-header {\n border-top: 1px solid var(--dv-paneview-header-border-color);\n}\n.pane-container .view .default-header {\n background-color: var(--dv-group-view-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n display: flex;\n padding: 0px 8px;\n}\n.pane-container .view .default-header > span {\n flex-grow: 1;\n}\n.pane-container:first-of-type > .pane > .pane-header {\n border-top: none !important;\n}\n.pane-container .pane {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n height: 100%;\n}\n.pane-container .pane .pane-header {\n box-sizing: border-box;\n user-select: none;\n position: relative;\n outline: none;\n}\n.pane-container .pane .pane-header.pane-draggable {\n cursor: pointer;\n}\n.pane-container .pane .pane-header:focus:before, .pane-container .pane .pane-header:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: \"\";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.pane-container .pane .pane-body {\n overflow-y: auto;\n overflow-x: hidden;\n flex-grow: 1;\n position: relative;\n outline: none;\n}\n.pane-container .pane .pane-body:focus:before, .pane-container .pane .pane-body:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: \"\";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.tabs-and-actions-container {\n display: flex;\n background-color: var(--dv-tabs-and-actions-container-background-color);\n flex-shrink: 0;\n box-sizing: border-box;\n height: var(--dv-tabs-and-actions-container-height);\n font-size: var(--dv-tabs-and-actions-container-font-size);\n}\n.tabs-and-actions-container.hidden {\n display: none;\n}\n.tabs-and-actions-container .void-container {\n display: flex;\n flex-grow: 1;\n}\n.tabs-and-actions-container .tabs-container {\n display: flex;\n overflow-x: overlay;\n overflow-y: hidden;\n scrollbar-width: thin;\n /* Track */\n /* Handle */\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar {\n height: 3px;\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar-track {\n background: transparent;\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar-thumb {\n background: var(--dv-tabs-container-scrollbar-color);\n}\n.tabs-and-actions-container .tabs-container .tab {\n -webkit-user-drag: element;\n outline: none;\n min-width: 75px;\n cursor: pointer;\n position: relative;\n box-sizing: border-box;\n}\n.tabs-and-actions-container .tabs-container .tab:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-tab-divider-color);\n width: 1px;\n height: 100%;\n}\n.split-view-container {\n position: relative;\n overflow: hidden;\n height: 100%;\n width: 100%;\n}\n.split-view-container.animation .view,\n.split-view-container.animation .sash {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.split-view-container.horizontal {\n height: 100%;\n}\n.split-view-container.horizontal > .sash-container > .sash {\n height: 100%;\n width: 4px;\n}\n.split-view-container.horizontal > .sash-container > .sash.enabled {\n cursor: ew-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.horizontal > .sash-container > .sash.maximum {\n cursor: w-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.minimum {\n cursor: e-resize;\n}\n.split-view-container.horizontal > .view-container > .view:not(:first-child)::before {\n height: 100%;\n width: 1px;\n}\n.split-view-container.vertical {\n width: 100%;\n}\n.split-view-container.vertical > .sash-container > .sash {\n width: 100%;\n height: 4px;\n}\n.split-view-container.vertical > .sash-container > .sash.enabled {\n cursor: ns-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.vertical > .sash-container > .sash.maximum {\n cursor: n-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.minimum {\n cursor: s-resize;\n}\n.split-view-container.vertical > .view-container > .view {\n width: 100%;\n}\n.split-view-container.vertical > .view-container > .view:not(:first-child)::before {\n height: 1px;\n width: 100%;\n}\n.split-view-container .sash-container {\n height: 100%;\n width: 100%;\n position: absolute;\n}\n.split-view-container .sash-container .sash {\n position: absolute;\n z-index: 99;\n outline: none;\n}\n.split-view-container .sash-container .sash:active {\n transition: background-color 0.1s ease-in-out;\n background-color: var(--dv-active-sash-color, transparent);\n}\n.split-view-container .sash-container .sash:hover {\n background-color: var(--dv-active-sash-color, transparent);\n transition: background-color 0.1s ease-in-out;\n transition-delay: 0.5s;\n}\n.split-view-container .view-container {\n position: relative;\n height: 100%;\n width: 100%;\n}\n.split-view-container .view-container .view {\n height: 100%;\n box-sizing: border-box;\n overflow: auto;\n position: absolute;\n}\n.split-view-container.separator-border .view:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-separator-border);\n}\n.dragged {\n transform: translate3d(0px, 0px, 0px);\n /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */\n}\n\n.tab {\n flex-shrink: 0;\n}\n.tab.dragging .tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.tab.active-tab > .default-tab .tab-action {\n visibility: visible;\n}\n.tab.inactive-tab > .default-tab .tab-action:not(.dirty) {\n visibility: hidden;\n}\n.tab.inactive-tab > .default-tab:hover .tab-action {\n visibility: visible;\n}\n.tab .default-tab {\n position: relative;\n height: 100%;\n display: flex;\n min-width: 80px;\n align-items: center;\n padding-left: 10px;\n white-space: nowrap;\n text-overflow: elipsis;\n}\n.tab .default-tab .tab-content {\n flex-grow: 1;\n}\n.tab .default-tab .action-container {\n text-align: right;\n width: 28px;\n display: flex;\n}\n.tab .default-tab .action-container .tab-list {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.tab .default-tab .action-container .tab-list a:active:hover {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.tab .default-tab .action-container .tab-list .tab-action {\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n}\n.tab .default-tab .action-container .tab-list .tab-action.disable-close {\n display: none;\n}\n.tab .default-tab .action-container .tab-list .tab-action.dirty:not(:hover) {\n display: block;\n -webkit-mask: var(--dv-tab-dirty-icon) 50% 50%/60% 60% no-repeat;\n mask: var(--dv-tab-dirty-icon) 50% 50%/60% 60% no-repeat;\n}\n.watermark {\n display: flex;\n width: 100%;\n}\n.watermark.has-actions .watermark-title .actions-bar {\n display: none;\n}\n.watermark .watermark-title {\n height: 35px;\n width: 100%;\n display: flex;\n}\n.watermark .watermark-content {\n flex-grow: 1;\n}";
|
|
62
|
+
var css_248z = ".dockview-theme-dark {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n}\n\n.dockview-theme-light {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: white;\n --dv-tabs-and-actions-container-background-color: #f3f3f3;\n --dv-activegroup-visiblepanel-tab-background-color: white;\n --dv-activegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-inactivegroup-visiblepanel-tab-background-color: white;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-tab-divider-color: white;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.35);\n --dv-separator-border: rgba(128, 128, 128, 0.35);\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n}\n\n.dockview-theme-vs {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>');\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n --dv-activegroup-visiblepanel-tab-background-color: dodgerblue;\n --dv-tabs-and-actions-container-height: 18px;\n --dv-tabs-and-actions-container-font-size: 11px;\n}\n.dockview-theme-vs .groupview.active-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.inactive-group > .tabs-and-actions-container {\n border-bottom: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.actions-bar {\n text-align: right;\n width: 28px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n.actions-bar .actions-container {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.actions-bar .actions-container a:active {\n -webkit-mask-size: 100% 100% !important;\n mask-size: 100% 100% !important;\n}\n.actions-bar .actions-container .close-action {\n background-color: white;\n height: 16px;\n width: 16px;\n display: block;\n -webkit-mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n mask: var(--dv-tab-close-icon) 50% 50%/90% 90% no-repeat;\n margin-right: \"0.5em\";\n cursor: pointer;\n}\n.drop-target {\n position: relative;\n}\n.drop-target > .drop-target-dropzone {\n position: absolute;\n left: 0px;\n top: 0px;\n height: 100%;\n width: 100%;\n z-index: 10000;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection {\n position: relative;\n 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}";
|
|
63
63
|
styleInject(css_248z);
|
|
64
64
|
|
|
65
65
|
exports.Event = void 0;
|
|
@@ -92,7 +92,6 @@ class Emitter {
|
|
|
92
92
|
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.replay) && this._last !== undefined) {
|
|
93
93
|
listener(this._last);
|
|
94
94
|
}
|
|
95
|
-
this._listeners.length === 0;
|
|
96
95
|
this._listeners.push(listener);
|
|
97
96
|
return {
|
|
98
97
|
dispose: () => {
|
|
@@ -108,9 +107,9 @@ class Emitter {
|
|
|
108
107
|
}
|
|
109
108
|
fire(e) {
|
|
110
109
|
this._last = e;
|
|
111
|
-
this._listeners
|
|
110
|
+
for (const listener of this._listeners) {
|
|
112
111
|
listener(e);
|
|
113
|
-
}
|
|
112
|
+
}
|
|
114
113
|
}
|
|
115
114
|
dispose() {
|
|
116
115
|
this._listeners = [];
|
|
@@ -168,7 +167,7 @@ class CompositeDisposable {
|
|
|
168
167
|
return new CompositeDisposable(...args);
|
|
169
168
|
}
|
|
170
169
|
addDisposables(...args) {
|
|
171
|
-
args
|
|
170
|
+
args.forEach((arg) => this.disposables.push(arg));
|
|
172
171
|
}
|
|
173
172
|
dispose() {
|
|
174
173
|
this.disposables.forEach((arg) => arg.dispose());
|
|
@@ -187,20 +186,11 @@ class MutableDisposable {
|
|
|
187
186
|
dispose() {
|
|
188
187
|
if (this._disposable) {
|
|
189
188
|
this._disposable.dispose();
|
|
189
|
+
this._disposable = exports.Disposable.NONE;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
function tryParseJSON(text, reviver) {
|
|
195
|
-
try {
|
|
196
|
-
return JSON.parse(text, reviver);
|
|
197
|
-
}
|
|
198
|
-
catch (err) {
|
|
199
|
-
console.warn('failed to parse JSON');
|
|
200
|
-
return undefined;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
194
|
class TransferObject {
|
|
205
195
|
constructor() {
|
|
206
196
|
//
|
|
@@ -221,45 +211,6 @@ class PaneTransfer extends TransferObject {
|
|
|
221
211
|
this.paneId = paneId;
|
|
222
212
|
}
|
|
223
213
|
}
|
|
224
|
-
const DATA_KEY = 'splitview/transfer';
|
|
225
|
-
const isPanelTransferEvent = (event) => {
|
|
226
|
-
if (!event.dataTransfer) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
return event.dataTransfer.types.includes(DATA_KEY);
|
|
230
|
-
};
|
|
231
|
-
exports.DragType = void 0;
|
|
232
|
-
(function (DragType) {
|
|
233
|
-
DragType["DOCKVIEW_TAB"] = "dockview_tab";
|
|
234
|
-
DragType["EXTERNAL"] = "external_group_drag";
|
|
235
|
-
})(exports.DragType || (exports.DragType = {}));
|
|
236
|
-
/**
|
|
237
|
-
* Determine whether this data belong to that of an event that was started by
|
|
238
|
-
* dragging a tab component
|
|
239
|
-
*/
|
|
240
|
-
const isTabDragEvent = (data) => {
|
|
241
|
-
return data.type === exports.DragType.DOCKVIEW_TAB;
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* Determine whether this data belong to that of an event that was started by
|
|
245
|
-
* a custom drag-enable component
|
|
246
|
-
*/
|
|
247
|
-
const isCustomDragEvent = (data) => {
|
|
248
|
-
return data.type === exports.DragType.EXTERNAL;
|
|
249
|
-
};
|
|
250
|
-
const extractData = (event) => {
|
|
251
|
-
if (!event.dataTransfer) {
|
|
252
|
-
return null;
|
|
253
|
-
}
|
|
254
|
-
const data = tryParseJSON(event.dataTransfer.getData(DATA_KEY));
|
|
255
|
-
if (!data) {
|
|
256
|
-
console.warn(`[dragEvent] ${DATA_KEY} data is missing`);
|
|
257
|
-
}
|
|
258
|
-
if (typeof data.type !== 'string') {
|
|
259
|
-
console.warn(`[dragEvent] invalid type ${data.type}`);
|
|
260
|
-
}
|
|
261
|
-
return data;
|
|
262
|
-
};
|
|
263
214
|
/**
|
|
264
215
|
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
265
216
|
*/
|
|
@@ -329,6 +280,9 @@ class SplitviewApi {
|
|
|
329
280
|
get length() {
|
|
330
281
|
return this.component.length;
|
|
331
282
|
}
|
|
283
|
+
get orientation() {
|
|
284
|
+
return this.component.orientation;
|
|
285
|
+
}
|
|
332
286
|
get onDidLayoutChange() {
|
|
333
287
|
return this.component.onDidLayoutChange;
|
|
334
288
|
}
|
|
@@ -338,9 +292,6 @@ class SplitviewApi {
|
|
|
338
292
|
get onDidRemoveView() {
|
|
339
293
|
return this.component.onDidRemoveView;
|
|
340
294
|
}
|
|
341
|
-
get orientation() {
|
|
342
|
-
return this.component.orientation;
|
|
343
|
-
}
|
|
344
295
|
updateOptions(options) {
|
|
345
296
|
this.component.updateOptions(options);
|
|
346
297
|
}
|
|
@@ -385,18 +336,18 @@ class PaneviewApi {
|
|
|
385
336
|
constructor(component) {
|
|
386
337
|
this.component = component;
|
|
387
338
|
}
|
|
388
|
-
get width() {
|
|
389
|
-
return this.component.width;
|
|
390
|
-
}
|
|
391
|
-
get height() {
|
|
392
|
-
return this.component.height;
|
|
393
|
-
}
|
|
394
339
|
get minimumSize() {
|
|
395
340
|
return this.component.minimumSize;
|
|
396
341
|
}
|
|
397
342
|
get maximumSize() {
|
|
398
343
|
return this.component.maximumSize;
|
|
399
344
|
}
|
|
345
|
+
get height() {
|
|
346
|
+
return this.component.height;
|
|
347
|
+
}
|
|
348
|
+
get width() {
|
|
349
|
+
return this.component.width;
|
|
350
|
+
}
|
|
400
351
|
get onDidLayoutChange() {
|
|
401
352
|
return this.component.onDidLayoutChange;
|
|
402
353
|
}
|
|
@@ -452,12 +403,6 @@ class GridviewApi {
|
|
|
452
403
|
constructor(component) {
|
|
453
404
|
this.component = component;
|
|
454
405
|
}
|
|
455
|
-
get width() {
|
|
456
|
-
return this.component.width;
|
|
457
|
-
}
|
|
458
|
-
get height() {
|
|
459
|
-
return this.component.height;
|
|
460
|
-
}
|
|
461
406
|
get minimumHeight() {
|
|
462
407
|
return this.component.minimumHeight;
|
|
463
408
|
}
|
|
@@ -470,12 +415,30 @@ class GridviewApi {
|
|
|
470
415
|
get maximumWidth() {
|
|
471
416
|
return this.component.maximumWidth;
|
|
472
417
|
}
|
|
418
|
+
get width() {
|
|
419
|
+
return this.component.width;
|
|
420
|
+
}
|
|
421
|
+
get height() {
|
|
422
|
+
return this.component.height;
|
|
423
|
+
}
|
|
473
424
|
get onGridEvent() {
|
|
474
425
|
return this.component.onGridEvent;
|
|
475
426
|
}
|
|
476
427
|
get onDidLayoutChange() {
|
|
477
428
|
return this.component.onDidLayoutChange;
|
|
478
429
|
}
|
|
430
|
+
get onDidAddGroup() {
|
|
431
|
+
return this.component.onDidAddGroup;
|
|
432
|
+
}
|
|
433
|
+
get onDidRemoveGroup() {
|
|
434
|
+
return this.component.onDidRemoveGroup;
|
|
435
|
+
}
|
|
436
|
+
get onDidActiveGroupChange() {
|
|
437
|
+
return this.component.onDidActiveGroupChange;
|
|
438
|
+
}
|
|
439
|
+
get onDidLayoutFromJSON() {
|
|
440
|
+
return this.component.onDidLayoutFromJSON;
|
|
441
|
+
}
|
|
479
442
|
get panels() {
|
|
480
443
|
return this.component.groups;
|
|
481
444
|
}
|
|
@@ -553,6 +516,27 @@ class DockviewApi {
|
|
|
553
516
|
get onGridEvent() {
|
|
554
517
|
return this.component.onGridEvent;
|
|
555
518
|
}
|
|
519
|
+
get onDidActiveGroupChange() {
|
|
520
|
+
return this.component.onDidActiveGroupChange;
|
|
521
|
+
}
|
|
522
|
+
get onDidAddGroup() {
|
|
523
|
+
return this.component.onDidAddGroup;
|
|
524
|
+
}
|
|
525
|
+
get onDidRemoveGroup() {
|
|
526
|
+
return this.component.onDidRemoveGroup;
|
|
527
|
+
}
|
|
528
|
+
get onDidActivePanelChange() {
|
|
529
|
+
return this.component.onDidActivePanelChange;
|
|
530
|
+
}
|
|
531
|
+
get onDidAddPanel() {
|
|
532
|
+
return this.component.onDidAddPanel;
|
|
533
|
+
}
|
|
534
|
+
get onDidRemovePanel() {
|
|
535
|
+
return this.component.onDidRemovePanel;
|
|
536
|
+
}
|
|
537
|
+
get onDidLayoutfromJSON() {
|
|
538
|
+
return this.component.onDidLayoutfromJSON;
|
|
539
|
+
}
|
|
556
540
|
get onDidLayoutChange() {
|
|
557
541
|
return this.component.onDidLayoutChange;
|
|
558
542
|
}
|
|
@@ -580,18 +564,12 @@ class DockviewApi {
|
|
|
580
564
|
getPanel(id) {
|
|
581
565
|
return this.component.getGroupPanel(id);
|
|
582
566
|
}
|
|
583
|
-
setActivePanel(panel) {
|
|
584
|
-
this.component.setActivePanel(panel);
|
|
585
|
-
}
|
|
586
567
|
layout(width, height, force = false) {
|
|
587
568
|
this.component.layout(width, height, force);
|
|
588
569
|
}
|
|
589
570
|
addPanel(options) {
|
|
590
571
|
return this.component.addPanel(options);
|
|
591
572
|
}
|
|
592
|
-
removePanel(panel) {
|
|
593
|
-
this.component.removePanel(panel);
|
|
594
|
-
}
|
|
595
573
|
addEmptyGroup(options) {
|
|
596
574
|
this.component.addEmptyGroup(options);
|
|
597
575
|
}
|
|
@@ -1611,7 +1589,7 @@ class Paneview extends CompositeDisposable {
|
|
|
1611
1589
|
this.paneItems.push(paneItem);
|
|
1612
1590
|
pane.orthogonalSize = this.splitview.orthogonalSize;
|
|
1613
1591
|
});
|
|
1614
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
1592
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
1615
1593
|
this._onDidChange.fire(undefined);
|
|
1616
1594
|
}), this.splitview.onDidAddView(() => {
|
|
1617
1595
|
this._onDidChange.fire();
|
|
@@ -1772,7 +1750,7 @@ class Droptarget extends CompositeDisposable {
|
|
|
1772
1750
|
this.options = options;
|
|
1773
1751
|
this._onDrop = new Emitter();
|
|
1774
1752
|
this.onDrop = this._onDrop.event;
|
|
1775
|
-
this.addDisposables(new DragAndDropObserver(this.element, {
|
|
1753
|
+
this.addDisposables(this._onDrop, new DragAndDropObserver(this.element, {
|
|
1776
1754
|
onDragEnter: (e) => undefined,
|
|
1777
1755
|
onDragOver: (e) => {
|
|
1778
1756
|
if (isBooleanValue(this.options.canDisplayOverlay)) {
|
|
@@ -1808,51 +1786,11 @@ class Droptarget extends CompositeDisposable {
|
|
|
1808
1786
|
const y = e.offsetY;
|
|
1809
1787
|
const xp = (100 * x) / width;
|
|
1810
1788
|
const yp = (100 * y) / height;
|
|
1811
|
-
|
|
1812
|
-
let isLeft = false;
|
|
1813
|
-
let isTop = false;
|
|
1814
|
-
let isBottom = false;
|
|
1815
|
-
switch (this.options.validOverlays) {
|
|
1816
|
-
case 'all':
|
|
1817
|
-
isRight = xp > 80;
|
|
1818
|
-
isLeft = xp < 20;
|
|
1819
|
-
isTop = !isRight && !isLeft && yp < 20;
|
|
1820
|
-
isBottom = !isRight && !isLeft && yp > 80;
|
|
1821
|
-
break;
|
|
1822
|
-
case 'vertical':
|
|
1823
|
-
isTop = yp < 50;
|
|
1824
|
-
isBottom = yp >= 50;
|
|
1825
|
-
break;
|
|
1826
|
-
case 'horizontal':
|
|
1827
|
-
isLeft = xp < 50;
|
|
1828
|
-
isRight = xp >= 50;
|
|
1829
|
-
break;
|
|
1830
|
-
}
|
|
1789
|
+
const quadrant = this.calculateQuadrant(this.options.validOverlays, xp, yp);
|
|
1831
1790
|
const isSmallX = width < 100;
|
|
1832
1791
|
const isSmallY = height < 100;
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1836
|
-
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1837
|
-
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1838
|
-
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1839
|
-
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1840
|
-
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1841
|
-
if (isRight) {
|
|
1842
|
-
this._state = exports.Position.Right;
|
|
1843
|
-
}
|
|
1844
|
-
else if (isLeft) {
|
|
1845
|
-
this._state = exports.Position.Left;
|
|
1846
|
-
}
|
|
1847
|
-
else if (isTop) {
|
|
1848
|
-
this._state = exports.Position.Top;
|
|
1849
|
-
}
|
|
1850
|
-
else if (isBottom) {
|
|
1851
|
-
this._state = exports.Position.Bottom;
|
|
1852
|
-
}
|
|
1853
|
-
else {
|
|
1854
|
-
this._state = exports.Position.Center;
|
|
1855
|
-
}
|
|
1792
|
+
this.toggleClasses(quadrant, isSmallX, isSmallY);
|
|
1793
|
+
this.setState(quadrant);
|
|
1856
1794
|
},
|
|
1857
1795
|
onDragLeave: (e) => {
|
|
1858
1796
|
this.removeDropTarget();
|
|
@@ -1881,9 +1819,73 @@ class Droptarget extends CompositeDisposable {
|
|
|
1881
1819
|
this.options.canDisplayOverlay = value;
|
|
1882
1820
|
}
|
|
1883
1821
|
dispose() {
|
|
1884
|
-
this._onDrop.dispose();
|
|
1885
1822
|
this.removeDropTarget();
|
|
1886
1823
|
}
|
|
1824
|
+
toggleClasses(quadrant, isSmallX, isSmallY) {
|
|
1825
|
+
if (!this.overlay) {
|
|
1826
|
+
return;
|
|
1827
|
+
}
|
|
1828
|
+
const isLeft = quadrant === 'left';
|
|
1829
|
+
const isRight = quadrant === 'right';
|
|
1830
|
+
const isTop = quadrant === 'top';
|
|
1831
|
+
const isBottom = quadrant === 'bottom';
|
|
1832
|
+
toggleClass(this.overlay, 'right', !isSmallX && isRight);
|
|
1833
|
+
toggleClass(this.overlay, 'left', !isSmallX && isLeft);
|
|
1834
|
+
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1835
|
+
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1836
|
+
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1837
|
+
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1838
|
+
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1839
|
+
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1840
|
+
}
|
|
1841
|
+
setState(quadrant) {
|
|
1842
|
+
switch (quadrant) {
|
|
1843
|
+
case 'top':
|
|
1844
|
+
this._state = exports.Position.Top;
|
|
1845
|
+
break;
|
|
1846
|
+
case 'left':
|
|
1847
|
+
this._state = exports.Position.Left;
|
|
1848
|
+
break;
|
|
1849
|
+
case 'bottom':
|
|
1850
|
+
this._state = exports.Position.Bottom;
|
|
1851
|
+
break;
|
|
1852
|
+
case 'right':
|
|
1853
|
+
this._state = exports.Position.Right;
|
|
1854
|
+
break;
|
|
1855
|
+
default:
|
|
1856
|
+
this._state = exports.Position.Center;
|
|
1857
|
+
break;
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
calculateQuadrant(overlayType, xp, yp) {
|
|
1861
|
+
switch (overlayType) {
|
|
1862
|
+
case 'all':
|
|
1863
|
+
if (xp < 20) {
|
|
1864
|
+
return 'left';
|
|
1865
|
+
}
|
|
1866
|
+
if (xp > 80) {
|
|
1867
|
+
return 'right';
|
|
1868
|
+
}
|
|
1869
|
+
if (yp < 20) {
|
|
1870
|
+
return 'top';
|
|
1871
|
+
}
|
|
1872
|
+
if (yp > 80) {
|
|
1873
|
+
return 'bottom';
|
|
1874
|
+
}
|
|
1875
|
+
break;
|
|
1876
|
+
case 'vertical':
|
|
1877
|
+
if (yp < 50) {
|
|
1878
|
+
return 'top';
|
|
1879
|
+
}
|
|
1880
|
+
return 'bottom';
|
|
1881
|
+
case 'horizontal':
|
|
1882
|
+
if (xp < 50) {
|
|
1883
|
+
return 'left';
|
|
1884
|
+
}
|
|
1885
|
+
return 'right';
|
|
1886
|
+
}
|
|
1887
|
+
return null;
|
|
1888
|
+
}
|
|
1887
1889
|
removeDropTarget() {
|
|
1888
1890
|
if (this.target) {
|
|
1889
1891
|
this._state = undefined;
|
|
@@ -1986,6 +1988,7 @@ class LeafNode {
|
|
|
1986
1988
|
this.view.layout(this.width, this.height);
|
|
1987
1989
|
}
|
|
1988
1990
|
dispose() {
|
|
1991
|
+
this._onDidChange.dispose();
|
|
1989
1992
|
this._disposable.dispose();
|
|
1990
1993
|
}
|
|
1991
1994
|
}
|
|
@@ -2037,7 +2040,7 @@ class BranchNode extends CompositeDisposable {
|
|
|
2037
2040
|
proportionalLayout,
|
|
2038
2041
|
});
|
|
2039
2042
|
}
|
|
2040
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
2043
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
2041
2044
|
this._onDidChange.fire(undefined);
|
|
2042
2045
|
}));
|
|
2043
2046
|
this.setupChildrenEvents();
|
|
@@ -2209,6 +2212,15 @@ class BranchNode extends CompositeDisposable {
|
|
|
2209
2212
|
* Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
|
|
2210
2213
|
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
|
|
2211
2214
|
*--------------------------------------------------------------------------------------------*/
|
|
2215
|
+
function findLeaf(candiateNode, last) {
|
|
2216
|
+
if (candiateNode instanceof LeafNode) {
|
|
2217
|
+
return candiateNode;
|
|
2218
|
+
}
|
|
2219
|
+
if (candiateNode instanceof BranchNode) {
|
|
2220
|
+
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2221
|
+
}
|
|
2222
|
+
throw new Error('invalid node');
|
|
2223
|
+
}
|
|
2212
2224
|
function flipNode(node, size, orthogonalSize) {
|
|
2213
2225
|
if (node instanceof BranchNode) {
|
|
2214
2226
|
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize);
|
|
@@ -2347,13 +2359,13 @@ class Gridview {
|
|
|
2347
2359
|
}
|
|
2348
2360
|
deserialize(json, deserializer) {
|
|
2349
2361
|
const orientation = json.orientation;
|
|
2350
|
-
const height = json.height;
|
|
2362
|
+
const height = orientation === exports.Orientation.VERTICAL ? json.height : json.width;
|
|
2351
2363
|
this._deserialize(json.root, orientation, deserializer, height);
|
|
2352
2364
|
}
|
|
2353
2365
|
_deserialize(root, orientation, deserializer, orthogonalSize) {
|
|
2354
|
-
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize);
|
|
2366
|
+
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize, true);
|
|
2355
2367
|
}
|
|
2356
|
-
_deserializeNode(node, orientation, deserializer, orthogonalSize) {
|
|
2368
|
+
_deserializeNode(node, orientation, deserializer, orthogonalSize, isRoot = false) {
|
|
2357
2369
|
let result;
|
|
2358
2370
|
if (node.type === 'branch') {
|
|
2359
2371
|
const serializedChildren = node.data;
|
|
@@ -2363,7 +2375,9 @@ class Gridview {
|
|
|
2363
2375
|
visible: serializedChild.visible,
|
|
2364
2376
|
};
|
|
2365
2377
|
});
|
|
2366
|
-
|
|
2378
|
+
// HORIZONTAL => height=orthogonalsize width=size
|
|
2379
|
+
// VERTICAL => height=size width=orthogonalsize
|
|
2380
|
+
result = new BranchNode(orientation, this.proportionalLayout, this.styles, isRoot ? orthogonalSize : node.size, isRoot ? node.size : orthogonalSize, children);
|
|
2367
2381
|
}
|
|
2368
2382
|
else {
|
|
2369
2383
|
result = new LeafNode(deserializer.fromJSON(node), orientation, orthogonalSize, node.size);
|
|
@@ -2424,15 +2438,6 @@ class Gridview {
|
|
|
2424
2438
|
if (!(node instanceof LeafNode)) {
|
|
2425
2439
|
throw new Error('invalid location');
|
|
2426
2440
|
}
|
|
2427
|
-
const findLeaf = (candiateNode, last) => {
|
|
2428
|
-
if (candiateNode instanceof LeafNode) {
|
|
2429
|
-
return candiateNode;
|
|
2430
|
-
}
|
|
2431
|
-
if (candiateNode instanceof BranchNode) {
|
|
2432
|
-
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2433
|
-
}
|
|
2434
|
-
throw new Error('invalid node');
|
|
2435
|
-
};
|
|
2436
2441
|
for (let i = path.length - 1; i > -1; i--) {
|
|
2437
2442
|
const n = path[i];
|
|
2438
2443
|
const l = location[i] || 0;
|
|
@@ -2534,9 +2539,9 @@ class Gridview {
|
|
|
2534
2539
|
if (parent.children.length > 1) {
|
|
2535
2540
|
return node.view;
|
|
2536
2541
|
}
|
|
2542
|
+
const sibling = parent.children[0];
|
|
2537
2543
|
if (pathToParent.length === 0) {
|
|
2538
2544
|
// parent is root
|
|
2539
|
-
const sibling = parent.children[0];
|
|
2540
2545
|
if (sibling instanceof LeafNode) {
|
|
2541
2546
|
return node.view;
|
|
2542
2547
|
}
|
|
@@ -2547,7 +2552,6 @@ class Gridview {
|
|
|
2547
2552
|
}
|
|
2548
2553
|
const [grandParent, ..._] = [...pathToParent].reverse();
|
|
2549
2554
|
const [parentIndex, ...__] = [...rest].reverse();
|
|
2550
|
-
const sibling = parent.children[0];
|
|
2551
2555
|
const isSiblingVisible = parent.isChildVisible(0);
|
|
2552
2556
|
parent.removeChild(0, sizing);
|
|
2553
2557
|
const sizes = grandParent.children.map((size, i) => grandParent.getChildSize(i));
|
|
@@ -2594,31 +2598,6 @@ class Gridview {
|
|
|
2594
2598
|
}
|
|
2595
2599
|
}
|
|
2596
2600
|
|
|
2597
|
-
/*! *****************************************************************************
|
|
2598
|
-
Copyright (c) Microsoft Corporation.
|
|
2599
|
-
|
|
2600
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2601
|
-
purpose with or without fee is hereby granted.
|
|
2602
|
-
|
|
2603
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2604
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2605
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2606
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2607
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2608
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2609
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2610
|
-
***************************************************************************** */
|
|
2611
|
-
|
|
2612
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
2613
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2614
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2615
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2616
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2617
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2618
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2619
|
-
});
|
|
2620
|
-
}
|
|
2621
|
-
|
|
2622
2601
|
class ContentContainer extends CompositeDisposable {
|
|
2623
2602
|
constructor() {
|
|
2624
2603
|
super();
|
|
@@ -2630,6 +2609,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
2630
2609
|
this._element = document.createElement('div');
|
|
2631
2610
|
this._element.className = 'content-container';
|
|
2632
2611
|
this._element.tabIndex = -1;
|
|
2612
|
+
this.addDisposables(this._onDidFocus, this._onDidBlur);
|
|
2633
2613
|
// for hosted containers
|
|
2634
2614
|
// 1) register a drop target on the host
|
|
2635
2615
|
// 2) register window dragStart events to disable pointer events
|
|
@@ -2696,6 +2676,41 @@ var DockviewDropTargets;
|
|
|
2696
2676
|
DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
|
|
2697
2677
|
})(DockviewDropTargets || (DockviewDropTargets = {}));
|
|
2698
2678
|
|
|
2679
|
+
class DragHandler extends CompositeDisposable {
|
|
2680
|
+
constructor(el) {
|
|
2681
|
+
super();
|
|
2682
|
+
this.el = el;
|
|
2683
|
+
this.disposable = new MutableDisposable();
|
|
2684
|
+
this._onDragStart = new Emitter();
|
|
2685
|
+
this.onDragStart = this._onDragStart.event;
|
|
2686
|
+
this.iframes = [];
|
|
2687
|
+
this.configure();
|
|
2688
|
+
}
|
|
2689
|
+
configure() {
|
|
2690
|
+
this.addDisposables(this._onDragStart, addDisposableListener(this.el, 'dragstart', (event) => {
|
|
2691
|
+
this.iframes = [
|
|
2692
|
+
...getElementsByTagName('iframe'),
|
|
2693
|
+
...getElementsByTagName('webview'),
|
|
2694
|
+
];
|
|
2695
|
+
for (const iframe of this.iframes) {
|
|
2696
|
+
iframe.style.pointerEvents = 'none';
|
|
2697
|
+
}
|
|
2698
|
+
this.el.classList.add('dragged');
|
|
2699
|
+
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
2700
|
+
this.disposable.value = this.getData();
|
|
2701
|
+
if (event.dataTransfer) {
|
|
2702
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
2703
|
+
}
|
|
2704
|
+
}), addDisposableListener(this.el, 'dragend', (ev) => {
|
|
2705
|
+
for (const iframe of this.iframes) {
|
|
2706
|
+
iframe.style.pointerEvents = 'auto';
|
|
2707
|
+
}
|
|
2708
|
+
this.iframes = [];
|
|
2709
|
+
this.disposable.dispose();
|
|
2710
|
+
}));
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2699
2714
|
exports.MouseEventKind = void 0;
|
|
2700
2715
|
(function (MouseEventKind) {
|
|
2701
2716
|
MouseEventKind["CLICK"] = "CLICK";
|
|
@@ -2705,42 +2720,34 @@ class Tab$1 extends CompositeDisposable {
|
|
|
2705
2720
|
constructor(panelId, accessor, group) {
|
|
2706
2721
|
super();
|
|
2707
2722
|
this.panelId = panelId;
|
|
2708
|
-
this.accessor = accessor;
|
|
2709
2723
|
this.group = group;
|
|
2710
2724
|
this._onChanged = new Emitter();
|
|
2711
2725
|
this.onChanged = this._onChanged.event;
|
|
2712
2726
|
this._onDropped = new Emitter();
|
|
2713
2727
|
this.onDrop = this._onDropped.event;
|
|
2714
|
-
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2715
|
-
this.iframes = [];
|
|
2716
2728
|
this.addDisposables(this._onChanged, this._onDropped);
|
|
2717
2729
|
this._element = document.createElement('div');
|
|
2718
2730
|
this._element.className = 'tab';
|
|
2719
2731
|
this._element.tabIndex = 0;
|
|
2720
2732
|
this._element.draggable = true;
|
|
2721
|
-
this.addDisposables(
|
|
2722
|
-
|
|
2723
|
-
...
|
|
2724
|
-
|
|
2725
|
-
];
|
|
2726
|
-
for (const iframe of this.iframes) {
|
|
2727
|
-
iframe.style.pointerEvents = 'none';
|
|
2733
|
+
this.addDisposables(new (class Handler extends DragHandler {
|
|
2734
|
+
constructor() {
|
|
2735
|
+
super(...arguments);
|
|
2736
|
+
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2728
2737
|
}
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2738
|
+
getData() {
|
|
2739
|
+
this.panelTransfer.setData([new PanelTransfer(accessor.id, group.id, panelId)], PanelTransfer.prototype);
|
|
2740
|
+
return {
|
|
2741
|
+
dispose: () => {
|
|
2742
|
+
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
2743
|
+
},
|
|
2744
|
+
};
|
|
2736
2745
|
}
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
iframe.style.pointerEvents = 'auto';
|
|
2746
|
+
dispose() {
|
|
2747
|
+
//
|
|
2740
2748
|
}
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
}), addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2749
|
+
})(this._element));
|
|
2750
|
+
this.addDisposables(addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2744
2751
|
if (event.defaultPrevented) {
|
|
2745
2752
|
return;
|
|
2746
2753
|
}
|
|
@@ -2942,12 +2949,10 @@ class TabsContainer extends CompositeDisposable {
|
|
|
2942
2949
|
if (!isLeftClick || event.event.defaultPrevented) {
|
|
2943
2950
|
return;
|
|
2944
2951
|
}
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
});
|
|
2950
|
-
break;
|
|
2952
|
+
if (event.kind === exports.MouseEventKind.CLICK) {
|
|
2953
|
+
this.group.model.openPanel(panel, {
|
|
2954
|
+
skipFocus: alreadyFocused,
|
|
2955
|
+
});
|
|
2951
2956
|
}
|
|
2952
2957
|
}), tabToAdd.onDrop((event) => {
|
|
2953
2958
|
this._onDrop.fire({
|
|
@@ -2976,7 +2981,6 @@ exports.GroupChangeKind2 = void 0;
|
|
|
2976
2981
|
GroupChangeKind2["ADD_PANEL"] = "ADD_PANEL";
|
|
2977
2982
|
GroupChangeKind2["REMOVE_PANEL"] = "REMOVE_PANEL";
|
|
2978
2983
|
GroupChangeKind2["PANEL_ACTIVE"] = "PANEL_ACTIVE";
|
|
2979
|
-
GroupChangeKind2["GROUP_ACTIVE"] = "GROUP_ACTIVE";
|
|
2980
2984
|
})(exports.GroupChangeKind2 || (exports.GroupChangeKind2 = {}));
|
|
2981
2985
|
class Groupview extends CompositeDisposable {
|
|
2982
2986
|
constructor(container, accessor, id, options, parent) {
|
|
@@ -2997,15 +3001,10 @@ class Groupview extends CompositeDisposable {
|
|
|
2997
3001
|
this.onMove = this._onMove.event;
|
|
2998
3002
|
this._onDidGroupChange = new Emitter();
|
|
2999
3003
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
3000
|
-
this.
|
|
3001
|
-
|
|
3002
|
-
return false;
|
|
3003
|
-
}
|
|
3004
|
-
this.doClose(panel);
|
|
3005
|
-
return true;
|
|
3006
|
-
});
|
|
3004
|
+
this._onDidDrop = new Emitter();
|
|
3005
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
3007
3006
|
this.container.classList.add('groupview');
|
|
3008
|
-
this.addDisposables(this._onMove, this._onDidGroupChange);
|
|
3007
|
+
this.addDisposables(this._onMove, this._onDidGroupChange, this._onDidChange, this._onDidDrop);
|
|
3009
3008
|
this.tabsContainer = new TabsContainer(this.accessor, this.parent, {
|
|
3010
3009
|
tabHeight: options.tabHeight,
|
|
3011
3010
|
});
|
|
@@ -3162,6 +3161,8 @@ class Groupview extends CompositeDisposable {
|
|
|
3162
3161
|
options.index > this.panels.length) {
|
|
3163
3162
|
options.index = this.panels.length;
|
|
3164
3163
|
}
|
|
3164
|
+
// ensure the group is updated before we fire any events
|
|
3165
|
+
panel.updateParentGroup(this.parent, true);
|
|
3165
3166
|
if (this._activePanel === panel) {
|
|
3166
3167
|
this.accessor.doSetGroupActive(this.parent);
|
|
3167
3168
|
return;
|
|
@@ -3182,43 +3183,19 @@ class Groupview extends CompositeDisposable {
|
|
|
3182
3183
|
return this._removePanel(panelToRemove);
|
|
3183
3184
|
}
|
|
3184
3185
|
closeAllPanels() {
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
const
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
if (this._activePanel && index > -1) {
|
|
3191
|
-
if (this.panels.indexOf(this._activePanel) < 0) {
|
|
3192
|
-
console.warn('active panel not tracked');
|
|
3193
|
-
}
|
|
3194
|
-
const canClose = !((_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.close) || (yield this._activePanel.close());
|
|
3195
|
-
if (!canClose) {
|
|
3196
|
-
return false;
|
|
3197
|
-
}
|
|
3198
|
-
}
|
|
3199
|
-
for (let i = 0; i < this.panels.length; i++) {
|
|
3200
|
-
if (i === index) {
|
|
3201
|
-
continue;
|
|
3202
|
-
}
|
|
3203
|
-
const panel = this.panels[i];
|
|
3204
|
-
this.openPanel(panel);
|
|
3205
|
-
if (panel.close) {
|
|
3206
|
-
const canClose = yield panel.close();
|
|
3207
|
-
if (!canClose) {
|
|
3208
|
-
return false;
|
|
3209
|
-
}
|
|
3210
|
-
}
|
|
3211
|
-
}
|
|
3212
|
-
if (this.panels.length > 0) {
|
|
3213
|
-
// take a copy since we will be edting the array as we iterate through
|
|
3214
|
-
const arrPanelCpy = [...this.panels];
|
|
3215
|
-
yield Promise.all(arrPanelCpy.map((p) => this.doClose(p)));
|
|
3186
|
+
if (this.panels.length > 0) {
|
|
3187
|
+
// take a copy since we will be edting the array as we iterate through
|
|
3188
|
+
const arrPanelCpy = [...this.panels];
|
|
3189
|
+
for (const panel of arrPanelCpy) {
|
|
3190
|
+
this.doClose(panel);
|
|
3216
3191
|
}
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3192
|
+
}
|
|
3193
|
+
else {
|
|
3194
|
+
this.accessor.removeGroup(this.parent);
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
closePanel(panel) {
|
|
3198
|
+
this.doClose(panel);
|
|
3222
3199
|
}
|
|
3223
3200
|
doClose(panel) {
|
|
3224
3201
|
this.accessor.removePanel(panel);
|
|
@@ -3361,8 +3338,11 @@ class Groupview extends CompositeDisposable {
|
|
|
3361
3338
|
this.tabsContainer.show();
|
|
3362
3339
|
}
|
|
3363
3340
|
}
|
|
3364
|
-
canDisplayOverlay(
|
|
3341
|
+
canDisplayOverlay(event, target) {
|
|
3365
3342
|
// custom overlay handler
|
|
3343
|
+
if (this.accessor.options.showDndOverlay) {
|
|
3344
|
+
return this.accessor.options.showDndOverlay(event, target);
|
|
3345
|
+
}
|
|
3366
3346
|
return false;
|
|
3367
3347
|
}
|
|
3368
3348
|
handleDropEvent(event, position, index) {
|
|
@@ -3387,6 +3367,9 @@ class Groupview extends CompositeDisposable {
|
|
|
3387
3367
|
index,
|
|
3388
3368
|
});
|
|
3389
3369
|
}
|
|
3370
|
+
else {
|
|
3371
|
+
this._onDidDrop.fire({ nativeEvent: event, position, index });
|
|
3372
|
+
}
|
|
3390
3373
|
}
|
|
3391
3374
|
dispose() {
|
|
3392
3375
|
for (const panel of this.panels) {
|
|
@@ -3439,10 +3422,15 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3439
3422
|
this.onGridEvent = this._onGridEvent.event;
|
|
3440
3423
|
this._onDidLayoutChange = new Emitter();
|
|
3441
3424
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
3425
|
+
this._onDidRemoveGroup = new Emitter();
|
|
3426
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
3427
|
+
this._onDidAddGroup = new Emitter();
|
|
3428
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
3429
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3430
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3442
3431
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
|
|
3443
3432
|
this.element.appendChild(this.gridview.element);
|
|
3444
|
-
|
|
3445
|
-
this.layout(0, 0, true);
|
|
3433
|
+
this.layout(0, 0, true); // set some elements height/widths
|
|
3446
3434
|
this.addDisposables(this.gridview.onDidChange(() => {
|
|
3447
3435
|
this._onGridEvent.fire({ kind: exports.GroupChangeKind.LAYOUT });
|
|
3448
3436
|
}));
|
|
@@ -3508,6 +3496,7 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3508
3496
|
doAddGroup(group, location = [0], size) {
|
|
3509
3497
|
this.gridview.addView(group, size !== null && size !== void 0 ? size : exports.Sizing.Distribute, location);
|
|
3510
3498
|
this._onGridEvent.fire({ kind: exports.GroupChangeKind.ADD_GROUP });
|
|
3499
|
+
this._onDidAddGroup.fire(group);
|
|
3511
3500
|
this.doSetGroupActive(group);
|
|
3512
3501
|
}
|
|
3513
3502
|
doRemoveGroup(group, options) {
|
|
@@ -3521,6 +3510,7 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3521
3510
|
this._groups.delete(group.id);
|
|
3522
3511
|
}
|
|
3523
3512
|
this._onGridEvent.fire({ kind: exports.GroupChangeKind.REMOVE_GROUP });
|
|
3513
|
+
this._onDidRemoveGroup.fire(group);
|
|
3524
3514
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
3525
3515
|
const groups = Array.from(this._groups.values());
|
|
3526
3516
|
this.doSetGroupActive(groups.length > 0 ? groups[0].value : undefined);
|
|
@@ -3551,6 +3541,7 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3551
3541
|
this._onGridEvent.fire({
|
|
3552
3542
|
kind: exports.GroupChangeKind.GROUP_ACTIVE,
|
|
3553
3543
|
});
|
|
3544
|
+
this._onDidActiveGroupChange.fire(group);
|
|
3554
3545
|
}
|
|
3555
3546
|
removeGroup(group) {
|
|
3556
3547
|
this.doRemoveGroup(group);
|
|
@@ -3607,6 +3598,10 @@ class BaseGrid extends CompositeDisposable {
|
|
|
3607
3598
|
dispose() {
|
|
3608
3599
|
super.dispose();
|
|
3609
3600
|
this._onGridEvent.dispose();
|
|
3601
|
+
this._onDidActiveGroupChange.dispose();
|
|
3602
|
+
this._onDidAddGroup.dispose();
|
|
3603
|
+
this._onDidRemoveGroup.dispose();
|
|
3604
|
+
this._onDidLayoutChange.dispose();
|
|
3610
3605
|
this.gridview.dispose();
|
|
3611
3606
|
}
|
|
3612
3607
|
}
|
|
@@ -3618,15 +3613,11 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3618
3613
|
constructor(id) {
|
|
3619
3614
|
super();
|
|
3620
3615
|
this.id = id;
|
|
3621
|
-
this._state = {};
|
|
3622
3616
|
this._isFocused = false;
|
|
3623
3617
|
this._isActive = false;
|
|
3624
3618
|
this._isVisible = true;
|
|
3625
3619
|
this._width = 0;
|
|
3626
3620
|
this._height = 0;
|
|
3627
|
-
this._onDidStateChange = new Emitter();
|
|
3628
|
-
this.onDidStateChange = this._onDidStateChange.event;
|
|
3629
|
-
//
|
|
3630
3621
|
this._onDidPanelDimensionChange = new Emitter({
|
|
3631
3622
|
replay: true,
|
|
3632
3623
|
});
|
|
@@ -3655,7 +3646,7 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3655
3646
|
//
|
|
3656
3647
|
this._onActiveChange = new Emitter();
|
|
3657
3648
|
this.onActiveChange = this._onActiveChange.event;
|
|
3658
|
-
this.addDisposables(this.
|
|
3649
|
+
this.addDisposables(this._onDidPanelDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3659
3650
|
this._isFocused = event.isFocused;
|
|
3660
3651
|
}), this.onDidActiveChange((event) => {
|
|
3661
3652
|
this._isActive = event.isActive;
|
|
@@ -3688,21 +3679,6 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
3688
3679
|
setActive() {
|
|
3689
3680
|
this._onActiveChange.fire();
|
|
3690
3681
|
}
|
|
3691
|
-
setState(key, value) {
|
|
3692
|
-
if (typeof key === 'object') {
|
|
3693
|
-
this._state = key;
|
|
3694
|
-
}
|
|
3695
|
-
else if (typeof value !== undefined) {
|
|
3696
|
-
this._state[key] = value;
|
|
3697
|
-
}
|
|
3698
|
-
this._onDidStateChange.fire(undefined);
|
|
3699
|
-
}
|
|
3700
|
-
getState() {
|
|
3701
|
-
return this._state;
|
|
3702
|
-
}
|
|
3703
|
-
getStateKey(key) {
|
|
3704
|
-
return this._state[key];
|
|
3705
|
-
}
|
|
3706
3682
|
dispose() {
|
|
3707
3683
|
super.dispose();
|
|
3708
3684
|
}
|
|
@@ -3722,6 +3698,7 @@ class GridviewPanelApiImpl extends PanelApiImpl {
|
|
|
3722
3698
|
//
|
|
3723
3699
|
this._onDidSizeChange = new Emitter();
|
|
3724
3700
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
3701
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
3725
3702
|
}
|
|
3726
3703
|
setConstraints(value) {
|
|
3727
3704
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -3735,19 +3712,19 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3735
3712
|
constructor(panel, group) {
|
|
3736
3713
|
super(panel.id);
|
|
3737
3714
|
this.panel = panel;
|
|
3738
|
-
this._onDidDirtyChange = new Emitter();
|
|
3739
|
-
this.onDidDirtyChange = this._onDidDirtyChange.event;
|
|
3740
3715
|
this._onDidTitleChange = new Emitter();
|
|
3741
3716
|
this.onDidTitleChange = this._onDidTitleChange.event;
|
|
3742
3717
|
this._titleChanged = new Emitter();
|
|
3743
3718
|
this.titleChanged = this._titleChanged.event;
|
|
3744
3719
|
this._suppressClosableChanged = new Emitter();
|
|
3745
3720
|
this.suppressClosableChanged = this._suppressClosableChanged.event;
|
|
3746
|
-
this.
|
|
3747
|
-
this.
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3721
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3722
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3723
|
+
this._onDidGroupChange = new Emitter();
|
|
3724
|
+
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
3725
|
+
this.disposable = new MutableDisposable();
|
|
3726
|
+
this.group = group;
|
|
3727
|
+
this.addDisposables(this.disposable, this._onDidTitleChange, this._titleChanged, this._suppressClosableChanged, this._onDidGroupChange, this._onDidActiveGroupChange);
|
|
3751
3728
|
}
|
|
3752
3729
|
get title() {
|
|
3753
3730
|
return this.panel.title;
|
|
@@ -3760,7 +3737,17 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3760
3737
|
return !!((_a = this.group) === null || _a === void 0 ? void 0 : _a.isActive);
|
|
3761
3738
|
}
|
|
3762
3739
|
set group(value) {
|
|
3740
|
+
const isOldGroupActive = this.isGroupActive;
|
|
3763
3741
|
this._group = value;
|
|
3742
|
+
this._onDidGroupChange.fire();
|
|
3743
|
+
if (this._group) {
|
|
3744
|
+
this.disposable.value = this._group.api.onDidActiveChange(() => {
|
|
3745
|
+
this._onDidActiveGroupChange.fire();
|
|
3746
|
+
});
|
|
3747
|
+
if (this.isGroupActive !== isOldGroupActive) {
|
|
3748
|
+
this._onDidActiveGroupChange.fire();
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3764
3751
|
}
|
|
3765
3752
|
get group() {
|
|
3766
3753
|
return this._group;
|
|
@@ -3774,16 +3761,10 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
3774
3761
|
}
|
|
3775
3762
|
return this.group.model.closePanel(this.panel);
|
|
3776
3763
|
}
|
|
3777
|
-
interceptOnCloseAction(interceptor) {
|
|
3778
|
-
this._interceptor = interceptor;
|
|
3779
|
-
}
|
|
3780
|
-
dispose() {
|
|
3781
|
-
super.dispose();
|
|
3782
|
-
}
|
|
3783
3764
|
}
|
|
3784
3765
|
|
|
3785
3766
|
class DockviewGroupPanel extends CompositeDisposable {
|
|
3786
|
-
constructor(id, containerApi) {
|
|
3767
|
+
constructor(id, accessor, containerApi) {
|
|
3787
3768
|
super();
|
|
3788
3769
|
this.id = id;
|
|
3789
3770
|
this.containerApi = containerApi;
|
|
@@ -3791,9 +3772,8 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3791
3772
|
this._suppressClosable = false;
|
|
3792
3773
|
this._title = '';
|
|
3793
3774
|
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
3794
|
-
this.onDidStateChange = this.api.onDidStateChange;
|
|
3795
3775
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
3796
|
-
|
|
3776
|
+
accessor.setActivePanel(this);
|
|
3797
3777
|
}), this.api.onDidTitleChange((event) => {
|
|
3798
3778
|
const title = event.title;
|
|
3799
3779
|
this.update({ params: { title } });
|
|
@@ -3817,32 +3797,18 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3817
3797
|
this._view = params.view;
|
|
3818
3798
|
this.setTitle(params.title);
|
|
3819
3799
|
this.setSuppressClosable(params.suppressClosable || false);
|
|
3820
|
-
if (params.state) {
|
|
3821
|
-
this.api.setState(params.state);
|
|
3822
|
-
}
|
|
3823
3800
|
(_a = this.view) === null || _a === void 0 ? void 0 : _a.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
3824
3801
|
}
|
|
3825
3802
|
focus() {
|
|
3826
3803
|
this.api._onFocusEvent.fire();
|
|
3827
3804
|
}
|
|
3828
|
-
setDirty(isDirty) {
|
|
3829
|
-
this.api._onDidDirtyChange.fire(isDirty);
|
|
3830
|
-
}
|
|
3831
|
-
close() {
|
|
3832
|
-
if (this.api.tryClose) {
|
|
3833
|
-
return this.api.tryClose();
|
|
3834
|
-
}
|
|
3835
|
-
return Promise.resolve(true);
|
|
3836
|
-
}
|
|
3837
3805
|
toJSON() {
|
|
3838
|
-
const state = this.api.getState();
|
|
3839
3806
|
return {
|
|
3840
3807
|
id: this.id,
|
|
3841
3808
|
view: this.view.toJSON(),
|
|
3842
3809
|
params: Object.keys(this._params || {}).length > 0
|
|
3843
3810
|
? this._params
|
|
3844
3811
|
: undefined,
|
|
3845
|
-
state: state && Object.keys(state).length > 0 ? state : undefined,
|
|
3846
3812
|
suppressClosable: this.suppressClosable || undefined,
|
|
3847
3813
|
title: this.title,
|
|
3848
3814
|
};
|
|
@@ -3887,18 +3853,6 @@ class DockviewGroupPanel extends CompositeDisposable {
|
|
|
3887
3853
|
var _a;
|
|
3888
3854
|
this._group = group;
|
|
3889
3855
|
this.api.group = group;
|
|
3890
|
-
this.mutableDisposable.value = this._group.model.onDidGroupChange((ev) => {
|
|
3891
|
-
var _a;
|
|
3892
|
-
if (ev.kind === exports.GroupChangeKind2.GROUP_ACTIVE) {
|
|
3893
|
-
const isVisible = !!((_a = this._group) === null || _a === void 0 ? void 0 : _a.model.isPanelActive(this));
|
|
3894
|
-
this.api._onDidActiveChange.fire({
|
|
3895
|
-
isActive: isGroupActive && isVisible,
|
|
3896
|
-
});
|
|
3897
|
-
this.api._onDidVisibilityChange.fire({
|
|
3898
|
-
isVisible,
|
|
3899
|
-
});
|
|
3900
|
-
}
|
|
3901
|
-
});
|
|
3902
3856
|
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
3903
3857
|
this.api._onDidActiveChange.fire({
|
|
3904
3858
|
isActive: isGroupActive && isPanelVisible,
|
|
@@ -4008,15 +3962,6 @@ class Watermark extends CompositeDisposable {
|
|
|
4008
3962
|
}
|
|
4009
3963
|
}
|
|
4010
3964
|
|
|
4011
|
-
function debounce(cb, wait) {
|
|
4012
|
-
let timeout;
|
|
4013
|
-
const callable = (...args) => {
|
|
4014
|
-
clearTimeout(timeout);
|
|
4015
|
-
timeout = setTimeout(() => cb(...args), wait);
|
|
4016
|
-
};
|
|
4017
|
-
return callable;
|
|
4018
|
-
}
|
|
4019
|
-
|
|
4020
3965
|
class DefaultDeserializer {
|
|
4021
3966
|
constructor(layout, panelDeserializer) {
|
|
4022
3967
|
this.layout = layout;
|
|
@@ -4117,9 +4062,6 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4117
4062
|
this._isGroupActive = false;
|
|
4118
4063
|
//
|
|
4119
4064
|
this.params = {};
|
|
4120
|
-
//
|
|
4121
|
-
this.isDirtyDisposable = new MutableDisposable();
|
|
4122
|
-
this.addDisposables(this.isDirtyDisposable);
|
|
4123
4065
|
this._element = document.createElement('div');
|
|
4124
4066
|
this._element.className = 'default-tab';
|
|
4125
4067
|
//
|
|
@@ -4164,10 +4106,6 @@ class DefaultTab extends CompositeDisposable {
|
|
|
4164
4106
|
init(params) {
|
|
4165
4107
|
this.params = params;
|
|
4166
4108
|
this._content.textContent = params.title;
|
|
4167
|
-
this.isDirtyDisposable.value = this.params.api.onDidDirtyChange((event) => {
|
|
4168
|
-
const isDirty = event;
|
|
4169
|
-
toggleClass(this.action, 'dirty', isDirty);
|
|
4170
|
-
});
|
|
4171
4109
|
if (!this.params.suppressClosable) {
|
|
4172
4110
|
addDisposableListener(this.action, 'click', (ev) => {
|
|
4173
4111
|
ev.preventDefault(); //
|
|
@@ -4221,6 +4159,10 @@ class BasePanelView extends CompositeDisposable {
|
|
|
4221
4159
|
get height() {
|
|
4222
4160
|
return this._height;
|
|
4223
4161
|
}
|
|
4162
|
+
get params() {
|
|
4163
|
+
var _a;
|
|
4164
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
4165
|
+
}
|
|
4224
4166
|
focus() {
|
|
4225
4167
|
this.api._onFocusEvent.fire();
|
|
4226
4168
|
}
|
|
@@ -4229,29 +4171,27 @@ class BasePanelView extends CompositeDisposable {
|
|
|
4229
4171
|
this._height = height;
|
|
4230
4172
|
this.api._onDidPanelDimensionChange.fire({ width, height });
|
|
4231
4173
|
if (this.part) {
|
|
4232
|
-
if (this.
|
|
4233
|
-
this.part.update(this.
|
|
4174
|
+
if (this._params) {
|
|
4175
|
+
this.part.update(this._params.params);
|
|
4234
4176
|
}
|
|
4235
4177
|
}
|
|
4236
4178
|
}
|
|
4237
4179
|
init(parameters) {
|
|
4238
|
-
this.
|
|
4180
|
+
this._params = parameters;
|
|
4239
4181
|
this.part = this.getComponent();
|
|
4240
4182
|
}
|
|
4241
4183
|
update(event) {
|
|
4242
4184
|
var _a, _b;
|
|
4243
|
-
this.
|
|
4244
|
-
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this.
|
|
4185
|
+
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) });
|
|
4186
|
+
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this._params.params });
|
|
4245
4187
|
}
|
|
4246
4188
|
toJSON() {
|
|
4247
4189
|
var _a, _b;
|
|
4248
|
-
const
|
|
4249
|
-
const params = (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4190
|
+
const params = (_b = (_a = this._params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4250
4191
|
return {
|
|
4251
4192
|
id: this.id,
|
|
4252
4193
|
component: this.component,
|
|
4253
4194
|
params: Object.keys(params).length > 0 ? params : undefined,
|
|
4254
|
-
state: Object.keys(state).length === 0 ? undefined : state,
|
|
4255
4195
|
};
|
|
4256
4196
|
}
|
|
4257
4197
|
dispose() {
|
|
@@ -4274,12 +4214,12 @@ class GridviewPanel extends BasePanelView {
|
|
|
4274
4214
|
this._snap = false;
|
|
4275
4215
|
this._onDidChange = new Emitter();
|
|
4276
4216
|
this.onDidChange = this._onDidChange.event;
|
|
4277
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
4217
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4278
4218
|
const { isVisible } = event;
|
|
4279
|
-
const { containerApi } = this.
|
|
4219
|
+
const { containerApi } = this._params;
|
|
4280
4220
|
containerApi.setVisible(this, isVisible);
|
|
4281
4221
|
}), this.api.onActiveChange(() => {
|
|
4282
|
-
const { containerApi } = this.
|
|
4222
|
+
const { containerApi } = this._params;
|
|
4283
4223
|
containerApi.setActive(this);
|
|
4284
4224
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4285
4225
|
if (typeof event.minimumWidth === 'number' ||
|
|
@@ -4394,9 +4334,6 @@ class GridviewPanel extends BasePanelView {
|
|
|
4394
4334
|
const minimum = (value) => (value <= 0 ? undefined : value);
|
|
4395
4335
|
return Object.assign(Object.assign({}, state), { minimumHeight: minimum(this.minimumHeight), maximumHeight: maximum(this.maximumHeight), minimumWidth: minimum(this.minimumWidth), maximumWidth: maximum(this.maximumWidth), snap: this.snap, priority: this.priority });
|
|
4396
4336
|
}
|
|
4397
|
-
dispose() {
|
|
4398
|
-
super.dispose();
|
|
4399
|
-
}
|
|
4400
4337
|
}
|
|
4401
4338
|
|
|
4402
4339
|
class GroupviewPanel extends GridviewPanel {
|
|
@@ -4503,15 +4440,22 @@ class DockviewComponent extends BaseGrid {
|
|
|
4503
4440
|
orientation: options.orientation || exports.Orientation.HORIZONTAL,
|
|
4504
4441
|
styles: options.styles,
|
|
4505
4442
|
});
|
|
4506
|
-
this._panels = new Map();
|
|
4507
|
-
this.dirtyPanels = new Set();
|
|
4508
|
-
this.debouncedDeque = debounce(this.syncConfigs.bind(this), 5000);
|
|
4509
4443
|
// events
|
|
4510
4444
|
this._onTabInteractionEvent = new Emitter();
|
|
4511
4445
|
this.onTabInteractionEvent = this._onTabInteractionEvent.event;
|
|
4512
4446
|
this._onTabContextMenu = new Emitter();
|
|
4513
4447
|
this.onTabContextMenu = this._onTabContextMenu.event;
|
|
4514
|
-
this.
|
|
4448
|
+
this._onDidDrop = new Emitter();
|
|
4449
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
4450
|
+
this._onDidRemovePanel = new Emitter();
|
|
4451
|
+
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4452
|
+
this._onDidAddPanel = new Emitter();
|
|
4453
|
+
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
4454
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4455
|
+
this.onDidLayoutfromJSON = this._onDidLayoutfromJSON.event;
|
|
4456
|
+
this._onDidActivePanelChange = new Emitter();
|
|
4457
|
+
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4458
|
+
this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop);
|
|
4515
4459
|
this._options = options;
|
|
4516
4460
|
if (!this.options.components) {
|
|
4517
4461
|
this.options.components = {};
|
|
@@ -4532,10 +4476,10 @@ class DockviewComponent extends BaseGrid {
|
|
|
4532
4476
|
this._api = new DockviewApi(this);
|
|
4533
4477
|
}
|
|
4534
4478
|
get totalPanels() {
|
|
4535
|
-
return this.
|
|
4479
|
+
return this.panels.length;
|
|
4536
4480
|
}
|
|
4537
4481
|
get panels() {
|
|
4538
|
-
return
|
|
4482
|
+
return this.groups.flatMap((group) => group.model.panels);
|
|
4539
4483
|
}
|
|
4540
4484
|
get deserializer() {
|
|
4541
4485
|
return this._deserializer;
|
|
@@ -4565,10 +4509,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
4565
4509
|
updateOptions(options) {
|
|
4566
4510
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
4567
4511
|
this.options.orientation !== options.orientation;
|
|
4568
|
-
// TODO support style update
|
|
4569
|
-
// const hasStylesChanged =
|
|
4570
|
-
// typeof options.styles === 'object' &&
|
|
4571
|
-
// this.options.styles !== options.styles;
|
|
4572
4512
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
4573
4513
|
if (hasOrientationChanged) {
|
|
4574
4514
|
this.gridview.orientation = options.orientation;
|
|
@@ -4580,8 +4520,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4580
4520
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4581
4521
|
}
|
|
4582
4522
|
getGroupPanel(id) {
|
|
4583
|
-
|
|
4584
|
-
return (_a = this._panels.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
4523
|
+
return this.panels.find((panel) => panel.id === id);
|
|
4585
4524
|
}
|
|
4586
4525
|
setActivePanel(panel) {
|
|
4587
4526
|
if (!panel.group) {
|
|
@@ -4630,24 +4569,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
4630
4569
|
this.doSetGroupActive(next);
|
|
4631
4570
|
}
|
|
4632
4571
|
}
|
|
4633
|
-
registerPanel(panel) {
|
|
4634
|
-
if (this._panels.has(panel.id)) {
|
|
4635
|
-
throw new Error(`panel ${panel.id} already exists`);
|
|
4636
|
-
}
|
|
4637
|
-
const disposable = new CompositeDisposable(panel.onDidStateChange(() => this.addDirtyPanel(panel)));
|
|
4638
|
-
this._panels.set(panel.id, { value: panel, disposable });
|
|
4639
|
-
}
|
|
4640
|
-
unregisterPanel(panel) {
|
|
4641
|
-
if (!this._panels.has(panel.id)) {
|
|
4642
|
-
throw new Error(`panel ${panel.id} doesn't exist`);
|
|
4643
|
-
}
|
|
4644
|
-
const item = this._panels.get(panel.id);
|
|
4645
|
-
if (item) {
|
|
4646
|
-
item.disposable.dispose();
|
|
4647
|
-
item.value.dispose();
|
|
4648
|
-
}
|
|
4649
|
-
this._panels.delete(panel.id);
|
|
4650
|
-
}
|
|
4651
4572
|
/**
|
|
4652
4573
|
* Serialize the current state of the layout
|
|
4653
4574
|
*
|
|
@@ -4655,12 +4576,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
4655
4576
|
*/
|
|
4656
4577
|
toJSON() {
|
|
4657
4578
|
var _a;
|
|
4658
|
-
this.syncConfigs();
|
|
4659
4579
|
const data = this.gridview.serialize();
|
|
4660
|
-
const panels =
|
|
4661
|
-
|
|
4662
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4663
|
-
}
|
|
4580
|
+
const panels = this.panels.reduce((collection, panel) => {
|
|
4581
|
+
collection[panel.id] = panel.toJSON();
|
|
4664
4582
|
return collection;
|
|
4665
4583
|
}, {});
|
|
4666
4584
|
return {
|
|
@@ -4672,11 +4590,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
4672
4590
|
}
|
|
4673
4591
|
fromJSON(data) {
|
|
4674
4592
|
this.gridview.clear();
|
|
4675
|
-
this.
|
|
4676
|
-
panel.
|
|
4677
|
-
panel.value.dispose();
|
|
4593
|
+
this.panels.forEach((panel) => {
|
|
4594
|
+
panel.dispose();
|
|
4678
4595
|
});
|
|
4679
|
-
this._panels.clear();
|
|
4680
4596
|
this._groups.clear();
|
|
4681
4597
|
if (!this.deserializer) {
|
|
4682
4598
|
throw new Error('invalid deserializer');
|
|
@@ -4691,9 +4607,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4691
4607
|
this.gridview.deserialize(grid, new DefaultDeserializer(this, {
|
|
4692
4608
|
createPanel: (id) => {
|
|
4693
4609
|
const panelData = panels[id];
|
|
4694
|
-
|
|
4695
|
-
this.registerPanel(panel);
|
|
4696
|
-
return panel;
|
|
4610
|
+
return this.deserializer.fromJSON(panelData);
|
|
4697
4611
|
},
|
|
4698
4612
|
}));
|
|
4699
4613
|
if (typeof activeGroup === 'string') {
|
|
@@ -4704,30 +4618,23 @@ class DockviewComponent extends BaseGrid {
|
|
|
4704
4618
|
}
|
|
4705
4619
|
this.gridview.layout(this.width, this.height);
|
|
4706
4620
|
this._onGridEvent.fire({ kind: exports.GroupChangeKind.LAYOUT_FROM_JSON });
|
|
4621
|
+
this._onDidLayoutfromJSON.fire();
|
|
4707
4622
|
}
|
|
4708
4623
|
closeAllGroups() {
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
if (!didCloseAll) {
|
|
4714
|
-
return false;
|
|
4715
|
-
}
|
|
4716
|
-
}
|
|
4717
|
-
return true;
|
|
4718
|
-
});
|
|
4624
|
+
for (const entry of this._groups.entries()) {
|
|
4625
|
+
const [_, group] = entry;
|
|
4626
|
+
group.value.model.closeAllPanels();
|
|
4627
|
+
}
|
|
4719
4628
|
}
|
|
4720
4629
|
fireMouseEvent(event) {
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
}
|
|
4730
|
-
break;
|
|
4630
|
+
if (event.kind === exports.MouseEventKind.CONTEXT_MENU) {
|
|
4631
|
+
if (event.tab && event.panel) {
|
|
4632
|
+
this._onTabContextMenu.fire({
|
|
4633
|
+
event: event.event,
|
|
4634
|
+
api: this._api,
|
|
4635
|
+
panel: event.panel,
|
|
4636
|
+
});
|
|
4637
|
+
}
|
|
4731
4638
|
}
|
|
4732
4639
|
}
|
|
4733
4640
|
addPanel(options) {
|
|
@@ -4761,7 +4668,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
4761
4668
|
return panel;
|
|
4762
4669
|
}
|
|
4763
4670
|
removePanel(panel) {
|
|
4764
|
-
this.unregisterPanel(panel);
|
|
4765
4671
|
const group = panel.group;
|
|
4766
4672
|
if (!group) {
|
|
4767
4673
|
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
@@ -4780,10 +4686,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
4780
4686
|
: {}, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.watermark);
|
|
4781
4687
|
}
|
|
4782
4688
|
addEmptyGroup(options) {
|
|
4783
|
-
var _a;
|
|
4784
4689
|
const group = this.createGroup();
|
|
4785
4690
|
if (options) {
|
|
4786
|
-
const referencePanel =
|
|
4691
|
+
const referencePanel = this.panels.find((panel) => panel.id === options.referencePanel);
|
|
4787
4692
|
if (!referencePanel) {
|
|
4788
4693
|
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
4789
4694
|
}
|
|
@@ -4812,13 +4717,13 @@ class DockviewComponent extends BaseGrid {
|
|
|
4812
4717
|
super.removeGroup(group);
|
|
4813
4718
|
}
|
|
4814
4719
|
moveGroupOrPanel(referenceGroup, groupId, itemId, target, index) {
|
|
4815
|
-
var _a
|
|
4720
|
+
var _a;
|
|
4816
4721
|
const sourceGroup = groupId
|
|
4817
4722
|
? (_a = this._groups.get(groupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
4818
4723
|
: undefined;
|
|
4819
4724
|
if (!target || target === exports.Position.Center) {
|
|
4820
4725
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4821
|
-
|
|
4726
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4822
4727
|
if (!groupItem) {
|
|
4823
4728
|
throw new Error(`No panel with id ${itemId}`);
|
|
4824
4729
|
}
|
|
@@ -4854,7 +4759,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4854
4759
|
}
|
|
4855
4760
|
else {
|
|
4856
4761
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4857
|
-
|
|
4762
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4858
4763
|
if (!groupItem) {
|
|
4859
4764
|
throw new Error(`No panel with id ${itemId}`);
|
|
4860
4765
|
}
|
|
@@ -4864,7 +4769,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4864
4769
|
}
|
|
4865
4770
|
}
|
|
4866
4771
|
doSetGroupActive(group, skipFocus) {
|
|
4867
|
-
var _a, _b;
|
|
4772
|
+
var _a, _b, _c;
|
|
4868
4773
|
const isGroupAlreadyFocused = this._activeGroup === group;
|
|
4869
4774
|
super.doSetGroupActive(group, skipFocus);
|
|
4870
4775
|
if (!isGroupAlreadyFocused && ((_a = this._activeGroup) === null || _a === void 0 ? void 0 : _a.model.activePanel)) {
|
|
@@ -4872,6 +4777,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
4872
4777
|
kind: exports.GroupChangeKind.PANEL_ACTIVE,
|
|
4873
4778
|
panel: (_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel,
|
|
4874
4779
|
});
|
|
4780
|
+
this._onDidActivePanelChange.fire((_c = this._activeGroup) === null || _c === void 0 ? void 0 : _c.model.activePanel);
|
|
4875
4781
|
}
|
|
4876
4782
|
}
|
|
4877
4783
|
createGroup(options) {
|
|
@@ -4897,6 +4803,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
4897
4803
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4898
4804
|
const { groupId, itemId, target, index } = event;
|
|
4899
4805
|
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
4806
|
+
}), view.model.onDidDrop((event) => {
|
|
4807
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api }));
|
|
4900
4808
|
}), view.model.onDidGroupChange((event) => {
|
|
4901
4809
|
switch (event.kind) {
|
|
4902
4810
|
case exports.GroupChangeKind2.ADD_PANEL:
|
|
@@ -4904,24 +4812,25 @@ class DockviewComponent extends BaseGrid {
|
|
|
4904
4812
|
kind: exports.GroupChangeKind.ADD_PANEL,
|
|
4905
4813
|
panel: event.panel,
|
|
4906
4814
|
});
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
kind: exports.GroupChangeKind.GROUP_ACTIVE,
|
|
4911
|
-
panel: event.panel,
|
|
4912
|
-
});
|
|
4815
|
+
if (event.panel) {
|
|
4816
|
+
this._onDidAddPanel.fire(event.panel);
|
|
4817
|
+
}
|
|
4913
4818
|
break;
|
|
4914
4819
|
case exports.GroupChangeKind2.REMOVE_PANEL:
|
|
4915
4820
|
this._onGridEvent.fire({
|
|
4916
4821
|
kind: exports.GroupChangeKind.REMOVE_PANEL,
|
|
4917
4822
|
panel: event.panel,
|
|
4918
4823
|
});
|
|
4824
|
+
if (event.panel) {
|
|
4825
|
+
this._onDidRemovePanel.fire(event.panel);
|
|
4826
|
+
}
|
|
4919
4827
|
break;
|
|
4920
4828
|
case exports.GroupChangeKind2.PANEL_ACTIVE:
|
|
4921
4829
|
this._onGridEvent.fire({
|
|
4922
4830
|
kind: exports.GroupChangeKind.PANEL_ACTIVE,
|
|
4923
4831
|
panel: event.panel,
|
|
4924
4832
|
});
|
|
4833
|
+
this._onDidActivePanelChange.fire(event.panel);
|
|
4925
4834
|
break;
|
|
4926
4835
|
}
|
|
4927
4836
|
}));
|
|
@@ -4935,44 +4844,18 @@ class DockviewComponent extends BaseGrid {
|
|
|
4935
4844
|
}
|
|
4936
4845
|
return view;
|
|
4937
4846
|
}
|
|
4938
|
-
dispose() {
|
|
4939
|
-
super.dispose();
|
|
4940
|
-
this._onGridEvent.dispose();
|
|
4941
|
-
}
|
|
4942
|
-
/**
|
|
4943
|
-
* Ensure the local copy of the layout state is up-to-date
|
|
4944
|
-
*/
|
|
4945
|
-
syncConfigs() {
|
|
4946
|
-
const dirtyPanels = Array.from(this.dirtyPanels);
|
|
4947
|
-
if (dirtyPanels.length === 0) ;
|
|
4948
|
-
this.dirtyPanels.clear();
|
|
4949
|
-
const partialPanelState = dirtyPanels
|
|
4950
|
-
.map((panel) => this._panels.get(panel.id))
|
|
4951
|
-
.filter((_) => !!_)
|
|
4952
|
-
.reduce((collection, panel) => {
|
|
4953
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4954
|
-
return collection;
|
|
4955
|
-
}, {});
|
|
4956
|
-
this.panelState = Object.assign(Object.assign({}, this.panelState), partialPanelState);
|
|
4957
|
-
dirtyPanels
|
|
4958
|
-
.filter((p) => this._panels.has(p.id))
|
|
4959
|
-
.forEach((panel) => {
|
|
4960
|
-
panel.setDirty(false);
|
|
4961
|
-
});
|
|
4962
|
-
}
|
|
4963
4847
|
_addPanel(options) {
|
|
4964
4848
|
const view = new DefaultGroupPanelView({
|
|
4965
4849
|
content: this.createContentComponent(options.id, options.component),
|
|
4966
4850
|
tab: this.createTabComponent(options.id, options.tabComponent),
|
|
4967
4851
|
});
|
|
4968
|
-
const panel = new DockviewGroupPanel(options.id, this._api);
|
|
4852
|
+
const panel = new DockviewGroupPanel(options.id, this, this._api);
|
|
4969
4853
|
panel.init({
|
|
4970
4854
|
view,
|
|
4971
4855
|
title: options.title || options.id,
|
|
4972
4856
|
suppressClosable: options === null || options === void 0 ? void 0 : options.suppressClosable,
|
|
4973
4857
|
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
4974
4858
|
});
|
|
4975
|
-
this.registerPanel(panel);
|
|
4976
4859
|
return panel;
|
|
4977
4860
|
}
|
|
4978
4861
|
createContentComponent(id, componentName) {
|
|
@@ -4992,10 +4875,12 @@ class DockviewComponent extends BaseGrid {
|
|
|
4992
4875
|
var _a;
|
|
4993
4876
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
4994
4877
|
}
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
this.
|
|
4878
|
+
dispose() {
|
|
4879
|
+
super.dispose();
|
|
4880
|
+
this._onDidActivePanelChange.dispose();
|
|
4881
|
+
this._onDidAddPanel.dispose();
|
|
4882
|
+
this._onDidRemovePanel.dispose();
|
|
4883
|
+
this._onDidLayoutfromJSON.dispose();
|
|
4999
4884
|
}
|
|
5000
4885
|
}
|
|
5001
4886
|
|
|
@@ -5006,6 +4891,8 @@ class GridviewComponent extends BaseGrid {
|
|
|
5006
4891
|
orientation: options.orientation,
|
|
5007
4892
|
styles: options.styles,
|
|
5008
4893
|
});
|
|
4894
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4895
|
+
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
5009
4896
|
this._options = options;
|
|
5010
4897
|
if (!this.options.components) {
|
|
5011
4898
|
this.options.components = {};
|
|
@@ -5114,6 +5001,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
5114
5001
|
}
|
|
5115
5002
|
}
|
|
5116
5003
|
this._onGridEvent.fire({ kind: exports.GroupChangeKind.LAYOUT_FROM_JSON });
|
|
5004
|
+
this._onDidLayoutfromJSON.fire();
|
|
5117
5005
|
}
|
|
5118
5006
|
movePanel(panel, options) {
|
|
5119
5007
|
var _a;
|
|
@@ -5228,6 +5116,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
5228
5116
|
}
|
|
5229
5117
|
dispose() {
|
|
5230
5118
|
super.dispose();
|
|
5119
|
+
this._onDidLayoutfromJSON.dispose();
|
|
5231
5120
|
}
|
|
5232
5121
|
}
|
|
5233
5122
|
|
|
@@ -5254,7 +5143,7 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5254
5143
|
options.frameworkComponents = {};
|
|
5255
5144
|
}
|
|
5256
5145
|
this.splitview = new Splitview(this.element, options);
|
|
5257
|
-
this.addDisposables(this._disposable);
|
|
5146
|
+
this.addDisposables(this._disposable, this._onDidAddView, this._onDidRemoveView, this._onDidLayoutChange);
|
|
5258
5147
|
}
|
|
5259
5148
|
get options() {
|
|
5260
5149
|
return this._options;
|
|
@@ -5476,41 +5365,6 @@ class SplitviewComponent extends CompositeDisposable {
|
|
|
5476
5365
|
}
|
|
5477
5366
|
}
|
|
5478
5367
|
|
|
5479
|
-
class DragHandler extends CompositeDisposable {
|
|
5480
|
-
constructor(el) {
|
|
5481
|
-
super();
|
|
5482
|
-
this.el = el;
|
|
5483
|
-
this.iframes = [];
|
|
5484
|
-
this._onDragStart = new Emitter();
|
|
5485
|
-
this.onDragStart = this._onDragStart.event;
|
|
5486
|
-
this.configure();
|
|
5487
|
-
}
|
|
5488
|
-
configure() {
|
|
5489
|
-
this.addDisposables(addDisposableListener(this.el, 'dragstart', (event) => {
|
|
5490
|
-
var _a;
|
|
5491
|
-
this.iframes = [
|
|
5492
|
-
...getElementsByTagName('iframe'),
|
|
5493
|
-
...getElementsByTagName('webview'),
|
|
5494
|
-
];
|
|
5495
|
-
for (const iframe of this.iframes) {
|
|
5496
|
-
iframe.style.pointerEvents = 'none';
|
|
5497
|
-
}
|
|
5498
|
-
this.el.classList.add('dragged');
|
|
5499
|
-
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
5500
|
-
(_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5501
|
-
this.disposable = this.getData();
|
|
5502
|
-
}), addDisposableListener(this.el, 'dragend', (ev) => {
|
|
5503
|
-
var _a;
|
|
5504
|
-
for (const iframe of this.iframes) {
|
|
5505
|
-
iframe.style.pointerEvents = 'auto';
|
|
5506
|
-
}
|
|
5507
|
-
this.iframes = [];
|
|
5508
|
-
(_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5509
|
-
this.disposable = undefined;
|
|
5510
|
-
}));
|
|
5511
|
-
}
|
|
5512
|
-
}
|
|
5513
|
-
|
|
5514
5368
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
5515
5369
|
//
|
|
5516
5370
|
constructor(id) {
|
|
@@ -5525,6 +5379,7 @@ class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
|
5525
5379
|
//
|
|
5526
5380
|
this._onDidSizeChange = new Emitter();
|
|
5527
5381
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
5382
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
5528
5383
|
}
|
|
5529
5384
|
setConstraints(value) {
|
|
5530
5385
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -5532,11 +5387,6 @@ class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
|
5532
5387
|
setSize(event) {
|
|
5533
5388
|
this._onDidSizeChange.fire(event);
|
|
5534
5389
|
}
|
|
5535
|
-
dispose() {
|
|
5536
|
-
super.dispose();
|
|
5537
|
-
this._onDidConstraintsChange.dispose();
|
|
5538
|
-
this._onDidSizeChange.dispose();
|
|
5539
|
-
}
|
|
5540
5390
|
}
|
|
5541
5391
|
|
|
5542
5392
|
class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
@@ -5550,6 +5400,7 @@ class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
|
5550
5400
|
this.onMouseEnter = this._onMouseEnter.event;
|
|
5551
5401
|
this._onMouseLeave = new Emitter({});
|
|
5552
5402
|
this.onMouseLeave = this._onMouseLeave.event;
|
|
5403
|
+
this.addDisposables(this._onDidExpansionChange, this._onMouseEnter, this._onMouseLeave);
|
|
5553
5404
|
}
|
|
5554
5405
|
set pane(pane) {
|
|
5555
5406
|
this._pane = pane;
|
|
@@ -5718,7 +5569,7 @@ class PaneviewPanel extends BasePanelView {
|
|
|
5718
5569
|
}
|
|
5719
5570
|
}
|
|
5720
5571
|
toJSON() {
|
|
5721
|
-
const params = this.
|
|
5572
|
+
const params = this._params;
|
|
5722
5573
|
return Object.assign(Object.assign({}, super.toJSON()), { headerComponent: this.headerComponent, title: params.title });
|
|
5723
5574
|
}
|
|
5724
5575
|
renderOnce() {
|
|
@@ -5787,36 +5638,39 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
5787
5638
|
},
|
|
5788
5639
|
});
|
|
5789
5640
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
5790
|
-
|
|
5791
|
-
if (!data) {
|
|
5792
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5793
|
-
return;
|
|
5794
|
-
}
|
|
5795
|
-
const containerApi = this.params
|
|
5796
|
-
.containerApi;
|
|
5797
|
-
const panelId = data.paneId;
|
|
5798
|
-
const existingPanel = containerApi.getPanel(panelId);
|
|
5799
|
-
if (!existingPanel) {
|
|
5800
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5801
|
-
return;
|
|
5802
|
-
}
|
|
5803
|
-
const allPanels = containerApi.getPanels();
|
|
5804
|
-
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5805
|
-
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5806
|
-
if (event.position === exports.Position.Left ||
|
|
5807
|
-
event.position === exports.Position.Top) {
|
|
5808
|
-
toIndex = Math.max(0, toIndex - 1);
|
|
5809
|
-
}
|
|
5810
|
-
if (event.position === exports.Position.Right ||
|
|
5811
|
-
event.position === exports.Position.Bottom) {
|
|
5812
|
-
if (fromIndex > toIndex) {
|
|
5813
|
-
toIndex++;
|
|
5814
|
-
}
|
|
5815
|
-
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5816
|
-
}
|
|
5817
|
-
containerApi.movePanel(fromIndex, toIndex);
|
|
5641
|
+
this.onDrop(event);
|
|
5818
5642
|
}));
|
|
5819
5643
|
}
|
|
5644
|
+
onDrop(event) {
|
|
5645
|
+
const data = getPaneData();
|
|
5646
|
+
if (!data) {
|
|
5647
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5648
|
+
return;
|
|
5649
|
+
}
|
|
5650
|
+
const containerApi = this._params
|
|
5651
|
+
.containerApi;
|
|
5652
|
+
const panelId = data.paneId;
|
|
5653
|
+
const existingPanel = containerApi.getPanel(panelId);
|
|
5654
|
+
if (!existingPanel) {
|
|
5655
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5656
|
+
return;
|
|
5657
|
+
}
|
|
5658
|
+
const allPanels = containerApi.getPanels();
|
|
5659
|
+
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5660
|
+
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5661
|
+
if (event.position === exports.Position.Left ||
|
|
5662
|
+
event.position === exports.Position.Top) {
|
|
5663
|
+
toIndex = Math.max(0, toIndex - 1);
|
|
5664
|
+
}
|
|
5665
|
+
if (event.position === exports.Position.Right ||
|
|
5666
|
+
event.position === exports.Position.Bottom) {
|
|
5667
|
+
if (fromIndex > toIndex) {
|
|
5668
|
+
toIndex++;
|
|
5669
|
+
}
|
|
5670
|
+
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5671
|
+
}
|
|
5672
|
+
containerApi.movePanel(fromIndex, toIndex);
|
|
5673
|
+
}
|
|
5820
5674
|
}
|
|
5821
5675
|
|
|
5822
5676
|
class DefaultHeader extends CompositeDisposable {
|
|
@@ -5880,6 +5734,7 @@ class PaneviewComponent extends CompositeDisposable {
|
|
|
5880
5734
|
this.onDidAddView = this._onDidAddView.event;
|
|
5881
5735
|
this._onDidRemoveView = new Emitter();
|
|
5882
5736
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
5737
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
|
|
5883
5738
|
this._options = options;
|
|
5884
5739
|
if (!options.components) {
|
|
5885
5740
|
options.components = {};
|
|
@@ -6107,12 +5962,14 @@ class SplitviewPanel extends BasePanelView {
|
|
|
6107
5962
|
this._snap = false;
|
|
6108
5963
|
this._onDidChange = new Emitter();
|
|
6109
5964
|
this.onDidChange = this._onDidChange.event;
|
|
6110
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
5965
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
6111
5966
|
const { isVisible } = event;
|
|
6112
|
-
const { containerApi } = this
|
|
5967
|
+
const { containerApi } = this
|
|
5968
|
+
._params;
|
|
6113
5969
|
containerApi.setVisible(this, isVisible);
|
|
6114
5970
|
}), this.api.onActiveChange(() => {
|
|
6115
|
-
const { containerApi } = this
|
|
5971
|
+
const { containerApi } = this
|
|
5972
|
+
._params;
|
|
6116
5973
|
containerApi.setActive(this);
|
|
6117
5974
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
6118
5975
|
if (typeof event.minimumSize === 'number' ||
|
|
@@ -6255,14 +6112,13 @@ class ReactPart {
|
|
|
6255
6112
|
if (this.disposed) {
|
|
6256
6113
|
throw new Error('invalid operation: resource is already disposed');
|
|
6257
6114
|
}
|
|
6258
|
-
// TODO use a better check for isReactFunctionalComponent
|
|
6259
6115
|
if (typeof this.component !== 'function') {
|
|
6260
6116
|
/**
|
|
6261
6117
|
* we know this isn't a React.FunctionComponent so throw an error here.
|
|
6262
6118
|
* if we do not intercept this the React library will throw a very obsure error
|
|
6263
6119
|
* for the same reason, at least at this point we will emit a sensible stacktrace.
|
|
6264
6120
|
*/
|
|
6265
|
-
throw new Error('
|
|
6121
|
+
throw new Error('Invalid Operation. dockview only supports React Functional Components.');
|
|
6266
6122
|
}
|
|
6267
6123
|
const bridgeComponent = React__namespace.createElement(React__namespace.forwardRef(ReactComponentBridge), {
|
|
6268
6124
|
component: this
|
|
@@ -6326,16 +6182,14 @@ class ReactPanelContentPart {
|
|
|
6326
6182
|
this._onDidBlur = new Emitter();
|
|
6327
6183
|
this.onDidBlur = this._onDidBlur.event;
|
|
6328
6184
|
this._element = document.createElement('div');
|
|
6329
|
-
this._element.
|
|
6330
|
-
this._element.style.width = '100%';
|
|
6185
|
+
this._element.className = 'dockview-react-part';
|
|
6331
6186
|
// this.hostedContainer = new HostedContainer({
|
|
6332
6187
|
// id,
|
|
6333
6188
|
// });
|
|
6334
6189
|
// this.hostedContainer.onDidFocus(() => this._onDidFocus.fire());
|
|
6335
6190
|
// this.hostedContainer.onDidBlur(() => this._onDidBlur.fire());
|
|
6336
6191
|
this._actionsElement = document.createElement('div');
|
|
6337
|
-
this._actionsElement.
|
|
6338
|
-
this._actionsElement.style.width = '100%';
|
|
6192
|
+
this._actionsElement.className = 'dockview-react-part';
|
|
6339
6193
|
}
|
|
6340
6194
|
get element() {
|
|
6341
6195
|
return this._element;
|
|
@@ -6383,6 +6237,8 @@ class ReactPanelContentPart {
|
|
|
6383
6237
|
}
|
|
6384
6238
|
dispose() {
|
|
6385
6239
|
var _a, _b;
|
|
6240
|
+
this._onDidFocus.dispose();
|
|
6241
|
+
this._onDidBlur.dispose();
|
|
6386
6242
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
6387
6243
|
// this.hostedContainer?.dispose();
|
|
6388
6244
|
(_b = this.actionsPart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
@@ -6395,6 +6251,7 @@ class ReactPanelHeaderPart {
|
|
|
6395
6251
|
this.component = component;
|
|
6396
6252
|
this.reactPortalStore = reactPortalStore;
|
|
6397
6253
|
this._element = document.createElement('div');
|
|
6254
|
+
this._element.className = 'dockview-react-part';
|
|
6398
6255
|
}
|
|
6399
6256
|
get element() {
|
|
6400
6257
|
return this._element;
|
|
@@ -6439,7 +6296,6 @@ class ReactPanelDeserialzier {
|
|
|
6439
6296
|
const panelId = panelData.id;
|
|
6440
6297
|
const params = panelData.params;
|
|
6441
6298
|
const title = panelData.title;
|
|
6442
|
-
const state = panelData.state;
|
|
6443
6299
|
const suppressClosable = panelData.suppressClosable;
|
|
6444
6300
|
const viewData = panelData.view;
|
|
6445
6301
|
const view = new DefaultGroupPanelView({
|
|
@@ -6448,13 +6304,12 @@ class ReactPanelDeserialzier {
|
|
|
6448
6304
|
? createComponent(viewData.tab.id, viewData.tab.id, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab)
|
|
6449
6305
|
: new DefaultTab(),
|
|
6450
6306
|
});
|
|
6451
|
-
const panel = new DockviewGroupPanel(panelId, new DockviewApi(this.layout));
|
|
6307
|
+
const panel = new DockviewGroupPanel(panelId, this.layout, new DockviewApi(this.layout));
|
|
6452
6308
|
panel.init({
|
|
6453
6309
|
view,
|
|
6454
6310
|
title,
|
|
6455
6311
|
suppressClosable,
|
|
6456
6312
|
params: params || {},
|
|
6457
|
-
state: state || {},
|
|
6458
6313
|
});
|
|
6459
6314
|
return panel;
|
|
6460
6315
|
}
|
|
@@ -6469,8 +6324,7 @@ class ReactWatermarkPart {
|
|
|
6469
6324
|
value: undefined,
|
|
6470
6325
|
};
|
|
6471
6326
|
this._element = document.createElement('div');
|
|
6472
|
-
this._element.
|
|
6473
|
-
this._element.style.width = '100%';
|
|
6327
|
+
this._element.className = 'dockview-react-part';
|
|
6474
6328
|
}
|
|
6475
6329
|
get element() {
|
|
6476
6330
|
return this._element;
|
|
@@ -6568,12 +6422,16 @@ const DockviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6568
6422
|
frameworkTabComponents: props.tabComponents,
|
|
6569
6423
|
tabHeight: props.tabHeight,
|
|
6570
6424
|
debug: props.debug,
|
|
6571
|
-
enableExternalDragEvents: props.enableExternalDragEvents,
|
|
6572
6425
|
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6573
6426
|
styles: props.hideBorders
|
|
6574
6427
|
? { separatorBorder: 'transparent' }
|
|
6575
6428
|
: undefined,
|
|
6576
6429
|
});
|
|
6430
|
+
const disposable = dockview.onDidDrop((event) => {
|
|
6431
|
+
if (props.onDidDrop) {
|
|
6432
|
+
props.onDidDrop(event);
|
|
6433
|
+
}
|
|
6434
|
+
});
|
|
6577
6435
|
(_a = domRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(dockview.element);
|
|
6578
6436
|
dockview.deserializer = new ReactPanelDeserialzier(dockview);
|
|
6579
6437
|
const { clientWidth, clientHeight } = domRef.current;
|
|
@@ -6583,6 +6441,7 @@ const DockviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6583
6441
|
}
|
|
6584
6442
|
dockviewRef.current = dockview;
|
|
6585
6443
|
return () => {
|
|
6444
|
+
disposable.dispose();
|
|
6586
6445
|
dockview.dispose();
|
|
6587
6446
|
};
|
|
6588
6447
|
}, []);
|
|
@@ -6594,6 +6453,14 @@ const DockviewReact = React__namespace.forwardRef((props, ref) => {
|
|
|
6594
6453
|
frameworkComponents: props.components,
|
|
6595
6454
|
});
|
|
6596
6455
|
}, [props.components]);
|
|
6456
|
+
React__namespace.useEffect(() => {
|
|
6457
|
+
if (!dockviewRef.current) {
|
|
6458
|
+
return;
|
|
6459
|
+
}
|
|
6460
|
+
dockviewRef.current.updateOptions({
|
|
6461
|
+
showDndOverlay: props.showDndOverlay,
|
|
6462
|
+
});
|
|
6463
|
+
}, [props.showDndOverlay]);
|
|
6597
6464
|
React__namespace.useEffect(() => {
|
|
6598
6465
|
if (!dockviewRef.current) {
|
|
6599
6466
|
return;
|
|
@@ -6682,9 +6549,9 @@ class ReactPanelView extends SplitviewPanel {
|
|
|
6682
6549
|
getComponent() {
|
|
6683
6550
|
var _a;
|
|
6684
6551
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6685
|
-
params: ((_a = this.
|
|
6552
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6686
6553
|
api: this.api,
|
|
6687
|
-
containerApi: this.
|
|
6554
|
+
containerApi: this._params
|
|
6688
6555
|
.containerApi,
|
|
6689
6556
|
});
|
|
6690
6557
|
}
|
|
@@ -6757,9 +6624,9 @@ class ReactGridPanelView extends GridviewPanel {
|
|
|
6757
6624
|
getComponent() {
|
|
6758
6625
|
var _a;
|
|
6759
6626
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6760
|
-
params: ((_a = this.
|
|
6627
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6761
6628
|
api: this.api,
|
|
6762
|
-
containerApi: this.
|
|
6629
|
+
containerApi: this._params
|
|
6763
6630
|
.containerApi,
|
|
6764
6631
|
});
|
|
6765
6632
|
}
|
|
@@ -6950,7 +6817,6 @@ PaneviewReact.displayName = 'PaneviewComponent';
|
|
|
6950
6817
|
exports.BaseGrid = BaseGrid;
|
|
6951
6818
|
exports.CompositeDisposable = CompositeDisposable;
|
|
6952
6819
|
exports.ContentContainer = ContentContainer;
|
|
6953
|
-
exports.DATA_KEY = DATA_KEY;
|
|
6954
6820
|
exports.DockviewApi = DockviewApi;
|
|
6955
6821
|
exports.DockviewComponent = DockviewComponent;
|
|
6956
6822
|
exports.DockviewComponents = DockviewComponents;
|
|
@@ -6985,7 +6851,6 @@ exports.Tab = Tab$1;
|
|
|
6985
6851
|
exports.TickDelayedEvent = TickDelayedEvent;
|
|
6986
6852
|
exports.addDisposableListener = addDisposableListener;
|
|
6987
6853
|
exports.addDisposableWindowListener = addDisposableWindowListener;
|
|
6988
|
-
exports.extractData = extractData;
|
|
6989
6854
|
exports.getDirectionOrientation = getDirectionOrientation;
|
|
6990
6855
|
exports.getGridLocation = getGridLocation;
|
|
6991
6856
|
exports.getLocationOrientation = getLocationOrientation;
|
|
@@ -6993,11 +6858,8 @@ exports.getPaneData = getPaneData;
|
|
|
6993
6858
|
exports.getPanelData = getPanelData;
|
|
6994
6859
|
exports.getRelativeLocation = getRelativeLocation;
|
|
6995
6860
|
exports.indexInParent = indexInParent;
|
|
6996
|
-
exports.isCustomDragEvent = isCustomDragEvent;
|
|
6997
6861
|
exports.isGridBranchNode = isGridBranchNode;
|
|
6998
|
-
exports.isPanelTransferEvent = isPanelTransferEvent;
|
|
6999
6862
|
exports.isReactElement = isReactElement;
|
|
7000
|
-
exports.isTabDragEvent = isTabDragEvent;
|
|
7001
6863
|
exports.orthogonal = orthogonal;
|
|
7002
6864
|
exports.toTarget = toTarget;
|
|
7003
6865
|
exports.usePortalsLifecycle = usePortalsLifecycle;
|