dockview-core 1.9.1 → 1.10.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/dist/cjs/api/component.api.d.ts +25 -6
- package/dist/cjs/api/component.api.js +27 -5
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +7 -1
- package/dist/cjs/api/dockviewGroupPanelApi.js +22 -3
- package/dist/cjs/api/dockviewPanelApi.d.ts +23 -7
- package/dist/cjs/api/dockviewPanelApi.js +49 -12
- package/dist/cjs/api/gridviewPanelApi.d.ts +0 -1
- package/dist/cjs/api/gridviewPanelApi.js +1 -4
- package/dist/cjs/api/panelApi.d.ts +20 -9
- package/dist/cjs/api/panelApi.js +30 -30
- package/dist/cjs/api/paneviewPanelApi.d.ts +0 -1
- package/dist/cjs/api/paneviewPanelApi.js +0 -1
- package/dist/cjs/api/splitviewPanelApi.d.ts +0 -1
- package/dist/cjs/api/splitviewPanelApi.js +0 -1
- package/dist/cjs/array.d.ts +0 -1
- package/dist/cjs/array.js +0 -1
- package/dist/cjs/constants.d.ts +0 -1
- package/dist/cjs/constants.js +0 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts +0 -1
- package/dist/cjs/dnd/abstractDragHandler.js +0 -1
- package/dist/cjs/dnd/dataTransfer.d.ts +0 -1
- package/dist/cjs/dnd/dataTransfer.js +0 -1
- package/dist/cjs/dnd/dnd.d.ts +0 -1
- package/dist/cjs/dnd/dnd.js +0 -1
- package/dist/cjs/dnd/droptarget.d.ts +20 -9
- package/dist/cjs/dnd/droptarget.js +71 -14
- package/dist/cjs/dnd/ghost.d.ts +0 -1
- package/dist/cjs/dnd/ghost.js +0 -1
- package/dist/cjs/dnd/groupDragHandler.d.ts +0 -1
- package/dist/cjs/dnd/groupDragHandler.js +1 -2
- package/dist/cjs/dnd/overlay.d.ts +0 -1
- package/dist/cjs/dnd/overlay.js +0 -1
- package/dist/cjs/dockview/components/panel/content.d.ts +0 -1
- package/dist/cjs/dockview/components/panel/content.js +8 -9
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +0 -1
- package/dist/cjs/dockview/components/tab/defaultTab.js +0 -1
- package/dist/cjs/dockview/components/tab/tab.d.ts +5 -13
- package/dist/cjs/dockview/components/tab/tab.js +5 -6
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +17 -14
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +26 -22
- package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +3 -3
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +5 -6
- package/dist/cjs/dockview/components/watermark/watermark.d.ts +0 -1
- package/dist/cjs/dockview/components/watermark/watermark.js +0 -1
- package/dist/cjs/dockview/deserializer.d.ts +0 -1
- package/dist/cjs/dockview/deserializer.js +0 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +86 -25
- package/dist/cjs/dockview/dockviewComponent.js +578 -198
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +0 -1
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.js +0 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.js +6 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +79 -34
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +227 -57
- package/dist/cjs/dockview/dockviewPanel.d.ts +8 -3
- package/dist/cjs/dockview/dockviewPanel.js +39 -12
- package/dist/cjs/dockview/dockviewPanelModel.d.ts +1 -4
- package/dist/cjs/dockview/dockviewPanelModel.js +2 -22
- package/dist/cjs/dockview/options.d.ts +9 -4
- package/dist/cjs/dockview/options.js +0 -1
- package/dist/cjs/dockview/types.d.ts +1 -11
- package/dist/cjs/dockview/types.js +0 -9
- package/dist/cjs/dom.d.ts +0 -1
- package/dist/cjs/dom.js +0 -1
- package/dist/cjs/events.d.ts +10 -1
- package/dist/cjs/events.js +25 -2
- package/dist/cjs/gridview/baseComponentGridview.d.ts +15 -16
- package/dist/cjs/gridview/baseComponentGridview.js +37 -27
- package/dist/cjs/gridview/basePanelView.d.ts +0 -1
- package/dist/cjs/gridview/basePanelView.js +7 -2
- package/dist/cjs/gridview/branchNode.d.ts +3 -2
- package/dist/cjs/gridview/branchNode.js +12 -2
- package/dist/cjs/gridview/gridview.d.ts +5 -3
- package/dist/cjs/gridview/gridview.js +54 -21
- package/dist/cjs/gridview/gridviewComponent.d.ts +10 -2
- package/dist/cjs/gridview/gridviewComponent.js +14 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts +3 -3
- package/dist/cjs/gridview/gridviewPanel.js +4 -5
- package/dist/cjs/gridview/leafNode.d.ts +0 -1
- package/dist/cjs/gridview/leafNode.js +0 -1
- package/dist/cjs/gridview/options.d.ts +1 -2
- package/dist/cjs/gridview/options.js +0 -1
- package/dist/cjs/gridview/types.d.ts +0 -1
- package/dist/cjs/gridview/types.js +0 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/lifecycle.d.ts +2 -3
- package/dist/cjs/lifecycle.js +5 -2
- package/dist/cjs/math.d.ts +0 -1
- package/dist/cjs/math.js +0 -1
- package/dist/cjs/overlayRenderContainer.d.ts +1 -1
- package/dist/cjs/overlayRenderContainer.js +8 -4
- package/dist/cjs/panel/componentFactory.d.ts +0 -1
- package/dist/cjs/panel/componentFactory.js +0 -1
- package/dist/cjs/panel/types.d.ts +1 -2
- package/dist/cjs/panel/types.js +0 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +0 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.js +0 -1
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +0 -1
- package/dist/cjs/paneview/draggablePaneviewPanel.js +0 -1
- package/dist/cjs/paneview/options.d.ts +1 -2
- package/dist/cjs/paneview/options.js +0 -1
- package/dist/cjs/paneview/paneview.d.ts +0 -1
- package/dist/cjs/paneview/paneview.js +0 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +0 -1
- package/dist/cjs/paneview/paneviewComponent.js +0 -1
- package/dist/cjs/paneview/paneviewPanel.d.ts +0 -1
- package/dist/cjs/paneview/paneviewPanel.js +0 -1
- package/dist/cjs/popoutWindow.d.ts +15 -4
- package/dist/cjs/popoutWindow.js +140 -56
- package/dist/cjs/resizable.d.ts +1 -2
- package/dist/cjs/resizable.js +1 -10
- package/dist/cjs/splitview/options.d.ts +3 -7
- package/dist/cjs/splitview/options.js +0 -1
- package/dist/cjs/splitview/splitview.d.ts +3 -1
- package/dist/cjs/splitview/splitview.js +12 -1
- package/dist/cjs/splitview/splitviewComponent.d.ts +0 -1
- package/dist/cjs/splitview/splitviewComponent.js +0 -1
- package/dist/cjs/splitview/splitviewPanel.d.ts +2 -3
- package/dist/cjs/splitview/splitviewPanel.js +3 -4
- package/dist/cjs/splitview/viewItem.d.ts +0 -1
- package/dist/cjs/splitview/viewItem.js +0 -1
- package/dist/cjs/svg.d.ts +0 -1
- package/dist/cjs/svg.js +0 -1
- package/dist/cjs/types.d.ts +0 -1
- package/dist/cjs/types.js +0 -1
- package/dist/dockview-core.amd.js +1265 -529
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +1264 -528
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +1265 -529
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +1263 -530
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +1265 -529
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +1264 -528
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +25 -6
- package/dist/esm/api/component.api.js +19 -5
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +7 -1
- package/dist/esm/api/dockviewGroupPanelApi.js +22 -3
- package/dist/esm/api/dockviewPanelApi.d.ts +23 -7
- package/dist/esm/api/dockviewPanelApi.js +46 -13
- package/dist/esm/api/gridviewPanelApi.d.ts +0 -1
- package/dist/esm/api/gridviewPanelApi.js +1 -4
- package/dist/esm/api/panelApi.d.ts +20 -9
- package/dist/esm/api/panelApi.js +23 -30
- package/dist/esm/api/paneviewPanelApi.d.ts +0 -1
- package/dist/esm/api/paneviewPanelApi.js +0 -1
- package/dist/esm/api/splitviewPanelApi.d.ts +0 -1
- package/dist/esm/api/splitviewPanelApi.js +0 -1
- package/dist/esm/array.d.ts +0 -1
- package/dist/esm/array.js +0 -1
- package/dist/esm/constants.d.ts +0 -1
- package/dist/esm/constants.js +0 -1
- package/dist/esm/dnd/abstractDragHandler.d.ts +0 -1
- package/dist/esm/dnd/abstractDragHandler.js +0 -1
- package/dist/esm/dnd/dataTransfer.d.ts +0 -1
- package/dist/esm/dnd/dataTransfer.js +0 -1
- package/dist/esm/dnd/dnd.d.ts +0 -1
- package/dist/esm/dnd/dnd.js +0 -1
- package/dist/esm/dnd/droptarget.d.ts +20 -9
- package/dist/esm/dnd/droptarget.js +59 -14
- package/dist/esm/dnd/ghost.d.ts +0 -1
- package/dist/esm/dnd/ghost.js +0 -1
- package/dist/esm/dnd/groupDragHandler.d.ts +0 -1
- package/dist/esm/dnd/groupDragHandler.js +1 -2
- package/dist/esm/dnd/overlay.d.ts +0 -1
- package/dist/esm/dnd/overlay.js +0 -1
- package/dist/esm/dockview/components/panel/content.d.ts +0 -1
- package/dist/esm/dockview/components/panel/content.js +8 -9
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +0 -1
- package/dist/esm/dockview/components/tab/defaultTab.js +0 -1
- package/dist/esm/dockview/components/tab/tab.d.ts +5 -13
- package/dist/esm/dockview/components/tab/tab.js +6 -7
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +17 -14
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +24 -20
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +3 -3
- package/dist/esm/dockview/components/titlebar/voidContainer.js +6 -7
- package/dist/esm/dockview/components/watermark/watermark.d.ts +0 -1
- package/dist/esm/dockview/components/watermark/watermark.js +0 -1
- package/dist/esm/dockview/deserializer.d.ts +0 -1
- package/dist/esm/dockview/deserializer.js +0 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +86 -25
- package/dist/esm/dockview/dockviewComponent.js +521 -163
- package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +0 -1
- package/dist/esm/dockview/dockviewFloatingGroupPanel.js +0 -1
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +1 -1
- package/dist/esm/dockview/dockviewGroupPanel.js +6 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +79 -34
- package/dist/esm/dockview/dockviewGroupPanelModel.js +170 -53
- package/dist/esm/dockview/dockviewPanel.d.ts +8 -3
- package/dist/esm/dockview/dockviewPanel.js +39 -12
- package/dist/esm/dockview/dockviewPanelModel.d.ts +1 -4
- package/dist/esm/dockview/dockviewPanelModel.js +2 -22
- package/dist/esm/dockview/options.d.ts +9 -4
- package/dist/esm/dockview/options.js +0 -1
- package/dist/esm/dockview/types.d.ts +1 -11
- package/dist/esm/dockview/types.js +1 -8
- package/dist/esm/dom.d.ts +0 -1
- package/dist/esm/dom.js +0 -1
- package/dist/esm/events.d.ts +10 -1
- package/dist/esm/events.js +14 -1
- package/dist/esm/gridview/baseComponentGridview.d.ts +15 -16
- package/dist/esm/gridview/baseComponentGridview.js +33 -27
- package/dist/esm/gridview/basePanelView.d.ts +0 -1
- package/dist/esm/gridview/basePanelView.js +7 -2
- package/dist/esm/gridview/branchNode.d.ts +3 -2
- package/dist/esm/gridview/branchNode.js +8 -2
- package/dist/esm/gridview/gridview.d.ts +5 -3
- package/dist/esm/gridview/gridview.js +49 -20
- package/dist/esm/gridview/gridviewComponent.d.ts +10 -2
- package/dist/esm/gridview/gridviewComponent.js +14 -1
- package/dist/esm/gridview/gridviewPanel.d.ts +3 -3
- package/dist/esm/gridview/gridviewPanel.js +4 -5
- package/dist/esm/gridview/leafNode.d.ts +0 -1
- package/dist/esm/gridview/leafNode.js +0 -1
- package/dist/esm/gridview/options.d.ts +1 -2
- package/dist/esm/gridview/options.js +0 -1
- package/dist/esm/gridview/types.d.ts +0 -1
- package/dist/esm/gridview/types.js +0 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/lifecycle.d.ts +2 -3
- package/dist/esm/lifecycle.js +5 -2
- package/dist/esm/math.d.ts +0 -1
- package/dist/esm/math.js +0 -1
- package/dist/esm/overlayRenderContainer.d.ts +1 -1
- package/dist/esm/overlayRenderContainer.js +8 -4
- package/dist/esm/panel/componentFactory.d.ts +0 -1
- package/dist/esm/panel/componentFactory.js +0 -1
- package/dist/esm/panel/types.d.ts +1 -2
- package/dist/esm/panel/types.js +0 -1
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +0 -1
- package/dist/esm/paneview/defaultPaneviewHeader.js +0 -1
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +0 -1
- package/dist/esm/paneview/draggablePaneviewPanel.js +0 -1
- package/dist/esm/paneview/options.d.ts +1 -2
- package/dist/esm/paneview/options.js +0 -1
- package/dist/esm/paneview/paneview.d.ts +0 -1
- package/dist/esm/paneview/paneview.js +0 -1
- package/dist/esm/paneview/paneviewComponent.d.ts +0 -1
- package/dist/esm/paneview/paneviewComponent.js +0 -1
- package/dist/esm/paneview/paneviewPanel.d.ts +0 -1
- package/dist/esm/paneview/paneviewPanel.js +0 -1
- package/dist/esm/popoutWindow.d.ts +15 -4
- package/dist/esm/popoutWindow.js +105 -52
- package/dist/esm/resizable.d.ts +1 -2
- package/dist/esm/resizable.js +1 -10
- package/dist/esm/splitview/options.d.ts +3 -7
- package/dist/esm/splitview/options.js +0 -1
- package/dist/esm/splitview/splitview.d.ts +3 -1
- package/dist/esm/splitview/splitview.js +8 -1
- package/dist/esm/splitview/splitviewComponent.d.ts +0 -1
- package/dist/esm/splitview/splitviewComponent.js +0 -1
- package/dist/esm/splitview/splitviewPanel.d.ts +2 -3
- package/dist/esm/splitview/splitviewPanel.js +3 -4
- package/dist/esm/splitview/viewItem.d.ts +0 -1
- package/dist/esm/splitview/viewItem.js +0 -1
- package/dist/esm/svg.d.ts +0 -1
- package/dist/esm/svg.js +0 -1
- package/dist/esm/types.d.ts +0 -1
- package/dist/esm/types.js +0 -1
- package/dist/styles/dockview.css +20 -6
- package/package.json +3 -3
- package/dist/cjs/api/component.api.d.ts.map +0 -1
- package/dist/cjs/api/component.api.js.map +0 -1
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts.map +0 -1
- package/dist/cjs/api/dockviewGroupPanelApi.js.map +0 -1
- package/dist/cjs/api/dockviewPanelApi.d.ts.map +0 -1
- package/dist/cjs/api/dockviewPanelApi.js.map +0 -1
- package/dist/cjs/api/gridviewPanelApi.d.ts.map +0 -1
- package/dist/cjs/api/gridviewPanelApi.js.map +0 -1
- package/dist/cjs/api/panelApi.d.ts.map +0 -1
- package/dist/cjs/api/panelApi.js.map +0 -1
- package/dist/cjs/api/paneviewPanelApi.d.ts.map +0 -1
- package/dist/cjs/api/paneviewPanelApi.js.map +0 -1
- package/dist/cjs/api/splitviewPanelApi.d.ts.map +0 -1
- package/dist/cjs/api/splitviewPanelApi.js.map +0 -1
- package/dist/cjs/array.d.ts.map +0 -1
- package/dist/cjs/array.js.map +0 -1
- package/dist/cjs/constants.d.ts.map +0 -1
- package/dist/cjs/constants.js.map +0 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts.map +0 -1
- package/dist/cjs/dnd/abstractDragHandler.js.map +0 -1
- package/dist/cjs/dnd/dataTransfer.d.ts.map +0 -1
- package/dist/cjs/dnd/dataTransfer.js.map +0 -1
- package/dist/cjs/dnd/dnd.d.ts.map +0 -1
- package/dist/cjs/dnd/dnd.js.map +0 -1
- package/dist/cjs/dnd/droptarget.d.ts.map +0 -1
- package/dist/cjs/dnd/droptarget.js.map +0 -1
- package/dist/cjs/dnd/ghost.d.ts.map +0 -1
- package/dist/cjs/dnd/ghost.js.map +0 -1
- package/dist/cjs/dnd/groupDragHandler.d.ts.map +0 -1
- package/dist/cjs/dnd/groupDragHandler.js.map +0 -1
- package/dist/cjs/dnd/overlay.d.ts.map +0 -1
- package/dist/cjs/dnd/overlay.js.map +0 -1
- package/dist/cjs/dockview/components/panel/content.d.ts.map +0 -1
- package/dist/cjs/dockview/components/panel/content.js.map +0 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts.map +0 -1
- package/dist/cjs/dockview/components/tab/defaultTab.js.map +0 -1
- package/dist/cjs/dockview/components/tab/tab.d.ts.map +0 -1
- package/dist/cjs/dockview/components/tab/tab.js.map +0 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts.map +0 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js.map +0 -1
- package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts.map +0 -1
- package/dist/cjs/dockview/components/titlebar/voidContainer.js.map +0 -1
- package/dist/cjs/dockview/components/watermark/watermark.d.ts.map +0 -1
- package/dist/cjs/dockview/components/watermark/watermark.js.map +0 -1
- package/dist/cjs/dockview/deserializer.d.ts.map +0 -1
- package/dist/cjs/dockview/deserializer.js.map +0 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts.map +0 -1
- package/dist/cjs/dockview/dockviewComponent.js.map +0 -1
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts.map +0 -1
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.js.map +0 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts.map +0 -1
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +0 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts.map +0 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.js.map +0 -1
- package/dist/cjs/dockview/dockviewPanel.d.ts.map +0 -1
- package/dist/cjs/dockview/dockviewPanel.js.map +0 -1
- package/dist/cjs/dockview/dockviewPanelModel.d.ts.map +0 -1
- package/dist/cjs/dockview/dockviewPanelModel.js.map +0 -1
- package/dist/cjs/dockview/dockviewPopoutGroupPanel.d.ts +0 -16
- package/dist/cjs/dockview/dockviewPopoutGroupPanel.d.ts.map +0 -1
- package/dist/cjs/dockview/dockviewPopoutGroupPanel.js +0 -50
- package/dist/cjs/dockview/dockviewPopoutGroupPanel.js.map +0 -1
- package/dist/cjs/dockview/options.d.ts.map +0 -1
- package/dist/cjs/dockview/options.js.map +0 -1
- package/dist/cjs/dockview/types.d.ts.map +0 -1
- package/dist/cjs/dockview/types.js.map +0 -1
- package/dist/cjs/dom.d.ts.map +0 -1
- package/dist/cjs/dom.js.map +0 -1
- package/dist/cjs/events.d.ts.map +0 -1
- package/dist/cjs/events.js.map +0 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts.map +0 -1
- package/dist/cjs/gridview/baseComponentGridview.js.map +0 -1
- package/dist/cjs/gridview/basePanelView.d.ts.map +0 -1
- package/dist/cjs/gridview/basePanelView.js.map +0 -1
- package/dist/cjs/gridview/branchNode.d.ts.map +0 -1
- package/dist/cjs/gridview/branchNode.js.map +0 -1
- package/dist/cjs/gridview/gridview.d.ts.map +0 -1
- package/dist/cjs/gridview/gridview.js.map +0 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts.map +0 -1
- package/dist/cjs/gridview/gridviewComponent.js.map +0 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts.map +0 -1
- package/dist/cjs/gridview/gridviewPanel.js.map +0 -1
- package/dist/cjs/gridview/leafNode.d.ts.map +0 -1
- package/dist/cjs/gridview/leafNode.js.map +0 -1
- package/dist/cjs/gridview/options.d.ts.map +0 -1
- package/dist/cjs/gridview/options.js.map +0 -1
- package/dist/cjs/gridview/types.d.ts.map +0 -1
- package/dist/cjs/gridview/types.js.map +0 -1
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/lifecycle.d.ts.map +0 -1
- package/dist/cjs/lifecycle.js.map +0 -1
- package/dist/cjs/math.d.ts.map +0 -1
- package/dist/cjs/math.js.map +0 -1
- package/dist/cjs/overlayRenderContainer.d.ts.map +0 -1
- package/dist/cjs/overlayRenderContainer.js.map +0 -1
- package/dist/cjs/panel/componentFactory.d.ts.map +0 -1
- package/dist/cjs/panel/componentFactory.js.map +0 -1
- package/dist/cjs/panel/types.d.ts.map +0 -1
- package/dist/cjs/panel/types.js.map +0 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.d.ts.map +0 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.js.map +0 -1
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts.map +0 -1
- package/dist/cjs/paneview/draggablePaneviewPanel.js.map +0 -1
- package/dist/cjs/paneview/options.d.ts.map +0 -1
- package/dist/cjs/paneview/options.js.map +0 -1
- package/dist/cjs/paneview/paneview.d.ts.map +0 -1
- package/dist/cjs/paneview/paneview.js.map +0 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts.map +0 -1
- package/dist/cjs/paneview/paneviewComponent.js.map +0 -1
- package/dist/cjs/paneview/paneviewPanel.d.ts.map +0 -1
- package/dist/cjs/paneview/paneviewPanel.js.map +0 -1
- package/dist/cjs/popoutWindow.d.ts.map +0 -1
- package/dist/cjs/popoutWindow.js.map +0 -1
- package/dist/cjs/resizable.d.ts.map +0 -1
- package/dist/cjs/resizable.js.map +0 -1
- package/dist/cjs/splitview/options.d.ts.map +0 -1
- package/dist/cjs/splitview/options.js.map +0 -1
- package/dist/cjs/splitview/splitview.d.ts.map +0 -1
- package/dist/cjs/splitview/splitview.js.map +0 -1
- package/dist/cjs/splitview/splitviewComponent.d.ts.map +0 -1
- package/dist/cjs/splitview/splitviewComponent.js.map +0 -1
- package/dist/cjs/splitview/splitviewPanel.d.ts.map +0 -1
- package/dist/cjs/splitview/splitviewPanel.js.map +0 -1
- package/dist/cjs/splitview/viewItem.d.ts.map +0 -1
- package/dist/cjs/splitview/viewItem.js.map +0 -1
- package/dist/cjs/svg.d.ts.map +0 -1
- package/dist/cjs/svg.js.map +0 -1
- package/dist/cjs/types.d.ts.map +0 -1
- package/dist/cjs/types.js.map +0 -1
- package/dist/esm/api/component.api.d.ts.map +0 -1
- package/dist/esm/api/component.api.js.map +0 -1
- package/dist/esm/api/dockviewGroupPanelApi.d.ts.map +0 -1
- package/dist/esm/api/dockviewGroupPanelApi.js.map +0 -1
- package/dist/esm/api/dockviewPanelApi.d.ts.map +0 -1
- package/dist/esm/api/dockviewPanelApi.js.map +0 -1
- package/dist/esm/api/gridviewPanelApi.d.ts.map +0 -1
- package/dist/esm/api/gridviewPanelApi.js.map +0 -1
- package/dist/esm/api/panelApi.d.ts.map +0 -1
- package/dist/esm/api/panelApi.js.map +0 -1
- package/dist/esm/api/paneviewPanelApi.d.ts.map +0 -1
- package/dist/esm/api/paneviewPanelApi.js.map +0 -1
- package/dist/esm/api/splitviewPanelApi.d.ts.map +0 -1
- package/dist/esm/api/splitviewPanelApi.js.map +0 -1
- package/dist/esm/array.d.ts.map +0 -1
- package/dist/esm/array.js.map +0 -1
- package/dist/esm/constants.d.ts.map +0 -1
- package/dist/esm/constants.js.map +0 -1
- package/dist/esm/dnd/abstractDragHandler.d.ts.map +0 -1
- package/dist/esm/dnd/abstractDragHandler.js.map +0 -1
- package/dist/esm/dnd/dataTransfer.d.ts.map +0 -1
- package/dist/esm/dnd/dataTransfer.js.map +0 -1
- package/dist/esm/dnd/dnd.d.ts.map +0 -1
- package/dist/esm/dnd/dnd.js.map +0 -1
- package/dist/esm/dnd/droptarget.d.ts.map +0 -1
- package/dist/esm/dnd/droptarget.js.map +0 -1
- package/dist/esm/dnd/ghost.d.ts.map +0 -1
- package/dist/esm/dnd/ghost.js.map +0 -1
- package/dist/esm/dnd/groupDragHandler.d.ts.map +0 -1
- package/dist/esm/dnd/groupDragHandler.js.map +0 -1
- package/dist/esm/dnd/overlay.d.ts.map +0 -1
- package/dist/esm/dnd/overlay.js.map +0 -1
- package/dist/esm/dockview/components/panel/content.d.ts.map +0 -1
- package/dist/esm/dockview/components/panel/content.js.map +0 -1
- package/dist/esm/dockview/components/tab/defaultTab.d.ts.map +0 -1
- package/dist/esm/dockview/components/tab/defaultTab.js.map +0 -1
- package/dist/esm/dockview/components/tab/tab.d.ts.map +0 -1
- package/dist/esm/dockview/components/tab/tab.js.map +0 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts.map +0 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.js.map +0 -1
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts.map +0 -1
- package/dist/esm/dockview/components/titlebar/voidContainer.js.map +0 -1
- package/dist/esm/dockview/components/watermark/watermark.d.ts.map +0 -1
- package/dist/esm/dockview/components/watermark/watermark.js.map +0 -1
- package/dist/esm/dockview/deserializer.d.ts.map +0 -1
- package/dist/esm/dockview/deserializer.js.map +0 -1
- package/dist/esm/dockview/dockviewComponent.d.ts.map +0 -1
- package/dist/esm/dockview/dockviewComponent.js.map +0 -1
- package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts.map +0 -1
- package/dist/esm/dockview/dockviewFloatingGroupPanel.js.map +0 -1
- package/dist/esm/dockview/dockviewGroupPanel.d.ts.map +0 -1
- package/dist/esm/dockview/dockviewGroupPanel.js.map +0 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts.map +0 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.js.map +0 -1
- package/dist/esm/dockview/dockviewPanel.d.ts.map +0 -1
- package/dist/esm/dockview/dockviewPanel.js.map +0 -1
- package/dist/esm/dockview/dockviewPanelModel.d.ts.map +0 -1
- package/dist/esm/dockview/dockviewPanelModel.js.map +0 -1
- package/dist/esm/dockview/dockviewPopoutGroupPanel.d.ts +0 -16
- package/dist/esm/dockview/dockviewPopoutGroupPanel.d.ts.map +0 -1
- package/dist/esm/dockview/dockviewPopoutGroupPanel.js +0 -28
- package/dist/esm/dockview/dockviewPopoutGroupPanel.js.map +0 -1
- package/dist/esm/dockview/options.d.ts.map +0 -1
- package/dist/esm/dockview/options.js.map +0 -1
- package/dist/esm/dockview/types.d.ts.map +0 -1
- package/dist/esm/dockview/types.js.map +0 -1
- package/dist/esm/dom.d.ts.map +0 -1
- package/dist/esm/dom.js.map +0 -1
- package/dist/esm/events.d.ts.map +0 -1
- package/dist/esm/events.js.map +0 -1
- package/dist/esm/gridview/baseComponentGridview.d.ts.map +0 -1
- package/dist/esm/gridview/baseComponentGridview.js.map +0 -1
- package/dist/esm/gridview/basePanelView.d.ts.map +0 -1
- package/dist/esm/gridview/basePanelView.js.map +0 -1
- package/dist/esm/gridview/branchNode.d.ts.map +0 -1
- package/dist/esm/gridview/branchNode.js.map +0 -1
- package/dist/esm/gridview/gridview.d.ts.map +0 -1
- package/dist/esm/gridview/gridview.js.map +0 -1
- package/dist/esm/gridview/gridviewComponent.d.ts.map +0 -1
- package/dist/esm/gridview/gridviewComponent.js.map +0 -1
- package/dist/esm/gridview/gridviewPanel.d.ts.map +0 -1
- package/dist/esm/gridview/gridviewPanel.js.map +0 -1
- package/dist/esm/gridview/leafNode.d.ts.map +0 -1
- package/dist/esm/gridview/leafNode.js.map +0 -1
- package/dist/esm/gridview/options.d.ts.map +0 -1
- package/dist/esm/gridview/options.js.map +0 -1
- package/dist/esm/gridview/types.d.ts.map +0 -1
- package/dist/esm/gridview/types.js.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/lifecycle.d.ts.map +0 -1
- package/dist/esm/lifecycle.js.map +0 -1
- package/dist/esm/math.d.ts.map +0 -1
- package/dist/esm/math.js.map +0 -1
- package/dist/esm/overlayRenderContainer.d.ts.map +0 -1
- package/dist/esm/overlayRenderContainer.js.map +0 -1
- package/dist/esm/panel/componentFactory.d.ts.map +0 -1
- package/dist/esm/panel/componentFactory.js.map +0 -1
- package/dist/esm/panel/types.d.ts.map +0 -1
- package/dist/esm/panel/types.js.map +0 -1
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts.map +0 -1
- package/dist/esm/paneview/defaultPaneviewHeader.js.map +0 -1
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts.map +0 -1
- package/dist/esm/paneview/draggablePaneviewPanel.js.map +0 -1
- package/dist/esm/paneview/options.d.ts.map +0 -1
- package/dist/esm/paneview/options.js.map +0 -1
- package/dist/esm/paneview/paneview.d.ts.map +0 -1
- package/dist/esm/paneview/paneview.js.map +0 -1
- package/dist/esm/paneview/paneviewComponent.d.ts.map +0 -1
- package/dist/esm/paneview/paneviewComponent.js.map +0 -1
- package/dist/esm/paneview/paneviewPanel.d.ts.map +0 -1
- package/dist/esm/paneview/paneviewPanel.js.map +0 -1
- package/dist/esm/popoutWindow.d.ts.map +0 -1
- package/dist/esm/popoutWindow.js.map +0 -1
- package/dist/esm/resizable.d.ts.map +0 -1
- package/dist/esm/resizable.js.map +0 -1
- package/dist/esm/splitview/options.d.ts.map +0 -1
- package/dist/esm/splitview/options.js.map +0 -1
- package/dist/esm/splitview/splitview.d.ts.map +0 -1
- package/dist/esm/splitview/splitview.js.map +0 -1
- package/dist/esm/splitview/splitviewComponent.d.ts.map +0 -1
- package/dist/esm/splitview/splitviewComponent.js.map +0 -1
- package/dist/esm/splitview/splitviewPanel.d.ts.map +0 -1
- package/dist/esm/splitview/splitviewPanel.js.map +0 -1
- package/dist/esm/splitview/viewItem.d.ts.map +0 -1
- package/dist/esm/splitview/viewItem.js.map +0 -1
- package/dist/esm/svg.d.ts.map +0 -1
- package/dist/esm/svg.js.map +0 -1
- package/dist/esm/types.d.ts.map +0 -1
- package/dist/esm/types.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 1.
|
|
3
|
+
* @version 1.10.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -92,6 +92,17 @@
|
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
94
|
})(exports.DockviewEvent || (exports.DockviewEvent = {}));
|
|
95
|
+
class DockviewEvent {
|
|
96
|
+
constructor() {
|
|
97
|
+
this._defaultPrevented = false;
|
|
98
|
+
}
|
|
99
|
+
get defaultPrevented() {
|
|
100
|
+
return this._defaultPrevented;
|
|
101
|
+
}
|
|
102
|
+
preventDefault() {
|
|
103
|
+
this._defaultPrevented = true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
95
106
|
class LeakageMonitor {
|
|
96
107
|
constructor() {
|
|
97
108
|
this.events = new Map();
|
|
@@ -135,6 +146,9 @@
|
|
|
135
146
|
}
|
|
136
147
|
Emitter.ENABLE_TRACKING = isEnabled;
|
|
137
148
|
}
|
|
149
|
+
get value() {
|
|
150
|
+
return this._last;
|
|
151
|
+
}
|
|
138
152
|
constructor(options) {
|
|
139
153
|
this.options = options;
|
|
140
154
|
this._listeners = [];
|
|
@@ -257,8 +271,12 @@
|
|
|
257
271
|
args.forEach((arg) => this._disposables.push(arg));
|
|
258
272
|
}
|
|
259
273
|
dispose() {
|
|
260
|
-
this.
|
|
274
|
+
if (this._isDisposed) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
261
277
|
this._isDisposed = true;
|
|
278
|
+
this._disposables.forEach((arg) => arg.dispose());
|
|
279
|
+
this._disposables = [];
|
|
262
280
|
}
|
|
263
281
|
}
|
|
264
282
|
class MutableDisposable {
|
|
@@ -742,6 +760,13 @@
|
|
|
742
760
|
this._endSnappingEnabled = endSnappingEnabled;
|
|
743
761
|
this.updateSashEnablement();
|
|
744
762
|
}
|
|
763
|
+
get disabled() {
|
|
764
|
+
return this._disabled;
|
|
765
|
+
}
|
|
766
|
+
set disabled(value) {
|
|
767
|
+
this._disabled = value;
|
|
768
|
+
toggleClass(this.element, 'dv-splitview-disabled', value);
|
|
769
|
+
}
|
|
745
770
|
constructor(container, options) {
|
|
746
771
|
this.container = container;
|
|
747
772
|
this.viewItems = [];
|
|
@@ -752,6 +777,7 @@
|
|
|
752
777
|
this._proportions = undefined;
|
|
753
778
|
this._startSnappingEnabled = true;
|
|
754
779
|
this._endSnappingEnabled = true;
|
|
780
|
+
this._disabled = false;
|
|
755
781
|
this._onDidSashEnd = new Emitter();
|
|
756
782
|
this.onDidSashEnd = this._onDidSashEnd.event;
|
|
757
783
|
this._onDidAddView = new Emitter();
|
|
@@ -1679,7 +1705,13 @@
|
|
|
1679
1705
|
}
|
|
1680
1706
|
return exports.LayoutPriority.Normal;
|
|
1681
1707
|
}
|
|
1682
|
-
|
|
1708
|
+
get disabled() {
|
|
1709
|
+
return this.splitview.disabled;
|
|
1710
|
+
}
|
|
1711
|
+
set disabled(value) {
|
|
1712
|
+
this.splitview.disabled = value;
|
|
1713
|
+
}
|
|
1714
|
+
constructor(orientation, proportionalLayout, styles, size, orthogonalSize, disabled, childDescriptors) {
|
|
1683
1715
|
super();
|
|
1684
1716
|
this.orientation = orientation;
|
|
1685
1717
|
this.proportionalLayout = proportionalLayout;
|
|
@@ -1724,6 +1756,7 @@
|
|
|
1724
1756
|
styles,
|
|
1725
1757
|
});
|
|
1726
1758
|
}
|
|
1759
|
+
this.disabled = disabled;
|
|
1727
1760
|
this.addDisposables(this._onDidChange, this._onDidVisibilityChange, this.splitview.onDidSashEnd(() => {
|
|
1728
1761
|
this._onDidChange.fire({});
|
|
1729
1762
|
}));
|
|
@@ -1857,7 +1890,7 @@
|
|
|
1857
1890
|
}
|
|
1858
1891
|
function flipNode(node, size, orthogonalSize) {
|
|
1859
1892
|
if (node instanceof BranchNode) {
|
|
1860
|
-
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize);
|
|
1893
|
+
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize, node.disabled);
|
|
1861
1894
|
let totalSize = 0;
|
|
1862
1895
|
for (let i = node.children.length - 1; i >= 0; i--) {
|
|
1863
1896
|
const child = node.children[i];
|
|
@@ -1993,31 +2026,57 @@
|
|
|
1993
2026
|
get maximumHeight() {
|
|
1994
2027
|
return this.root.maximumHeight;
|
|
1995
2028
|
}
|
|
2029
|
+
get locked() {
|
|
2030
|
+
return this._locked;
|
|
2031
|
+
}
|
|
2032
|
+
set locked(value) {
|
|
2033
|
+
this._locked = value;
|
|
2034
|
+
const branch = [this.root];
|
|
2035
|
+
/**
|
|
2036
|
+
* simple depth-first-search to cover all nodes
|
|
2037
|
+
*
|
|
2038
|
+
* @see https://en.wikipedia.org/wiki/Depth-first_search
|
|
2039
|
+
*/
|
|
2040
|
+
while (branch.length > 0) {
|
|
2041
|
+
const node = branch.pop();
|
|
2042
|
+
if (node instanceof BranchNode) {
|
|
2043
|
+
node.disabled = value;
|
|
2044
|
+
branch.push(...node.children);
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
1996
2048
|
maximizedView() {
|
|
1997
2049
|
var _a;
|
|
1998
|
-
return (_a = this._maximizedNode) === null || _a === void 0 ? void 0 : _a.view;
|
|
2050
|
+
return (_a = this._maximizedNode) === null || _a === void 0 ? void 0 : _a.leaf.view;
|
|
1999
2051
|
}
|
|
2000
2052
|
hasMaximizedView() {
|
|
2001
2053
|
return this._maximizedNode !== undefined;
|
|
2002
2054
|
}
|
|
2003
2055
|
maximizeView(view) {
|
|
2056
|
+
var _a;
|
|
2004
2057
|
const location = getGridLocation(view.element);
|
|
2005
2058
|
const [_, node] = this.getNode(location);
|
|
2006
2059
|
if (!(node instanceof LeafNode)) {
|
|
2007
2060
|
return;
|
|
2008
2061
|
}
|
|
2009
|
-
if (this._maximizedNode === node) {
|
|
2062
|
+
if (((_a = this._maximizedNode) === null || _a === void 0 ? void 0 : _a.leaf) === node) {
|
|
2010
2063
|
return;
|
|
2011
2064
|
}
|
|
2012
2065
|
if (this.hasMaximizedView()) {
|
|
2013
2066
|
this.exitMaximizedView();
|
|
2014
2067
|
}
|
|
2068
|
+
const hiddenOnMaximize = [];
|
|
2015
2069
|
function hideAllViewsBut(parent, exclude) {
|
|
2016
2070
|
for (let i = 0; i < parent.children.length; i++) {
|
|
2017
2071
|
const child = parent.children[i];
|
|
2018
2072
|
if (child instanceof LeafNode) {
|
|
2019
2073
|
if (child !== exclude) {
|
|
2020
|
-
parent.
|
|
2074
|
+
if (parent.isChildVisible(i)) {
|
|
2075
|
+
parent.setChildVisible(i, false);
|
|
2076
|
+
}
|
|
2077
|
+
else {
|
|
2078
|
+
hiddenOnMaximize.push(child);
|
|
2079
|
+
}
|
|
2021
2080
|
}
|
|
2022
2081
|
}
|
|
2023
2082
|
else {
|
|
@@ -2026,18 +2085,21 @@
|
|
|
2026
2085
|
}
|
|
2027
2086
|
}
|
|
2028
2087
|
hideAllViewsBut(this.root, node);
|
|
2029
|
-
this._maximizedNode = node;
|
|
2030
|
-
this.
|
|
2088
|
+
this._maximizedNode = { leaf: node, hiddenOnMaximize };
|
|
2089
|
+
this._onDidMaximizedNodeChange.fire();
|
|
2031
2090
|
}
|
|
2032
2091
|
exitMaximizedView() {
|
|
2033
2092
|
if (!this._maximizedNode) {
|
|
2034
2093
|
return;
|
|
2035
2094
|
}
|
|
2095
|
+
const hiddenOnMaximize = this._maximizedNode.hiddenOnMaximize;
|
|
2036
2096
|
function showViewsInReverseOrder(parent) {
|
|
2037
2097
|
for (let index = parent.children.length - 1; index >= 0; index--) {
|
|
2038
2098
|
const child = parent.children[index];
|
|
2039
2099
|
if (child instanceof LeafNode) {
|
|
2040
|
-
|
|
2100
|
+
if (!hiddenOnMaximize.includes(child)) {
|
|
2101
|
+
parent.setChildVisible(index, true);
|
|
2102
|
+
}
|
|
2041
2103
|
}
|
|
2042
2104
|
else {
|
|
2043
2105
|
showViewsInReverseOrder(child);
|
|
@@ -2046,13 +2108,13 @@
|
|
|
2046
2108
|
}
|
|
2047
2109
|
showViewsInReverseOrder(this.root);
|
|
2048
2110
|
this._maximizedNode = undefined;
|
|
2049
|
-
this.
|
|
2111
|
+
this._onDidMaximizedNodeChange.fire();
|
|
2050
2112
|
}
|
|
2051
2113
|
serialize() {
|
|
2052
2114
|
if (this.hasMaximizedView()) {
|
|
2053
2115
|
/**
|
|
2054
|
-
* do not persist maximized view state
|
|
2055
|
-
*
|
|
2116
|
+
* do not persist maximized view state
|
|
2117
|
+
* firstly exit any maximized views to ensure the correct dimensions are persisted
|
|
2056
2118
|
*/
|
|
2057
2119
|
this.exitMaximizedView();
|
|
2058
2120
|
}
|
|
@@ -2067,14 +2129,14 @@
|
|
|
2067
2129
|
dispose() {
|
|
2068
2130
|
this.disposable.dispose();
|
|
2069
2131
|
this._onDidChange.dispose();
|
|
2070
|
-
this.
|
|
2132
|
+
this._onDidMaximizedNodeChange.dispose();
|
|
2071
2133
|
this.root.dispose();
|
|
2072
2134
|
this._maximizedNode = undefined;
|
|
2073
2135
|
this.element.remove();
|
|
2074
2136
|
}
|
|
2075
2137
|
clear() {
|
|
2076
2138
|
const orientation = this.root.orientation;
|
|
2077
|
-
this.root = new BranchNode(orientation, this.proportionalLayout, this.styles, this.root.size, this.root.orthogonalSize);
|
|
2139
|
+
this.root = new BranchNode(orientation, this.proportionalLayout, this.styles, this.root.size, this.root.orthogonalSize, this._locked);
|
|
2078
2140
|
}
|
|
2079
2141
|
deserialize(json, deserializer) {
|
|
2080
2142
|
const orientation = json.orientation;
|
|
@@ -2095,8 +2157,8 @@
|
|
|
2095
2157
|
};
|
|
2096
2158
|
});
|
|
2097
2159
|
result = new BranchNode(orientation, this.proportionalLayout, this.styles, node.size, // <- orthogonal size - flips at each depth
|
|
2098
|
-
orthogonalSize, // <- size - flips at each depth
|
|
2099
|
-
children);
|
|
2160
|
+
orthogonalSize, // <- size - flips at each depth,
|
|
2161
|
+
this._locked, children);
|
|
2100
2162
|
}
|
|
2101
2163
|
else {
|
|
2102
2164
|
result = new LeafNode(deserializer.fromJSON(node), orientation, orthogonalSize, node.size);
|
|
@@ -2129,7 +2191,7 @@
|
|
|
2129
2191
|
}
|
|
2130
2192
|
const oldRoot = this.root;
|
|
2131
2193
|
oldRoot.element.remove();
|
|
2132
|
-
this._root = new BranchNode(orthogonal(oldRoot.orientation), this.proportionalLayout, this.styles, this.root.orthogonalSize, this.root.size);
|
|
2194
|
+
this._root = new BranchNode(orthogonal(oldRoot.orientation), this.proportionalLayout, this.styles, this.root.orthogonalSize, this.root.size, this._locked);
|
|
2133
2195
|
if (oldRoot.children.length === 0) ;
|
|
2134
2196
|
else if (oldRoot.children.length === 1) {
|
|
2135
2197
|
// can remove one level of redundant branching if there is only a single child
|
|
@@ -2197,15 +2259,16 @@
|
|
|
2197
2259
|
constructor(proportionalLayout, styles, orientation) {
|
|
2198
2260
|
this.proportionalLayout = proportionalLayout;
|
|
2199
2261
|
this.styles = styles;
|
|
2262
|
+
this._locked = false;
|
|
2200
2263
|
this._maximizedNode = undefined;
|
|
2201
2264
|
this.disposable = new MutableDisposable();
|
|
2202
2265
|
this._onDidChange = new Emitter();
|
|
2203
2266
|
this.onDidChange = this._onDidChange.event;
|
|
2204
|
-
this.
|
|
2205
|
-
this.
|
|
2267
|
+
this._onDidMaximizedNodeChange = new Emitter();
|
|
2268
|
+
this.onDidMaximizedNodeChange = this._onDidMaximizedNodeChange.event;
|
|
2206
2269
|
this.element = document.createElement('div');
|
|
2207
2270
|
this.element.className = 'grid-view';
|
|
2208
|
-
this.root = new BranchNode(orientation, proportionalLayout, styles, 0, 0);
|
|
2271
|
+
this.root = new BranchNode(orientation, proportionalLayout, styles, 0, 0, this._locked);
|
|
2209
2272
|
}
|
|
2210
2273
|
isViewVisible(location) {
|
|
2211
2274
|
const [rest, index] = tail(location);
|
|
@@ -2256,7 +2319,7 @@
|
|
|
2256
2319
|
}
|
|
2257
2320
|
const child = grandParent.removeChild(parentIndex);
|
|
2258
2321
|
child.dispose();
|
|
2259
|
-
const newParent = new BranchNode(parent.orientation, this.proportionalLayout, this.styles, parent.size, parent.orthogonalSize);
|
|
2322
|
+
const newParent = new BranchNode(parent.orientation, this.proportionalLayout, this.styles, parent.size, parent.orthogonalSize, this._locked);
|
|
2260
2323
|
grandParent.addChild(newParent, parent.size, parentIndex);
|
|
2261
2324
|
const newSibling = new LeafNode(parent.view, grandParent.orientation, parent.size);
|
|
2262
2325
|
newParent.addChild(newSibling, newSiblingSize, 0);
|
|
@@ -2883,6 +2946,21 @@
|
|
|
2883
2946
|
get onDidDrop() {
|
|
2884
2947
|
return this.component.onDidDrop;
|
|
2885
2948
|
}
|
|
2949
|
+
/**
|
|
2950
|
+
* Invoked when a Drag'n'Drop event occurs but before dockview handles it giving the user an opportunity to intecept and
|
|
2951
|
+
* prevent the event from occuring using the standard `preventDefault()` syntax.
|
|
2952
|
+
*
|
|
2953
|
+
* Preventing certain events may causes unexpected behaviours, use carefully.
|
|
2954
|
+
*/
|
|
2955
|
+
get onWillDrop() {
|
|
2956
|
+
return this.component.onWillDrop;
|
|
2957
|
+
}
|
|
2958
|
+
/**
|
|
2959
|
+
*
|
|
2960
|
+
*/
|
|
2961
|
+
get onWillShowOverlay() {
|
|
2962
|
+
return this.component.onWillShowOverlay;
|
|
2963
|
+
}
|
|
2886
2964
|
/**
|
|
2887
2965
|
* Invoked before a group is dragged. Exposed for custom Drag'n'Drop functionality.
|
|
2888
2966
|
*/
|
|
@@ -3018,17 +3096,17 @@
|
|
|
3018
3096
|
hasMaximizedGroup() {
|
|
3019
3097
|
return this.component.hasMaximizedGroup();
|
|
3020
3098
|
}
|
|
3021
|
-
|
|
3099
|
+
exitMaximizedGroup() {
|
|
3022
3100
|
this.component.exitMaximizedGroup();
|
|
3023
3101
|
}
|
|
3024
|
-
get
|
|
3025
|
-
return this.component.
|
|
3102
|
+
get onDidMaximizedGroupChange() {
|
|
3103
|
+
return this.component.onDidMaximizedGroupChange;
|
|
3026
3104
|
}
|
|
3027
3105
|
/**
|
|
3028
3106
|
* Add a popout group in a new Window
|
|
3029
3107
|
*/
|
|
3030
3108
|
addPopoutGroup(item, options) {
|
|
3031
|
-
this.component.addPopoutGroup(item, options);
|
|
3109
|
+
return this.component.addPopoutGroup(item, options);
|
|
3032
3110
|
}
|
|
3033
3111
|
}
|
|
3034
3112
|
|
|
@@ -3082,6 +3160,18 @@
|
|
|
3082
3160
|
}
|
|
3083
3161
|
}
|
|
3084
3162
|
|
|
3163
|
+
class WillShowOverlayEvent extends DockviewEvent {
|
|
3164
|
+
get nativeEvent() {
|
|
3165
|
+
return this.options.nativeEvent;
|
|
3166
|
+
}
|
|
3167
|
+
get position() {
|
|
3168
|
+
return this.options.position;
|
|
3169
|
+
}
|
|
3170
|
+
constructor(options) {
|
|
3171
|
+
super();
|
|
3172
|
+
this.options = options;
|
|
3173
|
+
}
|
|
3174
|
+
}
|
|
3085
3175
|
function directionToPosition(direction) {
|
|
3086
3176
|
switch (direction) {
|
|
3087
3177
|
case 'above':
|
|
@@ -3134,6 +3224,8 @@
|
|
|
3134
3224
|
this.options = options;
|
|
3135
3225
|
this._onDrop = new Emitter();
|
|
3136
3226
|
this.onDrop = this._onDrop.event;
|
|
3227
|
+
this._onWillShowOverlay = new Emitter();
|
|
3228
|
+
this.onWillShowOverlay = this._onWillShowOverlay.event;
|
|
3137
3229
|
// use a set to take advantage of #<set>.has
|
|
3138
3230
|
this._acceptedTargetZonesSet = new Set(this.options.acceptedTargetZones);
|
|
3139
3231
|
this.dnd = new DragAndDropObserver(this.element, {
|
|
@@ -3162,6 +3254,19 @@
|
|
|
3162
3254
|
this.removeDropTarget();
|
|
3163
3255
|
return;
|
|
3164
3256
|
}
|
|
3257
|
+
const willShowOverlayEvent = new WillShowOverlayEvent({
|
|
3258
|
+
nativeEvent: e,
|
|
3259
|
+
position: quadrant,
|
|
3260
|
+
});
|
|
3261
|
+
/**
|
|
3262
|
+
* Provide an opportunity to prevent the overlay appearing and in turn
|
|
3263
|
+
* any dnd behaviours
|
|
3264
|
+
*/
|
|
3265
|
+
this._onWillShowOverlay.fire(willShowOverlayEvent);
|
|
3266
|
+
if (willShowOverlayEvent.defaultPrevented) {
|
|
3267
|
+
this.removeDropTarget();
|
|
3268
|
+
return;
|
|
3269
|
+
}
|
|
3165
3270
|
if (typeof this.options.canDisplayOverlay === 'boolean') {
|
|
3166
3271
|
if (!this.options.canDisplayOverlay) {
|
|
3167
3272
|
this.removeDropTarget();
|
|
@@ -3204,7 +3309,7 @@
|
|
|
3204
3309
|
}
|
|
3205
3310
|
},
|
|
3206
3311
|
});
|
|
3207
|
-
this.addDisposables(this._onDrop, this.dnd);
|
|
3312
|
+
this.addDisposables(this._onDrop, this._onWillShowOverlay, this.dnd);
|
|
3208
3313
|
}
|
|
3209
3314
|
setTargetZones(acceptedTargetZones) {
|
|
3210
3315
|
this._acceptedTargetZonesSet = new Set(acceptedTargetZones);
|
|
@@ -3257,25 +3362,44 @@
|
|
|
3257
3362
|
size = clamp(0, sizeOptions.value, height) / height;
|
|
3258
3363
|
}
|
|
3259
3364
|
}
|
|
3260
|
-
const
|
|
3261
|
-
|
|
3262
|
-
|
|
3365
|
+
const box = { top: '0px', left: '0px', width: '100%', height: '100%' };
|
|
3366
|
+
/**
|
|
3367
|
+
* You can also achieve the overlay placement using the transform CSS property
|
|
3368
|
+
* to translate and scale the element however this has the undesired effect of
|
|
3369
|
+
* 'skewing' the element. Comment left here for anybody that ever revisits this.
|
|
3370
|
+
*
|
|
3371
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform
|
|
3372
|
+
*
|
|
3373
|
+
* right
|
|
3374
|
+
* translateX(${100 * (1 - size) / 2}%) scaleX(${scale})
|
|
3375
|
+
*
|
|
3376
|
+
* left
|
|
3377
|
+
* translateX(-${100 * (1 - size) / 2}%) scaleX(${scale})
|
|
3378
|
+
*
|
|
3379
|
+
* top
|
|
3380
|
+
* translateY(-${100 * (1 - size) / 2}%) scaleY(${scale})
|
|
3381
|
+
*
|
|
3382
|
+
* bottom
|
|
3383
|
+
* translateY(${100 * (1 - size) / 2}%) scaleY(${scale})
|
|
3384
|
+
*/
|
|
3263
3385
|
if (rightClass) {
|
|
3264
|
-
|
|
3386
|
+
box.left = `${100 * (1 - size)}%`;
|
|
3387
|
+
box.width = `${100 * size}%`;
|
|
3265
3388
|
}
|
|
3266
3389
|
else if (leftClass) {
|
|
3267
|
-
|
|
3390
|
+
box.width = `${100 * size}%`;
|
|
3268
3391
|
}
|
|
3269
3392
|
else if (topClass) {
|
|
3270
|
-
|
|
3393
|
+
box.height = `${100 * size}%`;
|
|
3271
3394
|
}
|
|
3272
3395
|
else if (bottomClass) {
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
else {
|
|
3276
|
-
transform = '';
|
|
3396
|
+
box.top = `${100 * (1 - size)}%`;
|
|
3397
|
+
box.height = `${100 * size}%`;
|
|
3277
3398
|
}
|
|
3278
|
-
this.overlayElement.style.
|
|
3399
|
+
this.overlayElement.style.top = box.top;
|
|
3400
|
+
this.overlayElement.style.left = box.left;
|
|
3401
|
+
this.overlayElement.style.width = box.width;
|
|
3402
|
+
this.overlayElement.style.height = box.height;
|
|
3279
3403
|
toggleClass(this.overlayElement, 'dv-drop-target-small-vertical', isSmallY);
|
|
3280
3404
|
toggleClass(this.overlayElement, 'dv-drop-target-small-horizontal', isSmallX);
|
|
3281
3405
|
toggleClass(this.overlayElement, 'dv-drop-target-left', isLeft);
|
|
@@ -3343,14 +3467,6 @@
|
|
|
3343
3467
|
return 'center';
|
|
3344
3468
|
}
|
|
3345
3469
|
|
|
3346
|
-
exports.DockviewDropTargets = void 0;
|
|
3347
|
-
(function (DockviewDropTargets) {
|
|
3348
|
-
DockviewDropTargets[DockviewDropTargets["Tab"] = 0] = "Tab";
|
|
3349
|
-
DockviewDropTargets[DockviewDropTargets["Panel"] = 1] = "Panel";
|
|
3350
|
-
DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
|
|
3351
|
-
DockviewDropTargets[DockviewDropTargets["Edge"] = 3] = "Edge";
|
|
3352
|
-
})(exports.DockviewDropTargets || (exports.DockviewDropTargets = {}));
|
|
3353
|
-
|
|
3354
3470
|
class ContentContainer extends CompositeDisposable {
|
|
3355
3471
|
get element() {
|
|
3356
3472
|
return this._element;
|
|
@@ -3378,7 +3494,7 @@
|
|
|
3378
3494
|
const data = getPanelData();
|
|
3379
3495
|
if (!data &&
|
|
3380
3496
|
event.shiftKey &&
|
|
3381
|
-
this.group.location !== 'floating') {
|
|
3497
|
+
this.group.location.type !== 'floating') {
|
|
3382
3498
|
return false;
|
|
3383
3499
|
}
|
|
3384
3500
|
if (data && data.viewId === this.accessor.id) {
|
|
@@ -3396,7 +3512,7 @@
|
|
|
3396
3512
|
data.groupId === this.group.id;
|
|
3397
3513
|
return !groupHasOnePanelAndIsActiveDragElement;
|
|
3398
3514
|
}
|
|
3399
|
-
return this.group.canDisplayOverlay(event, position,
|
|
3515
|
+
return this.group.canDisplayOverlay(event, position, 'panel');
|
|
3400
3516
|
},
|
|
3401
3517
|
});
|
|
3402
3518
|
this.addDisposables(this.dropTarget);
|
|
@@ -3421,7 +3537,7 @@
|
|
|
3421
3537
|
let container;
|
|
3422
3538
|
switch (panel.api.renderer) {
|
|
3423
3539
|
case 'onlyWhenVisibile':
|
|
3424
|
-
this.
|
|
3540
|
+
this.group.renderContainer.detatch(panel);
|
|
3425
3541
|
if (this.panel) {
|
|
3426
3542
|
if (doRender) {
|
|
3427
3543
|
this._element.appendChild(this.panel.view.content.element);
|
|
@@ -3433,7 +3549,7 @@
|
|
|
3433
3549
|
if (panel.view.content.element.parentElement === this._element) {
|
|
3434
3550
|
this._element.removeChild(panel.view.content.element);
|
|
3435
3551
|
}
|
|
3436
|
-
container = this.
|
|
3552
|
+
container = this.group.renderContainer.attach({
|
|
3437
3553
|
panel,
|
|
3438
3554
|
referenceContainer: this,
|
|
3439
3555
|
});
|
|
@@ -3464,12 +3580,13 @@
|
|
|
3464
3580
|
// noop
|
|
3465
3581
|
}
|
|
3466
3582
|
closePanel() {
|
|
3583
|
+
var _a;
|
|
3467
3584
|
if (this.panel) {
|
|
3468
|
-
if (this.
|
|
3469
|
-
this.
|
|
3585
|
+
if (this.panel.api.renderer === 'onlyWhenVisibile') {
|
|
3586
|
+
(_a = this.panel.view.content.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.panel.view.content.element);
|
|
3470
3587
|
}
|
|
3471
|
-
this.panel = undefined;
|
|
3472
3588
|
}
|
|
3589
|
+
this.panel = undefined;
|
|
3473
3590
|
}
|
|
3474
3591
|
dispose() {
|
|
3475
3592
|
this.disposable.dispose();
|
|
@@ -3577,7 +3694,7 @@
|
|
|
3577
3694
|
this._element.draggable = true;
|
|
3578
3695
|
toggleClass(this.element, 'inactive-tab', true);
|
|
3579
3696
|
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
3580
|
-
this.
|
|
3697
|
+
this.dropTarget = new Droptarget(this._element, {
|
|
3581
3698
|
acceptedTargetZones: ['center'],
|
|
3582
3699
|
canDisplayOverlay: (event, position) => {
|
|
3583
3700
|
if (this.group.locked) {
|
|
@@ -3592,9 +3709,10 @@
|
|
|
3592
3709
|
}
|
|
3593
3710
|
return this.panel.id !== data.panelId;
|
|
3594
3711
|
}
|
|
3595
|
-
return this.group.model.canDisplayOverlay(event, position,
|
|
3712
|
+
return this.group.model.canDisplayOverlay(event, position, 'tab');
|
|
3596
3713
|
},
|
|
3597
3714
|
});
|
|
3715
|
+
this.onWillShowOverlay = this.dropTarget.onWillShowOverlay;
|
|
3598
3716
|
this.addDisposables(this._onChanged, this._onDropped, this._onDragStart, dragHandler.onDragStart((event) => {
|
|
3599
3717
|
this._onDragStart.fire(event);
|
|
3600
3718
|
}), dragHandler, addDisposableListener(this._element, 'mousedown', (event) => {
|
|
@@ -3602,9 +3720,9 @@
|
|
|
3602
3720
|
return;
|
|
3603
3721
|
}
|
|
3604
3722
|
this._onChanged.fire(event);
|
|
3605
|
-
}), this.
|
|
3723
|
+
}), this.dropTarget.onDrop((event) => {
|
|
3606
3724
|
this._onDropped.fire(event);
|
|
3607
|
-
}), this.
|
|
3725
|
+
}), this.dropTarget);
|
|
3608
3726
|
}
|
|
3609
3727
|
setActive(isActive) {
|
|
3610
3728
|
toggleClass(this.element, 'active-tab', isActive);
|
|
@@ -3651,7 +3769,7 @@
|
|
|
3651
3769
|
}, true));
|
|
3652
3770
|
}
|
|
3653
3771
|
isCancelled(_event) {
|
|
3654
|
-
if (this.group.api.location === 'floating' && !_event.shiftKey) {
|
|
3772
|
+
if (this.group.api.location.type === 'floating' && !_event.shiftKey) {
|
|
3655
3773
|
return true;
|
|
3656
3774
|
}
|
|
3657
3775
|
return false;
|
|
@@ -3703,7 +3821,7 @@
|
|
|
3703
3821
|
this.accessor.doSetGroupActive(this.group);
|
|
3704
3822
|
}));
|
|
3705
3823
|
const handler = new GroupDragHandler(this._element, accessor, group);
|
|
3706
|
-
this.
|
|
3824
|
+
this.dropTraget = new Droptarget(this._element, {
|
|
3707
3825
|
acceptedTargetZones: ['center'],
|
|
3708
3826
|
canDisplayOverlay: (event, position) => {
|
|
3709
3827
|
var _a;
|
|
@@ -3717,14 +3835,15 @@
|
|
|
3717
3835
|
// don't show the overlay if the tab being dragged is the last panel of this group
|
|
3718
3836
|
return ((_a = last(this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
|
|
3719
3837
|
}
|
|
3720
|
-
return group.model.canDisplayOverlay(event, position,
|
|
3838
|
+
return group.model.canDisplayOverlay(event, position, 'panel');
|
|
3721
3839
|
},
|
|
3722
3840
|
});
|
|
3841
|
+
this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
|
|
3723
3842
|
this.addDisposables(handler, handler.onDragStart((event) => {
|
|
3724
3843
|
this._onDragStart.fire(event);
|
|
3725
|
-
}), this.
|
|
3844
|
+
}), this.dropTraget.onDrop((event) => {
|
|
3726
3845
|
this._onDrop.fire(event);
|
|
3727
|
-
}), this.
|
|
3846
|
+
}), this.dropTraget);
|
|
3728
3847
|
}
|
|
3729
3848
|
}
|
|
3730
3849
|
|
|
@@ -3812,19 +3931,11 @@
|
|
|
3812
3931
|
this.onTabDragStart = this._onTabDragStart.event;
|
|
3813
3932
|
this._onGroupDragStart = new Emitter();
|
|
3814
3933
|
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
3815
|
-
this.
|
|
3934
|
+
this._onWillShowOverlay = new Emitter();
|
|
3935
|
+
this.onWillShowOverlay = this._onWillShowOverlay.event;
|
|
3816
3936
|
this._element = document.createElement('div');
|
|
3817
3937
|
this._element.className = 'tabs-and-actions-container';
|
|
3818
3938
|
toggleClass(this._element, 'dv-full-width-single-tab', this.accessor.options.singleTabMode === 'fullwidth');
|
|
3819
|
-
this.addDisposables(this.accessor.onDidAddPanel((e) => {
|
|
3820
|
-
if (e.api.group === this.group) {
|
|
3821
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
3822
|
-
}
|
|
3823
|
-
}), this.accessor.onDidRemovePanel((e) => {
|
|
3824
|
-
if (e.api.group === this.group) {
|
|
3825
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
3826
|
-
}
|
|
3827
|
-
}));
|
|
3828
3939
|
this.rightActionsContainer = document.createElement('div');
|
|
3829
3940
|
this.rightActionsContainer.className = 'right-actions-container';
|
|
3830
3941
|
this.leftActionsContainer = document.createElement('div');
|
|
@@ -3839,7 +3950,15 @@
|
|
|
3839
3950
|
this._element.appendChild(this.leftActionsContainer);
|
|
3840
3951
|
this._element.appendChild(this.voidContainer.element);
|
|
3841
3952
|
this._element.appendChild(this.rightActionsContainer);
|
|
3842
|
-
this.addDisposables(this.
|
|
3953
|
+
this.addDisposables(this.accessor.onDidAddPanel((e) => {
|
|
3954
|
+
if (e.api.group === this.group) {
|
|
3955
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
3956
|
+
}
|
|
3957
|
+
}), this.accessor.onDidRemovePanel((e) => {
|
|
3958
|
+
if (e.api.group === this.group) {
|
|
3959
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
3960
|
+
}
|
|
3961
|
+
}), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
3843
3962
|
this._onGroupDragStart.fire({
|
|
3844
3963
|
nativeEvent: event,
|
|
3845
3964
|
group: this.group,
|
|
@@ -3849,11 +3968,15 @@
|
|
|
3849
3968
|
event: event.nativeEvent,
|
|
3850
3969
|
index: this.tabs.length,
|
|
3851
3970
|
});
|
|
3971
|
+
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
3972
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
3973
|
+
kind: 'header_space',
|
|
3974
|
+
}));
|
|
3852
3975
|
}), addDisposableListener(this.voidContainer.element, 'mousedown', (event) => {
|
|
3853
3976
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
3854
3977
|
if (isFloatingGroupsEnabled &&
|
|
3855
3978
|
event.shiftKey &&
|
|
3856
|
-
this.group.api.location !== 'floating') {
|
|
3979
|
+
this.group.api.location.type !== 'floating') {
|
|
3857
3980
|
event.preventDefault();
|
|
3858
3981
|
const { top, left } = this.element.getBoundingClientRect();
|
|
3859
3982
|
const { top: rootTop, left: rootLeft } = this.accessor.element.getBoundingClientRect();
|
|
@@ -3916,9 +4039,9 @@
|
|
|
3916
4039
|
const disposable = new CompositeDisposable(tab.onDragStart((event) => {
|
|
3917
4040
|
this._onTabDragStart.fire({ nativeEvent: event, panel });
|
|
3918
4041
|
}), tab.onChanged((event) => {
|
|
3919
|
-
var _a;
|
|
3920
4042
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
3921
|
-
const isFloatingWithOnePanel = this.group.api.location === 'floating' &&
|
|
4043
|
+
const isFloatingWithOnePanel = this.group.api.location.type === 'floating' &&
|
|
4044
|
+
this.size === 1;
|
|
3922
4045
|
if (isFloatingGroupsEnabled &&
|
|
3923
4046
|
!isFloatingWithOnePanel &&
|
|
3924
4047
|
event.shiftKey) {
|
|
@@ -3932,20 +4055,20 @@
|
|
|
3932
4055
|
}, { inDragMode: true });
|
|
3933
4056
|
return;
|
|
3934
4057
|
}
|
|
3935
|
-
const alreadyFocused = panel.id === ((_a = this.group.model.activePanel) === null || _a === void 0 ? void 0 : _a.id) &&
|
|
3936
|
-
this.group.model.isContentFocused;
|
|
3937
4058
|
const isLeftClick = event.button === 0;
|
|
3938
4059
|
if (!isLeftClick || event.defaultPrevented) {
|
|
3939
4060
|
return;
|
|
3940
4061
|
}
|
|
3941
|
-
this.group.
|
|
3942
|
-
|
|
3943
|
-
}
|
|
4062
|
+
if (this.group.activePanel !== panel) {
|
|
4063
|
+
this.group.model.openPanel(panel);
|
|
4064
|
+
}
|
|
3944
4065
|
}), tab.onDrop((event) => {
|
|
3945
4066
|
this._onDrop.fire({
|
|
3946
4067
|
event: event.nativeEvent,
|
|
3947
4068
|
index: this.tabs.findIndex((x) => x.value === tab),
|
|
3948
4069
|
});
|
|
4070
|
+
}), tab.onWillShowOverlay((event) => {
|
|
4071
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, { kind: 'tab' }));
|
|
3949
4072
|
}));
|
|
3950
4073
|
const value = { value: tab, disposable };
|
|
3951
4074
|
this.addTab(value, index);
|
|
@@ -3963,6 +4086,60 @@
|
|
|
3963
4086
|
}
|
|
3964
4087
|
}
|
|
3965
4088
|
|
|
4089
|
+
class DockviewDidDropEvent extends DockviewEvent {
|
|
4090
|
+
get nativeEvent() {
|
|
4091
|
+
return this.options.nativeEvent;
|
|
4092
|
+
}
|
|
4093
|
+
get position() {
|
|
4094
|
+
return this.options.position;
|
|
4095
|
+
}
|
|
4096
|
+
get panel() {
|
|
4097
|
+
return this.options.panel;
|
|
4098
|
+
}
|
|
4099
|
+
get group() {
|
|
4100
|
+
return this.options.group;
|
|
4101
|
+
}
|
|
4102
|
+
get api() {
|
|
4103
|
+
return this.options.api;
|
|
4104
|
+
}
|
|
4105
|
+
constructor(options) {
|
|
4106
|
+
super();
|
|
4107
|
+
this.options = options;
|
|
4108
|
+
}
|
|
4109
|
+
getData() {
|
|
4110
|
+
return this.options.getData();
|
|
4111
|
+
}
|
|
4112
|
+
}
|
|
4113
|
+
class DockviewWillDropEvent extends DockviewDidDropEvent {
|
|
4114
|
+
get kind() {
|
|
4115
|
+
return this._kind;
|
|
4116
|
+
}
|
|
4117
|
+
constructor(options) {
|
|
4118
|
+
super(options);
|
|
4119
|
+
this._kind = options.kind;
|
|
4120
|
+
}
|
|
4121
|
+
}
|
|
4122
|
+
class WillShowOverlayLocationEvent {
|
|
4123
|
+
get kind() {
|
|
4124
|
+
return this._kind;
|
|
4125
|
+
}
|
|
4126
|
+
get nativeEvent() {
|
|
4127
|
+
return this.event.nativeEvent;
|
|
4128
|
+
}
|
|
4129
|
+
get position() {
|
|
4130
|
+
return this.event.position;
|
|
4131
|
+
}
|
|
4132
|
+
get defaultPrevented() {
|
|
4133
|
+
return this.event.defaultPrevented;
|
|
4134
|
+
}
|
|
4135
|
+
preventDefault() {
|
|
4136
|
+
this.event.preventDefault();
|
|
4137
|
+
}
|
|
4138
|
+
constructor(event, options) {
|
|
4139
|
+
this.event = event;
|
|
4140
|
+
this._kind = options.kind;
|
|
4141
|
+
}
|
|
4142
|
+
}
|
|
3966
4143
|
class DockviewGroupPanelModel extends CompositeDisposable {
|
|
3967
4144
|
get element() {
|
|
3968
4145
|
throw new Error('not supported');
|
|
@@ -4008,7 +4185,7 @@
|
|
|
4008
4185
|
this._location = value;
|
|
4009
4186
|
toggleClass(this.container, 'dv-groupview-floating', false);
|
|
4010
4187
|
toggleClass(this.container, 'dv-groupview-popout', false);
|
|
4011
|
-
switch (value) {
|
|
4188
|
+
switch (value.type) {
|
|
4012
4189
|
case 'grid':
|
|
4013
4190
|
this.contentContainer.dropTarget.setTargetZones([
|
|
4014
4191
|
'top',
|
|
@@ -4044,7 +4221,7 @@
|
|
|
4044
4221
|
this.groupPanel = groupPanel;
|
|
4045
4222
|
this._isGroupActive = false;
|
|
4046
4223
|
this._locked = false;
|
|
4047
|
-
this._location = 'grid';
|
|
4224
|
+
this._location = { type: 'grid' };
|
|
4048
4225
|
this.mostRecentlyUsed = [];
|
|
4049
4226
|
this._onDidChange = new Emitter();
|
|
4050
4227
|
this.onDidChange = this._onDidChange.event;
|
|
@@ -4055,6 +4232,10 @@
|
|
|
4055
4232
|
this.onMove = this._onMove.event;
|
|
4056
4233
|
this._onDidDrop = new Emitter();
|
|
4057
4234
|
this.onDidDrop = this._onDidDrop.event;
|
|
4235
|
+
this._onWillDrop = new Emitter();
|
|
4236
|
+
this.onWillDrop = this._onWillDrop.event;
|
|
4237
|
+
this._onWillShowOverlay = new Emitter();
|
|
4238
|
+
this.onWillShowOverlay = this._onWillShowOverlay.event;
|
|
4058
4239
|
this._onTabDragStart = new Emitter();
|
|
4059
4240
|
this.onTabDragStart = this._onTabDragStart.event;
|
|
4060
4241
|
this._onGroupDragStart = new Emitter();
|
|
@@ -4065,46 +4246,69 @@
|
|
|
4065
4246
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4066
4247
|
this._onDidActivePanelChange = new Emitter();
|
|
4067
4248
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4249
|
+
this._overwriteRenderContainer = null;
|
|
4068
4250
|
toggleClass(this.container, 'groupview', true);
|
|
4251
|
+
this._api = new DockviewApi(this.accessor);
|
|
4069
4252
|
this.tabsContainer = new TabsContainer(this.accessor, this.groupPanel);
|
|
4070
4253
|
this.contentContainer = new ContentContainer(this.accessor, this);
|
|
4071
4254
|
container.append(this.tabsContainer.element, this.contentContainer.element);
|
|
4072
4255
|
this.header.hidden = !!options.hideHeader;
|
|
4073
4256
|
this.locked = (_a = options.locked) !== null && _a !== void 0 ? _a : false;
|
|
4074
|
-
this.addDisposables(this._onTabDragStart, this._onGroupDragStart, this.tabsContainer.onTabDragStart((event) => {
|
|
4257
|
+
this.addDisposables(this._onTabDragStart, this._onGroupDragStart, this._onWillShowOverlay, this.tabsContainer.onTabDragStart((event) => {
|
|
4075
4258
|
this._onTabDragStart.fire(event);
|
|
4076
4259
|
}), this.tabsContainer.onGroupDragStart((event) => {
|
|
4077
4260
|
this._onGroupDragStart.fire(event);
|
|
4078
4261
|
}), this.tabsContainer.onDrop((event) => {
|
|
4079
|
-
this.handleDropEvent(event.event, 'center', event.index);
|
|
4262
|
+
this.handleDropEvent('header', event.event, 'center', event.index);
|
|
4080
4263
|
}), this.contentContainer.onDidFocus(() => {
|
|
4081
|
-
this.accessor.doSetGroupActive(this.groupPanel
|
|
4264
|
+
this.accessor.doSetGroupActive(this.groupPanel);
|
|
4082
4265
|
}), this.contentContainer.onDidBlur(() => {
|
|
4083
4266
|
// noop
|
|
4084
4267
|
}), this.contentContainer.dropTarget.onDrop((event) => {
|
|
4085
|
-
this.handleDropEvent(event.nativeEvent, event.position);
|
|
4086
|
-
}), this.
|
|
4268
|
+
this.handleDropEvent('content', event.nativeEvent, event.position);
|
|
4269
|
+
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
4270
|
+
this._onWillShowOverlay.fire(event);
|
|
4271
|
+
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
4272
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
4273
|
+
kind: 'content',
|
|
4274
|
+
}));
|
|
4275
|
+
}), this._onMove, this._onDidChange, this._onDidDrop, this._onWillDrop, this._onDidAddPanel, this._onDidRemovePanel, this._onDidActivePanelChange);
|
|
4276
|
+
}
|
|
4277
|
+
focusContent() {
|
|
4278
|
+
this.contentContainer.element.focus();
|
|
4279
|
+
}
|
|
4280
|
+
set renderContainer(value) {
|
|
4281
|
+
this.panels.forEach((panel) => {
|
|
4282
|
+
this.renderContainer.detatch(panel);
|
|
4283
|
+
});
|
|
4284
|
+
this._overwriteRenderContainer = value;
|
|
4285
|
+
this.panels.forEach((panel) => {
|
|
4286
|
+
this.rerender(panel);
|
|
4287
|
+
});
|
|
4288
|
+
}
|
|
4289
|
+
get renderContainer() {
|
|
4290
|
+
var _a;
|
|
4291
|
+
return ((_a = this._overwriteRenderContainer) !== null && _a !== void 0 ? _a : this.accessor.overlayRenderContainer);
|
|
4087
4292
|
}
|
|
4088
4293
|
initialize() {
|
|
4089
|
-
|
|
4090
|
-
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.panels) {
|
|
4294
|
+
if (this.options.panels) {
|
|
4091
4295
|
this.options.panels.forEach((panel) => {
|
|
4092
4296
|
this.doAddPanel(panel);
|
|
4093
4297
|
});
|
|
4094
4298
|
}
|
|
4095
|
-
if (
|
|
4299
|
+
if (this.options.activePanel) {
|
|
4096
4300
|
this.openPanel(this.options.activePanel);
|
|
4097
4301
|
}
|
|
4098
4302
|
// must be run after the constructor otherwise this.parent may not be
|
|
4099
4303
|
// correctly initialized
|
|
4100
|
-
this.setActive(this.isActive, true
|
|
4304
|
+
this.setActive(this.isActive, true);
|
|
4101
4305
|
this.updateContainer();
|
|
4102
4306
|
if (this.accessor.options.createRightHeaderActionsElement) {
|
|
4103
4307
|
this._rightHeaderActions =
|
|
4104
4308
|
this.accessor.options.createRightHeaderActionsElement(this.groupPanel);
|
|
4105
4309
|
this.addDisposables(this._rightHeaderActions);
|
|
4106
4310
|
this._rightHeaderActions.init({
|
|
4107
|
-
containerApi:
|
|
4311
|
+
containerApi: this._api,
|
|
4108
4312
|
api: this.groupPanel.api,
|
|
4109
4313
|
});
|
|
4110
4314
|
this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element);
|
|
@@ -4114,7 +4318,7 @@
|
|
|
4114
4318
|
this.accessor.options.createLeftHeaderActionsElement(this.groupPanel);
|
|
4115
4319
|
this.addDisposables(this._leftHeaderActions);
|
|
4116
4320
|
this._leftHeaderActions.init({
|
|
4117
|
-
containerApi:
|
|
4321
|
+
containerApi: this._api,
|
|
4118
4322
|
api: this.groupPanel.api,
|
|
4119
4323
|
});
|
|
4120
4324
|
this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element);
|
|
@@ -4124,7 +4328,7 @@
|
|
|
4124
4328
|
this.accessor.options.createPrefixHeaderActionsElement(this.groupPanel);
|
|
4125
4329
|
this.addDisposables(this._prefixHeaderActions);
|
|
4126
4330
|
this._prefixHeaderActions.init({
|
|
4127
|
-
containerApi:
|
|
4331
|
+
containerApi: this._api,
|
|
4128
4332
|
api: this.groupPanel.api,
|
|
4129
4333
|
});
|
|
4130
4334
|
this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element);
|
|
@@ -4204,34 +4408,45 @@
|
|
|
4204
4408
|
//noop
|
|
4205
4409
|
}
|
|
4206
4410
|
focus() {
|
|
4207
|
-
var _a
|
|
4208
|
-
(
|
|
4411
|
+
var _a;
|
|
4412
|
+
(_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4209
4413
|
}
|
|
4210
4414
|
openPanel(panel, options = {}) {
|
|
4415
|
+
/**
|
|
4416
|
+
* set the panel group
|
|
4417
|
+
* add the panel
|
|
4418
|
+
* check if group active
|
|
4419
|
+
* check if panel active
|
|
4420
|
+
*/
|
|
4211
4421
|
if (typeof options.index !== 'number' ||
|
|
4212
4422
|
options.index > this.panels.length) {
|
|
4213
4423
|
options.index = this.panels.length;
|
|
4214
4424
|
}
|
|
4215
|
-
const
|
|
4216
|
-
const skipSetGroupActive = !!options.skipSetGroupActive;
|
|
4425
|
+
const skipSetActive = !!options.skipSetActive;
|
|
4217
4426
|
// ensure the group is updated before we fire any events
|
|
4218
|
-
panel.updateParentGroup(this.groupPanel,
|
|
4427
|
+
panel.updateParentGroup(this.groupPanel, {
|
|
4428
|
+
skipSetActive: options.skipSetActive,
|
|
4429
|
+
});
|
|
4430
|
+
this.doAddPanel(panel, options.index, {
|
|
4431
|
+
skipSetActive: skipSetActive,
|
|
4432
|
+
});
|
|
4219
4433
|
if (this._activePanel === panel) {
|
|
4220
|
-
|
|
4221
|
-
this.accessor.doSetGroupActive(this.groupPanel);
|
|
4222
|
-
}
|
|
4434
|
+
this.contentContainer.renderPanel(panel, { asActive: true });
|
|
4223
4435
|
return;
|
|
4224
4436
|
}
|
|
4225
|
-
|
|
4226
|
-
if (!skipSetPanelActive) {
|
|
4437
|
+
if (!skipSetActive) {
|
|
4227
4438
|
this.doSetActivePanel(panel);
|
|
4228
4439
|
}
|
|
4229
|
-
if (!skipSetGroupActive) {
|
|
4230
|
-
this.accessor.doSetGroupActive(this.groupPanel
|
|
4440
|
+
if (!options.skipSetGroupActive) {
|
|
4441
|
+
this.accessor.doSetGroupActive(this.groupPanel);
|
|
4442
|
+
}
|
|
4443
|
+
if (!options.skipSetActive) {
|
|
4444
|
+
this.updateContainer();
|
|
4231
4445
|
}
|
|
4232
|
-
this.updateContainer();
|
|
4233
4446
|
}
|
|
4234
|
-
removePanel(groupItemOrId
|
|
4447
|
+
removePanel(groupItemOrId, options = {
|
|
4448
|
+
skipSetActive: false,
|
|
4449
|
+
}) {
|
|
4235
4450
|
const id = typeof groupItemOrId === 'string'
|
|
4236
4451
|
? groupItemOrId
|
|
4237
4452
|
: groupItemOrId.id;
|
|
@@ -4239,7 +4454,7 @@
|
|
|
4239
4454
|
if (!panelToRemove) {
|
|
4240
4455
|
throw new Error('invalid operation');
|
|
4241
4456
|
}
|
|
4242
|
-
return this._removePanel(panelToRemove);
|
|
4457
|
+
return this._removePanel(panelToRemove, options);
|
|
4243
4458
|
}
|
|
4244
4459
|
closeAllPanels() {
|
|
4245
4460
|
if (this.panels.length > 0) {
|
|
@@ -4265,12 +4480,8 @@
|
|
|
4265
4480
|
updateActions(element) {
|
|
4266
4481
|
this.tabsContainer.setRightActionsElement(element);
|
|
4267
4482
|
}
|
|
4268
|
-
setActive(isGroupActive,
|
|
4269
|
-
var _a, _b, _c, _d;
|
|
4483
|
+
setActive(isGroupActive, force = false) {
|
|
4270
4484
|
if (!force && this.isActive === isGroupActive) {
|
|
4271
|
-
if (!skipFocus) {
|
|
4272
|
-
(_b = (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4273
|
-
}
|
|
4274
4485
|
return;
|
|
4275
4486
|
}
|
|
4276
4487
|
this._isGroupActive = isGroupActive;
|
|
@@ -4281,11 +4492,6 @@
|
|
|
4281
4492
|
this.doSetActivePanel(this.panels[0]);
|
|
4282
4493
|
}
|
|
4283
4494
|
this.updateContainer();
|
|
4284
|
-
if (isGroupActive) {
|
|
4285
|
-
if (!skipFocus) {
|
|
4286
|
-
(_d = (_c = this._activePanel) === null || _c === void 0 ? void 0 : _c.focus) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
4287
|
-
}
|
|
4288
|
-
}
|
|
4289
4495
|
}
|
|
4290
4496
|
layout(width, height) {
|
|
4291
4497
|
var _a;
|
|
@@ -4296,17 +4502,22 @@
|
|
|
4296
4502
|
this._activePanel.layout(this._width, this._height);
|
|
4297
4503
|
}
|
|
4298
4504
|
}
|
|
4299
|
-
_removePanel(panel) {
|
|
4505
|
+
_removePanel(panel, options) {
|
|
4300
4506
|
const isActivePanel = this._activePanel === panel;
|
|
4301
4507
|
this.doRemovePanel(panel);
|
|
4302
4508
|
if (isActivePanel && this.panels.length > 0) {
|
|
4303
4509
|
const nextPanel = this.mostRecentlyUsed[0];
|
|
4304
|
-
this.openPanel(nextPanel
|
|
4510
|
+
this.openPanel(nextPanel, {
|
|
4511
|
+
skipSetActive: options.skipSetActive,
|
|
4512
|
+
skipSetGroupActive: options.skipSetActiveGroup,
|
|
4513
|
+
});
|
|
4305
4514
|
}
|
|
4306
4515
|
if (this._activePanel && this.panels.length === 0) {
|
|
4307
4516
|
this.doSetActivePanel(undefined);
|
|
4308
4517
|
}
|
|
4309
|
-
|
|
4518
|
+
if (!options.skipSetActive) {
|
|
4519
|
+
this.updateContainer();
|
|
4520
|
+
}
|
|
4310
4521
|
return panel;
|
|
4311
4522
|
}
|
|
4312
4523
|
doRemovePanel(panel) {
|
|
@@ -4321,13 +4532,13 @@
|
|
|
4321
4532
|
}
|
|
4322
4533
|
this._onDidRemovePanel.fire({ panel });
|
|
4323
4534
|
}
|
|
4324
|
-
doAddPanel(panel, index = this.panels.length,
|
|
4535
|
+
doAddPanel(panel, index = this.panels.length, options = { skipSetActive: false }) {
|
|
4325
4536
|
const existingPanel = this._panels.indexOf(panel);
|
|
4326
4537
|
const hasExistingPanel = existingPanel > -1;
|
|
4327
4538
|
this.tabsContainer.show();
|
|
4328
4539
|
this.contentContainer.show();
|
|
4329
4540
|
this.tabsContainer.openPanel(panel, index);
|
|
4330
|
-
if (!skipSetActive) {
|
|
4541
|
+
if (!options.skipSetActive) {
|
|
4331
4542
|
this.contentContainer.openPanel(panel);
|
|
4332
4543
|
}
|
|
4333
4544
|
if (hasExistingPanel) {
|
|
@@ -4339,12 +4550,17 @@
|
|
|
4339
4550
|
this._onDidAddPanel.fire({ panel });
|
|
4340
4551
|
}
|
|
4341
4552
|
doSetActivePanel(panel) {
|
|
4553
|
+
if (this._activePanel === panel) {
|
|
4554
|
+
return;
|
|
4555
|
+
}
|
|
4342
4556
|
this._activePanel = panel;
|
|
4343
4557
|
if (panel) {
|
|
4344
4558
|
this.tabsContainer.setActivePanel(panel);
|
|
4345
4559
|
panel.layout(this._width, this._height);
|
|
4346
4560
|
this.updateMru(panel);
|
|
4347
|
-
this._onDidActivePanelChange.fire({
|
|
4561
|
+
this._onDidActivePanelChange.fire({
|
|
4562
|
+
panel,
|
|
4563
|
+
});
|
|
4348
4564
|
}
|
|
4349
4565
|
}
|
|
4350
4566
|
updateMru(panel) {
|
|
@@ -4356,11 +4572,11 @@
|
|
|
4356
4572
|
updateContainer() {
|
|
4357
4573
|
var _a, _b;
|
|
4358
4574
|
toggleClass(this.container, 'empty', this.isEmpty);
|
|
4359
|
-
this.panels.forEach((panel) => panel.
|
|
4575
|
+
this.panels.forEach((panel) => panel.runEvents());
|
|
4360
4576
|
if (this.isEmpty && !this.watermark) {
|
|
4361
4577
|
const watermark = this.accessor.createWatermarkComponent();
|
|
4362
4578
|
watermark.init({
|
|
4363
|
-
containerApi:
|
|
4579
|
+
containerApi: this._api,
|
|
4364
4580
|
group: this.groupPanel,
|
|
4365
4581
|
});
|
|
4366
4582
|
this.watermark = watermark;
|
|
@@ -4393,10 +4609,32 @@
|
|
|
4393
4609
|
}
|
|
4394
4610
|
return false;
|
|
4395
4611
|
}
|
|
4396
|
-
handleDropEvent(event, position, index) {
|
|
4612
|
+
handleDropEvent(type, event, position, index) {
|
|
4397
4613
|
if (this.locked === 'no-drop-target') {
|
|
4398
4614
|
return;
|
|
4399
4615
|
}
|
|
4616
|
+
function getKind() {
|
|
4617
|
+
switch (type) {
|
|
4618
|
+
case 'header':
|
|
4619
|
+
return typeof index === 'number' ? 'tab' : 'header_space';
|
|
4620
|
+
case 'content':
|
|
4621
|
+
return 'content';
|
|
4622
|
+
}
|
|
4623
|
+
}
|
|
4624
|
+
const panel = typeof index === 'number' ? this.panels[index] : undefined;
|
|
4625
|
+
const willDropEvent = new DockviewWillDropEvent({
|
|
4626
|
+
nativeEvent: event,
|
|
4627
|
+
position,
|
|
4628
|
+
panel,
|
|
4629
|
+
getData: () => getPanelData(),
|
|
4630
|
+
kind: getKind(),
|
|
4631
|
+
group: this.groupPanel,
|
|
4632
|
+
api: this._api,
|
|
4633
|
+
});
|
|
4634
|
+
this._onWillDrop.fire(willDropEvent);
|
|
4635
|
+
if (willDropEvent.defaultPrevented) {
|
|
4636
|
+
return;
|
|
4637
|
+
}
|
|
4400
4638
|
const data = getPanelData();
|
|
4401
4639
|
if (data && data.viewId === this.accessor.id) {
|
|
4402
4640
|
if (data.panelId === null) {
|
|
@@ -4429,12 +4667,14 @@
|
|
|
4429
4667
|
});
|
|
4430
4668
|
}
|
|
4431
4669
|
else {
|
|
4432
|
-
this._onDidDrop.fire({
|
|
4670
|
+
this._onDidDrop.fire(new DockviewDidDropEvent({
|
|
4433
4671
|
nativeEvent: event,
|
|
4434
4672
|
position,
|
|
4435
|
-
|
|
4673
|
+
panel,
|
|
4436
4674
|
getData: () => getPanelData(),
|
|
4437
|
-
|
|
4675
|
+
group: this.groupPanel,
|
|
4676
|
+
api: this._api,
|
|
4677
|
+
}));
|
|
4438
4678
|
}
|
|
4439
4679
|
}
|
|
4440
4680
|
dispose() {
|
|
@@ -4442,6 +4682,7 @@
|
|
|
4442
4682
|
super.dispose();
|
|
4443
4683
|
(_a = this.watermark) === null || _a === void 0 ? void 0 : _a.element.remove();
|
|
4444
4684
|
(_c = (_b = this.watermark) === null || _b === void 0 ? void 0 : _b.dispose) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
4685
|
+
this.watermark = undefined;
|
|
4445
4686
|
for (const panel of this.panels) {
|
|
4446
4687
|
panel.dispose();
|
|
4447
4688
|
}
|
|
@@ -4463,15 +4704,7 @@
|
|
|
4463
4704
|
constructor(parentElement, disableResizing = false) {
|
|
4464
4705
|
super();
|
|
4465
4706
|
this._disableResizing = disableResizing;
|
|
4466
|
-
|
|
4467
|
-
this._element = parentElement;
|
|
4468
|
-
}
|
|
4469
|
-
else {
|
|
4470
|
-
this._element = document.createElement('div');
|
|
4471
|
-
this._element.style.height = '100%';
|
|
4472
|
-
this._element.style.width = '100%';
|
|
4473
|
-
this._element.className = 'dv-resizable-container';
|
|
4474
|
-
}
|
|
4707
|
+
this._element = parentElement;
|
|
4475
4708
|
this.addDisposables(watchElementResize(this._element, (entry) => {
|
|
4476
4709
|
if (this.isDisposed) {
|
|
4477
4710
|
/**
|
|
@@ -4559,25 +4792,38 @@
|
|
|
4559
4792
|
get activeGroup() {
|
|
4560
4793
|
return this._activeGroup;
|
|
4561
4794
|
}
|
|
4795
|
+
get locked() {
|
|
4796
|
+
return this.gridview.locked;
|
|
4797
|
+
}
|
|
4798
|
+
set locked(value) {
|
|
4799
|
+
this.gridview.locked = value;
|
|
4800
|
+
}
|
|
4562
4801
|
constructor(options) {
|
|
4563
|
-
super(
|
|
4802
|
+
super(document.createElement('div'), options.disableAutoResizing);
|
|
4564
4803
|
this._id = nextLayoutId$1.next();
|
|
4565
4804
|
this._groups = new Map();
|
|
4566
4805
|
this._onDidLayoutChange = new Emitter();
|
|
4567
4806
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
4568
|
-
this.
|
|
4569
|
-
this.
|
|
4570
|
-
this.
|
|
4571
|
-
this.
|
|
4572
|
-
this.
|
|
4573
|
-
this.
|
|
4807
|
+
this._onDidRemove = new Emitter();
|
|
4808
|
+
this.onDidRemove = this._onDidRemove.event;
|
|
4809
|
+
this._onDidAdd = new Emitter();
|
|
4810
|
+
this.onDidAdd = this._onDidAdd.event;
|
|
4811
|
+
this._onDidActiveChange = new Emitter();
|
|
4812
|
+
this.onDidActiveChange = this._onDidActiveChange.event;
|
|
4574
4813
|
this._bufferOnDidLayoutChange = new TickDelayedEvent();
|
|
4814
|
+
this.element.style.height = '100%';
|
|
4815
|
+
this.element.style.width = '100%';
|
|
4816
|
+
options.parentElement.appendChild(this.element);
|
|
4575
4817
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
|
|
4818
|
+
this.gridview.locked = !!options.locked;
|
|
4576
4819
|
this.element.appendChild(this.gridview.element);
|
|
4577
4820
|
this.layout(0, 0, true); // set some elements height/widths
|
|
4578
|
-
this.addDisposables(
|
|
4821
|
+
this.addDisposables(Disposable.from(() => {
|
|
4822
|
+
var _a;
|
|
4823
|
+
(_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.element);
|
|
4824
|
+
}), this.gridview.onDidChange(() => {
|
|
4579
4825
|
this._bufferOnDidLayoutChange.fire();
|
|
4580
|
-
}), exports.DockviewEvent.any(this.
|
|
4826
|
+
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove, this.onDidActiveChange)(() => {
|
|
4581
4827
|
this._bufferOnDidLayoutChange.fire();
|
|
4582
4828
|
}), this._bufferOnDidLayoutChange.onEvent(() => {
|
|
4583
4829
|
this._onDidLayoutChange.fire();
|
|
@@ -4592,6 +4838,7 @@
|
|
|
4592
4838
|
}
|
|
4593
4839
|
maximizeGroup(panel) {
|
|
4594
4840
|
this.gridview.maximizeView(panel);
|
|
4841
|
+
this.doSetGroupActive(panel);
|
|
4595
4842
|
}
|
|
4596
4843
|
isMaximizedGroup(panel) {
|
|
4597
4844
|
return this.gridview.maximizedView() === panel;
|
|
@@ -4602,13 +4849,12 @@
|
|
|
4602
4849
|
hasMaximizedGroup() {
|
|
4603
4850
|
return this.gridview.hasMaximizedView();
|
|
4604
4851
|
}
|
|
4605
|
-
get
|
|
4606
|
-
return this.gridview.
|
|
4852
|
+
get onDidMaximizedGroupChange() {
|
|
4853
|
+
return this.gridview.onDidMaximizedNodeChange;
|
|
4607
4854
|
}
|
|
4608
4855
|
doAddGroup(group, location = [0], size) {
|
|
4609
4856
|
this.gridview.addView(group, size !== null && size !== void 0 ? size : exports.Sizing.Distribute, location);
|
|
4610
|
-
this.
|
|
4611
|
-
this.doSetGroupActive(group);
|
|
4857
|
+
this._onDidAdd.fire(group);
|
|
4612
4858
|
}
|
|
4613
4859
|
doRemoveGroup(group, options) {
|
|
4614
4860
|
if (!this._groups.has(group.id)) {
|
|
@@ -4620,8 +4866,8 @@
|
|
|
4620
4866
|
item.disposable.dispose();
|
|
4621
4867
|
item.value.dispose();
|
|
4622
4868
|
this._groups.delete(group.id);
|
|
4869
|
+
this._onDidRemove.fire(group);
|
|
4623
4870
|
}
|
|
4624
|
-
this._onDidRemoveGroup.fire(group);
|
|
4625
4871
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
4626
4872
|
const groups = Array.from(this._groups.values());
|
|
4627
4873
|
this.doSetGroupActive(groups.length > 0 ? groups[0].value : undefined);
|
|
@@ -4632,25 +4878,18 @@
|
|
|
4632
4878
|
var _a;
|
|
4633
4879
|
return (_a = this._groups.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
4634
4880
|
}
|
|
4635
|
-
doSetGroupActive(group
|
|
4636
|
-
var _a, _b, _c;
|
|
4881
|
+
doSetGroupActive(group) {
|
|
4637
4882
|
if (this._activeGroup === group) {
|
|
4638
4883
|
return;
|
|
4639
4884
|
}
|
|
4640
4885
|
if (this._activeGroup) {
|
|
4641
4886
|
this._activeGroup.setActive(false);
|
|
4642
|
-
if (!skipFocus) {
|
|
4643
|
-
(_b = (_a = this._activeGroup).focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4644
|
-
}
|
|
4645
4887
|
}
|
|
4646
4888
|
if (group) {
|
|
4647
4889
|
group.setActive(true);
|
|
4648
|
-
if (!skipFocus) {
|
|
4649
|
-
(_c = group.focus) === null || _c === void 0 ? void 0 : _c.call(group);
|
|
4650
|
-
}
|
|
4651
4890
|
}
|
|
4652
4891
|
this._activeGroup = group;
|
|
4653
|
-
this.
|
|
4892
|
+
this._onDidActiveChange.fire(group);
|
|
4654
4893
|
}
|
|
4655
4894
|
removeGroup(group) {
|
|
4656
4895
|
this.doRemoveGroup(group);
|
|
@@ -4695,9 +4934,9 @@
|
|
|
4695
4934
|
this.gridview.layout(width, height);
|
|
4696
4935
|
}
|
|
4697
4936
|
dispose() {
|
|
4698
|
-
this.
|
|
4699
|
-
this.
|
|
4700
|
-
this.
|
|
4937
|
+
this._onDidActiveChange.dispose();
|
|
4938
|
+
this._onDidAdd.dispose();
|
|
4939
|
+
this._onDidRemove.dispose();
|
|
4701
4940
|
this._onDidLayoutChange.dispose();
|
|
4702
4941
|
for (const group of this.groups) {
|
|
4703
4942
|
group.dispose();
|
|
@@ -4707,11 +4946,15 @@
|
|
|
4707
4946
|
}
|
|
4708
4947
|
}
|
|
4709
4948
|
|
|
4949
|
+
class WillFocusEvent extends DockviewEvent {
|
|
4950
|
+
constructor() {
|
|
4951
|
+
super();
|
|
4952
|
+
}
|
|
4953
|
+
}
|
|
4710
4954
|
/**
|
|
4711
4955
|
* A core api implementation that should be used across all panel-like objects
|
|
4712
4956
|
*/
|
|
4713
4957
|
class PanelApiImpl extends CompositeDisposable {
|
|
4714
|
-
//
|
|
4715
4958
|
get isFocused() {
|
|
4716
4959
|
return this._isFocused;
|
|
4717
4960
|
}
|
|
@@ -4721,6 +4964,9 @@
|
|
|
4721
4964
|
get isVisible() {
|
|
4722
4965
|
return this._isVisible;
|
|
4723
4966
|
}
|
|
4967
|
+
get isHidden() {
|
|
4968
|
+
return this._isHidden;
|
|
4969
|
+
}
|
|
4724
4970
|
get width() {
|
|
4725
4971
|
return this._width;
|
|
4726
4972
|
}
|
|
@@ -4733,38 +4979,26 @@
|
|
|
4733
4979
|
this._isFocused = false;
|
|
4734
4980
|
this._isActive = false;
|
|
4735
4981
|
this._isVisible = true;
|
|
4982
|
+
this._isHidden = false;
|
|
4736
4983
|
this._width = 0;
|
|
4737
4984
|
this._height = 0;
|
|
4738
4985
|
this.panelUpdatesDisposable = new MutableDisposable();
|
|
4739
|
-
this._onDidDimensionChange = new Emitter(
|
|
4740
|
-
replay: true,
|
|
4741
|
-
});
|
|
4986
|
+
this._onDidDimensionChange = new Emitter();
|
|
4742
4987
|
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
4743
|
-
|
|
4744
|
-
this._onDidChangeFocus = new Emitter({
|
|
4745
|
-
replay: true,
|
|
4746
|
-
});
|
|
4988
|
+
this._onDidChangeFocus = new Emitter();
|
|
4747
4989
|
this.onDidFocusChange = this._onDidChangeFocus.event;
|
|
4748
4990
|
//
|
|
4749
|
-
this.
|
|
4750
|
-
this.
|
|
4991
|
+
this._onWillFocus = new Emitter();
|
|
4992
|
+
this.onWillFocus = this._onWillFocus.event;
|
|
4751
4993
|
//
|
|
4752
|
-
this._onDidVisibilityChange = new Emitter(
|
|
4753
|
-
replay: true,
|
|
4754
|
-
});
|
|
4994
|
+
this._onDidVisibilityChange = new Emitter();
|
|
4755
4995
|
this.onDidVisibilityChange = this._onDidVisibilityChange.event;
|
|
4756
|
-
|
|
4757
|
-
this.
|
|
4758
|
-
this.
|
|
4759
|
-
//
|
|
4760
|
-
this._onDidActiveChange = new Emitter({
|
|
4761
|
-
replay: true,
|
|
4762
|
-
});
|
|
4996
|
+
this._onDidHiddenChange = new Emitter();
|
|
4997
|
+
this.onDidHiddenChange = this._onDidHiddenChange.event;
|
|
4998
|
+
this._onDidActiveChange = new Emitter();
|
|
4763
4999
|
this.onDidActiveChange = this._onDidActiveChange.event;
|
|
4764
|
-
//
|
|
4765
5000
|
this._onActiveChange = new Emitter();
|
|
4766
5001
|
this.onActiveChange = this._onActiveChange.event;
|
|
4767
|
-
//
|
|
4768
5002
|
this._onUpdateParameters = new Emitter();
|
|
4769
5003
|
this.onUpdateParameters = this._onUpdateParameters.event;
|
|
4770
5004
|
this.addDisposables(this.onDidFocusChange((event) => {
|
|
@@ -4773,10 +5007,12 @@
|
|
|
4773
5007
|
this._isActive = event.isActive;
|
|
4774
5008
|
}), this.onDidVisibilityChange((event) => {
|
|
4775
5009
|
this._isVisible = event.isVisible;
|
|
5010
|
+
}), this.onDidHiddenChange((event) => {
|
|
5011
|
+
this._isHidden = event.isHidden;
|
|
4776
5012
|
}), this.onDidDimensionsChange((event) => {
|
|
4777
5013
|
this._width = event.width;
|
|
4778
5014
|
this._height = event.height;
|
|
4779
|
-
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this.
|
|
5015
|
+
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onUpdateParameters, this._onWillFocus, this._onDidHiddenChange, this._onUpdateParameters);
|
|
4780
5016
|
}
|
|
4781
5017
|
initialize(panel) {
|
|
4782
5018
|
this.panelUpdatesDisposable.value = this._onUpdateParameters.event((parameters) => {
|
|
@@ -4785,8 +5021,8 @@
|
|
|
4785
5021
|
});
|
|
4786
5022
|
});
|
|
4787
5023
|
}
|
|
4788
|
-
|
|
4789
|
-
this.
|
|
5024
|
+
setHidden(isHidden) {
|
|
5025
|
+
this._onDidHiddenChange.fire({ isHidden });
|
|
4790
5026
|
}
|
|
4791
5027
|
setActive() {
|
|
4792
5028
|
this._onActiveChange.fire();
|
|
@@ -4794,9 +5030,6 @@
|
|
|
4794
5030
|
updateParameters(parameters) {
|
|
4795
5031
|
this._onUpdateParameters.fire(parameters);
|
|
4796
5032
|
}
|
|
4797
|
-
dispose() {
|
|
4798
|
-
super.dispose();
|
|
4799
|
-
}
|
|
4800
5033
|
}
|
|
4801
5034
|
|
|
4802
5035
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
@@ -4884,7 +5117,12 @@
|
|
|
4884
5117
|
}), focusTracker);
|
|
4885
5118
|
}
|
|
4886
5119
|
focus() {
|
|
4887
|
-
|
|
5120
|
+
const event = new WillFocusEvent();
|
|
5121
|
+
this.api._onWillFocus.fire(event);
|
|
5122
|
+
if (event.defaultPrevented) {
|
|
5123
|
+
return;
|
|
5124
|
+
}
|
|
5125
|
+
this._element.focus();
|
|
4888
5126
|
}
|
|
4889
5127
|
layout(width, height) {
|
|
4890
5128
|
this._width = width;
|
|
@@ -5213,9 +5451,7 @@
|
|
|
5213
5451
|
super(id);
|
|
5214
5452
|
this._onDidConstraintsChangeInternal = new Emitter();
|
|
5215
5453
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
5216
|
-
this._onDidConstraintsChange = new Emitter(
|
|
5217
|
-
replay: true,
|
|
5218
|
-
});
|
|
5454
|
+
this._onDidConstraintsChange = new Emitter();
|
|
5219
5455
|
this.onDidConstraintsChange = this._onDidConstraintsChange.event;
|
|
5220
5456
|
this._onDidSizeChange = new Emitter();
|
|
5221
5457
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
@@ -5308,13 +5544,13 @@
|
|
|
5308
5544
|
this._maximumHeight = options.maximumHeight;
|
|
5309
5545
|
}
|
|
5310
5546
|
this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
|
|
5311
|
-
this.addDisposables(this.api.
|
|
5312
|
-
const {
|
|
5547
|
+
this.addDisposables(this.api.onDidHiddenChange((event) => {
|
|
5548
|
+
const { isHidden } = event;
|
|
5313
5549
|
const { accessor } = this._params;
|
|
5314
|
-
accessor.setVisible(this,
|
|
5550
|
+
accessor.setVisible(this, !isHidden);
|
|
5315
5551
|
}), this.api.onActiveChange(() => {
|
|
5316
5552
|
const { accessor } = this._params;
|
|
5317
|
-
accessor.
|
|
5553
|
+
accessor.doSetGroupActive(this);
|
|
5318
5554
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
5319
5555
|
if (typeof event.minimumWidth === 'number' ||
|
|
5320
5556
|
typeof event.minimumWidth === 'function') {
|
|
@@ -5397,6 +5633,17 @@
|
|
|
5397
5633
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
5398
5634
|
this.addDisposables(this._onDidLocationChange);
|
|
5399
5635
|
}
|
|
5636
|
+
close() {
|
|
5637
|
+
if (!this._group) {
|
|
5638
|
+
return;
|
|
5639
|
+
}
|
|
5640
|
+
return this.accessor.removeGroup(this._group);
|
|
5641
|
+
}
|
|
5642
|
+
getWindow() {
|
|
5643
|
+
return this.location.type === 'popout'
|
|
5644
|
+
? this.location.getWindow()
|
|
5645
|
+
: window;
|
|
5646
|
+
}
|
|
5400
5647
|
moveTo(options) {
|
|
5401
5648
|
var _a, _b, _c;
|
|
5402
5649
|
if (!this._group) {
|
|
@@ -5404,14 +5651,23 @@
|
|
|
5404
5651
|
}
|
|
5405
5652
|
const group = (_a = options.group) !== null && _a !== void 0 ? _a : this.accessor.addGroup({
|
|
5406
5653
|
direction: positionToDirection((_b = options.position) !== null && _b !== void 0 ? _b : 'right'),
|
|
5654
|
+
skipSetActive: true,
|
|
5655
|
+
});
|
|
5656
|
+
this.accessor.moveGroupOrPanel({
|
|
5657
|
+
from: { groupId: this._group.id },
|
|
5658
|
+
to: {
|
|
5659
|
+
group,
|
|
5660
|
+
position: options.group
|
|
5661
|
+
? (_c = options.position) !== null && _c !== void 0 ? _c : 'center'
|
|
5662
|
+
: 'center',
|
|
5663
|
+
},
|
|
5407
5664
|
});
|
|
5408
|
-
this.accessor.moveGroupOrPanel(group, this._group.id, undefined, options.group ? (_c = options.position) !== null && _c !== void 0 ? _c : 'center' : 'center');
|
|
5409
5665
|
}
|
|
5410
5666
|
maximize() {
|
|
5411
5667
|
if (!this._group) {
|
|
5412
5668
|
throw new Error(NOT_INITIALIZED_MESSAGE);
|
|
5413
5669
|
}
|
|
5414
|
-
if (this.location !== 'grid') {
|
|
5670
|
+
if (this.location.type !== 'grid') {
|
|
5415
5671
|
// only grid groups can be maximized
|
|
5416
5672
|
return;
|
|
5417
5673
|
}
|
|
@@ -5468,6 +5724,12 @@
|
|
|
5468
5724
|
this.api.initialize(this); // cannot use 'this' after after 'super' call
|
|
5469
5725
|
this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
|
|
5470
5726
|
}
|
|
5727
|
+
focus() {
|
|
5728
|
+
if (!this.api.isActive) {
|
|
5729
|
+
this.api.setActive();
|
|
5730
|
+
}
|
|
5731
|
+
super.focus();
|
|
5732
|
+
}
|
|
5471
5733
|
initialize() {
|
|
5472
5734
|
this._model.initialize();
|
|
5473
5735
|
}
|
|
@@ -5513,6 +5775,9 @@
|
|
|
5513
5775
|
}
|
|
5514
5776
|
|
|
5515
5777
|
class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
5778
|
+
get location() {
|
|
5779
|
+
return this.group.api.location;
|
|
5780
|
+
}
|
|
5516
5781
|
get title() {
|
|
5517
5782
|
return this.panel.title;
|
|
5518
5783
|
}
|
|
@@ -5524,15 +5789,34 @@
|
|
|
5524
5789
|
}
|
|
5525
5790
|
set group(value) {
|
|
5526
5791
|
const isOldGroupActive = this.isGroupActive;
|
|
5527
|
-
this._group
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5792
|
+
if (this._group !== value) {
|
|
5793
|
+
this._group = value;
|
|
5794
|
+
this._onDidGroupChange.fire({});
|
|
5795
|
+
let _trackGroupActive = isOldGroupActive; // prevent duplicate events with same state
|
|
5796
|
+
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidLocationChange((event) => {
|
|
5797
|
+
if (this.group !== this.panel.group) {
|
|
5798
|
+
return;
|
|
5799
|
+
}
|
|
5800
|
+
this._onDidLocationChange.fire(event);
|
|
5801
|
+
}), this.group.api.onDidActiveChange(() => {
|
|
5802
|
+
if (this.group !== this.panel.group) {
|
|
5803
|
+
return;
|
|
5804
|
+
}
|
|
5805
|
+
if (_trackGroupActive !== this.isGroupActive) {
|
|
5806
|
+
_trackGroupActive = this.isGroupActive;
|
|
5807
|
+
this._onDidActiveGroupChange.fire({
|
|
5808
|
+
isActive: this.isGroupActive,
|
|
5809
|
+
});
|
|
5810
|
+
}
|
|
5811
|
+
}));
|
|
5812
|
+
// if (this.isGroupActive !== isOldGroupActive) {
|
|
5813
|
+
// this._onDidActiveGroupChange.fire({
|
|
5814
|
+
// isActive: this.isGroupActive,
|
|
5815
|
+
// });
|
|
5816
|
+
// }
|
|
5817
|
+
this._onDidLocationChange.fire({
|
|
5818
|
+
location: this.group.api.location,
|
|
5532
5819
|
});
|
|
5533
|
-
if (this.isGroupActive !== isOldGroupActive) {
|
|
5534
|
-
this._onDidActiveGroupChange.fire();
|
|
5535
|
-
}
|
|
5536
5820
|
}
|
|
5537
5821
|
}
|
|
5538
5822
|
get group() {
|
|
@@ -5550,14 +5834,26 @@
|
|
|
5550
5834
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
5551
5835
|
this._onDidRendererChange = new Emitter();
|
|
5552
5836
|
this.onDidRendererChange = this._onDidRendererChange.event;
|
|
5553
|
-
this.
|
|
5837
|
+
this._onDidLocationChange = new Emitter();
|
|
5838
|
+
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
5839
|
+
this.groupEventsDisposable = new MutableDisposable();
|
|
5554
5840
|
this.initialize(panel);
|
|
5555
5841
|
this._group = group;
|
|
5556
|
-
this.addDisposables(this.
|
|
5842
|
+
this.addDisposables(this.groupEventsDisposable, this._onDidRendererChange, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange, this._onDidLocationChange);
|
|
5843
|
+
}
|
|
5844
|
+
getWindow() {
|
|
5845
|
+
return this.group.api.getWindow();
|
|
5557
5846
|
}
|
|
5558
5847
|
moveTo(options) {
|
|
5559
5848
|
var _a;
|
|
5560
|
-
this.accessor.moveGroupOrPanel(
|
|
5849
|
+
this.accessor.moveGroupOrPanel({
|
|
5850
|
+
from: { groupId: this._group.id, panelId: this.panel.id },
|
|
5851
|
+
to: {
|
|
5852
|
+
group: options.group,
|
|
5853
|
+
position: (_a = options.position) !== null && _a !== void 0 ? _a : 'center',
|
|
5854
|
+
index: options.index,
|
|
5855
|
+
},
|
|
5856
|
+
});
|
|
5561
5857
|
}
|
|
5562
5858
|
setTitle(title) {
|
|
5563
5859
|
this.panel.setTitle(title);
|
|
@@ -5618,7 +5914,14 @@
|
|
|
5618
5914
|
this.setTitle(params.title);
|
|
5619
5915
|
}
|
|
5620
5916
|
focus() {
|
|
5621
|
-
|
|
5917
|
+
const event = new WillFocusEvent();
|
|
5918
|
+
this.api._onWillFocus.fire(event);
|
|
5919
|
+
if (event.defaultPrevented) {
|
|
5920
|
+
return;
|
|
5921
|
+
}
|
|
5922
|
+
if (!this.api.isActive) {
|
|
5923
|
+
this.api.setActive();
|
|
5924
|
+
}
|
|
5622
5925
|
}
|
|
5623
5926
|
toJSON() {
|
|
5624
5927
|
return {
|
|
@@ -5675,20 +5978,40 @@
|
|
|
5675
5978
|
},
|
|
5676
5979
|
});
|
|
5677
5980
|
}
|
|
5678
|
-
updateParentGroup(group,
|
|
5981
|
+
updateParentGroup(group, options) {
|
|
5679
5982
|
this._group = group;
|
|
5680
|
-
this.api.group =
|
|
5983
|
+
this.api.group = this._group;
|
|
5681
5984
|
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
5682
|
-
this.api.
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5985
|
+
const isActive = this.group.api.isActive && isPanelVisible;
|
|
5986
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipSetActive)) {
|
|
5987
|
+
if (this.api.isActive !== isActive) {
|
|
5988
|
+
this.api._onDidActiveChange.fire({
|
|
5989
|
+
isActive: this.group.api.isActive && isPanelVisible,
|
|
5990
|
+
});
|
|
5991
|
+
}
|
|
5992
|
+
}
|
|
5993
|
+
if (this.api.isVisible !== isPanelVisible) {
|
|
5994
|
+
this.api._onDidVisibilityChange.fire({
|
|
5995
|
+
isVisible: isPanelVisible,
|
|
5996
|
+
});
|
|
5997
|
+
}
|
|
5998
|
+
}
|
|
5999
|
+
runEvents() {
|
|
6000
|
+
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
6001
|
+
const isActive = this.group.api.isActive && isPanelVisible;
|
|
6002
|
+
if (this.api.isActive !== isActive) {
|
|
6003
|
+
this.api._onDidActiveChange.fire({
|
|
6004
|
+
isActive: this.group.api.isActive && isPanelVisible,
|
|
6005
|
+
});
|
|
6006
|
+
}
|
|
6007
|
+
if (this.api.isVisible !== isPanelVisible) {
|
|
6008
|
+
this.api._onDidVisibilityChange.fire({
|
|
6009
|
+
isVisible: isPanelVisible,
|
|
6010
|
+
});
|
|
6011
|
+
}
|
|
5689
6012
|
}
|
|
5690
6013
|
layout(width, height) {
|
|
5691
|
-
//
|
|
6014
|
+
// TODO: Can we somehow do height without header height or indicate what the header height is?
|
|
5692
6015
|
this.api._onDidDimensionChange.fire({
|
|
5693
6016
|
width,
|
|
5694
6017
|
height: height,
|
|
@@ -5810,8 +6133,6 @@
|
|
|
5810
6133
|
this.id = id;
|
|
5811
6134
|
this.contentComponent = contentComponent;
|
|
5812
6135
|
this.tabComponent = tabComponent;
|
|
5813
|
-
this._group = null;
|
|
5814
|
-
this._isPanelVisible = null;
|
|
5815
6136
|
this._content = this.createContentComponent(this.id, contentComponent);
|
|
5816
6137
|
this._tab = this.createTabComponent(this.id, tabComponent);
|
|
5817
6138
|
}
|
|
@@ -5819,25 +6140,8 @@
|
|
|
5819
6140
|
this.content.init(Object.assign(Object.assign({}, params), { tab: this.tab }));
|
|
5820
6141
|
this.tab.init(params);
|
|
5821
6142
|
}
|
|
5822
|
-
updateParentGroup(
|
|
5823
|
-
|
|
5824
|
-
this._group = group;
|
|
5825
|
-
if (this._content.onGroupChange) {
|
|
5826
|
-
this._content.onGroupChange(group);
|
|
5827
|
-
}
|
|
5828
|
-
if (this._tab.onGroupChange) {
|
|
5829
|
-
this._tab.onGroupChange(group);
|
|
5830
|
-
}
|
|
5831
|
-
}
|
|
5832
|
-
if (isPanelVisible !== this._isPanelVisible) {
|
|
5833
|
-
this._isPanelVisible = isPanelVisible;
|
|
5834
|
-
if (this._content.onPanelVisibleChange) {
|
|
5835
|
-
this._content.onPanelVisibleChange(isPanelVisible);
|
|
5836
|
-
}
|
|
5837
|
-
if (this._tab.onPanelVisibleChange) {
|
|
5838
|
-
this._tab.onPanelVisibleChange(isPanelVisible);
|
|
5839
|
-
}
|
|
5840
|
-
}
|
|
6143
|
+
updateParentGroup(_group, _isPanelVisible) {
|
|
6144
|
+
// noop
|
|
5841
6145
|
}
|
|
5842
6146
|
layout(width, height) {
|
|
5843
6147
|
var _a, _b;
|
|
@@ -6270,117 +6574,6 @@
|
|
|
6270
6574
|
}
|
|
6271
6575
|
}
|
|
6272
6576
|
|
|
6273
|
-
class PopoutWindow extends CompositeDisposable {
|
|
6274
|
-
constructor(id, className, options) {
|
|
6275
|
-
super();
|
|
6276
|
-
this.id = id;
|
|
6277
|
-
this.className = className;
|
|
6278
|
-
this.options = options;
|
|
6279
|
-
this._onDidClose = new Emitter();
|
|
6280
|
-
this.onDidClose = this._onDidClose.event;
|
|
6281
|
-
this._window = null;
|
|
6282
|
-
this.addDisposables(this._onDidClose, {
|
|
6283
|
-
dispose: () => {
|
|
6284
|
-
this.close();
|
|
6285
|
-
},
|
|
6286
|
-
});
|
|
6287
|
-
}
|
|
6288
|
-
dimensions() {
|
|
6289
|
-
if (!this._window) {
|
|
6290
|
-
return null;
|
|
6291
|
-
}
|
|
6292
|
-
const left = this._window.value.screenX;
|
|
6293
|
-
const top = this._window.value.screenY;
|
|
6294
|
-
const width = this._window.value.innerWidth;
|
|
6295
|
-
const height = this._window.value.innerHeight;
|
|
6296
|
-
return { top, left, width, height };
|
|
6297
|
-
}
|
|
6298
|
-
close() {
|
|
6299
|
-
if (this._window) {
|
|
6300
|
-
this._window.disposable.dispose();
|
|
6301
|
-
this._window.value.close();
|
|
6302
|
-
this._window = null;
|
|
6303
|
-
}
|
|
6304
|
-
}
|
|
6305
|
-
open(content) {
|
|
6306
|
-
if (this._window) {
|
|
6307
|
-
throw new Error('instance of popout window is already open');
|
|
6308
|
-
}
|
|
6309
|
-
const url = `${this.options.url}`;
|
|
6310
|
-
const features = Object.entries({
|
|
6311
|
-
top: this.options.top,
|
|
6312
|
-
left: this.options.left,
|
|
6313
|
-
width: this.options.width,
|
|
6314
|
-
height: this.options.height,
|
|
6315
|
-
})
|
|
6316
|
-
.map(([key, value]) => `${key}=${value}`)
|
|
6317
|
-
.join(',');
|
|
6318
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Window/open
|
|
6319
|
-
const externalWindow = window.open(url, this.id, features);
|
|
6320
|
-
if (!externalWindow) {
|
|
6321
|
-
return;
|
|
6322
|
-
}
|
|
6323
|
-
const disposable = new CompositeDisposable();
|
|
6324
|
-
this._window = { value: externalWindow, disposable };
|
|
6325
|
-
const cleanUp = () => {
|
|
6326
|
-
this._onDidClose.fire();
|
|
6327
|
-
this._window = null;
|
|
6328
|
-
};
|
|
6329
|
-
// prevent any default content from loading
|
|
6330
|
-
// externalWindow.document.body.replaceWith(document.createElement('div'));
|
|
6331
|
-
disposable.addDisposables(addDisposableWindowListener(window, 'beforeunload', () => {
|
|
6332
|
-
cleanUp();
|
|
6333
|
-
this.close();
|
|
6334
|
-
}));
|
|
6335
|
-
externalWindow.addEventListener('load', () => {
|
|
6336
|
-
const externalDocument = externalWindow.document;
|
|
6337
|
-
externalDocument.title = document.title;
|
|
6338
|
-
const div = document.createElement('div');
|
|
6339
|
-
div.classList.add('dv-popout-window');
|
|
6340
|
-
div.style.position = 'absolute';
|
|
6341
|
-
div.style.width = '100%';
|
|
6342
|
-
div.style.height = '100%';
|
|
6343
|
-
div.style.top = '0px';
|
|
6344
|
-
div.style.left = '0px';
|
|
6345
|
-
div.classList.add(this.className);
|
|
6346
|
-
div.appendChild(content);
|
|
6347
|
-
externalDocument.body.replaceChildren(div);
|
|
6348
|
-
externalDocument.body.classList.add(this.className);
|
|
6349
|
-
addStyles(externalDocument, window.document.styleSheets);
|
|
6350
|
-
externalWindow.addEventListener('beforeunload', () => {
|
|
6351
|
-
// TODO: indicate external window is closing
|
|
6352
|
-
cleanUp();
|
|
6353
|
-
});
|
|
6354
|
-
});
|
|
6355
|
-
}
|
|
6356
|
-
}
|
|
6357
|
-
|
|
6358
|
-
class DockviewPopoutGroupPanel extends CompositeDisposable {
|
|
6359
|
-
constructor(id, group, options) {
|
|
6360
|
-
var _a;
|
|
6361
|
-
super();
|
|
6362
|
-
this.id = id;
|
|
6363
|
-
this.group = group;
|
|
6364
|
-
this.options = options;
|
|
6365
|
-
this.window = new PopoutWindow(id, (_a = options.className) !== null && _a !== void 0 ? _a : '', {
|
|
6366
|
-
url: this.options.popoutUrl,
|
|
6367
|
-
left: this.options.box.left,
|
|
6368
|
-
top: this.options.box.top,
|
|
6369
|
-
width: this.options.box.width,
|
|
6370
|
-
height: this.options.box.height,
|
|
6371
|
-
});
|
|
6372
|
-
group.model.location = 'popout';
|
|
6373
|
-
this.addDisposables(this.window, {
|
|
6374
|
-
dispose: () => {
|
|
6375
|
-
group.model.location = 'grid';
|
|
6376
|
-
},
|
|
6377
|
-
}, this.window.onDidClose(() => {
|
|
6378
|
-
this.dispose();
|
|
6379
|
-
}));
|
|
6380
|
-
this.window.open(group.element);
|
|
6381
|
-
}
|
|
6382
|
-
}
|
|
6383
|
-
|
|
6384
6577
|
const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
|
|
6385
6578
|
const DEFAULT_FLOATING_GROUP_POSITION = { left: 100, top: 100 };
|
|
6386
6579
|
|
|
@@ -6394,11 +6587,13 @@
|
|
|
6394
6587
|
super();
|
|
6395
6588
|
this.element = element;
|
|
6396
6589
|
this.map = {};
|
|
6590
|
+
this._disposed = false;
|
|
6397
6591
|
this.addDisposables(Disposable.from(() => {
|
|
6398
6592
|
for (const value of Object.values(this.map)) {
|
|
6399
6593
|
value.disposable.dispose();
|
|
6400
6594
|
value.destroy.dispose();
|
|
6401
6595
|
}
|
|
6596
|
+
this._disposed = true;
|
|
6402
6597
|
}));
|
|
6403
6598
|
}
|
|
6404
6599
|
detatch(panel) {
|
|
@@ -6438,7 +6633,7 @@
|
|
|
6438
6633
|
focusContainer.style.top = `${box.top - box2.top}px`;
|
|
6439
6634
|
focusContainer.style.width = `${box.width}px`;
|
|
6440
6635
|
focusContainer.style.height = `${box.height}px`;
|
|
6441
|
-
toggleClass(focusContainer, 'dv-render-overlay-float', panel.group.api.location === 'floating');
|
|
6636
|
+
toggleClass(focusContainer, 'dv-render-overlay-float', panel.group.api.location.type === 'floating');
|
|
6442
6637
|
};
|
|
6443
6638
|
const visibilityChanged = () => {
|
|
6444
6639
|
if (panel.api.isVisible) {
|
|
@@ -6484,8 +6679,11 @@
|
|
|
6484
6679
|
resize();
|
|
6485
6680
|
}));
|
|
6486
6681
|
this.map[panel.api.id].destroy = Disposable.from(() => {
|
|
6487
|
-
|
|
6488
|
-
|
|
6682
|
+
var _a;
|
|
6683
|
+
if (panel.view.content.element.parentElement === focusContainer) {
|
|
6684
|
+
focusContainer.removeChild(panel.view.content.element);
|
|
6685
|
+
}
|
|
6686
|
+
(_a = focusContainer.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(focusContainer);
|
|
6489
6687
|
});
|
|
6490
6688
|
queueMicrotask(() => {
|
|
6491
6689
|
if (this.isDisposed) {
|
|
@@ -6506,11 +6704,187 @@
|
|
|
6506
6704
|
}
|
|
6507
6705
|
}
|
|
6508
6706
|
|
|
6707
|
+
/******************************************************************************
|
|
6708
|
+
Copyright (c) Microsoft Corporation.
|
|
6709
|
+
|
|
6710
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6711
|
+
purpose with or without fee is hereby granted.
|
|
6712
|
+
|
|
6713
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
6714
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
6715
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
6716
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
6717
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
6718
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
6719
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
6720
|
+
***************************************************************************** */
|
|
6721
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
6722
|
+
|
|
6723
|
+
|
|
6724
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
6725
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6726
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6727
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6728
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6729
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6730
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6731
|
+
});
|
|
6732
|
+
}
|
|
6733
|
+
|
|
6734
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
6735
|
+
var e = new Error(message);
|
|
6736
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
6737
|
+
};
|
|
6738
|
+
|
|
6739
|
+
class PopoutWindow extends CompositeDisposable {
|
|
6740
|
+
get window() {
|
|
6741
|
+
var _a, _b;
|
|
6742
|
+
return (_b = (_a = this._window) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null;
|
|
6743
|
+
}
|
|
6744
|
+
constructor(target, className, options) {
|
|
6745
|
+
super();
|
|
6746
|
+
this.target = target;
|
|
6747
|
+
this.className = className;
|
|
6748
|
+
this.options = options;
|
|
6749
|
+
this._onWillClose = new Emitter();
|
|
6750
|
+
this.onWillClose = this._onWillClose.event;
|
|
6751
|
+
this._onDidClose = new Emitter();
|
|
6752
|
+
this.onDidClose = this._onDidClose.event;
|
|
6753
|
+
this._window = null;
|
|
6754
|
+
this.addDisposables(this._onWillClose, this._onDidClose, {
|
|
6755
|
+
dispose: () => {
|
|
6756
|
+
this.close();
|
|
6757
|
+
},
|
|
6758
|
+
});
|
|
6759
|
+
}
|
|
6760
|
+
dimensions() {
|
|
6761
|
+
if (!this._window) {
|
|
6762
|
+
return null;
|
|
6763
|
+
}
|
|
6764
|
+
const left = this._window.value.screenX;
|
|
6765
|
+
const top = this._window.value.screenY;
|
|
6766
|
+
const width = this._window.value.innerWidth;
|
|
6767
|
+
const height = this._window.value.innerHeight;
|
|
6768
|
+
return { top, left, width, height };
|
|
6769
|
+
}
|
|
6770
|
+
close() {
|
|
6771
|
+
var _a, _b;
|
|
6772
|
+
if (this._window) {
|
|
6773
|
+
this._onWillClose.fire();
|
|
6774
|
+
(_b = (_a = this.options).onWillClose) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
6775
|
+
id: this.target,
|
|
6776
|
+
window: this._window.value,
|
|
6777
|
+
});
|
|
6778
|
+
this._window.disposable.dispose();
|
|
6779
|
+
this._window.value.close();
|
|
6780
|
+
this._window = null;
|
|
6781
|
+
this._onDidClose.fire();
|
|
6782
|
+
}
|
|
6783
|
+
}
|
|
6784
|
+
open() {
|
|
6785
|
+
var _a, _b;
|
|
6786
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6787
|
+
if (this._window) {
|
|
6788
|
+
throw new Error('instance of popout window is already open');
|
|
6789
|
+
}
|
|
6790
|
+
const url = `${this.options.url}`;
|
|
6791
|
+
const features = Object.entries({
|
|
6792
|
+
top: this.options.top,
|
|
6793
|
+
left: this.options.left,
|
|
6794
|
+
width: this.options.width,
|
|
6795
|
+
height: this.options.height,
|
|
6796
|
+
})
|
|
6797
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
6798
|
+
.join(',');
|
|
6799
|
+
/**
|
|
6800
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/open
|
|
6801
|
+
*/
|
|
6802
|
+
const externalWindow = window.open(url, this.target, features);
|
|
6803
|
+
if (!externalWindow) {
|
|
6804
|
+
/**
|
|
6805
|
+
* Popup blocked
|
|
6806
|
+
*/
|
|
6807
|
+
return null;
|
|
6808
|
+
}
|
|
6809
|
+
const disposable = new CompositeDisposable();
|
|
6810
|
+
this._window = { value: externalWindow, disposable };
|
|
6811
|
+
disposable.addDisposables(addDisposableWindowListener(window, 'beforeunload', () => {
|
|
6812
|
+
/**
|
|
6813
|
+
* before the main window closes we should close this popup too
|
|
6814
|
+
* to be good citizens
|
|
6815
|
+
*
|
|
6816
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
6817
|
+
*/
|
|
6818
|
+
this.close();
|
|
6819
|
+
}));
|
|
6820
|
+
const container = this.createPopoutWindowContainer();
|
|
6821
|
+
if (this.className) {
|
|
6822
|
+
container.classList.add(this.className);
|
|
6823
|
+
}
|
|
6824
|
+
(_b = (_a = this.options).onDidOpen) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
6825
|
+
id: this.target,
|
|
6826
|
+
window: externalWindow,
|
|
6827
|
+
});
|
|
6828
|
+
return new Promise((resolve) => {
|
|
6829
|
+
externalWindow.addEventListener('unload', (e) => {
|
|
6830
|
+
// if page fails to load before unloading
|
|
6831
|
+
// this.close();
|
|
6832
|
+
});
|
|
6833
|
+
externalWindow.addEventListener('load', () => {
|
|
6834
|
+
/**
|
|
6835
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
|
|
6836
|
+
*/
|
|
6837
|
+
const externalDocument = externalWindow.document;
|
|
6838
|
+
externalDocument.title = document.title;
|
|
6839
|
+
externalDocument.body.appendChild(container);
|
|
6840
|
+
addStyles(externalDocument, window.document.styleSheets);
|
|
6841
|
+
/**
|
|
6842
|
+
* beforeunload must be registered after load for reasons I could not determine
|
|
6843
|
+
* otherwise the beforeunload event will not fire when the window is closed
|
|
6844
|
+
*/
|
|
6845
|
+
addDisposableWindowListener(externalWindow, 'beforeunload', () => {
|
|
6846
|
+
/**
|
|
6847
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
6848
|
+
*/
|
|
6849
|
+
this.close();
|
|
6850
|
+
});
|
|
6851
|
+
resolve(container);
|
|
6852
|
+
});
|
|
6853
|
+
});
|
|
6854
|
+
});
|
|
6855
|
+
}
|
|
6856
|
+
createPopoutWindowContainer() {
|
|
6857
|
+
const el = document.createElement('div');
|
|
6858
|
+
el.classList.add('dv-popout-window');
|
|
6859
|
+
el.id = 'dv-popout-window';
|
|
6860
|
+
el.style.position = 'absolute';
|
|
6861
|
+
el.style.width = '100%';
|
|
6862
|
+
el.style.height = '100%';
|
|
6863
|
+
el.style.top = '0px';
|
|
6864
|
+
el.style.left = '0px';
|
|
6865
|
+
return el;
|
|
6866
|
+
}
|
|
6867
|
+
}
|
|
6868
|
+
|
|
6509
6869
|
const DEFAULT_ROOT_OVERLAY_MODEL = {
|
|
6510
6870
|
activationSize: { type: 'pixels', value: 10 },
|
|
6511
6871
|
size: { type: 'pixels', value: 20 },
|
|
6512
6872
|
};
|
|
6513
|
-
function
|
|
6873
|
+
function moveGroupWithoutDestroying(options) {
|
|
6874
|
+
const activePanel = options.from.activePanel;
|
|
6875
|
+
const panels = [...options.from.panels].map((panel) => {
|
|
6876
|
+
const removedPanel = options.from.model.removePanel(panel);
|
|
6877
|
+
options.from.model.renderContainer.detatch(panel);
|
|
6878
|
+
return removedPanel;
|
|
6879
|
+
});
|
|
6880
|
+
panels.forEach((panel) => {
|
|
6881
|
+
options.to.model.openPanel(panel, {
|
|
6882
|
+
skipSetActive: activePanel !== panel,
|
|
6883
|
+
skipSetGroupActive: true,
|
|
6884
|
+
});
|
|
6885
|
+
});
|
|
6886
|
+
}
|
|
6887
|
+
function getDockviewTheme(element) {
|
|
6514
6888
|
function toClassList(element) {
|
|
6515
6889
|
const list = [];
|
|
6516
6890
|
for (let i = 0; i < element.classList.length; i++) {
|
|
@@ -6561,6 +6935,7 @@
|
|
|
6561
6935
|
styles: options.styles,
|
|
6562
6936
|
parentElement: options.parentElement,
|
|
6563
6937
|
disableAutoResizing: options.disableAutoResizing,
|
|
6938
|
+
locked: options.locked,
|
|
6564
6939
|
});
|
|
6565
6940
|
this.nextGroupId = sequentialNumberGenerator();
|
|
6566
6941
|
this._deserializer = new DefaultDockviewDeserialzier(this);
|
|
@@ -6571,6 +6946,10 @@
|
|
|
6571
6946
|
this.onWillDragGroup = this._onWillDragGroup.event;
|
|
6572
6947
|
this._onDidDrop = new Emitter();
|
|
6573
6948
|
this.onDidDrop = this._onDidDrop.event;
|
|
6949
|
+
this._onWillDrop = new Emitter();
|
|
6950
|
+
this.onWillDrop = this._onWillDrop.event;
|
|
6951
|
+
this._onWillShowOverlay = new Emitter();
|
|
6952
|
+
this.onWillShowOverlay = this._onWillShowOverlay.event;
|
|
6574
6953
|
this._onDidRemovePanel = new Emitter();
|
|
6575
6954
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
6576
6955
|
this._onDidAddPanel = new Emitter();
|
|
@@ -6579,15 +6958,36 @@
|
|
|
6579
6958
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
6580
6959
|
this._onDidActivePanelChange = new Emitter();
|
|
6581
6960
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6961
|
+
this._onDidMovePanel = new Emitter();
|
|
6582
6962
|
this._floatingGroups = [];
|
|
6583
6963
|
this._popoutGroups = [];
|
|
6964
|
+
this._ignoreEvents = 0;
|
|
6965
|
+
this._onDidRemoveGroup = new Emitter();
|
|
6966
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
6967
|
+
this._onDidAddGroup = new Emitter();
|
|
6968
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
6969
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
6970
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
6971
|
+
this._moving = false;
|
|
6584
6972
|
const gready = document.createElement('div');
|
|
6585
6973
|
gready.className = 'dv-overlay-render-container';
|
|
6586
6974
|
this.gridview.element.appendChild(gready);
|
|
6587
6975
|
this.overlayRenderContainer = new OverlayRenderContainer(gready);
|
|
6588
6976
|
toggleClass(this.gridview.element, 'dv-dockview', true);
|
|
6589
6977
|
toggleClass(this.element, 'dv-debug', !!options.debug);
|
|
6590
|
-
this.addDisposables(this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop,
|
|
6978
|
+
this.addDisposables(this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this.onDidAdd((event) => {
|
|
6979
|
+
if (!this._moving) {
|
|
6980
|
+
this._onDidAddGroup.fire(event);
|
|
6981
|
+
}
|
|
6982
|
+
}), this.onDidRemove((event) => {
|
|
6983
|
+
if (!this._moving) {
|
|
6984
|
+
this._onDidRemoveGroup.fire(event);
|
|
6985
|
+
}
|
|
6986
|
+
}), this.onDidActiveChange((event) => {
|
|
6987
|
+
if (!this._moving) {
|
|
6988
|
+
this._onDidActiveGroupChange.fire(event);
|
|
6989
|
+
}
|
|
6990
|
+
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove)(() => {
|
|
6591
6991
|
this.updateWatermark();
|
|
6592
6992
|
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
6593
6993
|
this._bufferOnDidLayoutChange.fire();
|
|
@@ -6598,7 +6998,7 @@
|
|
|
6598
6998
|
}
|
|
6599
6999
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
6600
7000
|
for (const group of [...this._popoutGroups]) {
|
|
6601
|
-
group.dispose();
|
|
7001
|
+
group.disposable.dispose();
|
|
6602
7002
|
}
|
|
6603
7003
|
}));
|
|
6604
7004
|
this._options = options;
|
|
@@ -6644,7 +7044,7 @@
|
|
|
6644
7044
|
return this.options.showDndOverlay({
|
|
6645
7045
|
nativeEvent: event,
|
|
6646
7046
|
position: position,
|
|
6647
|
-
target:
|
|
7047
|
+
target: 'edge',
|
|
6648
7048
|
getData: getPanelData,
|
|
6649
7049
|
});
|
|
6650
7050
|
}
|
|
@@ -6655,86 +7055,249 @@
|
|
|
6655
7055
|
});
|
|
6656
7056
|
this.addDisposables(this._rootDropTarget.onDrop((event) => {
|
|
6657
7057
|
var _a;
|
|
7058
|
+
const willDropEvent = new DockviewWillDropEvent({
|
|
7059
|
+
nativeEvent: event.nativeEvent,
|
|
7060
|
+
position: event.position,
|
|
7061
|
+
panel: undefined,
|
|
7062
|
+
api: this._api,
|
|
7063
|
+
group: undefined,
|
|
7064
|
+
getData: getPanelData,
|
|
7065
|
+
kind: 'content',
|
|
7066
|
+
});
|
|
7067
|
+
this._onWillDrop.fire(willDropEvent);
|
|
7068
|
+
if (willDropEvent.defaultPrevented) {
|
|
7069
|
+
return;
|
|
7070
|
+
}
|
|
6658
7071
|
const data = getPanelData();
|
|
6659
7072
|
if (data) {
|
|
6660
|
-
this.moveGroupOrPanel(
|
|
7073
|
+
this.moveGroupOrPanel({
|
|
7074
|
+
from: {
|
|
7075
|
+
groupId: data.groupId,
|
|
7076
|
+
panelId: (_a = data.panelId) !== null && _a !== void 0 ? _a : undefined,
|
|
7077
|
+
},
|
|
7078
|
+
to: {
|
|
7079
|
+
group: this.orthogonalize(event.position),
|
|
7080
|
+
position: 'center',
|
|
7081
|
+
},
|
|
7082
|
+
});
|
|
6661
7083
|
}
|
|
6662
7084
|
else {
|
|
6663
|
-
this._onDidDrop.fire(
|
|
7085
|
+
this._onDidDrop.fire(new DockviewDidDropEvent({
|
|
7086
|
+
nativeEvent: event.nativeEvent,
|
|
7087
|
+
position: event.position,
|
|
7088
|
+
panel: undefined,
|
|
7089
|
+
api: this._api,
|
|
7090
|
+
group: undefined,
|
|
7091
|
+
getData: getPanelData,
|
|
7092
|
+
}));
|
|
6664
7093
|
}
|
|
6665
7094
|
}), this._rootDropTarget);
|
|
6666
7095
|
this._api = new DockviewApi(this);
|
|
6667
7096
|
this.updateWatermark();
|
|
6668
7097
|
}
|
|
6669
|
-
addPopoutGroup(
|
|
6670
|
-
var _a;
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
7098
|
+
addPopoutGroup(itemToPopout, options) {
|
|
7099
|
+
var _a, _b, _c;
|
|
7100
|
+
if (itemToPopout instanceof DockviewPanel &&
|
|
7101
|
+
itemToPopout.group.size === 1) {
|
|
7102
|
+
return this.addPopoutGroup(itemToPopout.group);
|
|
7103
|
+
}
|
|
7104
|
+
const theme = getDockviewTheme(this.gridview.element);
|
|
7105
|
+
const element = this.element;
|
|
7106
|
+
function getBox() {
|
|
7107
|
+
if (options === null || options === void 0 ? void 0 : options.position) {
|
|
7108
|
+
return options.position;
|
|
7109
|
+
}
|
|
7110
|
+
if (itemToPopout instanceof DockviewGroupPanel) {
|
|
7111
|
+
return itemToPopout.element.getBoundingClientRect();
|
|
7112
|
+
}
|
|
7113
|
+
if (itemToPopout.group) {
|
|
7114
|
+
return itemToPopout.group.element.getBoundingClientRect();
|
|
7115
|
+
}
|
|
7116
|
+
return element.getBoundingClientRect();
|
|
7117
|
+
}
|
|
7118
|
+
const box = getBox();
|
|
7119
|
+
const groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId(); //item.id;
|
|
7120
|
+
if (itemToPopout.api.location.type === 'grid') {
|
|
7121
|
+
itemToPopout.api.setHidden(true);
|
|
7122
|
+
}
|
|
7123
|
+
const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
|
|
7124
|
+
theme !== null && theme !== void 0 ? theme : '', {
|
|
7125
|
+
url: (_c = options === null || options === void 0 ? void 0 : options.popoutUrl) !== null && _c !== void 0 ? _c : '/popout.html',
|
|
7126
|
+
left: window.screenX + box.left,
|
|
7127
|
+
top: window.screenY + box.top,
|
|
7128
|
+
width: box.width,
|
|
7129
|
+
height: box.height,
|
|
7130
|
+
onDidOpen: options === null || options === void 0 ? void 0 : options.onDidOpen,
|
|
7131
|
+
onWillClose: options === null || options === void 0 ? void 0 : options.onWillClose,
|
|
7132
|
+
});
|
|
7133
|
+
const popoutWindowDisposable = new CompositeDisposable(_window, _window.onDidClose(() => {
|
|
7134
|
+
popoutWindowDisposable.dispose();
|
|
7135
|
+
}));
|
|
7136
|
+
return _window
|
|
7137
|
+
.open()
|
|
7138
|
+
.then((popoutContainer) => {
|
|
7139
|
+
var _a;
|
|
7140
|
+
if (_window.isDisposed) {
|
|
7141
|
+
return;
|
|
6682
7142
|
}
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
if (!box) {
|
|
6687
|
-
box = group.element.getBoundingClientRect();
|
|
7143
|
+
if (popoutContainer === null) {
|
|
7144
|
+
popoutWindowDisposable.dispose();
|
|
7145
|
+
return;
|
|
6688
7146
|
}
|
|
6689
|
-
const
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
7147
|
+
const gready = document.createElement('div');
|
|
7148
|
+
gready.className = 'dv-overlay-render-container';
|
|
7149
|
+
const overlayRenderContainer = new OverlayRenderContainer(gready);
|
|
7150
|
+
const referenceGroup = itemToPopout instanceof DockviewPanel
|
|
7151
|
+
? itemToPopout.group
|
|
7152
|
+
: itemToPopout;
|
|
7153
|
+
const referenceLocation = itemToPopout.api.location.type;
|
|
7154
|
+
const group = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) !== null && _a !== void 0 ? _a : this.createGroup({ id: groupId });
|
|
7155
|
+
group.model.renderContainer = overlayRenderContainer;
|
|
7156
|
+
if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGroup)) {
|
|
7157
|
+
this._onDidAddGroup.fire(group);
|
|
7158
|
+
}
|
|
7159
|
+
if (itemToPopout instanceof DockviewPanel) {
|
|
7160
|
+
this.movingLock(() => {
|
|
7161
|
+
const panel = referenceGroup.model.removePanel(itemToPopout);
|
|
7162
|
+
group.model.openPanel(panel);
|
|
7163
|
+
});
|
|
7164
|
+
}
|
|
7165
|
+
else {
|
|
7166
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7167
|
+
from: referenceGroup,
|
|
7168
|
+
to: group,
|
|
7169
|
+
}));
|
|
7170
|
+
switch (referenceLocation) {
|
|
7171
|
+
case 'grid':
|
|
7172
|
+
referenceGroup.api.setHidden(true);
|
|
7173
|
+
break;
|
|
7174
|
+
case 'floating':
|
|
7175
|
+
case 'popout':
|
|
7176
|
+
this.removeGroup(referenceGroup);
|
|
7177
|
+
break;
|
|
7178
|
+
}
|
|
7179
|
+
}
|
|
7180
|
+
popoutContainer.classList.add('dv-dockview');
|
|
7181
|
+
popoutContainer.style.overflow = 'hidden';
|
|
7182
|
+
popoutContainer.appendChild(gready);
|
|
7183
|
+
popoutContainer.appendChild(group.element);
|
|
7184
|
+
group.model.location = {
|
|
7185
|
+
type: 'popout',
|
|
7186
|
+
getWindow: () => _window.window,
|
|
7187
|
+
};
|
|
7188
|
+
this.doSetGroupAndPanelActive(group);
|
|
7189
|
+
popoutWindowDisposable.addDisposables(group.api.onDidActiveChange((event) => {
|
|
7190
|
+
var _a;
|
|
7191
|
+
if (event.isActive) {
|
|
7192
|
+
(_a = _window.window) === null || _a === void 0 ? void 0 : _a.focus();
|
|
7193
|
+
}
|
|
7194
|
+
}), group.api.onWillFocus(() => {
|
|
7195
|
+
var _a;
|
|
7196
|
+
(_a = _window.window) === null || _a === void 0 ? void 0 : _a.focus();
|
|
7197
|
+
}));
|
|
7198
|
+
let returnedGroup;
|
|
7199
|
+
const value = {
|
|
7200
|
+
window: _window,
|
|
7201
|
+
popoutGroup: group,
|
|
7202
|
+
referenceGroup: this.getPanel(referenceGroup.id)
|
|
7203
|
+
? referenceGroup.id
|
|
7204
|
+
: undefined,
|
|
7205
|
+
disposable: {
|
|
7206
|
+
dispose: () => {
|
|
7207
|
+
popoutWindowDisposable.dispose();
|
|
7208
|
+
return returnedGroup;
|
|
7209
|
+
},
|
|
7210
|
+
},
|
|
7211
|
+
};
|
|
7212
|
+
popoutWindowDisposable.addDisposables(
|
|
7213
|
+
/**
|
|
7214
|
+
* ResizeObserver seems slow here, I do not know why but we don't need it
|
|
7215
|
+
* since we can reply on the window resize event as we will occupy the full
|
|
7216
|
+
* window dimensions
|
|
7217
|
+
*/
|
|
7218
|
+
addDisposableWindowListener(_window.window, 'resize', () => {
|
|
7219
|
+
group.layout(window.innerWidth, window.innerHeight);
|
|
7220
|
+
}), overlayRenderContainer, Disposable.from(() => {
|
|
7221
|
+
if (this.getPanel(referenceGroup.id)) {
|
|
7222
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7223
|
+
from: group,
|
|
7224
|
+
to: referenceGroup,
|
|
7225
|
+
}));
|
|
7226
|
+
if (referenceGroup.api.isHidden) {
|
|
7227
|
+
referenceGroup.api.setHidden(false);
|
|
7228
|
+
}
|
|
7229
|
+
if (this.getPanel(group.id)) {
|
|
7230
|
+
this.doRemoveGroup(group, {
|
|
7231
|
+
skipPopoutAssociated: true,
|
|
7232
|
+
});
|
|
7233
|
+
}
|
|
7234
|
+
}
|
|
7235
|
+
else {
|
|
7236
|
+
if (this.getPanel(group.id)) {
|
|
7237
|
+
const removedGroup = this.doRemoveGroup(group, {
|
|
7238
|
+
skipDispose: true,
|
|
7239
|
+
skipActive: true,
|
|
7240
|
+
});
|
|
7241
|
+
removedGroup.model.renderContainer =
|
|
7242
|
+
this.overlayRenderContainer;
|
|
7243
|
+
removedGroup.model.location = { type: 'grid' };
|
|
7244
|
+
returnedGroup = removedGroup;
|
|
7245
|
+
}
|
|
7246
|
+
}
|
|
7247
|
+
}));
|
|
7248
|
+
this._popoutGroups.push(value);
|
|
7249
|
+
this.updateWatermark();
|
|
7250
|
+
})
|
|
7251
|
+
.catch((err) => {
|
|
7252
|
+
console.error(err);
|
|
6706
7253
|
});
|
|
6707
|
-
popoutWindow.addDisposables({
|
|
6708
|
-
dispose: () => {
|
|
6709
|
-
remove(this._popoutGroups, popoutWindow);
|
|
6710
|
-
this.updateWatermark();
|
|
6711
|
-
},
|
|
6712
|
-
}, popoutWindow.window.onDidClose(() => {
|
|
6713
|
-
this.doAddGroup(group, [0]);
|
|
6714
|
-
}));
|
|
6715
|
-
this._popoutGroups.push(popoutWindow);
|
|
6716
|
-
this.updateWatermark();
|
|
6717
7254
|
}
|
|
6718
7255
|
addFloatingGroup(item, coord, options) {
|
|
6719
|
-
var _a, _b, _c, _d, _e, _f;
|
|
7256
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6720
7257
|
let group;
|
|
6721
7258
|
if (item instanceof DockviewPanel) {
|
|
6722
7259
|
group = this.createGroup();
|
|
6723
|
-
this.
|
|
7260
|
+
this._onDidAddGroup.fire(group);
|
|
7261
|
+
this.movingLock(() => this.removePanel(item, {
|
|
6724
7262
|
removeEmptyGroup: true,
|
|
6725
7263
|
skipDispose: true,
|
|
6726
|
-
|
|
6727
|
-
|
|
7264
|
+
skipSetActiveGroup: true,
|
|
7265
|
+
}));
|
|
7266
|
+
group.model.openPanel(item, { skipSetGroupActive: true });
|
|
6728
7267
|
}
|
|
6729
7268
|
else {
|
|
6730
7269
|
group = item;
|
|
7270
|
+
const popoutReferenceGroupId = (_a = this._popoutGroups.find((_) => _.popoutGroup === group)) === null || _a === void 0 ? void 0 : _a.referenceGroup;
|
|
7271
|
+
const popoutReferenceGroup = popoutReferenceGroupId
|
|
7272
|
+
? this.getPanel(popoutReferenceGroupId)
|
|
7273
|
+
: undefined;
|
|
6731
7274
|
const skip = typeof (options === null || options === void 0 ? void 0 : options.skipRemoveGroup) === 'boolean' &&
|
|
6732
7275
|
options.skipRemoveGroup;
|
|
6733
7276
|
if (!skip) {
|
|
6734
|
-
|
|
7277
|
+
if (popoutReferenceGroup) {
|
|
7278
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7279
|
+
from: item,
|
|
7280
|
+
to: popoutReferenceGroup,
|
|
7281
|
+
}));
|
|
7282
|
+
this.doRemoveGroup(item, {
|
|
7283
|
+
skipPopoutReturn: true,
|
|
7284
|
+
skipPopoutAssociated: true,
|
|
7285
|
+
});
|
|
7286
|
+
this.doRemoveGroup(popoutReferenceGroup, {
|
|
7287
|
+
skipDispose: true,
|
|
7288
|
+
});
|
|
7289
|
+
group = popoutReferenceGroup;
|
|
7290
|
+
}
|
|
7291
|
+
else {
|
|
7292
|
+
this.doRemoveGroup(item, {
|
|
7293
|
+
skipDispose: true,
|
|
7294
|
+
skipPopoutReturn: true,
|
|
7295
|
+
skipPopoutAssociated: !!popoutReferenceGroup,
|
|
7296
|
+
});
|
|
7297
|
+
}
|
|
6735
7298
|
}
|
|
6736
7299
|
}
|
|
6737
|
-
group.model.location = 'floating';
|
|
7300
|
+
group.model.location = { type: 'floating' };
|
|
6738
7301
|
const overlayLeft = typeof (coord === null || coord === void 0 ? void 0 : coord.x) === 'number'
|
|
6739
7302
|
? Math.max(coord.x, 0)
|
|
6740
7303
|
: DEFAULT_FLOATING_GROUP_POSITION.left;
|
|
@@ -6744,16 +7307,16 @@
|
|
|
6744
7307
|
const overlay = new Overlay({
|
|
6745
7308
|
container: this.gridview.element,
|
|
6746
7309
|
content: group.element,
|
|
6747
|
-
height: (
|
|
6748
|
-
width: (
|
|
7310
|
+
height: (_b = coord === null || coord === void 0 ? void 0 : coord.height) !== null && _b !== void 0 ? _b : 300,
|
|
7311
|
+
width: (_c = coord === null || coord === void 0 ? void 0 : coord.width) !== null && _c !== void 0 ? _c : 300,
|
|
6749
7312
|
left: overlayLeft,
|
|
6750
7313
|
top: overlayTop,
|
|
6751
7314
|
minimumInViewportWidth: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
6752
7315
|
? undefined
|
|
6753
|
-
: (
|
|
7316
|
+
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumWidthWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
6754
7317
|
minimumInViewportHeight: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
6755
7318
|
? undefined
|
|
6756
|
-
: (
|
|
7319
|
+
: (_g = (_f = this.options.floatingGroupBounds) === null || _f === void 0 ? void 0 : _f.minimumHeightWithinViewport) !== null && _g !== void 0 ? _g : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
6757
7320
|
});
|
|
6758
7321
|
const el = group.element.querySelector('.void-container');
|
|
6759
7322
|
if (!el) {
|
|
@@ -6784,12 +7347,15 @@
|
|
|
6784
7347
|
}), {
|
|
6785
7348
|
dispose: () => {
|
|
6786
7349
|
disposable.dispose();
|
|
6787
|
-
group.model.location = 'grid';
|
|
7350
|
+
group.model.location = { type: 'grid' };
|
|
6788
7351
|
remove(this._floatingGroups, floatingGroupPanel);
|
|
6789
7352
|
this.updateWatermark();
|
|
6790
7353
|
},
|
|
6791
7354
|
});
|
|
6792
7355
|
this._floatingGroups.push(floatingGroupPanel);
|
|
7356
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipActiveGroup)) {
|
|
7357
|
+
this.doSetGroupAndPanelActive(group);
|
|
7358
|
+
}
|
|
6793
7359
|
this.updateWatermark();
|
|
6794
7360
|
}
|
|
6795
7361
|
orthogonalize(position) {
|
|
@@ -6879,8 +7445,8 @@
|
|
|
6879
7445
|
return this.panels.find((panel) => panel.id === id);
|
|
6880
7446
|
}
|
|
6881
7447
|
setActivePanel(panel) {
|
|
6882
|
-
this.doSetGroupActive(panel.group);
|
|
6883
7448
|
panel.group.model.openPanel(panel);
|
|
7449
|
+
this.doSetGroupAndPanelActive(panel.group);
|
|
6884
7450
|
}
|
|
6885
7451
|
moveToNext(options = {}) {
|
|
6886
7452
|
var _a;
|
|
@@ -6941,7 +7507,8 @@
|
|
|
6941
7507
|
});
|
|
6942
7508
|
const popoutGroups = this._popoutGroups.map((group) => {
|
|
6943
7509
|
return {
|
|
6944
|
-
data: group.
|
|
7510
|
+
data: group.popoutGroup.toJSON(),
|
|
7511
|
+
gridReferenceGroup: group.referenceGroup,
|
|
6945
7512
|
position: group.window.dimensions(),
|
|
6946
7513
|
};
|
|
6947
7514
|
});
|
|
@@ -6959,7 +7526,7 @@
|
|
|
6959
7526
|
return result;
|
|
6960
7527
|
}
|
|
6961
7528
|
fromJSON(data) {
|
|
6962
|
-
var _a, _b;
|
|
7529
|
+
var _a, _b, _c;
|
|
6963
7530
|
this.clear();
|
|
6964
7531
|
if (typeof data !== 'object' || data === null) {
|
|
6965
7532
|
throw new Error('serialized layout must be a non-null object');
|
|
@@ -6998,7 +7565,7 @@
|
|
|
6998
7565
|
const isActive = typeof activeView === 'string' &&
|
|
6999
7566
|
activeView === panel.id;
|
|
7000
7567
|
group.model.openPanel(panel, {
|
|
7001
|
-
|
|
7568
|
+
skipSetActive: !isActive,
|
|
7002
7569
|
skipSetGroupActive: true,
|
|
7003
7570
|
});
|
|
7004
7571
|
}
|
|
@@ -7028,11 +7595,16 @@
|
|
|
7028
7595
|
}
|
|
7029
7596
|
const serializedPopoutGroups = (_b = data.popoutGroups) !== null && _b !== void 0 ? _b : [];
|
|
7030
7597
|
for (const serializedPopoutGroup of serializedPopoutGroups) {
|
|
7031
|
-
const { data, position } = serializedPopoutGroup;
|
|
7598
|
+
const { data, position, gridReferenceGroup } = serializedPopoutGroup;
|
|
7032
7599
|
const group = createGroupFromSerializedState(data);
|
|
7033
|
-
this.addPopoutGroup(
|
|
7600
|
+
this.addPopoutGroup((_c = (gridReferenceGroup
|
|
7601
|
+
? this.getPanel(gridReferenceGroup)
|
|
7602
|
+
: undefined)) !== null && _c !== void 0 ? _c : group, {
|
|
7034
7603
|
skipRemoveGroup: true,
|
|
7035
7604
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
7605
|
+
overridePopoutGroup: gridReferenceGroup
|
|
7606
|
+
? group
|
|
7607
|
+
: undefined,
|
|
7036
7608
|
});
|
|
7037
7609
|
}
|
|
7038
7610
|
for (const floatingGroup of this._floatingGroups) {
|
|
@@ -7079,12 +7651,13 @@
|
|
|
7079
7651
|
*/
|
|
7080
7652
|
throw err;
|
|
7081
7653
|
}
|
|
7654
|
+
this.updateWatermark();
|
|
7082
7655
|
this._onDidLayoutFromJSON.fire();
|
|
7083
7656
|
}
|
|
7084
7657
|
clear() {
|
|
7085
7658
|
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
7086
7659
|
const hasActiveGroup = !!this.activeGroup;
|
|
7087
|
-
|
|
7660
|
+
!!this.activePanel;
|
|
7088
7661
|
for (const group of groups) {
|
|
7089
7662
|
// remove the group will automatically remove the panels
|
|
7090
7663
|
this.removeGroup(group, { skipActive: true });
|
|
@@ -7092,9 +7665,6 @@
|
|
|
7092
7665
|
if (hasActiveGroup) {
|
|
7093
7666
|
this.doSetGroupAndPanelActive(undefined);
|
|
7094
7667
|
}
|
|
7095
|
-
if (hasActivePanel) {
|
|
7096
|
-
this._onDidActivePanelChange.fire(undefined);
|
|
7097
|
-
}
|
|
7098
7668
|
this.gridview.clear();
|
|
7099
7669
|
}
|
|
7100
7670
|
closeAllGroups() {
|
|
@@ -7135,6 +7705,7 @@
|
|
|
7135
7705
|
const group = this.orthogonalize(directionToPosition(options.position.direction));
|
|
7136
7706
|
const panel = this.createPanel(options, group);
|
|
7137
7707
|
group.model.openPanel(panel);
|
|
7708
|
+
this.doSetGroupAndPanelActive(group);
|
|
7138
7709
|
return panel;
|
|
7139
7710
|
}
|
|
7140
7711
|
}
|
|
@@ -7146,6 +7717,7 @@
|
|
|
7146
7717
|
const target = toTarget(((_b = options.position) === null || _b === void 0 ? void 0 : _b.direction) || 'within');
|
|
7147
7718
|
if (options.floating) {
|
|
7148
7719
|
const group = this.createGroup();
|
|
7720
|
+
this._onDidAddGroup.fire(group);
|
|
7149
7721
|
const o = typeof options.floating === 'object' &&
|
|
7150
7722
|
options.floating !== null
|
|
7151
7723
|
? options.floating
|
|
@@ -7153,16 +7725,16 @@
|
|
|
7153
7725
|
this.addFloatingGroup(group, o, {
|
|
7154
7726
|
inDragMode: false,
|
|
7155
7727
|
skipRemoveGroup: true,
|
|
7728
|
+
skipActiveGroup: true,
|
|
7156
7729
|
});
|
|
7157
|
-
this._onDidAddGroup.fire(group);
|
|
7158
7730
|
panel = this.createPanel(options, group);
|
|
7159
7731
|
group.model.openPanel(panel);
|
|
7160
|
-
this.doSetGroupAndPanelActive(group);
|
|
7161
7732
|
}
|
|
7162
|
-
else if (referenceGroup.api.location === 'floating' ||
|
|
7733
|
+
else if (referenceGroup.api.location.type === 'floating' ||
|
|
7163
7734
|
target === 'center') {
|
|
7164
7735
|
panel = this.createPanel(options, referenceGroup);
|
|
7165
7736
|
referenceGroup.model.openPanel(panel);
|
|
7737
|
+
this.doSetGroupAndPanelActive(referenceGroup);
|
|
7166
7738
|
}
|
|
7167
7739
|
else {
|
|
7168
7740
|
const location = getGridLocation(referenceGroup.element);
|
|
@@ -7170,10 +7742,12 @@
|
|
|
7170
7742
|
const group = this.createGroupAtLocation(relativeLocation);
|
|
7171
7743
|
panel = this.createPanel(options, group);
|
|
7172
7744
|
group.model.openPanel(panel);
|
|
7745
|
+
this.doSetGroupAndPanelActive(group);
|
|
7173
7746
|
}
|
|
7174
7747
|
}
|
|
7175
7748
|
else if (options.floating) {
|
|
7176
7749
|
const group = this.createGroup();
|
|
7750
|
+
this._onDidAddGroup.fire(group);
|
|
7177
7751
|
const o = typeof options.floating === 'object' &&
|
|
7178
7752
|
options.floating !== null
|
|
7179
7753
|
? options.floating
|
|
@@ -7181,16 +7755,16 @@
|
|
|
7181
7755
|
this.addFloatingGroup(group, o, {
|
|
7182
7756
|
inDragMode: false,
|
|
7183
7757
|
skipRemoveGroup: true,
|
|
7758
|
+
skipActiveGroup: true,
|
|
7184
7759
|
});
|
|
7185
|
-
this._onDidAddGroup.fire(group);
|
|
7186
7760
|
panel = this.createPanel(options, group);
|
|
7187
7761
|
group.model.openPanel(panel);
|
|
7188
|
-
this.doSetGroupAndPanelActive(group);
|
|
7189
7762
|
}
|
|
7190
7763
|
else {
|
|
7191
7764
|
const group = this.createGroupAtLocation();
|
|
7192
7765
|
panel = this.createPanel(options, group);
|
|
7193
7766
|
group.model.openPanel(panel);
|
|
7767
|
+
this.doSetGroupAndPanelActive(group);
|
|
7194
7768
|
}
|
|
7195
7769
|
return panel;
|
|
7196
7770
|
}
|
|
@@ -7202,13 +7776,15 @@
|
|
|
7202
7776
|
if (!group) {
|
|
7203
7777
|
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
7204
7778
|
}
|
|
7205
|
-
group.model.removePanel(panel
|
|
7779
|
+
group.model.removePanel(panel, {
|
|
7780
|
+
skipSetActiveGroup: options.skipSetActiveGroup,
|
|
7781
|
+
});
|
|
7206
7782
|
if (!options.skipDispose) {
|
|
7207
|
-
|
|
7783
|
+
panel.group.model.renderContainer.detatch(panel);
|
|
7208
7784
|
panel.dispose();
|
|
7209
7785
|
}
|
|
7210
7786
|
if (group.size === 0 && options.removeEmptyGroup) {
|
|
7211
|
-
this.removeGroup(group);
|
|
7787
|
+
this.removeGroup(group, { skipActive: options.skipSetActiveGroup });
|
|
7212
7788
|
}
|
|
7213
7789
|
}
|
|
7214
7790
|
createWatermarkComponent() {
|
|
@@ -7221,7 +7797,7 @@
|
|
|
7221
7797
|
}
|
|
7222
7798
|
updateWatermark() {
|
|
7223
7799
|
var _a, _b;
|
|
7224
|
-
if (this.groups.filter((x) => x.api.location === 'grid').length === 0) {
|
|
7800
|
+
if (this.groups.filter((x) => x.api.location.type === 'grid' && !x.api.isHidden).length === 0) {
|
|
7225
7801
|
if (!this.watermark) {
|
|
7226
7802
|
this.watermark = this.createWatermarkComponent();
|
|
7227
7803
|
this.watermark.init({
|
|
@@ -7241,7 +7817,7 @@
|
|
|
7241
7817
|
}
|
|
7242
7818
|
addGroup(options) {
|
|
7243
7819
|
var _a;
|
|
7244
|
-
const group = this.createGroup();
|
|
7820
|
+
const group = this.createGroup(options);
|
|
7245
7821
|
if (options) {
|
|
7246
7822
|
let referenceGroup;
|
|
7247
7823
|
if (isGroupOptionsWithPanel(options)) {
|
|
@@ -7267,36 +7843,42 @@
|
|
|
7267
7843
|
}
|
|
7268
7844
|
else {
|
|
7269
7845
|
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
7846
|
+
if (!options.skipSetActive) {
|
|
7847
|
+
this.doSetGroupAndPanelActive(group);
|
|
7848
|
+
}
|
|
7270
7849
|
return group;
|
|
7271
7850
|
}
|
|
7272
7851
|
const target = toTarget(options.direction || 'within');
|
|
7273
7852
|
const location = getGridLocation(referenceGroup.element);
|
|
7274
7853
|
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
7275
7854
|
this.doAddGroup(group, relativeLocation);
|
|
7855
|
+
if (!options.skipSetActive) {
|
|
7856
|
+
this.doSetGroupAndPanelActive(group);
|
|
7857
|
+
}
|
|
7276
7858
|
return group;
|
|
7277
7859
|
}
|
|
7278
7860
|
else {
|
|
7279
7861
|
this.doAddGroup(group);
|
|
7862
|
+
this.doSetGroupAndPanelActive(group);
|
|
7280
7863
|
return group;
|
|
7281
7864
|
}
|
|
7282
7865
|
}
|
|
7283
7866
|
removeGroup(group, options) {
|
|
7867
|
+
this.doRemoveGroup(group, options);
|
|
7868
|
+
}
|
|
7869
|
+
doRemoveGroup(group, options) {
|
|
7284
7870
|
var _a;
|
|
7285
7871
|
const panels = [...group.panels]; // reassign since group panels will mutate
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7872
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
7873
|
+
for (const panel of panels) {
|
|
7874
|
+
this.removePanel(panel, {
|
|
7875
|
+
removeEmptyGroup: false,
|
|
7876
|
+
skipDispose: (_a = options === null || options === void 0 ? void 0 : options.skipDispose) !== null && _a !== void 0 ? _a : false,
|
|
7877
|
+
});
|
|
7878
|
+
}
|
|
7291
7879
|
}
|
|
7292
7880
|
const activePanel = this.activePanel;
|
|
7293
|
-
|
|
7294
|
-
if (this.activePanel !== activePanel) {
|
|
7295
|
-
this._onDidActivePanelChange.fire(this.activePanel);
|
|
7296
|
-
}
|
|
7297
|
-
}
|
|
7298
|
-
doRemoveGroup(group, options) {
|
|
7299
|
-
if (group.api.location === 'floating') {
|
|
7881
|
+
if (group.api.location.type === 'floating') {
|
|
7300
7882
|
const floatingGroup = this._floatingGroups.find((_) => _.group === group);
|
|
7301
7883
|
if (floatingGroup) {
|
|
7302
7884
|
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
@@ -7308,60 +7890,124 @@
|
|
|
7308
7890
|
floatingGroup.dispose();
|
|
7309
7891
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
7310
7892
|
const groups = Array.from(this._groups.values());
|
|
7311
|
-
this.
|
|
7893
|
+
this.doSetGroupAndPanelActive(groups.length > 0 ? groups[0].value : undefined);
|
|
7312
7894
|
}
|
|
7313
7895
|
return floatingGroup.group;
|
|
7314
7896
|
}
|
|
7315
7897
|
throw new Error('failed to find floating group');
|
|
7316
7898
|
}
|
|
7317
|
-
if (group.api.location === 'popout') {
|
|
7318
|
-
const selectedGroup = this._popoutGroups.find((_) => _.
|
|
7899
|
+
if (group.api.location.type === 'popout') {
|
|
7900
|
+
const selectedGroup = this._popoutGroups.find((_) => _.popoutGroup === group);
|
|
7319
7901
|
if (selectedGroup) {
|
|
7320
7902
|
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
7321
|
-
|
|
7903
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipPopoutAssociated)) {
|
|
7904
|
+
const refGroup = selectedGroup.referenceGroup
|
|
7905
|
+
? this.getPanel(selectedGroup.referenceGroup)
|
|
7906
|
+
: undefined;
|
|
7907
|
+
if (refGroup) {
|
|
7908
|
+
this.removeGroup(refGroup);
|
|
7909
|
+
}
|
|
7910
|
+
}
|
|
7911
|
+
selectedGroup.popoutGroup.dispose();
|
|
7322
7912
|
this._groups.delete(group.id);
|
|
7323
7913
|
this._onDidRemoveGroup.fire(group);
|
|
7324
7914
|
}
|
|
7325
|
-
selectedGroup.dispose();
|
|
7915
|
+
const removedGroup = selectedGroup.disposable.dispose();
|
|
7916
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipPopoutReturn) && removedGroup) {
|
|
7917
|
+
this.doAddGroup(removedGroup, [0]);
|
|
7918
|
+
this.doSetGroupAndPanelActive(removedGroup);
|
|
7919
|
+
}
|
|
7326
7920
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
7327
7921
|
const groups = Array.from(this._groups.values());
|
|
7328
|
-
this.
|
|
7922
|
+
this.doSetGroupAndPanelActive(groups.length > 0 ? groups[0].value : undefined);
|
|
7329
7923
|
}
|
|
7330
|
-
|
|
7924
|
+
this.updateWatermark();
|
|
7925
|
+
return selectedGroup.popoutGroup;
|
|
7331
7926
|
}
|
|
7332
7927
|
throw new Error('failed to find popout group');
|
|
7333
7928
|
}
|
|
7334
|
-
|
|
7929
|
+
const re = super.doRemoveGroup(group, options);
|
|
7930
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipActive)) {
|
|
7931
|
+
if (this.activePanel !== activePanel) {
|
|
7932
|
+
this._onDidActivePanelChange.fire(this.activePanel);
|
|
7933
|
+
}
|
|
7934
|
+
}
|
|
7935
|
+
return re;
|
|
7335
7936
|
}
|
|
7336
|
-
|
|
7337
|
-
|
|
7937
|
+
movingLock(func) {
|
|
7938
|
+
const isMoving = this._moving;
|
|
7939
|
+
try {
|
|
7940
|
+
this._moving = true;
|
|
7941
|
+
return func();
|
|
7942
|
+
}
|
|
7943
|
+
finally {
|
|
7944
|
+
this._moving = isMoving;
|
|
7945
|
+
}
|
|
7946
|
+
}
|
|
7947
|
+
moveGroupOrPanel(options) {
|
|
7948
|
+
var _a;
|
|
7949
|
+
const destinationGroup = options.to.group;
|
|
7950
|
+
const sourceGroupId = options.from.groupId;
|
|
7951
|
+
const sourceItemId = options.from.panelId;
|
|
7952
|
+
const destinationTarget = options.to.position;
|
|
7953
|
+
const destinationIndex = options.to.index;
|
|
7338
7954
|
const sourceGroup = sourceGroupId
|
|
7339
7955
|
? (_a = this._groups.get(sourceGroupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
7340
7956
|
: undefined;
|
|
7957
|
+
if (!sourceGroup) {
|
|
7958
|
+
throw new Error(`Failed to find group id ${sourceGroupId}`);
|
|
7959
|
+
}
|
|
7341
7960
|
if (sourceItemId === undefined) {
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7961
|
+
/**
|
|
7962
|
+
* Moving an entire group into another group
|
|
7963
|
+
*/
|
|
7964
|
+
this.moveGroup({
|
|
7965
|
+
from: { group: sourceGroup },
|
|
7966
|
+
to: {
|
|
7967
|
+
group: destinationGroup,
|
|
7968
|
+
position: destinationTarget,
|
|
7969
|
+
},
|
|
7970
|
+
});
|
|
7345
7971
|
return;
|
|
7346
7972
|
}
|
|
7347
7973
|
if (!destinationTarget || destinationTarget === 'center') {
|
|
7348
|
-
|
|
7349
|
-
|
|
7974
|
+
/**
|
|
7975
|
+
* Dropping a panel within another group
|
|
7976
|
+
*/
|
|
7977
|
+
const removedPanel = this.movingLock(() => sourceGroup.model.removePanel(sourceItemId, {
|
|
7978
|
+
skipSetActive: false,
|
|
7979
|
+
skipSetActiveGroup: true,
|
|
7980
|
+
}));
|
|
7981
|
+
if (!removedPanel) {
|
|
7350
7982
|
throw new Error(`No panel with id ${sourceItemId}`);
|
|
7351
7983
|
}
|
|
7352
|
-
if (
|
|
7353
|
-
|
|
7984
|
+
if (sourceGroup.model.size === 0) {
|
|
7985
|
+
// remove the group and do not set a new group as active
|
|
7986
|
+
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
7354
7987
|
}
|
|
7355
|
-
destinationGroup.model.openPanel(
|
|
7988
|
+
this.movingLock(() => destinationGroup.model.openPanel(removedPanel, {
|
|
7356
7989
|
index: destinationIndex,
|
|
7990
|
+
skipSetGroupActive: true,
|
|
7991
|
+
}));
|
|
7992
|
+
this.doSetGroupAndPanelActive(destinationGroup);
|
|
7993
|
+
this._onDidMovePanel.fire({
|
|
7994
|
+
panel: removedPanel,
|
|
7357
7995
|
});
|
|
7358
7996
|
}
|
|
7359
7997
|
else {
|
|
7998
|
+
/**
|
|
7999
|
+
* Dropping a panel to the extremities of a group which will place that panel
|
|
8000
|
+
* into an adjacent group
|
|
8001
|
+
*/
|
|
7360
8002
|
const referenceLocation = getGridLocation(destinationGroup.element);
|
|
7361
8003
|
const targetLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
7362
|
-
if (sourceGroup
|
|
8004
|
+
if (sourceGroup.size < 2) {
|
|
8005
|
+
/**
|
|
8006
|
+
* If we are moving from a group which only has one panel left we will consider
|
|
8007
|
+
* moving the group itself rather than moving the panel into a newly created group
|
|
8008
|
+
*/
|
|
7363
8009
|
const [targetParentLocation, to] = tail(targetLocation);
|
|
7364
|
-
if (sourceGroup.api.location === 'grid') {
|
|
8010
|
+
if (sourceGroup.api.location.type === 'grid') {
|
|
7365
8011
|
const sourceLocation = getGridLocation(sourceGroup.element);
|
|
7366
8012
|
const [sourceParentLocation, from] = tail(sourceLocation);
|
|
7367
8013
|
if (sequenceEquals(sourceParentLocation, targetParentLocation)) {
|
|
@@ -7369,78 +8015,123 @@
|
|
|
7369
8015
|
// if a group has one tab - we are essentially moving the 'group'
|
|
7370
8016
|
// which is equivalent to swapping two views in this case
|
|
7371
8017
|
this.gridview.moveView(sourceParentLocation, from, to);
|
|
8018
|
+
return;
|
|
7372
8019
|
}
|
|
7373
8020
|
}
|
|
7374
8021
|
// source group will become empty so delete the group
|
|
7375
|
-
const targetGroup = this.doRemoveGroup(sourceGroup, {
|
|
8022
|
+
const targetGroup = this.movingLock(() => this.doRemoveGroup(sourceGroup, {
|
|
7376
8023
|
skipActive: true,
|
|
7377
8024
|
skipDispose: true,
|
|
7378
|
-
});
|
|
8025
|
+
}));
|
|
7379
8026
|
// after deleting the group we need to re-evaulate the ref location
|
|
7380
8027
|
const updatedReferenceLocation = getGridLocation(destinationGroup.element);
|
|
7381
8028
|
const location = getRelativeLocation(this.gridview.orientation, updatedReferenceLocation, destinationTarget);
|
|
7382
|
-
this.doAddGroup(targetGroup, location);
|
|
8029
|
+
this.movingLock(() => this.doAddGroup(targetGroup, location));
|
|
8030
|
+
this.doSetGroupAndPanelActive(targetGroup);
|
|
7383
8031
|
}
|
|
7384
8032
|
else {
|
|
7385
|
-
|
|
7386
|
-
|
|
8033
|
+
/**
|
|
8034
|
+
* The group we are removing from has many panels, we need to remove the panels we are moving,
|
|
8035
|
+
* create a new group, add the panels to that new group and add the new group in an appropiate position
|
|
8036
|
+
*/
|
|
8037
|
+
const removedPanel = this.movingLock(() => sourceGroup.model.removePanel(sourceItemId, {
|
|
8038
|
+
skipSetActive: false,
|
|
8039
|
+
skipSetActiveGroup: true,
|
|
8040
|
+
}));
|
|
8041
|
+
if (!removedPanel) {
|
|
7387
8042
|
throw new Error(`No panel with id ${sourceItemId}`);
|
|
7388
8043
|
}
|
|
7389
8044
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
7390
8045
|
const group = this.createGroupAtLocation(dropLocation);
|
|
7391
|
-
group.model.openPanel(
|
|
8046
|
+
this.movingLock(() => group.model.openPanel(removedPanel, {
|
|
8047
|
+
skipSetGroupActive: true,
|
|
8048
|
+
}));
|
|
8049
|
+
this.doSetGroupAndPanelActive(group);
|
|
7392
8050
|
}
|
|
7393
8051
|
}
|
|
7394
8052
|
}
|
|
7395
|
-
moveGroup(
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
8053
|
+
moveGroup(options) {
|
|
8054
|
+
const from = options.from.group;
|
|
8055
|
+
const to = options.to.group;
|
|
8056
|
+
const target = options.to.position;
|
|
8057
|
+
if (target === 'center') {
|
|
8058
|
+
const activePanel = from.activePanel;
|
|
8059
|
+
const panels = this.movingLock(() => [...from.panels].map((p) => from.model.removePanel(p.id, {
|
|
8060
|
+
skipSetActive: true,
|
|
8061
|
+
})));
|
|
8062
|
+
if ((from === null || from === void 0 ? void 0 : from.model.size) === 0) {
|
|
8063
|
+
this.doRemoveGroup(from, { skipActive: true });
|
|
8064
|
+
}
|
|
8065
|
+
this.movingLock(() => {
|
|
7403
8066
|
for (const panel of panels) {
|
|
7404
|
-
|
|
7405
|
-
|
|
8067
|
+
to.model.openPanel(panel, {
|
|
8068
|
+
skipSetActive: panel !== activePanel,
|
|
8069
|
+
skipSetGroupActive: true,
|
|
7406
8070
|
});
|
|
7407
8071
|
}
|
|
7408
|
-
}
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
8072
|
+
});
|
|
8073
|
+
this.doSetGroupAndPanelActive(to);
|
|
8074
|
+
panels.forEach((panel) => {
|
|
8075
|
+
this._onDidMovePanel.fire({ panel });
|
|
8076
|
+
});
|
|
8077
|
+
}
|
|
8078
|
+
else {
|
|
8079
|
+
switch (from.api.location.type) {
|
|
8080
|
+
case 'grid':
|
|
8081
|
+
this.gridview.removeView(getGridLocation(from.element));
|
|
8082
|
+
break;
|
|
8083
|
+
case 'floating': {
|
|
8084
|
+
const selectedFloatingGroup = this._floatingGroups.find((x) => x.group === from);
|
|
8085
|
+
if (!selectedFloatingGroup) {
|
|
8086
|
+
throw new Error('failed to find floating group');
|
|
7421
8087
|
}
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
8088
|
+
selectedFloatingGroup.dispose();
|
|
8089
|
+
break;
|
|
8090
|
+
}
|
|
8091
|
+
case 'popout': {
|
|
8092
|
+
const selectedPopoutGroup = this._popoutGroups.find((x) => x.popoutGroup === from);
|
|
8093
|
+
if (!selectedPopoutGroup) {
|
|
8094
|
+
throw new Error('failed to find popout group');
|
|
7428
8095
|
}
|
|
8096
|
+
selectedPopoutGroup.disposable.dispose();
|
|
7429
8097
|
}
|
|
7430
|
-
const referenceLocation = getGridLocation(referenceGroup.element);
|
|
7431
|
-
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
7432
|
-
this.gridview.addView(sourceGroup, exports.Sizing.Distribute, dropLocation);
|
|
7433
8098
|
}
|
|
8099
|
+
const referenceLocation = getGridLocation(to.element);
|
|
8100
|
+
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
8101
|
+
this.gridview.addView(from, exports.Sizing.Distribute, dropLocation);
|
|
8102
|
+
from.panels.forEach((panel) => {
|
|
8103
|
+
this._onDidMovePanel.fire({ panel });
|
|
8104
|
+
});
|
|
7434
8105
|
}
|
|
7435
8106
|
}
|
|
7436
|
-
|
|
7437
|
-
|
|
8107
|
+
doSetGroupActive(group) {
|
|
8108
|
+
super.doSetGroupActive(group);
|
|
8109
|
+
const activePanel = this.activePanel;
|
|
8110
|
+
if (!this._moving &&
|
|
8111
|
+
activePanel !== this._onDidActivePanelChange.value) {
|
|
8112
|
+
this._onDidActivePanelChange.fire(activePanel);
|
|
8113
|
+
}
|
|
8114
|
+
}
|
|
8115
|
+
doSetGroupAndPanelActive(group) {
|
|
8116
|
+
super.doSetGroupActive(group);
|
|
7438
8117
|
const activePanel = this.activePanel;
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
this.
|
|
8118
|
+
if (group &&
|
|
8119
|
+
this.hasMaximizedGroup() &&
|
|
8120
|
+
!this.isMaximizedGroup(group)) {
|
|
8121
|
+
this.exitMaximizedGroup();
|
|
8122
|
+
}
|
|
8123
|
+
if (!this._moving &&
|
|
8124
|
+
activePanel !== this._onDidActivePanelChange.value) {
|
|
8125
|
+
this._onDidActivePanelChange.fire(activePanel);
|
|
7442
8126
|
}
|
|
7443
8127
|
}
|
|
8128
|
+
getNextGroupId() {
|
|
8129
|
+
let id = this.nextGroupId.next();
|
|
8130
|
+
while (this._groups.has(id)) {
|
|
8131
|
+
id = this.nextGroupId.next();
|
|
8132
|
+
}
|
|
8133
|
+
return id;
|
|
8134
|
+
}
|
|
7444
8135
|
createGroup(options) {
|
|
7445
8136
|
if (!options) {
|
|
7446
8137
|
options = {};
|
|
@@ -7457,7 +8148,7 @@
|
|
|
7457
8148
|
}
|
|
7458
8149
|
}
|
|
7459
8150
|
const view = new DockviewGroupPanel(this, id, options);
|
|
7460
|
-
view.init({ params: {}, accessor:
|
|
8151
|
+
view.init({ params: {}, accessor: this });
|
|
7461
8152
|
if (!this._groups.has(view.id)) {
|
|
7462
8153
|
const disposable = new CompositeDisposable(view.model.onTabDragStart((event) => {
|
|
7463
8154
|
this._onWillDragPanel.fire(event);
|
|
@@ -7465,20 +8156,48 @@
|
|
|
7465
8156
|
this._onWillDragGroup.fire(event);
|
|
7466
8157
|
}), view.model.onMove((event) => {
|
|
7467
8158
|
const { groupId, itemId, target, index } = event;
|
|
7468
|
-
this.moveGroupOrPanel(
|
|
8159
|
+
this.moveGroupOrPanel({
|
|
8160
|
+
from: { groupId: groupId, panelId: itemId },
|
|
8161
|
+
to: {
|
|
8162
|
+
group: view,
|
|
8163
|
+
position: target,
|
|
8164
|
+
index,
|
|
8165
|
+
},
|
|
8166
|
+
});
|
|
7469
8167
|
}), view.model.onDidDrop((event) => {
|
|
7470
|
-
this._onDidDrop.fire(
|
|
8168
|
+
this._onDidDrop.fire(event);
|
|
8169
|
+
}), view.model.onWillDrop((event) => {
|
|
8170
|
+
this._onWillDrop.fire(event);
|
|
8171
|
+
}), view.model.onWillShowOverlay((event) => {
|
|
8172
|
+
if (this.options.disableDnd) {
|
|
8173
|
+
event.preventDefault();
|
|
8174
|
+
return;
|
|
8175
|
+
}
|
|
8176
|
+
this._onWillShowOverlay.fire(event);
|
|
7471
8177
|
}), view.model.onDidAddPanel((event) => {
|
|
8178
|
+
if (this._moving) {
|
|
8179
|
+
return;
|
|
8180
|
+
}
|
|
7472
8181
|
this._onDidAddPanel.fire(event.panel);
|
|
7473
8182
|
}), view.model.onDidRemovePanel((event) => {
|
|
8183
|
+
if (this._moving) {
|
|
8184
|
+
return;
|
|
8185
|
+
}
|
|
7474
8186
|
this._onDidRemovePanel.fire(event.panel);
|
|
7475
8187
|
}), view.model.onDidActivePanelChange((event) => {
|
|
7476
|
-
this.
|
|
8188
|
+
if (this._moving) {
|
|
8189
|
+
return;
|
|
8190
|
+
}
|
|
8191
|
+
if (event.panel !== this.activePanel) {
|
|
8192
|
+
return;
|
|
8193
|
+
}
|
|
8194
|
+
if (this._onDidActivePanelChange.value !== event.panel) {
|
|
8195
|
+
this._onDidActivePanelChange.fire(event.panel);
|
|
8196
|
+
}
|
|
7477
8197
|
}));
|
|
7478
8198
|
this._groups.set(view.id, { value: view, disposable });
|
|
7479
8199
|
}
|
|
7480
|
-
// TODO: must be called after the above listeners have been setup,
|
|
7481
|
-
// not an ideal pattern
|
|
8200
|
+
// TODO: must be called after the above listeners have been setup, not an ideal pattern
|
|
7482
8201
|
view.initialize();
|
|
7483
8202
|
return view;
|
|
7484
8203
|
}
|
|
@@ -7531,7 +8250,20 @@
|
|
|
7531
8250
|
});
|
|
7532
8251
|
this._onDidLayoutfromJSON = new Emitter();
|
|
7533
8252
|
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
8253
|
+
this._onDidRemoveGroup = new Emitter();
|
|
8254
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
8255
|
+
this._onDidAddGroup = new Emitter();
|
|
8256
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
8257
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
8258
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
7534
8259
|
this._options = options;
|
|
8260
|
+
this.addDisposables(this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this.onDidAdd((event) => {
|
|
8261
|
+
this._onDidAddGroup.fire(event);
|
|
8262
|
+
}), this.onDidRemove((event) => {
|
|
8263
|
+
this._onDidRemoveGroup.fire(event);
|
|
8264
|
+
}), this.onDidActiveChange((event) => {
|
|
8265
|
+
this._onDidActiveGroupChange.fire(event);
|
|
8266
|
+
}));
|
|
7535
8267
|
if (!this.options.components) {
|
|
7536
8268
|
this.options.components = {};
|
|
7537
8269
|
}
|
|
@@ -7706,6 +8438,7 @@
|
|
|
7706
8438
|
});
|
|
7707
8439
|
this.registerPanel(view);
|
|
7708
8440
|
this.doAddGroup(view, relativeLocation, options.size);
|
|
8441
|
+
this.doSetGroupActive(view);
|
|
7709
8442
|
return view;
|
|
7710
8443
|
}
|
|
7711
8444
|
registerPanel(panel) {
|
|
@@ -8391,10 +9124,10 @@
|
|
|
8391
9124
|
this._onDidChange = new Emitter();
|
|
8392
9125
|
this.onDidChange = this._onDidChange.event;
|
|
8393
9126
|
this.api.initialize(this);
|
|
8394
|
-
this.addDisposables(this._onDidChange, this.api.
|
|
8395
|
-
const {
|
|
9127
|
+
this.addDisposables(this._onDidChange, this.api.onDidHiddenChange((event) => {
|
|
9128
|
+
const { isHidden } = event;
|
|
8396
9129
|
const { accessor } = this._params;
|
|
8397
|
-
accessor.setVisible(this,
|
|
9130
|
+
accessor.setVisible(this, !isHidden);
|
|
8398
9131
|
}), this.api.onActiveChange(() => {
|
|
8399
9132
|
const { accessor } = this._params;
|
|
8400
9133
|
accessor.setActive(this);
|
|
@@ -8460,11 +9193,13 @@
|
|
|
8460
9193
|
exports.DockviewApi = DockviewApi;
|
|
8461
9194
|
exports.DockviewComponent = DockviewComponent;
|
|
8462
9195
|
exports.DockviewCompositeDisposable = CompositeDisposable;
|
|
9196
|
+
exports.DockviewDidDropEvent = DockviewDidDropEvent;
|
|
8463
9197
|
exports.DockviewEmitter = Emitter;
|
|
8464
9198
|
exports.DockviewGroupPanel = DockviewGroupPanel;
|
|
8465
9199
|
exports.DockviewGroupPanelModel = DockviewGroupPanelModel;
|
|
8466
9200
|
exports.DockviewMutableDisposable = MutableDisposable;
|
|
8467
9201
|
exports.DockviewPanel = DockviewPanel;
|
|
9202
|
+
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
8468
9203
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
8469
9204
|
exports.Gridview = Gridview;
|
|
8470
9205
|
exports.GridviewApi = GridviewApi;
|
|
@@ -8483,6 +9218,7 @@
|
|
|
8483
9218
|
exports.SplitviewComponent = SplitviewComponent;
|
|
8484
9219
|
exports.SplitviewPanel = SplitviewPanel;
|
|
8485
9220
|
exports.Tab = Tab;
|
|
9221
|
+
exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
|
|
8486
9222
|
exports.createComponent = createComponent;
|
|
8487
9223
|
exports.directionToPosition = directionToPosition;
|
|
8488
9224
|
exports.getDirectionOrientation = getDirectionOrientation;
|