dockview-core 1.9.2 → 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 +6 -7
- 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 +577 -197
- 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 +226 -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 +7 -3
- 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 +1261 -526
- 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 +1260 -525
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +1261 -526
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +1259 -527
- 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 +1261 -526
- 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 +1260 -525
- 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 +6 -7
- 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 +520 -162
- 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 +169 -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 +7 -3
- 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,9 +3580,10 @@
|
|
|
3464
3580
|
// noop
|
|
3465
3581
|
}
|
|
3466
3582
|
closePanel() {
|
|
3583
|
+
var _a;
|
|
3467
3584
|
if (this.panel) {
|
|
3468
3585
|
if (this.panel.api.renderer === 'onlyWhenVisibile') {
|
|
3469
|
-
this.
|
|
3586
|
+
(_a = this.panel.view.content.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.panel.view.content.element);
|
|
3470
3587
|
}
|
|
3471
3588
|
}
|
|
3472
3589
|
this.panel = undefined;
|
|
@@ -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,35 +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
|
-
if (!skipSetGroupActive) {
|
|
4221
|
-
this.accessor.doSetGroupActive(this.groupPanel);
|
|
4222
|
-
}
|
|
4223
4434
|
this.contentContainer.renderPanel(panel, { asActive: true });
|
|
4224
4435
|
return;
|
|
4225
4436
|
}
|
|
4226
|
-
|
|
4227
|
-
if (!skipSetPanelActive) {
|
|
4437
|
+
if (!skipSetActive) {
|
|
4228
4438
|
this.doSetActivePanel(panel);
|
|
4229
4439
|
}
|
|
4230
|
-
if (!skipSetGroupActive) {
|
|
4231
|
-
this.accessor.doSetGroupActive(this.groupPanel
|
|
4440
|
+
if (!options.skipSetGroupActive) {
|
|
4441
|
+
this.accessor.doSetGroupActive(this.groupPanel);
|
|
4442
|
+
}
|
|
4443
|
+
if (!options.skipSetActive) {
|
|
4444
|
+
this.updateContainer();
|
|
4232
4445
|
}
|
|
4233
|
-
this.updateContainer();
|
|
4234
4446
|
}
|
|
4235
|
-
removePanel(groupItemOrId
|
|
4447
|
+
removePanel(groupItemOrId, options = {
|
|
4448
|
+
skipSetActive: false,
|
|
4449
|
+
}) {
|
|
4236
4450
|
const id = typeof groupItemOrId === 'string'
|
|
4237
4451
|
? groupItemOrId
|
|
4238
4452
|
: groupItemOrId.id;
|
|
@@ -4240,7 +4454,7 @@
|
|
|
4240
4454
|
if (!panelToRemove) {
|
|
4241
4455
|
throw new Error('invalid operation');
|
|
4242
4456
|
}
|
|
4243
|
-
return this._removePanel(panelToRemove);
|
|
4457
|
+
return this._removePanel(panelToRemove, options);
|
|
4244
4458
|
}
|
|
4245
4459
|
closeAllPanels() {
|
|
4246
4460
|
if (this.panels.length > 0) {
|
|
@@ -4266,12 +4480,8 @@
|
|
|
4266
4480
|
updateActions(element) {
|
|
4267
4481
|
this.tabsContainer.setRightActionsElement(element);
|
|
4268
4482
|
}
|
|
4269
|
-
setActive(isGroupActive,
|
|
4270
|
-
var _a, _b, _c, _d;
|
|
4483
|
+
setActive(isGroupActive, force = false) {
|
|
4271
4484
|
if (!force && this.isActive === isGroupActive) {
|
|
4272
|
-
if (!skipFocus) {
|
|
4273
|
-
(_b = (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4274
|
-
}
|
|
4275
4485
|
return;
|
|
4276
4486
|
}
|
|
4277
4487
|
this._isGroupActive = isGroupActive;
|
|
@@ -4282,11 +4492,6 @@
|
|
|
4282
4492
|
this.doSetActivePanel(this.panels[0]);
|
|
4283
4493
|
}
|
|
4284
4494
|
this.updateContainer();
|
|
4285
|
-
if (isGroupActive) {
|
|
4286
|
-
if (!skipFocus) {
|
|
4287
|
-
(_d = (_c = this._activePanel) === null || _c === void 0 ? void 0 : _c.focus) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
4288
|
-
}
|
|
4289
|
-
}
|
|
4290
4495
|
}
|
|
4291
4496
|
layout(width, height) {
|
|
4292
4497
|
var _a;
|
|
@@ -4297,17 +4502,22 @@
|
|
|
4297
4502
|
this._activePanel.layout(this._width, this._height);
|
|
4298
4503
|
}
|
|
4299
4504
|
}
|
|
4300
|
-
_removePanel(panel) {
|
|
4505
|
+
_removePanel(panel, options) {
|
|
4301
4506
|
const isActivePanel = this._activePanel === panel;
|
|
4302
4507
|
this.doRemovePanel(panel);
|
|
4303
4508
|
if (isActivePanel && this.panels.length > 0) {
|
|
4304
4509
|
const nextPanel = this.mostRecentlyUsed[0];
|
|
4305
|
-
this.openPanel(nextPanel
|
|
4510
|
+
this.openPanel(nextPanel, {
|
|
4511
|
+
skipSetActive: options.skipSetActive,
|
|
4512
|
+
skipSetGroupActive: options.skipSetActiveGroup,
|
|
4513
|
+
});
|
|
4306
4514
|
}
|
|
4307
4515
|
if (this._activePanel && this.panels.length === 0) {
|
|
4308
4516
|
this.doSetActivePanel(undefined);
|
|
4309
4517
|
}
|
|
4310
|
-
|
|
4518
|
+
if (!options.skipSetActive) {
|
|
4519
|
+
this.updateContainer();
|
|
4520
|
+
}
|
|
4311
4521
|
return panel;
|
|
4312
4522
|
}
|
|
4313
4523
|
doRemovePanel(panel) {
|
|
@@ -4322,13 +4532,13 @@
|
|
|
4322
4532
|
}
|
|
4323
4533
|
this._onDidRemovePanel.fire({ panel });
|
|
4324
4534
|
}
|
|
4325
|
-
doAddPanel(panel, index = this.panels.length,
|
|
4535
|
+
doAddPanel(panel, index = this.panels.length, options = { skipSetActive: false }) {
|
|
4326
4536
|
const existingPanel = this._panels.indexOf(panel);
|
|
4327
4537
|
const hasExistingPanel = existingPanel > -1;
|
|
4328
4538
|
this.tabsContainer.show();
|
|
4329
4539
|
this.contentContainer.show();
|
|
4330
4540
|
this.tabsContainer.openPanel(panel, index);
|
|
4331
|
-
if (!skipSetActive) {
|
|
4541
|
+
if (!options.skipSetActive) {
|
|
4332
4542
|
this.contentContainer.openPanel(panel);
|
|
4333
4543
|
}
|
|
4334
4544
|
if (hasExistingPanel) {
|
|
@@ -4340,12 +4550,17 @@
|
|
|
4340
4550
|
this._onDidAddPanel.fire({ panel });
|
|
4341
4551
|
}
|
|
4342
4552
|
doSetActivePanel(panel) {
|
|
4553
|
+
if (this._activePanel === panel) {
|
|
4554
|
+
return;
|
|
4555
|
+
}
|
|
4343
4556
|
this._activePanel = panel;
|
|
4344
4557
|
if (panel) {
|
|
4345
4558
|
this.tabsContainer.setActivePanel(panel);
|
|
4346
4559
|
panel.layout(this._width, this._height);
|
|
4347
4560
|
this.updateMru(panel);
|
|
4348
|
-
this._onDidActivePanelChange.fire({
|
|
4561
|
+
this._onDidActivePanelChange.fire({
|
|
4562
|
+
panel,
|
|
4563
|
+
});
|
|
4349
4564
|
}
|
|
4350
4565
|
}
|
|
4351
4566
|
updateMru(panel) {
|
|
@@ -4357,11 +4572,11 @@
|
|
|
4357
4572
|
updateContainer() {
|
|
4358
4573
|
var _a, _b;
|
|
4359
4574
|
toggleClass(this.container, 'empty', this.isEmpty);
|
|
4360
|
-
this.panels.forEach((panel) => panel.
|
|
4575
|
+
this.panels.forEach((panel) => panel.runEvents());
|
|
4361
4576
|
if (this.isEmpty && !this.watermark) {
|
|
4362
4577
|
const watermark = this.accessor.createWatermarkComponent();
|
|
4363
4578
|
watermark.init({
|
|
4364
|
-
containerApi:
|
|
4579
|
+
containerApi: this._api,
|
|
4365
4580
|
group: this.groupPanel,
|
|
4366
4581
|
});
|
|
4367
4582
|
this.watermark = watermark;
|
|
@@ -4394,10 +4609,32 @@
|
|
|
4394
4609
|
}
|
|
4395
4610
|
return false;
|
|
4396
4611
|
}
|
|
4397
|
-
handleDropEvent(event, position, index) {
|
|
4612
|
+
handleDropEvent(type, event, position, index) {
|
|
4398
4613
|
if (this.locked === 'no-drop-target') {
|
|
4399
4614
|
return;
|
|
4400
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
|
+
}
|
|
4401
4638
|
const data = getPanelData();
|
|
4402
4639
|
if (data && data.viewId === this.accessor.id) {
|
|
4403
4640
|
if (data.panelId === null) {
|
|
@@ -4430,12 +4667,14 @@
|
|
|
4430
4667
|
});
|
|
4431
4668
|
}
|
|
4432
4669
|
else {
|
|
4433
|
-
this._onDidDrop.fire({
|
|
4670
|
+
this._onDidDrop.fire(new DockviewDidDropEvent({
|
|
4434
4671
|
nativeEvent: event,
|
|
4435
4672
|
position,
|
|
4436
|
-
|
|
4673
|
+
panel,
|
|
4437
4674
|
getData: () => getPanelData(),
|
|
4438
|
-
|
|
4675
|
+
group: this.groupPanel,
|
|
4676
|
+
api: this._api,
|
|
4677
|
+
}));
|
|
4439
4678
|
}
|
|
4440
4679
|
}
|
|
4441
4680
|
dispose() {
|
|
@@ -4443,6 +4682,7 @@
|
|
|
4443
4682
|
super.dispose();
|
|
4444
4683
|
(_a = this.watermark) === null || _a === void 0 ? void 0 : _a.element.remove();
|
|
4445
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;
|
|
4446
4686
|
for (const panel of this.panels) {
|
|
4447
4687
|
panel.dispose();
|
|
4448
4688
|
}
|
|
@@ -4464,15 +4704,7 @@
|
|
|
4464
4704
|
constructor(parentElement, disableResizing = false) {
|
|
4465
4705
|
super();
|
|
4466
4706
|
this._disableResizing = disableResizing;
|
|
4467
|
-
|
|
4468
|
-
this._element = parentElement;
|
|
4469
|
-
}
|
|
4470
|
-
else {
|
|
4471
|
-
this._element = document.createElement('div');
|
|
4472
|
-
this._element.style.height = '100%';
|
|
4473
|
-
this._element.style.width = '100%';
|
|
4474
|
-
this._element.className = 'dv-resizable-container';
|
|
4475
|
-
}
|
|
4707
|
+
this._element = parentElement;
|
|
4476
4708
|
this.addDisposables(watchElementResize(this._element, (entry) => {
|
|
4477
4709
|
if (this.isDisposed) {
|
|
4478
4710
|
/**
|
|
@@ -4560,25 +4792,38 @@
|
|
|
4560
4792
|
get activeGroup() {
|
|
4561
4793
|
return this._activeGroup;
|
|
4562
4794
|
}
|
|
4795
|
+
get locked() {
|
|
4796
|
+
return this.gridview.locked;
|
|
4797
|
+
}
|
|
4798
|
+
set locked(value) {
|
|
4799
|
+
this.gridview.locked = value;
|
|
4800
|
+
}
|
|
4563
4801
|
constructor(options) {
|
|
4564
|
-
super(
|
|
4802
|
+
super(document.createElement('div'), options.disableAutoResizing);
|
|
4565
4803
|
this._id = nextLayoutId$1.next();
|
|
4566
4804
|
this._groups = new Map();
|
|
4567
4805
|
this._onDidLayoutChange = new Emitter();
|
|
4568
4806
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
4569
|
-
this.
|
|
4570
|
-
this.
|
|
4571
|
-
this.
|
|
4572
|
-
this.
|
|
4573
|
-
this.
|
|
4574
|
-
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;
|
|
4575
4813
|
this._bufferOnDidLayoutChange = new TickDelayedEvent();
|
|
4814
|
+
this.element.style.height = '100%';
|
|
4815
|
+
this.element.style.width = '100%';
|
|
4816
|
+
options.parentElement.appendChild(this.element);
|
|
4576
4817
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
|
|
4818
|
+
this.gridview.locked = !!options.locked;
|
|
4577
4819
|
this.element.appendChild(this.gridview.element);
|
|
4578
4820
|
this.layout(0, 0, true); // set some elements height/widths
|
|
4579
|
-
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(() => {
|
|
4580
4825
|
this._bufferOnDidLayoutChange.fire();
|
|
4581
|
-
}), exports.DockviewEvent.any(this.
|
|
4826
|
+
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove, this.onDidActiveChange)(() => {
|
|
4582
4827
|
this._bufferOnDidLayoutChange.fire();
|
|
4583
4828
|
}), this._bufferOnDidLayoutChange.onEvent(() => {
|
|
4584
4829
|
this._onDidLayoutChange.fire();
|
|
@@ -4593,6 +4838,7 @@
|
|
|
4593
4838
|
}
|
|
4594
4839
|
maximizeGroup(panel) {
|
|
4595
4840
|
this.gridview.maximizeView(panel);
|
|
4841
|
+
this.doSetGroupActive(panel);
|
|
4596
4842
|
}
|
|
4597
4843
|
isMaximizedGroup(panel) {
|
|
4598
4844
|
return this.gridview.maximizedView() === panel;
|
|
@@ -4603,13 +4849,12 @@
|
|
|
4603
4849
|
hasMaximizedGroup() {
|
|
4604
4850
|
return this.gridview.hasMaximizedView();
|
|
4605
4851
|
}
|
|
4606
|
-
get
|
|
4607
|
-
return this.gridview.
|
|
4852
|
+
get onDidMaximizedGroupChange() {
|
|
4853
|
+
return this.gridview.onDidMaximizedNodeChange;
|
|
4608
4854
|
}
|
|
4609
4855
|
doAddGroup(group, location = [0], size) {
|
|
4610
4856
|
this.gridview.addView(group, size !== null && size !== void 0 ? size : exports.Sizing.Distribute, location);
|
|
4611
|
-
this.
|
|
4612
|
-
this.doSetGroupActive(group);
|
|
4857
|
+
this._onDidAdd.fire(group);
|
|
4613
4858
|
}
|
|
4614
4859
|
doRemoveGroup(group, options) {
|
|
4615
4860
|
if (!this._groups.has(group.id)) {
|
|
@@ -4621,8 +4866,8 @@
|
|
|
4621
4866
|
item.disposable.dispose();
|
|
4622
4867
|
item.value.dispose();
|
|
4623
4868
|
this._groups.delete(group.id);
|
|
4869
|
+
this._onDidRemove.fire(group);
|
|
4624
4870
|
}
|
|
4625
|
-
this._onDidRemoveGroup.fire(group);
|
|
4626
4871
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
4627
4872
|
const groups = Array.from(this._groups.values());
|
|
4628
4873
|
this.doSetGroupActive(groups.length > 0 ? groups[0].value : undefined);
|
|
@@ -4633,25 +4878,18 @@
|
|
|
4633
4878
|
var _a;
|
|
4634
4879
|
return (_a = this._groups.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
4635
4880
|
}
|
|
4636
|
-
doSetGroupActive(group
|
|
4637
|
-
var _a, _b, _c;
|
|
4881
|
+
doSetGroupActive(group) {
|
|
4638
4882
|
if (this._activeGroup === group) {
|
|
4639
4883
|
return;
|
|
4640
4884
|
}
|
|
4641
4885
|
if (this._activeGroup) {
|
|
4642
4886
|
this._activeGroup.setActive(false);
|
|
4643
|
-
if (!skipFocus) {
|
|
4644
|
-
(_b = (_a = this._activeGroup).focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4645
|
-
}
|
|
4646
4887
|
}
|
|
4647
4888
|
if (group) {
|
|
4648
4889
|
group.setActive(true);
|
|
4649
|
-
if (!skipFocus) {
|
|
4650
|
-
(_c = group.focus) === null || _c === void 0 ? void 0 : _c.call(group);
|
|
4651
|
-
}
|
|
4652
4890
|
}
|
|
4653
4891
|
this._activeGroup = group;
|
|
4654
|
-
this.
|
|
4892
|
+
this._onDidActiveChange.fire(group);
|
|
4655
4893
|
}
|
|
4656
4894
|
removeGroup(group) {
|
|
4657
4895
|
this.doRemoveGroup(group);
|
|
@@ -4696,9 +4934,9 @@
|
|
|
4696
4934
|
this.gridview.layout(width, height);
|
|
4697
4935
|
}
|
|
4698
4936
|
dispose() {
|
|
4699
|
-
this.
|
|
4700
|
-
this.
|
|
4701
|
-
this.
|
|
4937
|
+
this._onDidActiveChange.dispose();
|
|
4938
|
+
this._onDidAdd.dispose();
|
|
4939
|
+
this._onDidRemove.dispose();
|
|
4702
4940
|
this._onDidLayoutChange.dispose();
|
|
4703
4941
|
for (const group of this.groups) {
|
|
4704
4942
|
group.dispose();
|
|
@@ -4708,11 +4946,15 @@
|
|
|
4708
4946
|
}
|
|
4709
4947
|
}
|
|
4710
4948
|
|
|
4949
|
+
class WillFocusEvent extends DockviewEvent {
|
|
4950
|
+
constructor() {
|
|
4951
|
+
super();
|
|
4952
|
+
}
|
|
4953
|
+
}
|
|
4711
4954
|
/**
|
|
4712
4955
|
* A core api implementation that should be used across all panel-like objects
|
|
4713
4956
|
*/
|
|
4714
4957
|
class PanelApiImpl extends CompositeDisposable {
|
|
4715
|
-
//
|
|
4716
4958
|
get isFocused() {
|
|
4717
4959
|
return this._isFocused;
|
|
4718
4960
|
}
|
|
@@ -4722,6 +4964,9 @@
|
|
|
4722
4964
|
get isVisible() {
|
|
4723
4965
|
return this._isVisible;
|
|
4724
4966
|
}
|
|
4967
|
+
get isHidden() {
|
|
4968
|
+
return this._isHidden;
|
|
4969
|
+
}
|
|
4725
4970
|
get width() {
|
|
4726
4971
|
return this._width;
|
|
4727
4972
|
}
|
|
@@ -4734,38 +4979,26 @@
|
|
|
4734
4979
|
this._isFocused = false;
|
|
4735
4980
|
this._isActive = false;
|
|
4736
4981
|
this._isVisible = true;
|
|
4982
|
+
this._isHidden = false;
|
|
4737
4983
|
this._width = 0;
|
|
4738
4984
|
this._height = 0;
|
|
4739
4985
|
this.panelUpdatesDisposable = new MutableDisposable();
|
|
4740
|
-
this._onDidDimensionChange = new Emitter(
|
|
4741
|
-
replay: true,
|
|
4742
|
-
});
|
|
4986
|
+
this._onDidDimensionChange = new Emitter();
|
|
4743
4987
|
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
4744
|
-
|
|
4745
|
-
this._onDidChangeFocus = new Emitter({
|
|
4746
|
-
replay: true,
|
|
4747
|
-
});
|
|
4988
|
+
this._onDidChangeFocus = new Emitter();
|
|
4748
4989
|
this.onDidFocusChange = this._onDidChangeFocus.event;
|
|
4749
4990
|
//
|
|
4750
|
-
this.
|
|
4751
|
-
this.
|
|
4991
|
+
this._onWillFocus = new Emitter();
|
|
4992
|
+
this.onWillFocus = this._onWillFocus.event;
|
|
4752
4993
|
//
|
|
4753
|
-
this._onDidVisibilityChange = new Emitter(
|
|
4754
|
-
replay: true,
|
|
4755
|
-
});
|
|
4994
|
+
this._onDidVisibilityChange = new Emitter();
|
|
4756
4995
|
this.onDidVisibilityChange = this._onDidVisibilityChange.event;
|
|
4757
|
-
|
|
4758
|
-
this.
|
|
4759
|
-
this.
|
|
4760
|
-
//
|
|
4761
|
-
this._onDidActiveChange = new Emitter({
|
|
4762
|
-
replay: true,
|
|
4763
|
-
});
|
|
4996
|
+
this._onDidHiddenChange = new Emitter();
|
|
4997
|
+
this.onDidHiddenChange = this._onDidHiddenChange.event;
|
|
4998
|
+
this._onDidActiveChange = new Emitter();
|
|
4764
4999
|
this.onDidActiveChange = this._onDidActiveChange.event;
|
|
4765
|
-
//
|
|
4766
5000
|
this._onActiveChange = new Emitter();
|
|
4767
5001
|
this.onActiveChange = this._onActiveChange.event;
|
|
4768
|
-
//
|
|
4769
5002
|
this._onUpdateParameters = new Emitter();
|
|
4770
5003
|
this.onUpdateParameters = this._onUpdateParameters.event;
|
|
4771
5004
|
this.addDisposables(this.onDidFocusChange((event) => {
|
|
@@ -4774,10 +5007,12 @@
|
|
|
4774
5007
|
this._isActive = event.isActive;
|
|
4775
5008
|
}), this.onDidVisibilityChange((event) => {
|
|
4776
5009
|
this._isVisible = event.isVisible;
|
|
5010
|
+
}), this.onDidHiddenChange((event) => {
|
|
5011
|
+
this._isHidden = event.isHidden;
|
|
4777
5012
|
}), this.onDidDimensionsChange((event) => {
|
|
4778
5013
|
this._width = event.width;
|
|
4779
5014
|
this._height = event.height;
|
|
4780
|
-
}), 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);
|
|
4781
5016
|
}
|
|
4782
5017
|
initialize(panel) {
|
|
4783
5018
|
this.panelUpdatesDisposable.value = this._onUpdateParameters.event((parameters) => {
|
|
@@ -4786,8 +5021,8 @@
|
|
|
4786
5021
|
});
|
|
4787
5022
|
});
|
|
4788
5023
|
}
|
|
4789
|
-
|
|
4790
|
-
this.
|
|
5024
|
+
setHidden(isHidden) {
|
|
5025
|
+
this._onDidHiddenChange.fire({ isHidden });
|
|
4791
5026
|
}
|
|
4792
5027
|
setActive() {
|
|
4793
5028
|
this._onActiveChange.fire();
|
|
@@ -4795,9 +5030,6 @@
|
|
|
4795
5030
|
updateParameters(parameters) {
|
|
4796
5031
|
this._onUpdateParameters.fire(parameters);
|
|
4797
5032
|
}
|
|
4798
|
-
dispose() {
|
|
4799
|
-
super.dispose();
|
|
4800
|
-
}
|
|
4801
5033
|
}
|
|
4802
5034
|
|
|
4803
5035
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
@@ -4885,7 +5117,12 @@
|
|
|
4885
5117
|
}), focusTracker);
|
|
4886
5118
|
}
|
|
4887
5119
|
focus() {
|
|
4888
|
-
|
|
5120
|
+
const event = new WillFocusEvent();
|
|
5121
|
+
this.api._onWillFocus.fire(event);
|
|
5122
|
+
if (event.defaultPrevented) {
|
|
5123
|
+
return;
|
|
5124
|
+
}
|
|
5125
|
+
this._element.focus();
|
|
4889
5126
|
}
|
|
4890
5127
|
layout(width, height) {
|
|
4891
5128
|
this._width = width;
|
|
@@ -5214,9 +5451,7 @@
|
|
|
5214
5451
|
super(id);
|
|
5215
5452
|
this._onDidConstraintsChangeInternal = new Emitter();
|
|
5216
5453
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
5217
|
-
this._onDidConstraintsChange = new Emitter(
|
|
5218
|
-
replay: true,
|
|
5219
|
-
});
|
|
5454
|
+
this._onDidConstraintsChange = new Emitter();
|
|
5220
5455
|
this.onDidConstraintsChange = this._onDidConstraintsChange.event;
|
|
5221
5456
|
this._onDidSizeChange = new Emitter();
|
|
5222
5457
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
@@ -5309,13 +5544,13 @@
|
|
|
5309
5544
|
this._maximumHeight = options.maximumHeight;
|
|
5310
5545
|
}
|
|
5311
5546
|
this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
|
|
5312
|
-
this.addDisposables(this.api.
|
|
5313
|
-
const {
|
|
5547
|
+
this.addDisposables(this.api.onDidHiddenChange((event) => {
|
|
5548
|
+
const { isHidden } = event;
|
|
5314
5549
|
const { accessor } = this._params;
|
|
5315
|
-
accessor.setVisible(this,
|
|
5550
|
+
accessor.setVisible(this, !isHidden);
|
|
5316
5551
|
}), this.api.onActiveChange(() => {
|
|
5317
5552
|
const { accessor } = this._params;
|
|
5318
|
-
accessor.
|
|
5553
|
+
accessor.doSetGroupActive(this);
|
|
5319
5554
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
5320
5555
|
if (typeof event.minimumWidth === 'number' ||
|
|
5321
5556
|
typeof event.minimumWidth === 'function') {
|
|
@@ -5398,6 +5633,17 @@
|
|
|
5398
5633
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
5399
5634
|
this.addDisposables(this._onDidLocationChange);
|
|
5400
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
|
+
}
|
|
5401
5647
|
moveTo(options) {
|
|
5402
5648
|
var _a, _b, _c;
|
|
5403
5649
|
if (!this._group) {
|
|
@@ -5405,14 +5651,23 @@
|
|
|
5405
5651
|
}
|
|
5406
5652
|
const group = (_a = options.group) !== null && _a !== void 0 ? _a : this.accessor.addGroup({
|
|
5407
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
|
+
},
|
|
5408
5664
|
});
|
|
5409
|
-
this.accessor.moveGroupOrPanel(group, this._group.id, undefined, options.group ? (_c = options.position) !== null && _c !== void 0 ? _c : 'center' : 'center');
|
|
5410
5665
|
}
|
|
5411
5666
|
maximize() {
|
|
5412
5667
|
if (!this._group) {
|
|
5413
5668
|
throw new Error(NOT_INITIALIZED_MESSAGE);
|
|
5414
5669
|
}
|
|
5415
|
-
if (this.location !== 'grid') {
|
|
5670
|
+
if (this.location.type !== 'grid') {
|
|
5416
5671
|
// only grid groups can be maximized
|
|
5417
5672
|
return;
|
|
5418
5673
|
}
|
|
@@ -5469,6 +5724,12 @@
|
|
|
5469
5724
|
this.api.initialize(this); // cannot use 'this' after after 'super' call
|
|
5470
5725
|
this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
|
|
5471
5726
|
}
|
|
5727
|
+
focus() {
|
|
5728
|
+
if (!this.api.isActive) {
|
|
5729
|
+
this.api.setActive();
|
|
5730
|
+
}
|
|
5731
|
+
super.focus();
|
|
5732
|
+
}
|
|
5472
5733
|
initialize() {
|
|
5473
5734
|
this._model.initialize();
|
|
5474
5735
|
}
|
|
@@ -5514,6 +5775,9 @@
|
|
|
5514
5775
|
}
|
|
5515
5776
|
|
|
5516
5777
|
class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
5778
|
+
get location() {
|
|
5779
|
+
return this.group.api.location;
|
|
5780
|
+
}
|
|
5517
5781
|
get title() {
|
|
5518
5782
|
return this.panel.title;
|
|
5519
5783
|
}
|
|
@@ -5525,15 +5789,34 @@
|
|
|
5525
5789
|
}
|
|
5526
5790
|
set group(value) {
|
|
5527
5791
|
const isOldGroupActive = this.isGroupActive;
|
|
5528
|
-
this._group
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
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,
|
|
5533
5819
|
});
|
|
5534
|
-
if (this.isGroupActive !== isOldGroupActive) {
|
|
5535
|
-
this._onDidActiveGroupChange.fire();
|
|
5536
|
-
}
|
|
5537
5820
|
}
|
|
5538
5821
|
}
|
|
5539
5822
|
get group() {
|
|
@@ -5551,14 +5834,26 @@
|
|
|
5551
5834
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
5552
5835
|
this._onDidRendererChange = new Emitter();
|
|
5553
5836
|
this.onDidRendererChange = this._onDidRendererChange.event;
|
|
5554
|
-
this.
|
|
5837
|
+
this._onDidLocationChange = new Emitter();
|
|
5838
|
+
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
5839
|
+
this.groupEventsDisposable = new MutableDisposable();
|
|
5555
5840
|
this.initialize(panel);
|
|
5556
5841
|
this._group = group;
|
|
5557
|
-
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();
|
|
5558
5846
|
}
|
|
5559
5847
|
moveTo(options) {
|
|
5560
5848
|
var _a;
|
|
5561
|
-
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
|
+
});
|
|
5562
5857
|
}
|
|
5563
5858
|
setTitle(title) {
|
|
5564
5859
|
this.panel.setTitle(title);
|
|
@@ -5619,7 +5914,14 @@
|
|
|
5619
5914
|
this.setTitle(params.title);
|
|
5620
5915
|
}
|
|
5621
5916
|
focus() {
|
|
5622
|
-
|
|
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
|
+
}
|
|
5623
5925
|
}
|
|
5624
5926
|
toJSON() {
|
|
5625
5927
|
return {
|
|
@@ -5676,20 +5978,40 @@
|
|
|
5676
5978
|
},
|
|
5677
5979
|
});
|
|
5678
5980
|
}
|
|
5679
|
-
updateParentGroup(group,
|
|
5981
|
+
updateParentGroup(group, options) {
|
|
5680
5982
|
this._group = group;
|
|
5681
|
-
this.api.group =
|
|
5983
|
+
this.api.group = this._group;
|
|
5682
5984
|
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
5683
|
-
this.api.
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
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
|
+
}
|
|
5690
6012
|
}
|
|
5691
6013
|
layout(width, height) {
|
|
5692
|
-
//
|
|
6014
|
+
// TODO: Can we somehow do height without header height or indicate what the header height is?
|
|
5693
6015
|
this.api._onDidDimensionChange.fire({
|
|
5694
6016
|
width,
|
|
5695
6017
|
height: height,
|
|
@@ -5811,8 +6133,6 @@
|
|
|
5811
6133
|
this.id = id;
|
|
5812
6134
|
this.contentComponent = contentComponent;
|
|
5813
6135
|
this.tabComponent = tabComponent;
|
|
5814
|
-
this._group = null;
|
|
5815
|
-
this._isPanelVisible = null;
|
|
5816
6136
|
this._content = this.createContentComponent(this.id, contentComponent);
|
|
5817
6137
|
this._tab = this.createTabComponent(this.id, tabComponent);
|
|
5818
6138
|
}
|
|
@@ -5820,25 +6140,8 @@
|
|
|
5820
6140
|
this.content.init(Object.assign(Object.assign({}, params), { tab: this.tab }));
|
|
5821
6141
|
this.tab.init(params);
|
|
5822
6142
|
}
|
|
5823
|
-
updateParentGroup(
|
|
5824
|
-
|
|
5825
|
-
this._group = group;
|
|
5826
|
-
if (this._content.onGroupChange) {
|
|
5827
|
-
this._content.onGroupChange(group);
|
|
5828
|
-
}
|
|
5829
|
-
if (this._tab.onGroupChange) {
|
|
5830
|
-
this._tab.onGroupChange(group);
|
|
5831
|
-
}
|
|
5832
|
-
}
|
|
5833
|
-
if (isPanelVisible !== this._isPanelVisible) {
|
|
5834
|
-
this._isPanelVisible = isPanelVisible;
|
|
5835
|
-
if (this._content.onPanelVisibleChange) {
|
|
5836
|
-
this._content.onPanelVisibleChange(isPanelVisible);
|
|
5837
|
-
}
|
|
5838
|
-
if (this._tab.onPanelVisibleChange) {
|
|
5839
|
-
this._tab.onPanelVisibleChange(isPanelVisible);
|
|
5840
|
-
}
|
|
5841
|
-
}
|
|
6143
|
+
updateParentGroup(_group, _isPanelVisible) {
|
|
6144
|
+
// noop
|
|
5842
6145
|
}
|
|
5843
6146
|
layout(width, height) {
|
|
5844
6147
|
var _a, _b;
|
|
@@ -6271,117 +6574,6 @@
|
|
|
6271
6574
|
}
|
|
6272
6575
|
}
|
|
6273
6576
|
|
|
6274
|
-
class PopoutWindow extends CompositeDisposable {
|
|
6275
|
-
constructor(id, className, options) {
|
|
6276
|
-
super();
|
|
6277
|
-
this.id = id;
|
|
6278
|
-
this.className = className;
|
|
6279
|
-
this.options = options;
|
|
6280
|
-
this._onDidClose = new Emitter();
|
|
6281
|
-
this.onDidClose = this._onDidClose.event;
|
|
6282
|
-
this._window = null;
|
|
6283
|
-
this.addDisposables(this._onDidClose, {
|
|
6284
|
-
dispose: () => {
|
|
6285
|
-
this.close();
|
|
6286
|
-
},
|
|
6287
|
-
});
|
|
6288
|
-
}
|
|
6289
|
-
dimensions() {
|
|
6290
|
-
if (!this._window) {
|
|
6291
|
-
return null;
|
|
6292
|
-
}
|
|
6293
|
-
const left = this._window.value.screenX;
|
|
6294
|
-
const top = this._window.value.screenY;
|
|
6295
|
-
const width = this._window.value.innerWidth;
|
|
6296
|
-
const height = this._window.value.innerHeight;
|
|
6297
|
-
return { top, left, width, height };
|
|
6298
|
-
}
|
|
6299
|
-
close() {
|
|
6300
|
-
if (this._window) {
|
|
6301
|
-
this._window.disposable.dispose();
|
|
6302
|
-
this._window.value.close();
|
|
6303
|
-
this._window = null;
|
|
6304
|
-
}
|
|
6305
|
-
}
|
|
6306
|
-
open(content) {
|
|
6307
|
-
if (this._window) {
|
|
6308
|
-
throw new Error('instance of popout window is already open');
|
|
6309
|
-
}
|
|
6310
|
-
const url = `${this.options.url}`;
|
|
6311
|
-
const features = Object.entries({
|
|
6312
|
-
top: this.options.top,
|
|
6313
|
-
left: this.options.left,
|
|
6314
|
-
width: this.options.width,
|
|
6315
|
-
height: this.options.height,
|
|
6316
|
-
})
|
|
6317
|
-
.map(([key, value]) => `${key}=${value}`)
|
|
6318
|
-
.join(',');
|
|
6319
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Window/open
|
|
6320
|
-
const externalWindow = window.open(url, this.id, features);
|
|
6321
|
-
if (!externalWindow) {
|
|
6322
|
-
return;
|
|
6323
|
-
}
|
|
6324
|
-
const disposable = new CompositeDisposable();
|
|
6325
|
-
this._window = { value: externalWindow, disposable };
|
|
6326
|
-
const cleanUp = () => {
|
|
6327
|
-
this._onDidClose.fire();
|
|
6328
|
-
this._window = null;
|
|
6329
|
-
};
|
|
6330
|
-
// prevent any default content from loading
|
|
6331
|
-
// externalWindow.document.body.replaceWith(document.createElement('div'));
|
|
6332
|
-
disposable.addDisposables(addDisposableWindowListener(window, 'beforeunload', () => {
|
|
6333
|
-
cleanUp();
|
|
6334
|
-
this.close();
|
|
6335
|
-
}));
|
|
6336
|
-
externalWindow.addEventListener('load', () => {
|
|
6337
|
-
const externalDocument = externalWindow.document;
|
|
6338
|
-
externalDocument.title = document.title;
|
|
6339
|
-
const div = document.createElement('div');
|
|
6340
|
-
div.classList.add('dv-popout-window');
|
|
6341
|
-
div.style.position = 'absolute';
|
|
6342
|
-
div.style.width = '100%';
|
|
6343
|
-
div.style.height = '100%';
|
|
6344
|
-
div.style.top = '0px';
|
|
6345
|
-
div.style.left = '0px';
|
|
6346
|
-
div.classList.add(this.className);
|
|
6347
|
-
div.appendChild(content);
|
|
6348
|
-
externalDocument.body.replaceChildren(div);
|
|
6349
|
-
externalDocument.body.classList.add(this.className);
|
|
6350
|
-
addStyles(externalDocument, window.document.styleSheets);
|
|
6351
|
-
externalWindow.addEventListener('beforeunload', () => {
|
|
6352
|
-
// TODO: indicate external window is closing
|
|
6353
|
-
cleanUp();
|
|
6354
|
-
});
|
|
6355
|
-
});
|
|
6356
|
-
}
|
|
6357
|
-
}
|
|
6358
|
-
|
|
6359
|
-
class DockviewPopoutGroupPanel extends CompositeDisposable {
|
|
6360
|
-
constructor(id, group, options) {
|
|
6361
|
-
var _a;
|
|
6362
|
-
super();
|
|
6363
|
-
this.id = id;
|
|
6364
|
-
this.group = group;
|
|
6365
|
-
this.options = options;
|
|
6366
|
-
this.window = new PopoutWindow(id, (_a = options.className) !== null && _a !== void 0 ? _a : '', {
|
|
6367
|
-
url: this.options.popoutUrl,
|
|
6368
|
-
left: this.options.box.left,
|
|
6369
|
-
top: this.options.box.top,
|
|
6370
|
-
width: this.options.box.width,
|
|
6371
|
-
height: this.options.box.height,
|
|
6372
|
-
});
|
|
6373
|
-
group.model.location = 'popout';
|
|
6374
|
-
this.addDisposables(this.window, {
|
|
6375
|
-
dispose: () => {
|
|
6376
|
-
group.model.location = 'grid';
|
|
6377
|
-
},
|
|
6378
|
-
}, this.window.onDidClose(() => {
|
|
6379
|
-
this.dispose();
|
|
6380
|
-
}));
|
|
6381
|
-
this.window.open(group.element);
|
|
6382
|
-
}
|
|
6383
|
-
}
|
|
6384
|
-
|
|
6385
6577
|
const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
|
|
6386
6578
|
const DEFAULT_FLOATING_GROUP_POSITION = { left: 100, top: 100 };
|
|
6387
6579
|
|
|
@@ -6395,11 +6587,13 @@
|
|
|
6395
6587
|
super();
|
|
6396
6588
|
this.element = element;
|
|
6397
6589
|
this.map = {};
|
|
6590
|
+
this._disposed = false;
|
|
6398
6591
|
this.addDisposables(Disposable.from(() => {
|
|
6399
6592
|
for (const value of Object.values(this.map)) {
|
|
6400
6593
|
value.disposable.dispose();
|
|
6401
6594
|
value.destroy.dispose();
|
|
6402
6595
|
}
|
|
6596
|
+
this._disposed = true;
|
|
6403
6597
|
}));
|
|
6404
6598
|
}
|
|
6405
6599
|
detatch(panel) {
|
|
@@ -6439,7 +6633,7 @@
|
|
|
6439
6633
|
focusContainer.style.top = `${box.top - box2.top}px`;
|
|
6440
6634
|
focusContainer.style.width = `${box.width}px`;
|
|
6441
6635
|
focusContainer.style.height = `${box.height}px`;
|
|
6442
|
-
toggleClass(focusContainer, 'dv-render-overlay-float', panel.group.api.location === 'floating');
|
|
6636
|
+
toggleClass(focusContainer, 'dv-render-overlay-float', panel.group.api.location.type === 'floating');
|
|
6443
6637
|
};
|
|
6444
6638
|
const visibilityChanged = () => {
|
|
6445
6639
|
if (panel.api.isVisible) {
|
|
@@ -6485,8 +6679,11 @@
|
|
|
6485
6679
|
resize();
|
|
6486
6680
|
}));
|
|
6487
6681
|
this.map[panel.api.id].destroy = Disposable.from(() => {
|
|
6488
|
-
|
|
6489
|
-
|
|
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);
|
|
6490
6687
|
});
|
|
6491
6688
|
queueMicrotask(() => {
|
|
6492
6689
|
if (this.isDisposed) {
|
|
@@ -6507,11 +6704,187 @@
|
|
|
6507
6704
|
}
|
|
6508
6705
|
}
|
|
6509
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
|
+
|
|
6510
6869
|
const DEFAULT_ROOT_OVERLAY_MODEL = {
|
|
6511
6870
|
activationSize: { type: 'pixels', value: 10 },
|
|
6512
6871
|
size: { type: 'pixels', value: 20 },
|
|
6513
6872
|
};
|
|
6514
|
-
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) {
|
|
6515
6888
|
function toClassList(element) {
|
|
6516
6889
|
const list = [];
|
|
6517
6890
|
for (let i = 0; i < element.classList.length; i++) {
|
|
@@ -6562,6 +6935,7 @@
|
|
|
6562
6935
|
styles: options.styles,
|
|
6563
6936
|
parentElement: options.parentElement,
|
|
6564
6937
|
disableAutoResizing: options.disableAutoResizing,
|
|
6938
|
+
locked: options.locked,
|
|
6565
6939
|
});
|
|
6566
6940
|
this.nextGroupId = sequentialNumberGenerator();
|
|
6567
6941
|
this._deserializer = new DefaultDockviewDeserialzier(this);
|
|
@@ -6572,6 +6946,10 @@
|
|
|
6572
6946
|
this.onWillDragGroup = this._onWillDragGroup.event;
|
|
6573
6947
|
this._onDidDrop = new Emitter();
|
|
6574
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;
|
|
6575
6953
|
this._onDidRemovePanel = new Emitter();
|
|
6576
6954
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
6577
6955
|
this._onDidAddPanel = new Emitter();
|
|
@@ -6580,15 +6958,36 @@
|
|
|
6580
6958
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
6581
6959
|
this._onDidActivePanelChange = new Emitter();
|
|
6582
6960
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6961
|
+
this._onDidMovePanel = new Emitter();
|
|
6583
6962
|
this._floatingGroups = [];
|
|
6584
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;
|
|
6585
6972
|
const gready = document.createElement('div');
|
|
6586
6973
|
gready.className = 'dv-overlay-render-container';
|
|
6587
6974
|
this.gridview.element.appendChild(gready);
|
|
6588
6975
|
this.overlayRenderContainer = new OverlayRenderContainer(gready);
|
|
6589
6976
|
toggleClass(this.gridview.element, 'dv-dockview', true);
|
|
6590
6977
|
toggleClass(this.element, 'dv-debug', !!options.debug);
|
|
6591
|
-
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)(() => {
|
|
6592
6991
|
this.updateWatermark();
|
|
6593
6992
|
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
6594
6993
|
this._bufferOnDidLayoutChange.fire();
|
|
@@ -6599,7 +6998,7 @@
|
|
|
6599
6998
|
}
|
|
6600
6999
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
6601
7000
|
for (const group of [...this._popoutGroups]) {
|
|
6602
|
-
group.dispose();
|
|
7001
|
+
group.disposable.dispose();
|
|
6603
7002
|
}
|
|
6604
7003
|
}));
|
|
6605
7004
|
this._options = options;
|
|
@@ -6645,7 +7044,7 @@
|
|
|
6645
7044
|
return this.options.showDndOverlay({
|
|
6646
7045
|
nativeEvent: event,
|
|
6647
7046
|
position: position,
|
|
6648
|
-
target:
|
|
7047
|
+
target: 'edge',
|
|
6649
7048
|
getData: getPanelData,
|
|
6650
7049
|
});
|
|
6651
7050
|
}
|
|
@@ -6656,86 +7055,249 @@
|
|
|
6656
7055
|
});
|
|
6657
7056
|
this.addDisposables(this._rootDropTarget.onDrop((event) => {
|
|
6658
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
|
+
}
|
|
6659
7071
|
const data = getPanelData();
|
|
6660
7072
|
if (data) {
|
|
6661
|
-
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
|
+
});
|
|
6662
7083
|
}
|
|
6663
7084
|
else {
|
|
6664
|
-
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
|
+
}));
|
|
6665
7093
|
}
|
|
6666
7094
|
}), this._rootDropTarget);
|
|
6667
7095
|
this._api = new DockviewApi(this);
|
|
6668
7096
|
this.updateWatermark();
|
|
6669
7097
|
}
|
|
6670
|
-
addPopoutGroup(
|
|
6671
|
-
var _a;
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
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;
|
|
6683
7142
|
}
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
if (!box) {
|
|
6688
|
-
box = group.element.getBoundingClientRect();
|
|
7143
|
+
if (popoutContainer === null) {
|
|
7144
|
+
popoutWindowDisposable.dispose();
|
|
7145
|
+
return;
|
|
6689
7146
|
}
|
|
6690
|
-
const
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
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);
|
|
6707
7253
|
});
|
|
6708
|
-
popoutWindow.addDisposables({
|
|
6709
|
-
dispose: () => {
|
|
6710
|
-
remove(this._popoutGroups, popoutWindow);
|
|
6711
|
-
this.updateWatermark();
|
|
6712
|
-
},
|
|
6713
|
-
}, popoutWindow.window.onDidClose(() => {
|
|
6714
|
-
this.doAddGroup(group, [0]);
|
|
6715
|
-
}));
|
|
6716
|
-
this._popoutGroups.push(popoutWindow);
|
|
6717
|
-
this.updateWatermark();
|
|
6718
7254
|
}
|
|
6719
7255
|
addFloatingGroup(item, coord, options) {
|
|
6720
|
-
var _a, _b, _c, _d, _e, _f;
|
|
7256
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6721
7257
|
let group;
|
|
6722
7258
|
if (item instanceof DockviewPanel) {
|
|
6723
7259
|
group = this.createGroup();
|
|
6724
|
-
this.
|
|
7260
|
+
this._onDidAddGroup.fire(group);
|
|
7261
|
+
this.movingLock(() => this.removePanel(item, {
|
|
6725
7262
|
removeEmptyGroup: true,
|
|
6726
7263
|
skipDispose: true,
|
|
6727
|
-
|
|
6728
|
-
|
|
7264
|
+
skipSetActiveGroup: true,
|
|
7265
|
+
}));
|
|
7266
|
+
group.model.openPanel(item, { skipSetGroupActive: true });
|
|
6729
7267
|
}
|
|
6730
7268
|
else {
|
|
6731
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;
|
|
6732
7274
|
const skip = typeof (options === null || options === void 0 ? void 0 : options.skipRemoveGroup) === 'boolean' &&
|
|
6733
7275
|
options.skipRemoveGroup;
|
|
6734
7276
|
if (!skip) {
|
|
6735
|
-
|
|
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
|
+
}
|
|
6736
7298
|
}
|
|
6737
7299
|
}
|
|
6738
|
-
group.model.location = 'floating';
|
|
7300
|
+
group.model.location = { type: 'floating' };
|
|
6739
7301
|
const overlayLeft = typeof (coord === null || coord === void 0 ? void 0 : coord.x) === 'number'
|
|
6740
7302
|
? Math.max(coord.x, 0)
|
|
6741
7303
|
: DEFAULT_FLOATING_GROUP_POSITION.left;
|
|
@@ -6745,16 +7307,16 @@
|
|
|
6745
7307
|
const overlay = new Overlay({
|
|
6746
7308
|
container: this.gridview.element,
|
|
6747
7309
|
content: group.element,
|
|
6748
|
-
height: (
|
|
6749
|
-
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,
|
|
6750
7312
|
left: overlayLeft,
|
|
6751
7313
|
top: overlayTop,
|
|
6752
7314
|
minimumInViewportWidth: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
6753
7315
|
? undefined
|
|
6754
|
-
: (
|
|
7316
|
+
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumWidthWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
6755
7317
|
minimumInViewportHeight: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
6756
7318
|
? undefined
|
|
6757
|
-
: (
|
|
7319
|
+
: (_g = (_f = this.options.floatingGroupBounds) === null || _f === void 0 ? void 0 : _f.minimumHeightWithinViewport) !== null && _g !== void 0 ? _g : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
6758
7320
|
});
|
|
6759
7321
|
const el = group.element.querySelector('.void-container');
|
|
6760
7322
|
if (!el) {
|
|
@@ -6785,12 +7347,15 @@
|
|
|
6785
7347
|
}), {
|
|
6786
7348
|
dispose: () => {
|
|
6787
7349
|
disposable.dispose();
|
|
6788
|
-
group.model.location = 'grid';
|
|
7350
|
+
group.model.location = { type: 'grid' };
|
|
6789
7351
|
remove(this._floatingGroups, floatingGroupPanel);
|
|
6790
7352
|
this.updateWatermark();
|
|
6791
7353
|
},
|
|
6792
7354
|
});
|
|
6793
7355
|
this._floatingGroups.push(floatingGroupPanel);
|
|
7356
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipActiveGroup)) {
|
|
7357
|
+
this.doSetGroupAndPanelActive(group);
|
|
7358
|
+
}
|
|
6794
7359
|
this.updateWatermark();
|
|
6795
7360
|
}
|
|
6796
7361
|
orthogonalize(position) {
|
|
@@ -6880,8 +7445,8 @@
|
|
|
6880
7445
|
return this.panels.find((panel) => panel.id === id);
|
|
6881
7446
|
}
|
|
6882
7447
|
setActivePanel(panel) {
|
|
6883
|
-
this.doSetGroupActive(panel.group);
|
|
6884
7448
|
panel.group.model.openPanel(panel);
|
|
7449
|
+
this.doSetGroupAndPanelActive(panel.group);
|
|
6885
7450
|
}
|
|
6886
7451
|
moveToNext(options = {}) {
|
|
6887
7452
|
var _a;
|
|
@@ -6942,7 +7507,8 @@
|
|
|
6942
7507
|
});
|
|
6943
7508
|
const popoutGroups = this._popoutGroups.map((group) => {
|
|
6944
7509
|
return {
|
|
6945
|
-
data: group.
|
|
7510
|
+
data: group.popoutGroup.toJSON(),
|
|
7511
|
+
gridReferenceGroup: group.referenceGroup,
|
|
6946
7512
|
position: group.window.dimensions(),
|
|
6947
7513
|
};
|
|
6948
7514
|
});
|
|
@@ -6960,7 +7526,7 @@
|
|
|
6960
7526
|
return result;
|
|
6961
7527
|
}
|
|
6962
7528
|
fromJSON(data) {
|
|
6963
|
-
var _a, _b;
|
|
7529
|
+
var _a, _b, _c;
|
|
6964
7530
|
this.clear();
|
|
6965
7531
|
if (typeof data !== 'object' || data === null) {
|
|
6966
7532
|
throw new Error('serialized layout must be a non-null object');
|
|
@@ -6999,7 +7565,7 @@
|
|
|
6999
7565
|
const isActive = typeof activeView === 'string' &&
|
|
7000
7566
|
activeView === panel.id;
|
|
7001
7567
|
group.model.openPanel(panel, {
|
|
7002
|
-
|
|
7568
|
+
skipSetActive: !isActive,
|
|
7003
7569
|
skipSetGroupActive: true,
|
|
7004
7570
|
});
|
|
7005
7571
|
}
|
|
@@ -7029,11 +7595,16 @@
|
|
|
7029
7595
|
}
|
|
7030
7596
|
const serializedPopoutGroups = (_b = data.popoutGroups) !== null && _b !== void 0 ? _b : [];
|
|
7031
7597
|
for (const serializedPopoutGroup of serializedPopoutGroups) {
|
|
7032
|
-
const { data, position } = serializedPopoutGroup;
|
|
7598
|
+
const { data, position, gridReferenceGroup } = serializedPopoutGroup;
|
|
7033
7599
|
const group = createGroupFromSerializedState(data);
|
|
7034
|
-
this.addPopoutGroup(
|
|
7600
|
+
this.addPopoutGroup((_c = (gridReferenceGroup
|
|
7601
|
+
? this.getPanel(gridReferenceGroup)
|
|
7602
|
+
: undefined)) !== null && _c !== void 0 ? _c : group, {
|
|
7035
7603
|
skipRemoveGroup: true,
|
|
7036
7604
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
7605
|
+
overridePopoutGroup: gridReferenceGroup
|
|
7606
|
+
? group
|
|
7607
|
+
: undefined,
|
|
7037
7608
|
});
|
|
7038
7609
|
}
|
|
7039
7610
|
for (const floatingGroup of this._floatingGroups) {
|
|
@@ -7080,12 +7651,13 @@
|
|
|
7080
7651
|
*/
|
|
7081
7652
|
throw err;
|
|
7082
7653
|
}
|
|
7654
|
+
this.updateWatermark();
|
|
7083
7655
|
this._onDidLayoutFromJSON.fire();
|
|
7084
7656
|
}
|
|
7085
7657
|
clear() {
|
|
7086
7658
|
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
7087
7659
|
const hasActiveGroup = !!this.activeGroup;
|
|
7088
|
-
|
|
7660
|
+
!!this.activePanel;
|
|
7089
7661
|
for (const group of groups) {
|
|
7090
7662
|
// remove the group will automatically remove the panels
|
|
7091
7663
|
this.removeGroup(group, { skipActive: true });
|
|
@@ -7093,9 +7665,6 @@
|
|
|
7093
7665
|
if (hasActiveGroup) {
|
|
7094
7666
|
this.doSetGroupAndPanelActive(undefined);
|
|
7095
7667
|
}
|
|
7096
|
-
if (hasActivePanel) {
|
|
7097
|
-
this._onDidActivePanelChange.fire(undefined);
|
|
7098
|
-
}
|
|
7099
7668
|
this.gridview.clear();
|
|
7100
7669
|
}
|
|
7101
7670
|
closeAllGroups() {
|
|
@@ -7136,6 +7705,7 @@
|
|
|
7136
7705
|
const group = this.orthogonalize(directionToPosition(options.position.direction));
|
|
7137
7706
|
const panel = this.createPanel(options, group);
|
|
7138
7707
|
group.model.openPanel(panel);
|
|
7708
|
+
this.doSetGroupAndPanelActive(group);
|
|
7139
7709
|
return panel;
|
|
7140
7710
|
}
|
|
7141
7711
|
}
|
|
@@ -7147,6 +7717,7 @@
|
|
|
7147
7717
|
const target = toTarget(((_b = options.position) === null || _b === void 0 ? void 0 : _b.direction) || 'within');
|
|
7148
7718
|
if (options.floating) {
|
|
7149
7719
|
const group = this.createGroup();
|
|
7720
|
+
this._onDidAddGroup.fire(group);
|
|
7150
7721
|
const o = typeof options.floating === 'object' &&
|
|
7151
7722
|
options.floating !== null
|
|
7152
7723
|
? options.floating
|
|
@@ -7154,16 +7725,16 @@
|
|
|
7154
7725
|
this.addFloatingGroup(group, o, {
|
|
7155
7726
|
inDragMode: false,
|
|
7156
7727
|
skipRemoveGroup: true,
|
|
7728
|
+
skipActiveGroup: true,
|
|
7157
7729
|
});
|
|
7158
|
-
this._onDidAddGroup.fire(group);
|
|
7159
7730
|
panel = this.createPanel(options, group);
|
|
7160
7731
|
group.model.openPanel(panel);
|
|
7161
|
-
this.doSetGroupAndPanelActive(group);
|
|
7162
7732
|
}
|
|
7163
|
-
else if (referenceGroup.api.location === 'floating' ||
|
|
7733
|
+
else if (referenceGroup.api.location.type === 'floating' ||
|
|
7164
7734
|
target === 'center') {
|
|
7165
7735
|
panel = this.createPanel(options, referenceGroup);
|
|
7166
7736
|
referenceGroup.model.openPanel(panel);
|
|
7737
|
+
this.doSetGroupAndPanelActive(referenceGroup);
|
|
7167
7738
|
}
|
|
7168
7739
|
else {
|
|
7169
7740
|
const location = getGridLocation(referenceGroup.element);
|
|
@@ -7171,10 +7742,12 @@
|
|
|
7171
7742
|
const group = this.createGroupAtLocation(relativeLocation);
|
|
7172
7743
|
panel = this.createPanel(options, group);
|
|
7173
7744
|
group.model.openPanel(panel);
|
|
7745
|
+
this.doSetGroupAndPanelActive(group);
|
|
7174
7746
|
}
|
|
7175
7747
|
}
|
|
7176
7748
|
else if (options.floating) {
|
|
7177
7749
|
const group = this.createGroup();
|
|
7750
|
+
this._onDidAddGroup.fire(group);
|
|
7178
7751
|
const o = typeof options.floating === 'object' &&
|
|
7179
7752
|
options.floating !== null
|
|
7180
7753
|
? options.floating
|
|
@@ -7182,16 +7755,16 @@
|
|
|
7182
7755
|
this.addFloatingGroup(group, o, {
|
|
7183
7756
|
inDragMode: false,
|
|
7184
7757
|
skipRemoveGroup: true,
|
|
7758
|
+
skipActiveGroup: true,
|
|
7185
7759
|
});
|
|
7186
|
-
this._onDidAddGroup.fire(group);
|
|
7187
7760
|
panel = this.createPanel(options, group);
|
|
7188
7761
|
group.model.openPanel(panel);
|
|
7189
|
-
this.doSetGroupAndPanelActive(group);
|
|
7190
7762
|
}
|
|
7191
7763
|
else {
|
|
7192
7764
|
const group = this.createGroupAtLocation();
|
|
7193
7765
|
panel = this.createPanel(options, group);
|
|
7194
7766
|
group.model.openPanel(panel);
|
|
7767
|
+
this.doSetGroupAndPanelActive(group);
|
|
7195
7768
|
}
|
|
7196
7769
|
return panel;
|
|
7197
7770
|
}
|
|
@@ -7203,13 +7776,15 @@
|
|
|
7203
7776
|
if (!group) {
|
|
7204
7777
|
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
7205
7778
|
}
|
|
7206
|
-
group.model.removePanel(panel
|
|
7779
|
+
group.model.removePanel(panel, {
|
|
7780
|
+
skipSetActiveGroup: options.skipSetActiveGroup,
|
|
7781
|
+
});
|
|
7207
7782
|
if (!options.skipDispose) {
|
|
7208
|
-
|
|
7783
|
+
panel.group.model.renderContainer.detatch(panel);
|
|
7209
7784
|
panel.dispose();
|
|
7210
7785
|
}
|
|
7211
7786
|
if (group.size === 0 && options.removeEmptyGroup) {
|
|
7212
|
-
this.removeGroup(group);
|
|
7787
|
+
this.removeGroup(group, { skipActive: options.skipSetActiveGroup });
|
|
7213
7788
|
}
|
|
7214
7789
|
}
|
|
7215
7790
|
createWatermarkComponent() {
|
|
@@ -7222,7 +7797,7 @@
|
|
|
7222
7797
|
}
|
|
7223
7798
|
updateWatermark() {
|
|
7224
7799
|
var _a, _b;
|
|
7225
|
-
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) {
|
|
7226
7801
|
if (!this.watermark) {
|
|
7227
7802
|
this.watermark = this.createWatermarkComponent();
|
|
7228
7803
|
this.watermark.init({
|
|
@@ -7268,36 +7843,42 @@
|
|
|
7268
7843
|
}
|
|
7269
7844
|
else {
|
|
7270
7845
|
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
7846
|
+
if (!options.skipSetActive) {
|
|
7847
|
+
this.doSetGroupAndPanelActive(group);
|
|
7848
|
+
}
|
|
7271
7849
|
return group;
|
|
7272
7850
|
}
|
|
7273
7851
|
const target = toTarget(options.direction || 'within');
|
|
7274
7852
|
const location = getGridLocation(referenceGroup.element);
|
|
7275
7853
|
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
7276
7854
|
this.doAddGroup(group, relativeLocation);
|
|
7855
|
+
if (!options.skipSetActive) {
|
|
7856
|
+
this.doSetGroupAndPanelActive(group);
|
|
7857
|
+
}
|
|
7277
7858
|
return group;
|
|
7278
7859
|
}
|
|
7279
7860
|
else {
|
|
7280
7861
|
this.doAddGroup(group);
|
|
7862
|
+
this.doSetGroupAndPanelActive(group);
|
|
7281
7863
|
return group;
|
|
7282
7864
|
}
|
|
7283
7865
|
}
|
|
7284
7866
|
removeGroup(group, options) {
|
|
7867
|
+
this.doRemoveGroup(group, options);
|
|
7868
|
+
}
|
|
7869
|
+
doRemoveGroup(group, options) {
|
|
7285
7870
|
var _a;
|
|
7286
7871
|
const panels = [...group.panels]; // reassign since group panels will mutate
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
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
|
+
}
|
|
7292
7879
|
}
|
|
7293
7880
|
const activePanel = this.activePanel;
|
|
7294
|
-
|
|
7295
|
-
if (this.activePanel !== activePanel) {
|
|
7296
|
-
this._onDidActivePanelChange.fire(this.activePanel);
|
|
7297
|
-
}
|
|
7298
|
-
}
|
|
7299
|
-
doRemoveGroup(group, options) {
|
|
7300
|
-
if (group.api.location === 'floating') {
|
|
7881
|
+
if (group.api.location.type === 'floating') {
|
|
7301
7882
|
const floatingGroup = this._floatingGroups.find((_) => _.group === group);
|
|
7302
7883
|
if (floatingGroup) {
|
|
7303
7884
|
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
@@ -7309,60 +7890,124 @@
|
|
|
7309
7890
|
floatingGroup.dispose();
|
|
7310
7891
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
7311
7892
|
const groups = Array.from(this._groups.values());
|
|
7312
|
-
this.
|
|
7893
|
+
this.doSetGroupAndPanelActive(groups.length > 0 ? groups[0].value : undefined);
|
|
7313
7894
|
}
|
|
7314
7895
|
return floatingGroup.group;
|
|
7315
7896
|
}
|
|
7316
7897
|
throw new Error('failed to find floating group');
|
|
7317
7898
|
}
|
|
7318
|
-
if (group.api.location === 'popout') {
|
|
7319
|
-
const selectedGroup = this._popoutGroups.find((_) => _.
|
|
7899
|
+
if (group.api.location.type === 'popout') {
|
|
7900
|
+
const selectedGroup = this._popoutGroups.find((_) => _.popoutGroup === group);
|
|
7320
7901
|
if (selectedGroup) {
|
|
7321
7902
|
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
7322
|
-
|
|
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();
|
|
7323
7912
|
this._groups.delete(group.id);
|
|
7324
7913
|
this._onDidRemoveGroup.fire(group);
|
|
7325
7914
|
}
|
|
7326
|
-
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
|
+
}
|
|
7327
7920
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
7328
7921
|
const groups = Array.from(this._groups.values());
|
|
7329
|
-
this.
|
|
7922
|
+
this.doSetGroupAndPanelActive(groups.length > 0 ? groups[0].value : undefined);
|
|
7330
7923
|
}
|
|
7331
|
-
|
|
7924
|
+
this.updateWatermark();
|
|
7925
|
+
return selectedGroup.popoutGroup;
|
|
7332
7926
|
}
|
|
7333
7927
|
throw new Error('failed to find popout group');
|
|
7334
7928
|
}
|
|
7335
|
-
|
|
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;
|
|
7336
7936
|
}
|
|
7337
|
-
|
|
7338
|
-
|
|
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;
|
|
7339
7954
|
const sourceGroup = sourceGroupId
|
|
7340
7955
|
? (_a = this._groups.get(sourceGroupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
7341
7956
|
: undefined;
|
|
7957
|
+
if (!sourceGroup) {
|
|
7958
|
+
throw new Error(`Failed to find group id ${sourceGroupId}`);
|
|
7959
|
+
}
|
|
7342
7960
|
if (sourceItemId === undefined) {
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
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
|
+
});
|
|
7346
7971
|
return;
|
|
7347
7972
|
}
|
|
7348
7973
|
if (!destinationTarget || destinationTarget === 'center') {
|
|
7349
|
-
|
|
7350
|
-
|
|
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) {
|
|
7351
7982
|
throw new Error(`No panel with id ${sourceItemId}`);
|
|
7352
7983
|
}
|
|
7353
|
-
if (
|
|
7354
|
-
|
|
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 });
|
|
7355
7987
|
}
|
|
7356
|
-
destinationGroup.model.openPanel(
|
|
7988
|
+
this.movingLock(() => destinationGroup.model.openPanel(removedPanel, {
|
|
7357
7989
|
index: destinationIndex,
|
|
7990
|
+
skipSetGroupActive: true,
|
|
7991
|
+
}));
|
|
7992
|
+
this.doSetGroupAndPanelActive(destinationGroup);
|
|
7993
|
+
this._onDidMovePanel.fire({
|
|
7994
|
+
panel: removedPanel,
|
|
7358
7995
|
});
|
|
7359
7996
|
}
|
|
7360
7997
|
else {
|
|
7998
|
+
/**
|
|
7999
|
+
* Dropping a panel to the extremities of a group which will place that panel
|
|
8000
|
+
* into an adjacent group
|
|
8001
|
+
*/
|
|
7361
8002
|
const referenceLocation = getGridLocation(destinationGroup.element);
|
|
7362
8003
|
const targetLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
7363
|
-
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
|
+
*/
|
|
7364
8009
|
const [targetParentLocation, to] = tail(targetLocation);
|
|
7365
|
-
if (sourceGroup.api.location === 'grid') {
|
|
8010
|
+
if (sourceGroup.api.location.type === 'grid') {
|
|
7366
8011
|
const sourceLocation = getGridLocation(sourceGroup.element);
|
|
7367
8012
|
const [sourceParentLocation, from] = tail(sourceLocation);
|
|
7368
8013
|
if (sequenceEquals(sourceParentLocation, targetParentLocation)) {
|
|
@@ -7370,78 +8015,123 @@
|
|
|
7370
8015
|
// if a group has one tab - we are essentially moving the 'group'
|
|
7371
8016
|
// which is equivalent to swapping two views in this case
|
|
7372
8017
|
this.gridview.moveView(sourceParentLocation, from, to);
|
|
8018
|
+
return;
|
|
7373
8019
|
}
|
|
7374
8020
|
}
|
|
7375
8021
|
// source group will become empty so delete the group
|
|
7376
|
-
const targetGroup = this.doRemoveGroup(sourceGroup, {
|
|
8022
|
+
const targetGroup = this.movingLock(() => this.doRemoveGroup(sourceGroup, {
|
|
7377
8023
|
skipActive: true,
|
|
7378
8024
|
skipDispose: true,
|
|
7379
|
-
});
|
|
8025
|
+
}));
|
|
7380
8026
|
// after deleting the group we need to re-evaulate the ref location
|
|
7381
8027
|
const updatedReferenceLocation = getGridLocation(destinationGroup.element);
|
|
7382
8028
|
const location = getRelativeLocation(this.gridview.orientation, updatedReferenceLocation, destinationTarget);
|
|
7383
|
-
this.doAddGroup(targetGroup, location);
|
|
8029
|
+
this.movingLock(() => this.doAddGroup(targetGroup, location));
|
|
8030
|
+
this.doSetGroupAndPanelActive(targetGroup);
|
|
7384
8031
|
}
|
|
7385
8032
|
else {
|
|
7386
|
-
|
|
7387
|
-
|
|
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) {
|
|
7388
8042
|
throw new Error(`No panel with id ${sourceItemId}`);
|
|
7389
8043
|
}
|
|
7390
8044
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
7391
8045
|
const group = this.createGroupAtLocation(dropLocation);
|
|
7392
|
-
group.model.openPanel(
|
|
8046
|
+
this.movingLock(() => group.model.openPanel(removedPanel, {
|
|
8047
|
+
skipSetGroupActive: true,
|
|
8048
|
+
}));
|
|
8049
|
+
this.doSetGroupAndPanelActive(group);
|
|
7393
8050
|
}
|
|
7394
8051
|
}
|
|
7395
8052
|
}
|
|
7396
|
-
moveGroup(
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
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(() => {
|
|
7404
8066
|
for (const panel of panels) {
|
|
7405
|
-
|
|
7406
|
-
|
|
8067
|
+
to.model.openPanel(panel, {
|
|
8068
|
+
skipSetActive: panel !== activePanel,
|
|
8069
|
+
skipSetGroupActive: true,
|
|
7407
8070
|
});
|
|
7408
8071
|
}
|
|
7409
|
-
}
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
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');
|
|
7422
8087
|
}
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
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');
|
|
7429
8095
|
}
|
|
8096
|
+
selectedPopoutGroup.disposable.dispose();
|
|
7430
8097
|
}
|
|
7431
|
-
const referenceLocation = getGridLocation(referenceGroup.element);
|
|
7432
|
-
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
7433
|
-
this.gridview.addView(sourceGroup, exports.Sizing.Distribute, dropLocation);
|
|
7434
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
|
+
});
|
|
7435
8105
|
}
|
|
7436
8106
|
}
|
|
7437
|
-
|
|
7438
|
-
|
|
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);
|
|
7439
8117
|
const activePanel = this.activePanel;
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
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);
|
|
7443
8126
|
}
|
|
7444
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
|
+
}
|
|
7445
8135
|
createGroup(options) {
|
|
7446
8136
|
if (!options) {
|
|
7447
8137
|
options = {};
|
|
@@ -7458,7 +8148,7 @@
|
|
|
7458
8148
|
}
|
|
7459
8149
|
}
|
|
7460
8150
|
const view = new DockviewGroupPanel(this, id, options);
|
|
7461
|
-
view.init({ params: {}, accessor:
|
|
8151
|
+
view.init({ params: {}, accessor: this });
|
|
7462
8152
|
if (!this._groups.has(view.id)) {
|
|
7463
8153
|
const disposable = new CompositeDisposable(view.model.onTabDragStart((event) => {
|
|
7464
8154
|
this._onWillDragPanel.fire(event);
|
|
@@ -7466,20 +8156,48 @@
|
|
|
7466
8156
|
this._onWillDragGroup.fire(event);
|
|
7467
8157
|
}), view.model.onMove((event) => {
|
|
7468
8158
|
const { groupId, itemId, target, index } = event;
|
|
7469
|
-
this.moveGroupOrPanel(
|
|
8159
|
+
this.moveGroupOrPanel({
|
|
8160
|
+
from: { groupId: groupId, panelId: itemId },
|
|
8161
|
+
to: {
|
|
8162
|
+
group: view,
|
|
8163
|
+
position: target,
|
|
8164
|
+
index,
|
|
8165
|
+
},
|
|
8166
|
+
});
|
|
7470
8167
|
}), view.model.onDidDrop((event) => {
|
|
7471
|
-
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);
|
|
7472
8177
|
}), view.model.onDidAddPanel((event) => {
|
|
8178
|
+
if (this._moving) {
|
|
8179
|
+
return;
|
|
8180
|
+
}
|
|
7473
8181
|
this._onDidAddPanel.fire(event.panel);
|
|
7474
8182
|
}), view.model.onDidRemovePanel((event) => {
|
|
8183
|
+
if (this._moving) {
|
|
8184
|
+
return;
|
|
8185
|
+
}
|
|
7475
8186
|
this._onDidRemovePanel.fire(event.panel);
|
|
7476
8187
|
}), view.model.onDidActivePanelChange((event) => {
|
|
7477
|
-
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
|
+
}
|
|
7478
8197
|
}));
|
|
7479
8198
|
this._groups.set(view.id, { value: view, disposable });
|
|
7480
8199
|
}
|
|
7481
|
-
// TODO: must be called after the above listeners have been setup,
|
|
7482
|
-
// not an ideal pattern
|
|
8200
|
+
// TODO: must be called after the above listeners have been setup, not an ideal pattern
|
|
7483
8201
|
view.initialize();
|
|
7484
8202
|
return view;
|
|
7485
8203
|
}
|
|
@@ -7532,7 +8250,20 @@
|
|
|
7532
8250
|
});
|
|
7533
8251
|
this._onDidLayoutfromJSON = new Emitter();
|
|
7534
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;
|
|
7535
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
|
+
}));
|
|
7536
8267
|
if (!this.options.components) {
|
|
7537
8268
|
this.options.components = {};
|
|
7538
8269
|
}
|
|
@@ -7707,6 +8438,7 @@
|
|
|
7707
8438
|
});
|
|
7708
8439
|
this.registerPanel(view);
|
|
7709
8440
|
this.doAddGroup(view, relativeLocation, options.size);
|
|
8441
|
+
this.doSetGroupActive(view);
|
|
7710
8442
|
return view;
|
|
7711
8443
|
}
|
|
7712
8444
|
registerPanel(panel) {
|
|
@@ -8392,10 +9124,10 @@
|
|
|
8392
9124
|
this._onDidChange = new Emitter();
|
|
8393
9125
|
this.onDidChange = this._onDidChange.event;
|
|
8394
9126
|
this.api.initialize(this);
|
|
8395
|
-
this.addDisposables(this._onDidChange, this.api.
|
|
8396
|
-
const {
|
|
9127
|
+
this.addDisposables(this._onDidChange, this.api.onDidHiddenChange((event) => {
|
|
9128
|
+
const { isHidden } = event;
|
|
8397
9129
|
const { accessor } = this._params;
|
|
8398
|
-
accessor.setVisible(this,
|
|
9130
|
+
accessor.setVisible(this, !isHidden);
|
|
8399
9131
|
}), this.api.onActiveChange(() => {
|
|
8400
9132
|
const { accessor } = this._params;
|
|
8401
9133
|
accessor.setActive(this);
|
|
@@ -8461,11 +9193,13 @@
|
|
|
8461
9193
|
exports.DockviewApi = DockviewApi;
|
|
8462
9194
|
exports.DockviewComponent = DockviewComponent;
|
|
8463
9195
|
exports.DockviewCompositeDisposable = CompositeDisposable;
|
|
9196
|
+
exports.DockviewDidDropEvent = DockviewDidDropEvent;
|
|
8464
9197
|
exports.DockviewEmitter = Emitter;
|
|
8465
9198
|
exports.DockviewGroupPanel = DockviewGroupPanel;
|
|
8466
9199
|
exports.DockviewGroupPanelModel = DockviewGroupPanelModel;
|
|
8467
9200
|
exports.DockviewMutableDisposable = MutableDisposable;
|
|
8468
9201
|
exports.DockviewPanel = DockviewPanel;
|
|
9202
|
+
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
8469
9203
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
8470
9204
|
exports.Gridview = Gridview;
|
|
8471
9205
|
exports.GridviewApi = GridviewApi;
|
|
@@ -8484,6 +9218,7 @@
|
|
|
8484
9218
|
exports.SplitviewComponent = SplitviewComponent;
|
|
8485
9219
|
exports.SplitviewPanel = SplitviewPanel;
|
|
8486
9220
|
exports.Tab = Tab;
|
|
9221
|
+
exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
|
|
8487
9222
|
exports.createComponent = createComponent;
|
|
8488
9223
|
exports.directionToPosition = directionToPosition;
|
|
8489
9224
|
exports.getDirectionOrientation = getDirectionOrientation;
|