dockview-core 1.9.2 → 1.10.1
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 +35 -8
- package/dist/cjs/api/component.api.js +37 -7
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +7 -1
- package/dist/cjs/api/dockviewGroupPanelApi.js +22 -3
- package/dist/cjs/api/dockviewPanelApi.d.ts +24 -7
- package/dist/cjs/api/dockviewPanelApi.js +60 -14
- package/dist/cjs/api/gridviewPanelApi.d.ts +0 -1
- package/dist/cjs/api/gridviewPanelApi.js +1 -4
- package/dist/cjs/api/panelApi.d.ts +10 -8
- package/dist/cjs/api/panelApi.js +19 -29
- 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 +586 -198
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +0 -1
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.js +0 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.js +6 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +81 -37
- 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 +10 -6
- package/dist/cjs/dockview/options.js +0 -1
- package/dist/cjs/dockview/types.d.ts +0 -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 +2 -3
- 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 +3 -4
- 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 +1 -1
- package/dist/cjs/paneview/paneview.js +3 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +2 -1
- package/dist/cjs/paneview/paneviewComponent.js +6 -1
- package/dist/cjs/paneview/paneviewPanel.d.ts +2 -1
- package/dist/cjs/paneview/paneviewPanel.js +5 -2
- 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 +1 -2
- package/dist/cjs/splitview/splitviewComponent.js +5 -6
- package/dist/cjs/splitview/splitviewPanel.d.ts +2 -3
- package/dist/cjs/splitview/splitviewPanel.js +1 -2
- 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 +1298 -531
- 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 +1297 -530
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +1298 -531
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +1296 -532
- 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 +1298 -531
- 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 +1297 -530
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +35 -8
- package/dist/esm/api/component.api.js +29 -7
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +7 -1
- package/dist/esm/api/dockviewGroupPanelApi.js +22 -3
- package/dist/esm/api/dockviewPanelApi.d.ts +24 -7
- package/dist/esm/api/dockviewPanelApi.js +56 -14
- package/dist/esm/api/gridviewPanelApi.d.ts +0 -1
- package/dist/esm/api/gridviewPanelApi.js +1 -4
- package/dist/esm/api/panelApi.d.ts +10 -8
- package/dist/esm/api/panelApi.js +16 -29
- 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 +529 -163
- package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +0 -1
- package/dist/esm/dockview/dockviewFloatingGroupPanel.js +0 -1
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +1 -1
- package/dist/esm/dockview/dockviewGroupPanel.js +6 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +81 -37
- 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 +10 -6
- package/dist/esm/dockview/options.js +0 -1
- package/dist/esm/dockview/types.d.ts +0 -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 +2 -3
- 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 +3 -4
- 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 +1 -1
- package/dist/esm/paneview/paneview.js +3 -1
- package/dist/esm/paneview/paneviewComponent.d.ts +2 -1
- package/dist/esm/paneview/paneviewComponent.js +6 -1
- package/dist/esm/paneview/paneviewPanel.d.ts +2 -1
- package/dist/esm/paneview/paneviewPanel.js +5 -2
- 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 +1 -2
- package/dist/esm/splitview/splitviewComponent.js +5 -6
- package/dist/esm/splitview/splitviewPanel.d.ts +2 -3
- package/dist/esm/splitview/splitviewPanel.js +1 -2
- 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.1
|
|
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();
|
|
@@ -1426,6 +1452,9 @@
|
|
|
1426
1452
|
this._onDidChange.fire();
|
|
1427
1453
|
}));
|
|
1428
1454
|
}
|
|
1455
|
+
setViewVisible(index, visible) {
|
|
1456
|
+
this.splitview.setViewVisible(index, visible);
|
|
1457
|
+
}
|
|
1429
1458
|
addPane(pane, size, index = this.splitview.length, skipLayout = false) {
|
|
1430
1459
|
const disposable = pane.onDidChangeExpansionState(() => {
|
|
1431
1460
|
this.setupAnimation();
|
|
@@ -1679,7 +1708,13 @@
|
|
|
1679
1708
|
}
|
|
1680
1709
|
return exports.LayoutPriority.Normal;
|
|
1681
1710
|
}
|
|
1682
|
-
|
|
1711
|
+
get disabled() {
|
|
1712
|
+
return this.splitview.disabled;
|
|
1713
|
+
}
|
|
1714
|
+
set disabled(value) {
|
|
1715
|
+
this.splitview.disabled = value;
|
|
1716
|
+
}
|
|
1717
|
+
constructor(orientation, proportionalLayout, styles, size, orthogonalSize, disabled, childDescriptors) {
|
|
1683
1718
|
super();
|
|
1684
1719
|
this.orientation = orientation;
|
|
1685
1720
|
this.proportionalLayout = proportionalLayout;
|
|
@@ -1724,6 +1759,7 @@
|
|
|
1724
1759
|
styles,
|
|
1725
1760
|
});
|
|
1726
1761
|
}
|
|
1762
|
+
this.disabled = disabled;
|
|
1727
1763
|
this.addDisposables(this._onDidChange, this._onDidVisibilityChange, this.splitview.onDidSashEnd(() => {
|
|
1728
1764
|
this._onDidChange.fire({});
|
|
1729
1765
|
}));
|
|
@@ -1857,7 +1893,7 @@
|
|
|
1857
1893
|
}
|
|
1858
1894
|
function flipNode(node, size, orthogonalSize) {
|
|
1859
1895
|
if (node instanceof BranchNode) {
|
|
1860
|
-
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize);
|
|
1896
|
+
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize, node.disabled);
|
|
1861
1897
|
let totalSize = 0;
|
|
1862
1898
|
for (let i = node.children.length - 1; i >= 0; i--) {
|
|
1863
1899
|
const child = node.children[i];
|
|
@@ -1993,31 +2029,57 @@
|
|
|
1993
2029
|
get maximumHeight() {
|
|
1994
2030
|
return this.root.maximumHeight;
|
|
1995
2031
|
}
|
|
2032
|
+
get locked() {
|
|
2033
|
+
return this._locked;
|
|
2034
|
+
}
|
|
2035
|
+
set locked(value) {
|
|
2036
|
+
this._locked = value;
|
|
2037
|
+
const branch = [this.root];
|
|
2038
|
+
/**
|
|
2039
|
+
* simple depth-first-search to cover all nodes
|
|
2040
|
+
*
|
|
2041
|
+
* @see https://en.wikipedia.org/wiki/Depth-first_search
|
|
2042
|
+
*/
|
|
2043
|
+
while (branch.length > 0) {
|
|
2044
|
+
const node = branch.pop();
|
|
2045
|
+
if (node instanceof BranchNode) {
|
|
2046
|
+
node.disabled = value;
|
|
2047
|
+
branch.push(...node.children);
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
1996
2051
|
maximizedView() {
|
|
1997
2052
|
var _a;
|
|
1998
|
-
return (_a = this._maximizedNode) === null || _a === void 0 ? void 0 : _a.view;
|
|
2053
|
+
return (_a = this._maximizedNode) === null || _a === void 0 ? void 0 : _a.leaf.view;
|
|
1999
2054
|
}
|
|
2000
2055
|
hasMaximizedView() {
|
|
2001
2056
|
return this._maximizedNode !== undefined;
|
|
2002
2057
|
}
|
|
2003
2058
|
maximizeView(view) {
|
|
2059
|
+
var _a;
|
|
2004
2060
|
const location = getGridLocation(view.element);
|
|
2005
2061
|
const [_, node] = this.getNode(location);
|
|
2006
2062
|
if (!(node instanceof LeafNode)) {
|
|
2007
2063
|
return;
|
|
2008
2064
|
}
|
|
2009
|
-
if (this._maximizedNode === node) {
|
|
2065
|
+
if (((_a = this._maximizedNode) === null || _a === void 0 ? void 0 : _a.leaf) === node) {
|
|
2010
2066
|
return;
|
|
2011
2067
|
}
|
|
2012
2068
|
if (this.hasMaximizedView()) {
|
|
2013
2069
|
this.exitMaximizedView();
|
|
2014
2070
|
}
|
|
2071
|
+
const hiddenOnMaximize = [];
|
|
2015
2072
|
function hideAllViewsBut(parent, exclude) {
|
|
2016
2073
|
for (let i = 0; i < parent.children.length; i++) {
|
|
2017
2074
|
const child = parent.children[i];
|
|
2018
2075
|
if (child instanceof LeafNode) {
|
|
2019
2076
|
if (child !== exclude) {
|
|
2020
|
-
parent.
|
|
2077
|
+
if (parent.isChildVisible(i)) {
|
|
2078
|
+
parent.setChildVisible(i, false);
|
|
2079
|
+
}
|
|
2080
|
+
else {
|
|
2081
|
+
hiddenOnMaximize.push(child);
|
|
2082
|
+
}
|
|
2021
2083
|
}
|
|
2022
2084
|
}
|
|
2023
2085
|
else {
|
|
@@ -2026,18 +2088,21 @@
|
|
|
2026
2088
|
}
|
|
2027
2089
|
}
|
|
2028
2090
|
hideAllViewsBut(this.root, node);
|
|
2029
|
-
this._maximizedNode = node;
|
|
2030
|
-
this.
|
|
2091
|
+
this._maximizedNode = { leaf: node, hiddenOnMaximize };
|
|
2092
|
+
this._onDidMaximizedNodeChange.fire();
|
|
2031
2093
|
}
|
|
2032
2094
|
exitMaximizedView() {
|
|
2033
2095
|
if (!this._maximizedNode) {
|
|
2034
2096
|
return;
|
|
2035
2097
|
}
|
|
2098
|
+
const hiddenOnMaximize = this._maximizedNode.hiddenOnMaximize;
|
|
2036
2099
|
function showViewsInReverseOrder(parent) {
|
|
2037
2100
|
for (let index = parent.children.length - 1; index >= 0; index--) {
|
|
2038
2101
|
const child = parent.children[index];
|
|
2039
2102
|
if (child instanceof LeafNode) {
|
|
2040
|
-
|
|
2103
|
+
if (!hiddenOnMaximize.includes(child)) {
|
|
2104
|
+
parent.setChildVisible(index, true);
|
|
2105
|
+
}
|
|
2041
2106
|
}
|
|
2042
2107
|
else {
|
|
2043
2108
|
showViewsInReverseOrder(child);
|
|
@@ -2046,13 +2111,13 @@
|
|
|
2046
2111
|
}
|
|
2047
2112
|
showViewsInReverseOrder(this.root);
|
|
2048
2113
|
this._maximizedNode = undefined;
|
|
2049
|
-
this.
|
|
2114
|
+
this._onDidMaximizedNodeChange.fire();
|
|
2050
2115
|
}
|
|
2051
2116
|
serialize() {
|
|
2052
2117
|
if (this.hasMaximizedView()) {
|
|
2053
2118
|
/**
|
|
2054
|
-
* do not persist maximized view state
|
|
2055
|
-
*
|
|
2119
|
+
* do not persist maximized view state
|
|
2120
|
+
* firstly exit any maximized views to ensure the correct dimensions are persisted
|
|
2056
2121
|
*/
|
|
2057
2122
|
this.exitMaximizedView();
|
|
2058
2123
|
}
|
|
@@ -2067,14 +2132,14 @@
|
|
|
2067
2132
|
dispose() {
|
|
2068
2133
|
this.disposable.dispose();
|
|
2069
2134
|
this._onDidChange.dispose();
|
|
2070
|
-
this.
|
|
2135
|
+
this._onDidMaximizedNodeChange.dispose();
|
|
2071
2136
|
this.root.dispose();
|
|
2072
2137
|
this._maximizedNode = undefined;
|
|
2073
2138
|
this.element.remove();
|
|
2074
2139
|
}
|
|
2075
2140
|
clear() {
|
|
2076
2141
|
const orientation = this.root.orientation;
|
|
2077
|
-
this.root = new BranchNode(orientation, this.proportionalLayout, this.styles, this.root.size, this.root.orthogonalSize);
|
|
2142
|
+
this.root = new BranchNode(orientation, this.proportionalLayout, this.styles, this.root.size, this.root.orthogonalSize, this._locked);
|
|
2078
2143
|
}
|
|
2079
2144
|
deserialize(json, deserializer) {
|
|
2080
2145
|
const orientation = json.orientation;
|
|
@@ -2095,8 +2160,8 @@
|
|
|
2095
2160
|
};
|
|
2096
2161
|
});
|
|
2097
2162
|
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);
|
|
2163
|
+
orthogonalSize, // <- size - flips at each depth,
|
|
2164
|
+
this._locked, children);
|
|
2100
2165
|
}
|
|
2101
2166
|
else {
|
|
2102
2167
|
result = new LeafNode(deserializer.fromJSON(node), orientation, orthogonalSize, node.size);
|
|
@@ -2129,7 +2194,7 @@
|
|
|
2129
2194
|
}
|
|
2130
2195
|
const oldRoot = this.root;
|
|
2131
2196
|
oldRoot.element.remove();
|
|
2132
|
-
this._root = new BranchNode(orthogonal(oldRoot.orientation), this.proportionalLayout, this.styles, this.root.orthogonalSize, this.root.size);
|
|
2197
|
+
this._root = new BranchNode(orthogonal(oldRoot.orientation), this.proportionalLayout, this.styles, this.root.orthogonalSize, this.root.size, this._locked);
|
|
2133
2198
|
if (oldRoot.children.length === 0) ;
|
|
2134
2199
|
else if (oldRoot.children.length === 1) {
|
|
2135
2200
|
// can remove one level of redundant branching if there is only a single child
|
|
@@ -2197,15 +2262,16 @@
|
|
|
2197
2262
|
constructor(proportionalLayout, styles, orientation) {
|
|
2198
2263
|
this.proportionalLayout = proportionalLayout;
|
|
2199
2264
|
this.styles = styles;
|
|
2265
|
+
this._locked = false;
|
|
2200
2266
|
this._maximizedNode = undefined;
|
|
2201
2267
|
this.disposable = new MutableDisposable();
|
|
2202
2268
|
this._onDidChange = new Emitter();
|
|
2203
2269
|
this.onDidChange = this._onDidChange.event;
|
|
2204
|
-
this.
|
|
2205
|
-
this.
|
|
2270
|
+
this._onDidMaximizedNodeChange = new Emitter();
|
|
2271
|
+
this.onDidMaximizedNodeChange = this._onDidMaximizedNodeChange.event;
|
|
2206
2272
|
this.element = document.createElement('div');
|
|
2207
2273
|
this.element.className = 'grid-view';
|
|
2208
|
-
this.root = new BranchNode(orientation, proportionalLayout, styles, 0, 0);
|
|
2274
|
+
this.root = new BranchNode(orientation, proportionalLayout, styles, 0, 0, this._locked);
|
|
2209
2275
|
}
|
|
2210
2276
|
isViewVisible(location) {
|
|
2211
2277
|
const [rest, index] = tail(location);
|
|
@@ -2256,7 +2322,7 @@
|
|
|
2256
2322
|
}
|
|
2257
2323
|
const child = grandParent.removeChild(parentIndex);
|
|
2258
2324
|
child.dispose();
|
|
2259
|
-
const newParent = new BranchNode(parent.orientation, this.proportionalLayout, this.styles, parent.size, parent.orthogonalSize);
|
|
2325
|
+
const newParent = new BranchNode(parent.orientation, this.proportionalLayout, this.styles, parent.size, parent.orthogonalSize, this._locked);
|
|
2260
2326
|
grandParent.addChild(newParent, parent.size, parentIndex);
|
|
2261
2327
|
const newSibling = new LeafNode(parent.view, grandParent.orientation, parent.size);
|
|
2262
2328
|
newParent.addChild(newSibling, newSiblingSize, 0);
|
|
@@ -2884,13 +2950,36 @@
|
|
|
2884
2950
|
return this.component.onDidDrop;
|
|
2885
2951
|
}
|
|
2886
2952
|
/**
|
|
2887
|
-
* Invoked
|
|
2953
|
+
* Invoked when a Drag'n'Drop event occurs but before dockview handles it giving the user an opportunity to intecept and
|
|
2954
|
+
* prevent the event from occuring using the standard `preventDefault()` syntax.
|
|
2955
|
+
*
|
|
2956
|
+
* Preventing certain events may causes unexpected behaviours, use carefully.
|
|
2957
|
+
*/
|
|
2958
|
+
get onWillDrop() {
|
|
2959
|
+
return this.component.onWillDrop;
|
|
2960
|
+
}
|
|
2961
|
+
/**
|
|
2962
|
+
* Invoked before an overlay is shown indicating a drop target.
|
|
2963
|
+
*
|
|
2964
|
+
* Calling `event.preventDefault()` will prevent the overlay being shown and prevent
|
|
2965
|
+
* the any subsequent drop event.
|
|
2966
|
+
*/
|
|
2967
|
+
get onWillShowOverlay() {
|
|
2968
|
+
return this.component.onWillShowOverlay;
|
|
2969
|
+
}
|
|
2970
|
+
/**
|
|
2971
|
+
* Invoked before a group is dragged.
|
|
2972
|
+
*
|
|
2973
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the group drag starting.
|
|
2974
|
+
*
|
|
2888
2975
|
*/
|
|
2889
2976
|
get onWillDragGroup() {
|
|
2890
2977
|
return this.component.onWillDragGroup;
|
|
2891
2978
|
}
|
|
2892
2979
|
/**
|
|
2893
|
-
* Invoked before a panel is dragged.
|
|
2980
|
+
* Invoked before a panel is dragged.
|
|
2981
|
+
*
|
|
2982
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
|
|
2894
2983
|
*/
|
|
2895
2984
|
get onWillDragPanel() {
|
|
2896
2985
|
return this.component.onWillDragPanel;
|
|
@@ -3018,17 +3107,17 @@
|
|
|
3018
3107
|
hasMaximizedGroup() {
|
|
3019
3108
|
return this.component.hasMaximizedGroup();
|
|
3020
3109
|
}
|
|
3021
|
-
|
|
3110
|
+
exitMaximizedGroup() {
|
|
3022
3111
|
this.component.exitMaximizedGroup();
|
|
3023
3112
|
}
|
|
3024
|
-
get
|
|
3025
|
-
return this.component.
|
|
3113
|
+
get onDidMaximizedGroupChange() {
|
|
3114
|
+
return this.component.onDidMaximizedGroupChange;
|
|
3026
3115
|
}
|
|
3027
3116
|
/**
|
|
3028
3117
|
* Add a popout group in a new Window
|
|
3029
3118
|
*/
|
|
3030
3119
|
addPopoutGroup(item, options) {
|
|
3031
|
-
this.component.addPopoutGroup(item, options);
|
|
3120
|
+
return this.component.addPopoutGroup(item, options);
|
|
3032
3121
|
}
|
|
3033
3122
|
}
|
|
3034
3123
|
|
|
@@ -3082,6 +3171,18 @@
|
|
|
3082
3171
|
}
|
|
3083
3172
|
}
|
|
3084
3173
|
|
|
3174
|
+
class WillShowOverlayEvent extends DockviewEvent {
|
|
3175
|
+
get nativeEvent() {
|
|
3176
|
+
return this.options.nativeEvent;
|
|
3177
|
+
}
|
|
3178
|
+
get position() {
|
|
3179
|
+
return this.options.position;
|
|
3180
|
+
}
|
|
3181
|
+
constructor(options) {
|
|
3182
|
+
super();
|
|
3183
|
+
this.options = options;
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3085
3186
|
function directionToPosition(direction) {
|
|
3086
3187
|
switch (direction) {
|
|
3087
3188
|
case 'above':
|
|
@@ -3134,6 +3235,8 @@
|
|
|
3134
3235
|
this.options = options;
|
|
3135
3236
|
this._onDrop = new Emitter();
|
|
3136
3237
|
this.onDrop = this._onDrop.event;
|
|
3238
|
+
this._onWillShowOverlay = new Emitter();
|
|
3239
|
+
this.onWillShowOverlay = this._onWillShowOverlay.event;
|
|
3137
3240
|
// use a set to take advantage of #<set>.has
|
|
3138
3241
|
this._acceptedTargetZonesSet = new Set(this.options.acceptedTargetZones);
|
|
3139
3242
|
this.dnd = new DragAndDropObserver(this.element, {
|
|
@@ -3162,6 +3265,19 @@
|
|
|
3162
3265
|
this.removeDropTarget();
|
|
3163
3266
|
return;
|
|
3164
3267
|
}
|
|
3268
|
+
const willShowOverlayEvent = new WillShowOverlayEvent({
|
|
3269
|
+
nativeEvent: e,
|
|
3270
|
+
position: quadrant,
|
|
3271
|
+
});
|
|
3272
|
+
/**
|
|
3273
|
+
* Provide an opportunity to prevent the overlay appearing and in turn
|
|
3274
|
+
* any dnd behaviours
|
|
3275
|
+
*/
|
|
3276
|
+
this._onWillShowOverlay.fire(willShowOverlayEvent);
|
|
3277
|
+
if (willShowOverlayEvent.defaultPrevented) {
|
|
3278
|
+
this.removeDropTarget();
|
|
3279
|
+
return;
|
|
3280
|
+
}
|
|
3165
3281
|
if (typeof this.options.canDisplayOverlay === 'boolean') {
|
|
3166
3282
|
if (!this.options.canDisplayOverlay) {
|
|
3167
3283
|
this.removeDropTarget();
|
|
@@ -3204,7 +3320,7 @@
|
|
|
3204
3320
|
}
|
|
3205
3321
|
},
|
|
3206
3322
|
});
|
|
3207
|
-
this.addDisposables(this._onDrop, this.dnd);
|
|
3323
|
+
this.addDisposables(this._onDrop, this._onWillShowOverlay, this.dnd);
|
|
3208
3324
|
}
|
|
3209
3325
|
setTargetZones(acceptedTargetZones) {
|
|
3210
3326
|
this._acceptedTargetZonesSet = new Set(acceptedTargetZones);
|
|
@@ -3257,25 +3373,44 @@
|
|
|
3257
3373
|
size = clamp(0, sizeOptions.value, height) / height;
|
|
3258
3374
|
}
|
|
3259
3375
|
}
|
|
3260
|
-
const
|
|
3261
|
-
|
|
3262
|
-
|
|
3376
|
+
const box = { top: '0px', left: '0px', width: '100%', height: '100%' };
|
|
3377
|
+
/**
|
|
3378
|
+
* You can also achieve the overlay placement using the transform CSS property
|
|
3379
|
+
* to translate and scale the element however this has the undesired effect of
|
|
3380
|
+
* 'skewing' the element. Comment left here for anybody that ever revisits this.
|
|
3381
|
+
*
|
|
3382
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform
|
|
3383
|
+
*
|
|
3384
|
+
* right
|
|
3385
|
+
* translateX(${100 * (1 - size) / 2}%) scaleX(${scale})
|
|
3386
|
+
*
|
|
3387
|
+
* left
|
|
3388
|
+
* translateX(-${100 * (1 - size) / 2}%) scaleX(${scale})
|
|
3389
|
+
*
|
|
3390
|
+
* top
|
|
3391
|
+
* translateY(-${100 * (1 - size) / 2}%) scaleY(${scale})
|
|
3392
|
+
*
|
|
3393
|
+
* bottom
|
|
3394
|
+
* translateY(${100 * (1 - size) / 2}%) scaleY(${scale})
|
|
3395
|
+
*/
|
|
3263
3396
|
if (rightClass) {
|
|
3264
|
-
|
|
3397
|
+
box.left = `${100 * (1 - size)}%`;
|
|
3398
|
+
box.width = `${100 * size}%`;
|
|
3265
3399
|
}
|
|
3266
3400
|
else if (leftClass) {
|
|
3267
|
-
|
|
3401
|
+
box.width = `${100 * size}%`;
|
|
3268
3402
|
}
|
|
3269
3403
|
else if (topClass) {
|
|
3270
|
-
|
|
3404
|
+
box.height = `${100 * size}%`;
|
|
3271
3405
|
}
|
|
3272
3406
|
else if (bottomClass) {
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
else {
|
|
3276
|
-
transform = '';
|
|
3407
|
+
box.top = `${100 * (1 - size)}%`;
|
|
3408
|
+
box.height = `${100 * size}%`;
|
|
3277
3409
|
}
|
|
3278
|
-
this.overlayElement.style.
|
|
3410
|
+
this.overlayElement.style.top = box.top;
|
|
3411
|
+
this.overlayElement.style.left = box.left;
|
|
3412
|
+
this.overlayElement.style.width = box.width;
|
|
3413
|
+
this.overlayElement.style.height = box.height;
|
|
3279
3414
|
toggleClass(this.overlayElement, 'dv-drop-target-small-vertical', isSmallY);
|
|
3280
3415
|
toggleClass(this.overlayElement, 'dv-drop-target-small-horizontal', isSmallX);
|
|
3281
3416
|
toggleClass(this.overlayElement, 'dv-drop-target-left', isLeft);
|
|
@@ -3343,14 +3478,6 @@
|
|
|
3343
3478
|
return 'center';
|
|
3344
3479
|
}
|
|
3345
3480
|
|
|
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
3481
|
class ContentContainer extends CompositeDisposable {
|
|
3355
3482
|
get element() {
|
|
3356
3483
|
return this._element;
|
|
@@ -3378,7 +3505,7 @@
|
|
|
3378
3505
|
const data = getPanelData();
|
|
3379
3506
|
if (!data &&
|
|
3380
3507
|
event.shiftKey &&
|
|
3381
|
-
this.group.location !== 'floating') {
|
|
3508
|
+
this.group.location.type !== 'floating') {
|
|
3382
3509
|
return false;
|
|
3383
3510
|
}
|
|
3384
3511
|
if (data && data.viewId === this.accessor.id) {
|
|
@@ -3396,7 +3523,7 @@
|
|
|
3396
3523
|
data.groupId === this.group.id;
|
|
3397
3524
|
return !groupHasOnePanelAndIsActiveDragElement;
|
|
3398
3525
|
}
|
|
3399
|
-
return this.group.canDisplayOverlay(event, position,
|
|
3526
|
+
return this.group.canDisplayOverlay(event, position, 'content');
|
|
3400
3527
|
},
|
|
3401
3528
|
});
|
|
3402
3529
|
this.addDisposables(this.dropTarget);
|
|
@@ -3421,7 +3548,7 @@
|
|
|
3421
3548
|
let container;
|
|
3422
3549
|
switch (panel.api.renderer) {
|
|
3423
3550
|
case 'onlyWhenVisibile':
|
|
3424
|
-
this.
|
|
3551
|
+
this.group.renderContainer.detatch(panel);
|
|
3425
3552
|
if (this.panel) {
|
|
3426
3553
|
if (doRender) {
|
|
3427
3554
|
this._element.appendChild(this.panel.view.content.element);
|
|
@@ -3433,7 +3560,7 @@
|
|
|
3433
3560
|
if (panel.view.content.element.parentElement === this._element) {
|
|
3434
3561
|
this._element.removeChild(panel.view.content.element);
|
|
3435
3562
|
}
|
|
3436
|
-
container = this.
|
|
3563
|
+
container = this.group.renderContainer.attach({
|
|
3437
3564
|
panel,
|
|
3438
3565
|
referenceContainer: this,
|
|
3439
3566
|
});
|
|
@@ -3464,9 +3591,10 @@
|
|
|
3464
3591
|
// noop
|
|
3465
3592
|
}
|
|
3466
3593
|
closePanel() {
|
|
3594
|
+
var _a;
|
|
3467
3595
|
if (this.panel) {
|
|
3468
3596
|
if (this.panel.api.renderer === 'onlyWhenVisibile') {
|
|
3469
|
-
this.
|
|
3597
|
+
(_a = this.panel.view.content.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.panel.view.content.element);
|
|
3470
3598
|
}
|
|
3471
3599
|
}
|
|
3472
3600
|
this.panel = undefined;
|
|
@@ -3577,7 +3705,7 @@
|
|
|
3577
3705
|
this._element.draggable = true;
|
|
3578
3706
|
toggleClass(this.element, 'inactive-tab', true);
|
|
3579
3707
|
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
3580
|
-
this.
|
|
3708
|
+
this.dropTarget = new Droptarget(this._element, {
|
|
3581
3709
|
acceptedTargetZones: ['center'],
|
|
3582
3710
|
canDisplayOverlay: (event, position) => {
|
|
3583
3711
|
if (this.group.locked) {
|
|
@@ -3592,9 +3720,10 @@
|
|
|
3592
3720
|
}
|
|
3593
3721
|
return this.panel.id !== data.panelId;
|
|
3594
3722
|
}
|
|
3595
|
-
return this.group.model.canDisplayOverlay(event, position,
|
|
3723
|
+
return this.group.model.canDisplayOverlay(event, position, 'tab');
|
|
3596
3724
|
},
|
|
3597
3725
|
});
|
|
3726
|
+
this.onWillShowOverlay = this.dropTarget.onWillShowOverlay;
|
|
3598
3727
|
this.addDisposables(this._onChanged, this._onDropped, this._onDragStart, dragHandler.onDragStart((event) => {
|
|
3599
3728
|
this._onDragStart.fire(event);
|
|
3600
3729
|
}), dragHandler, addDisposableListener(this._element, 'mousedown', (event) => {
|
|
@@ -3602,9 +3731,9 @@
|
|
|
3602
3731
|
return;
|
|
3603
3732
|
}
|
|
3604
3733
|
this._onChanged.fire(event);
|
|
3605
|
-
}), this.
|
|
3734
|
+
}), this.dropTarget.onDrop((event) => {
|
|
3606
3735
|
this._onDropped.fire(event);
|
|
3607
|
-
}), this.
|
|
3736
|
+
}), this.dropTarget);
|
|
3608
3737
|
}
|
|
3609
3738
|
setActive(isActive) {
|
|
3610
3739
|
toggleClass(this.element, 'active-tab', isActive);
|
|
@@ -3651,7 +3780,7 @@
|
|
|
3651
3780
|
}, true));
|
|
3652
3781
|
}
|
|
3653
3782
|
isCancelled(_event) {
|
|
3654
|
-
if (this.group.api.location === 'floating' && !_event.shiftKey) {
|
|
3783
|
+
if (this.group.api.location.type === 'floating' && !_event.shiftKey) {
|
|
3655
3784
|
return true;
|
|
3656
3785
|
}
|
|
3657
3786
|
return false;
|
|
@@ -3703,7 +3832,7 @@
|
|
|
3703
3832
|
this.accessor.doSetGroupActive(this.group);
|
|
3704
3833
|
}));
|
|
3705
3834
|
const handler = new GroupDragHandler(this._element, accessor, group);
|
|
3706
|
-
this.
|
|
3835
|
+
this.dropTraget = new Droptarget(this._element, {
|
|
3707
3836
|
acceptedTargetZones: ['center'],
|
|
3708
3837
|
canDisplayOverlay: (event, position) => {
|
|
3709
3838
|
var _a;
|
|
@@ -3717,14 +3846,15 @@
|
|
|
3717
3846
|
// don't show the overlay if the tab being dragged is the last panel of this group
|
|
3718
3847
|
return ((_a = last(this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
|
|
3719
3848
|
}
|
|
3720
|
-
return group.model.canDisplayOverlay(event, position,
|
|
3849
|
+
return group.model.canDisplayOverlay(event, position, 'header_space');
|
|
3721
3850
|
},
|
|
3722
3851
|
});
|
|
3852
|
+
this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
|
|
3723
3853
|
this.addDisposables(handler, handler.onDragStart((event) => {
|
|
3724
3854
|
this._onDragStart.fire(event);
|
|
3725
|
-
}), this.
|
|
3855
|
+
}), this.dropTraget.onDrop((event) => {
|
|
3726
3856
|
this._onDrop.fire(event);
|
|
3727
|
-
}), this.
|
|
3857
|
+
}), this.dropTraget);
|
|
3728
3858
|
}
|
|
3729
3859
|
}
|
|
3730
3860
|
|
|
@@ -3812,19 +3942,11 @@
|
|
|
3812
3942
|
this.onTabDragStart = this._onTabDragStart.event;
|
|
3813
3943
|
this._onGroupDragStart = new Emitter();
|
|
3814
3944
|
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
3815
|
-
this.
|
|
3945
|
+
this._onWillShowOverlay = new Emitter();
|
|
3946
|
+
this.onWillShowOverlay = this._onWillShowOverlay.event;
|
|
3816
3947
|
this._element = document.createElement('div');
|
|
3817
3948
|
this._element.className = 'tabs-and-actions-container';
|
|
3818
3949
|
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
3950
|
this.rightActionsContainer = document.createElement('div');
|
|
3829
3951
|
this.rightActionsContainer.className = 'right-actions-container';
|
|
3830
3952
|
this.leftActionsContainer = document.createElement('div');
|
|
@@ -3839,7 +3961,15 @@
|
|
|
3839
3961
|
this._element.appendChild(this.leftActionsContainer);
|
|
3840
3962
|
this._element.appendChild(this.voidContainer.element);
|
|
3841
3963
|
this._element.appendChild(this.rightActionsContainer);
|
|
3842
|
-
this.addDisposables(this.
|
|
3964
|
+
this.addDisposables(this.accessor.onDidAddPanel((e) => {
|
|
3965
|
+
if (e.api.group === this.group) {
|
|
3966
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
3967
|
+
}
|
|
3968
|
+
}), this.accessor.onDidRemovePanel((e) => {
|
|
3969
|
+
if (e.api.group === this.group) {
|
|
3970
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
3971
|
+
}
|
|
3972
|
+
}), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
3843
3973
|
this._onGroupDragStart.fire({
|
|
3844
3974
|
nativeEvent: event,
|
|
3845
3975
|
group: this.group,
|
|
@@ -3849,11 +3979,15 @@
|
|
|
3849
3979
|
event: event.nativeEvent,
|
|
3850
3980
|
index: this.tabs.length,
|
|
3851
3981
|
});
|
|
3982
|
+
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
3983
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
3984
|
+
kind: 'header_space',
|
|
3985
|
+
}));
|
|
3852
3986
|
}), addDisposableListener(this.voidContainer.element, 'mousedown', (event) => {
|
|
3853
3987
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
3854
3988
|
if (isFloatingGroupsEnabled &&
|
|
3855
3989
|
event.shiftKey &&
|
|
3856
|
-
this.group.api.location !== 'floating') {
|
|
3990
|
+
this.group.api.location.type !== 'floating') {
|
|
3857
3991
|
event.preventDefault();
|
|
3858
3992
|
const { top, left } = this.element.getBoundingClientRect();
|
|
3859
3993
|
const { top: rootTop, left: rootLeft } = this.accessor.element.getBoundingClientRect();
|
|
@@ -3916,9 +4050,9 @@
|
|
|
3916
4050
|
const disposable = new CompositeDisposable(tab.onDragStart((event) => {
|
|
3917
4051
|
this._onTabDragStart.fire({ nativeEvent: event, panel });
|
|
3918
4052
|
}), tab.onChanged((event) => {
|
|
3919
|
-
var _a;
|
|
3920
4053
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
3921
|
-
const isFloatingWithOnePanel = this.group.api.location === 'floating' &&
|
|
4054
|
+
const isFloatingWithOnePanel = this.group.api.location.type === 'floating' &&
|
|
4055
|
+
this.size === 1;
|
|
3922
4056
|
if (isFloatingGroupsEnabled &&
|
|
3923
4057
|
!isFloatingWithOnePanel &&
|
|
3924
4058
|
event.shiftKey) {
|
|
@@ -3932,20 +4066,20 @@
|
|
|
3932
4066
|
}, { inDragMode: true });
|
|
3933
4067
|
return;
|
|
3934
4068
|
}
|
|
3935
|
-
const alreadyFocused = panel.id === ((_a = this.group.model.activePanel) === null || _a === void 0 ? void 0 : _a.id) &&
|
|
3936
|
-
this.group.model.isContentFocused;
|
|
3937
4069
|
const isLeftClick = event.button === 0;
|
|
3938
4070
|
if (!isLeftClick || event.defaultPrevented) {
|
|
3939
4071
|
return;
|
|
3940
4072
|
}
|
|
3941
|
-
this.group.
|
|
3942
|
-
|
|
3943
|
-
}
|
|
4073
|
+
if (this.group.activePanel !== panel) {
|
|
4074
|
+
this.group.model.openPanel(panel);
|
|
4075
|
+
}
|
|
3944
4076
|
}), tab.onDrop((event) => {
|
|
3945
4077
|
this._onDrop.fire({
|
|
3946
4078
|
event: event.nativeEvent,
|
|
3947
4079
|
index: this.tabs.findIndex((x) => x.value === tab),
|
|
3948
4080
|
});
|
|
4081
|
+
}), tab.onWillShowOverlay((event) => {
|
|
4082
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, { kind: 'tab' }));
|
|
3949
4083
|
}));
|
|
3950
4084
|
const value = { value: tab, disposable };
|
|
3951
4085
|
this.addTab(value, index);
|
|
@@ -3963,6 +4097,60 @@
|
|
|
3963
4097
|
}
|
|
3964
4098
|
}
|
|
3965
4099
|
|
|
4100
|
+
class DockviewDidDropEvent extends DockviewEvent {
|
|
4101
|
+
get nativeEvent() {
|
|
4102
|
+
return this.options.nativeEvent;
|
|
4103
|
+
}
|
|
4104
|
+
get position() {
|
|
4105
|
+
return this.options.position;
|
|
4106
|
+
}
|
|
4107
|
+
get panel() {
|
|
4108
|
+
return this.options.panel;
|
|
4109
|
+
}
|
|
4110
|
+
get group() {
|
|
4111
|
+
return this.options.group;
|
|
4112
|
+
}
|
|
4113
|
+
get api() {
|
|
4114
|
+
return this.options.api;
|
|
4115
|
+
}
|
|
4116
|
+
constructor(options) {
|
|
4117
|
+
super();
|
|
4118
|
+
this.options = options;
|
|
4119
|
+
}
|
|
4120
|
+
getData() {
|
|
4121
|
+
return this.options.getData();
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
class DockviewWillDropEvent extends DockviewDidDropEvent {
|
|
4125
|
+
get kind() {
|
|
4126
|
+
return this._kind;
|
|
4127
|
+
}
|
|
4128
|
+
constructor(options) {
|
|
4129
|
+
super(options);
|
|
4130
|
+
this._kind = options.kind;
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
class WillShowOverlayLocationEvent {
|
|
4134
|
+
get kind() {
|
|
4135
|
+
return this._kind;
|
|
4136
|
+
}
|
|
4137
|
+
get nativeEvent() {
|
|
4138
|
+
return this.event.nativeEvent;
|
|
4139
|
+
}
|
|
4140
|
+
get position() {
|
|
4141
|
+
return this.event.position;
|
|
4142
|
+
}
|
|
4143
|
+
get defaultPrevented() {
|
|
4144
|
+
return this.event.defaultPrevented;
|
|
4145
|
+
}
|
|
4146
|
+
preventDefault() {
|
|
4147
|
+
this.event.preventDefault();
|
|
4148
|
+
}
|
|
4149
|
+
constructor(event, options) {
|
|
4150
|
+
this.event = event;
|
|
4151
|
+
this._kind = options.kind;
|
|
4152
|
+
}
|
|
4153
|
+
}
|
|
3966
4154
|
class DockviewGroupPanelModel extends CompositeDisposable {
|
|
3967
4155
|
get element() {
|
|
3968
4156
|
throw new Error('not supported');
|
|
@@ -4008,7 +4196,7 @@
|
|
|
4008
4196
|
this._location = value;
|
|
4009
4197
|
toggleClass(this.container, 'dv-groupview-floating', false);
|
|
4010
4198
|
toggleClass(this.container, 'dv-groupview-popout', false);
|
|
4011
|
-
switch (value) {
|
|
4199
|
+
switch (value.type) {
|
|
4012
4200
|
case 'grid':
|
|
4013
4201
|
this.contentContainer.dropTarget.setTargetZones([
|
|
4014
4202
|
'top',
|
|
@@ -4044,7 +4232,7 @@
|
|
|
4044
4232
|
this.groupPanel = groupPanel;
|
|
4045
4233
|
this._isGroupActive = false;
|
|
4046
4234
|
this._locked = false;
|
|
4047
|
-
this._location = 'grid';
|
|
4235
|
+
this._location = { type: 'grid' };
|
|
4048
4236
|
this.mostRecentlyUsed = [];
|
|
4049
4237
|
this._onDidChange = new Emitter();
|
|
4050
4238
|
this.onDidChange = this._onDidChange.event;
|
|
@@ -4055,6 +4243,10 @@
|
|
|
4055
4243
|
this.onMove = this._onMove.event;
|
|
4056
4244
|
this._onDidDrop = new Emitter();
|
|
4057
4245
|
this.onDidDrop = this._onDidDrop.event;
|
|
4246
|
+
this._onWillDrop = new Emitter();
|
|
4247
|
+
this.onWillDrop = this._onWillDrop.event;
|
|
4248
|
+
this._onWillShowOverlay = new Emitter();
|
|
4249
|
+
this.onWillShowOverlay = this._onWillShowOverlay.event;
|
|
4058
4250
|
this._onTabDragStart = new Emitter();
|
|
4059
4251
|
this.onTabDragStart = this._onTabDragStart.event;
|
|
4060
4252
|
this._onGroupDragStart = new Emitter();
|
|
@@ -4065,46 +4257,69 @@
|
|
|
4065
4257
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4066
4258
|
this._onDidActivePanelChange = new Emitter();
|
|
4067
4259
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4260
|
+
this._overwriteRenderContainer = null;
|
|
4068
4261
|
toggleClass(this.container, 'groupview', true);
|
|
4262
|
+
this._api = new DockviewApi(this.accessor);
|
|
4069
4263
|
this.tabsContainer = new TabsContainer(this.accessor, this.groupPanel);
|
|
4070
4264
|
this.contentContainer = new ContentContainer(this.accessor, this);
|
|
4071
4265
|
container.append(this.tabsContainer.element, this.contentContainer.element);
|
|
4072
4266
|
this.header.hidden = !!options.hideHeader;
|
|
4073
4267
|
this.locked = (_a = options.locked) !== null && _a !== void 0 ? _a : false;
|
|
4074
|
-
this.addDisposables(this._onTabDragStart, this._onGroupDragStart, this.tabsContainer.onTabDragStart((event) => {
|
|
4268
|
+
this.addDisposables(this._onTabDragStart, this._onGroupDragStart, this._onWillShowOverlay, this.tabsContainer.onTabDragStart((event) => {
|
|
4075
4269
|
this._onTabDragStart.fire(event);
|
|
4076
4270
|
}), this.tabsContainer.onGroupDragStart((event) => {
|
|
4077
4271
|
this._onGroupDragStart.fire(event);
|
|
4078
4272
|
}), this.tabsContainer.onDrop((event) => {
|
|
4079
|
-
this.handleDropEvent(event.event, 'center', event.index);
|
|
4273
|
+
this.handleDropEvent('header', event.event, 'center', event.index);
|
|
4080
4274
|
}), this.contentContainer.onDidFocus(() => {
|
|
4081
|
-
this.accessor.doSetGroupActive(this.groupPanel
|
|
4275
|
+
this.accessor.doSetGroupActive(this.groupPanel);
|
|
4082
4276
|
}), this.contentContainer.onDidBlur(() => {
|
|
4083
4277
|
// noop
|
|
4084
4278
|
}), this.contentContainer.dropTarget.onDrop((event) => {
|
|
4085
|
-
this.handleDropEvent(event.nativeEvent, event.position);
|
|
4086
|
-
}), this.
|
|
4279
|
+
this.handleDropEvent('content', event.nativeEvent, event.position);
|
|
4280
|
+
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
4281
|
+
this._onWillShowOverlay.fire(event);
|
|
4282
|
+
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
4283
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
4284
|
+
kind: 'content',
|
|
4285
|
+
}));
|
|
4286
|
+
}), this._onMove, this._onDidChange, this._onDidDrop, this._onWillDrop, this._onDidAddPanel, this._onDidRemovePanel, this._onDidActivePanelChange);
|
|
4287
|
+
}
|
|
4288
|
+
focusContent() {
|
|
4289
|
+
this.contentContainer.element.focus();
|
|
4290
|
+
}
|
|
4291
|
+
set renderContainer(value) {
|
|
4292
|
+
this.panels.forEach((panel) => {
|
|
4293
|
+
this.renderContainer.detatch(panel);
|
|
4294
|
+
});
|
|
4295
|
+
this._overwriteRenderContainer = value;
|
|
4296
|
+
this.panels.forEach((panel) => {
|
|
4297
|
+
this.rerender(panel);
|
|
4298
|
+
});
|
|
4299
|
+
}
|
|
4300
|
+
get renderContainer() {
|
|
4301
|
+
var _a;
|
|
4302
|
+
return ((_a = this._overwriteRenderContainer) !== null && _a !== void 0 ? _a : this.accessor.overlayRenderContainer);
|
|
4087
4303
|
}
|
|
4088
4304
|
initialize() {
|
|
4089
|
-
|
|
4090
|
-
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.panels) {
|
|
4305
|
+
if (this.options.panels) {
|
|
4091
4306
|
this.options.panels.forEach((panel) => {
|
|
4092
4307
|
this.doAddPanel(panel);
|
|
4093
4308
|
});
|
|
4094
4309
|
}
|
|
4095
|
-
if (
|
|
4310
|
+
if (this.options.activePanel) {
|
|
4096
4311
|
this.openPanel(this.options.activePanel);
|
|
4097
4312
|
}
|
|
4098
4313
|
// must be run after the constructor otherwise this.parent may not be
|
|
4099
4314
|
// correctly initialized
|
|
4100
|
-
this.setActive(this.isActive, true
|
|
4315
|
+
this.setActive(this.isActive, true);
|
|
4101
4316
|
this.updateContainer();
|
|
4102
4317
|
if (this.accessor.options.createRightHeaderActionsElement) {
|
|
4103
4318
|
this._rightHeaderActions =
|
|
4104
4319
|
this.accessor.options.createRightHeaderActionsElement(this.groupPanel);
|
|
4105
4320
|
this.addDisposables(this._rightHeaderActions);
|
|
4106
4321
|
this._rightHeaderActions.init({
|
|
4107
|
-
containerApi:
|
|
4322
|
+
containerApi: this._api,
|
|
4108
4323
|
api: this.groupPanel.api,
|
|
4109
4324
|
});
|
|
4110
4325
|
this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element);
|
|
@@ -4114,7 +4329,7 @@
|
|
|
4114
4329
|
this.accessor.options.createLeftHeaderActionsElement(this.groupPanel);
|
|
4115
4330
|
this.addDisposables(this._leftHeaderActions);
|
|
4116
4331
|
this._leftHeaderActions.init({
|
|
4117
|
-
containerApi:
|
|
4332
|
+
containerApi: this._api,
|
|
4118
4333
|
api: this.groupPanel.api,
|
|
4119
4334
|
});
|
|
4120
4335
|
this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element);
|
|
@@ -4124,7 +4339,7 @@
|
|
|
4124
4339
|
this.accessor.options.createPrefixHeaderActionsElement(this.groupPanel);
|
|
4125
4340
|
this.addDisposables(this._prefixHeaderActions);
|
|
4126
4341
|
this._prefixHeaderActions.init({
|
|
4127
|
-
containerApi:
|
|
4342
|
+
containerApi: this._api,
|
|
4128
4343
|
api: this.groupPanel.api,
|
|
4129
4344
|
});
|
|
4130
4345
|
this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element);
|
|
@@ -4204,35 +4419,45 @@
|
|
|
4204
4419
|
//noop
|
|
4205
4420
|
}
|
|
4206
4421
|
focus() {
|
|
4207
|
-
var _a
|
|
4208
|
-
(
|
|
4422
|
+
var _a;
|
|
4423
|
+
(_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4209
4424
|
}
|
|
4210
4425
|
openPanel(panel, options = {}) {
|
|
4426
|
+
/**
|
|
4427
|
+
* set the panel group
|
|
4428
|
+
* add the panel
|
|
4429
|
+
* check if group active
|
|
4430
|
+
* check if panel active
|
|
4431
|
+
*/
|
|
4211
4432
|
if (typeof options.index !== 'number' ||
|
|
4212
4433
|
options.index > this.panels.length) {
|
|
4213
4434
|
options.index = this.panels.length;
|
|
4214
4435
|
}
|
|
4215
|
-
const
|
|
4216
|
-
const skipSetGroupActive = !!options.skipSetGroupActive;
|
|
4436
|
+
const skipSetActive = !!options.skipSetActive;
|
|
4217
4437
|
// ensure the group is updated before we fire any events
|
|
4218
|
-
panel.updateParentGroup(this.groupPanel,
|
|
4438
|
+
panel.updateParentGroup(this.groupPanel, {
|
|
4439
|
+
skipSetActive: options.skipSetActive,
|
|
4440
|
+
});
|
|
4441
|
+
this.doAddPanel(panel, options.index, {
|
|
4442
|
+
skipSetActive: skipSetActive,
|
|
4443
|
+
});
|
|
4219
4444
|
if (this._activePanel === panel) {
|
|
4220
|
-
if (!skipSetGroupActive) {
|
|
4221
|
-
this.accessor.doSetGroupActive(this.groupPanel);
|
|
4222
|
-
}
|
|
4223
4445
|
this.contentContainer.renderPanel(panel, { asActive: true });
|
|
4224
4446
|
return;
|
|
4225
4447
|
}
|
|
4226
|
-
|
|
4227
|
-
if (!skipSetPanelActive) {
|
|
4448
|
+
if (!skipSetActive) {
|
|
4228
4449
|
this.doSetActivePanel(panel);
|
|
4229
4450
|
}
|
|
4230
|
-
if (!skipSetGroupActive) {
|
|
4231
|
-
this.accessor.doSetGroupActive(this.groupPanel
|
|
4451
|
+
if (!options.skipSetGroupActive) {
|
|
4452
|
+
this.accessor.doSetGroupActive(this.groupPanel);
|
|
4453
|
+
}
|
|
4454
|
+
if (!options.skipSetActive) {
|
|
4455
|
+
this.updateContainer();
|
|
4232
4456
|
}
|
|
4233
|
-
this.updateContainer();
|
|
4234
4457
|
}
|
|
4235
|
-
removePanel(groupItemOrId
|
|
4458
|
+
removePanel(groupItemOrId, options = {
|
|
4459
|
+
skipSetActive: false,
|
|
4460
|
+
}) {
|
|
4236
4461
|
const id = typeof groupItemOrId === 'string'
|
|
4237
4462
|
? groupItemOrId
|
|
4238
4463
|
: groupItemOrId.id;
|
|
@@ -4240,7 +4465,7 @@
|
|
|
4240
4465
|
if (!panelToRemove) {
|
|
4241
4466
|
throw new Error('invalid operation');
|
|
4242
4467
|
}
|
|
4243
|
-
return this._removePanel(panelToRemove);
|
|
4468
|
+
return this._removePanel(panelToRemove, options);
|
|
4244
4469
|
}
|
|
4245
4470
|
closeAllPanels() {
|
|
4246
4471
|
if (this.panels.length > 0) {
|
|
@@ -4266,12 +4491,8 @@
|
|
|
4266
4491
|
updateActions(element) {
|
|
4267
4492
|
this.tabsContainer.setRightActionsElement(element);
|
|
4268
4493
|
}
|
|
4269
|
-
setActive(isGroupActive,
|
|
4270
|
-
var _a, _b, _c, _d;
|
|
4494
|
+
setActive(isGroupActive, force = false) {
|
|
4271
4495
|
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
4496
|
return;
|
|
4276
4497
|
}
|
|
4277
4498
|
this._isGroupActive = isGroupActive;
|
|
@@ -4282,11 +4503,6 @@
|
|
|
4282
4503
|
this.doSetActivePanel(this.panels[0]);
|
|
4283
4504
|
}
|
|
4284
4505
|
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
4506
|
}
|
|
4291
4507
|
layout(width, height) {
|
|
4292
4508
|
var _a;
|
|
@@ -4297,17 +4513,22 @@
|
|
|
4297
4513
|
this._activePanel.layout(this._width, this._height);
|
|
4298
4514
|
}
|
|
4299
4515
|
}
|
|
4300
|
-
_removePanel(panel) {
|
|
4516
|
+
_removePanel(panel, options) {
|
|
4301
4517
|
const isActivePanel = this._activePanel === panel;
|
|
4302
4518
|
this.doRemovePanel(panel);
|
|
4303
4519
|
if (isActivePanel && this.panels.length > 0) {
|
|
4304
4520
|
const nextPanel = this.mostRecentlyUsed[0];
|
|
4305
|
-
this.openPanel(nextPanel
|
|
4521
|
+
this.openPanel(nextPanel, {
|
|
4522
|
+
skipSetActive: options.skipSetActive,
|
|
4523
|
+
skipSetGroupActive: options.skipSetActiveGroup,
|
|
4524
|
+
});
|
|
4306
4525
|
}
|
|
4307
4526
|
if (this._activePanel && this.panels.length === 0) {
|
|
4308
4527
|
this.doSetActivePanel(undefined);
|
|
4309
4528
|
}
|
|
4310
|
-
|
|
4529
|
+
if (!options.skipSetActive) {
|
|
4530
|
+
this.updateContainer();
|
|
4531
|
+
}
|
|
4311
4532
|
return panel;
|
|
4312
4533
|
}
|
|
4313
4534
|
doRemovePanel(panel) {
|
|
@@ -4322,13 +4543,13 @@
|
|
|
4322
4543
|
}
|
|
4323
4544
|
this._onDidRemovePanel.fire({ panel });
|
|
4324
4545
|
}
|
|
4325
|
-
doAddPanel(panel, index = this.panels.length,
|
|
4546
|
+
doAddPanel(panel, index = this.panels.length, options = { skipSetActive: false }) {
|
|
4326
4547
|
const existingPanel = this._panels.indexOf(panel);
|
|
4327
4548
|
const hasExistingPanel = existingPanel > -1;
|
|
4328
4549
|
this.tabsContainer.show();
|
|
4329
4550
|
this.contentContainer.show();
|
|
4330
4551
|
this.tabsContainer.openPanel(panel, index);
|
|
4331
|
-
if (!skipSetActive) {
|
|
4552
|
+
if (!options.skipSetActive) {
|
|
4332
4553
|
this.contentContainer.openPanel(panel);
|
|
4333
4554
|
}
|
|
4334
4555
|
if (hasExistingPanel) {
|
|
@@ -4340,12 +4561,17 @@
|
|
|
4340
4561
|
this._onDidAddPanel.fire({ panel });
|
|
4341
4562
|
}
|
|
4342
4563
|
doSetActivePanel(panel) {
|
|
4564
|
+
if (this._activePanel === panel) {
|
|
4565
|
+
return;
|
|
4566
|
+
}
|
|
4343
4567
|
this._activePanel = panel;
|
|
4344
4568
|
if (panel) {
|
|
4345
4569
|
this.tabsContainer.setActivePanel(panel);
|
|
4346
4570
|
panel.layout(this._width, this._height);
|
|
4347
4571
|
this.updateMru(panel);
|
|
4348
|
-
this._onDidActivePanelChange.fire({
|
|
4572
|
+
this._onDidActivePanelChange.fire({
|
|
4573
|
+
panel,
|
|
4574
|
+
});
|
|
4349
4575
|
}
|
|
4350
4576
|
}
|
|
4351
4577
|
updateMru(panel) {
|
|
@@ -4357,11 +4583,11 @@
|
|
|
4357
4583
|
updateContainer() {
|
|
4358
4584
|
var _a, _b;
|
|
4359
4585
|
toggleClass(this.container, 'empty', this.isEmpty);
|
|
4360
|
-
this.panels.forEach((panel) => panel.
|
|
4586
|
+
this.panels.forEach((panel) => panel.runEvents());
|
|
4361
4587
|
if (this.isEmpty && !this.watermark) {
|
|
4362
4588
|
const watermark = this.accessor.createWatermarkComponent();
|
|
4363
4589
|
watermark.init({
|
|
4364
|
-
containerApi:
|
|
4590
|
+
containerApi: this._api,
|
|
4365
4591
|
group: this.groupPanel,
|
|
4366
4592
|
});
|
|
4367
4593
|
this.watermark = watermark;
|
|
@@ -4394,10 +4620,32 @@
|
|
|
4394
4620
|
}
|
|
4395
4621
|
return false;
|
|
4396
4622
|
}
|
|
4397
|
-
handleDropEvent(event, position, index) {
|
|
4623
|
+
handleDropEvent(type, event, position, index) {
|
|
4398
4624
|
if (this.locked === 'no-drop-target') {
|
|
4399
4625
|
return;
|
|
4400
4626
|
}
|
|
4627
|
+
function getKind() {
|
|
4628
|
+
switch (type) {
|
|
4629
|
+
case 'header':
|
|
4630
|
+
return typeof index === 'number' ? 'tab' : 'header_space';
|
|
4631
|
+
case 'content':
|
|
4632
|
+
return 'content';
|
|
4633
|
+
}
|
|
4634
|
+
}
|
|
4635
|
+
const panel = typeof index === 'number' ? this.panels[index] : undefined;
|
|
4636
|
+
const willDropEvent = new DockviewWillDropEvent({
|
|
4637
|
+
nativeEvent: event,
|
|
4638
|
+
position,
|
|
4639
|
+
panel,
|
|
4640
|
+
getData: () => getPanelData(),
|
|
4641
|
+
kind: getKind(),
|
|
4642
|
+
group: this.groupPanel,
|
|
4643
|
+
api: this._api,
|
|
4644
|
+
});
|
|
4645
|
+
this._onWillDrop.fire(willDropEvent);
|
|
4646
|
+
if (willDropEvent.defaultPrevented) {
|
|
4647
|
+
return;
|
|
4648
|
+
}
|
|
4401
4649
|
const data = getPanelData();
|
|
4402
4650
|
if (data && data.viewId === this.accessor.id) {
|
|
4403
4651
|
if (data.panelId === null) {
|
|
@@ -4430,12 +4678,14 @@
|
|
|
4430
4678
|
});
|
|
4431
4679
|
}
|
|
4432
4680
|
else {
|
|
4433
|
-
this._onDidDrop.fire({
|
|
4681
|
+
this._onDidDrop.fire(new DockviewDidDropEvent({
|
|
4434
4682
|
nativeEvent: event,
|
|
4435
4683
|
position,
|
|
4436
|
-
|
|
4684
|
+
panel,
|
|
4437
4685
|
getData: () => getPanelData(),
|
|
4438
|
-
|
|
4686
|
+
group: this.groupPanel,
|
|
4687
|
+
api: this._api,
|
|
4688
|
+
}));
|
|
4439
4689
|
}
|
|
4440
4690
|
}
|
|
4441
4691
|
dispose() {
|
|
@@ -4443,6 +4693,7 @@
|
|
|
4443
4693
|
super.dispose();
|
|
4444
4694
|
(_a = this.watermark) === null || _a === void 0 ? void 0 : _a.element.remove();
|
|
4445
4695
|
(_c = (_b = this.watermark) === null || _b === void 0 ? void 0 : _b.dispose) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
4696
|
+
this.watermark = undefined;
|
|
4446
4697
|
for (const panel of this.panels) {
|
|
4447
4698
|
panel.dispose();
|
|
4448
4699
|
}
|
|
@@ -4464,15 +4715,7 @@
|
|
|
4464
4715
|
constructor(parentElement, disableResizing = false) {
|
|
4465
4716
|
super();
|
|
4466
4717
|
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
|
-
}
|
|
4718
|
+
this._element = parentElement;
|
|
4476
4719
|
this.addDisposables(watchElementResize(this._element, (entry) => {
|
|
4477
4720
|
if (this.isDisposed) {
|
|
4478
4721
|
/**
|
|
@@ -4560,25 +4803,38 @@
|
|
|
4560
4803
|
get activeGroup() {
|
|
4561
4804
|
return this._activeGroup;
|
|
4562
4805
|
}
|
|
4806
|
+
get locked() {
|
|
4807
|
+
return this.gridview.locked;
|
|
4808
|
+
}
|
|
4809
|
+
set locked(value) {
|
|
4810
|
+
this.gridview.locked = value;
|
|
4811
|
+
}
|
|
4563
4812
|
constructor(options) {
|
|
4564
|
-
super(
|
|
4813
|
+
super(document.createElement('div'), options.disableAutoResizing);
|
|
4565
4814
|
this._id = nextLayoutId$1.next();
|
|
4566
4815
|
this._groups = new Map();
|
|
4567
4816
|
this._onDidLayoutChange = new Emitter();
|
|
4568
4817
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
4569
|
-
this.
|
|
4570
|
-
this.
|
|
4571
|
-
this.
|
|
4572
|
-
this.
|
|
4573
|
-
this.
|
|
4574
|
-
this.
|
|
4818
|
+
this._onDidRemove = new Emitter();
|
|
4819
|
+
this.onDidRemove = this._onDidRemove.event;
|
|
4820
|
+
this._onDidAdd = new Emitter();
|
|
4821
|
+
this.onDidAdd = this._onDidAdd.event;
|
|
4822
|
+
this._onDidActiveChange = new Emitter();
|
|
4823
|
+
this.onDidActiveChange = this._onDidActiveChange.event;
|
|
4575
4824
|
this._bufferOnDidLayoutChange = new TickDelayedEvent();
|
|
4825
|
+
this.element.style.height = '100%';
|
|
4826
|
+
this.element.style.width = '100%';
|
|
4827
|
+
options.parentElement.appendChild(this.element);
|
|
4576
4828
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
|
|
4829
|
+
this.gridview.locked = !!options.locked;
|
|
4577
4830
|
this.element.appendChild(this.gridview.element);
|
|
4578
4831
|
this.layout(0, 0, true); // set some elements height/widths
|
|
4579
|
-
this.addDisposables(
|
|
4832
|
+
this.addDisposables(Disposable.from(() => {
|
|
4833
|
+
var _a;
|
|
4834
|
+
(_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.element);
|
|
4835
|
+
}), this.gridview.onDidChange(() => {
|
|
4580
4836
|
this._bufferOnDidLayoutChange.fire();
|
|
4581
|
-
}), exports.DockviewEvent.any(this.
|
|
4837
|
+
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove, this.onDidActiveChange)(() => {
|
|
4582
4838
|
this._bufferOnDidLayoutChange.fire();
|
|
4583
4839
|
}), this._bufferOnDidLayoutChange.onEvent(() => {
|
|
4584
4840
|
this._onDidLayoutChange.fire();
|
|
@@ -4593,6 +4849,7 @@
|
|
|
4593
4849
|
}
|
|
4594
4850
|
maximizeGroup(panel) {
|
|
4595
4851
|
this.gridview.maximizeView(panel);
|
|
4852
|
+
this.doSetGroupActive(panel);
|
|
4596
4853
|
}
|
|
4597
4854
|
isMaximizedGroup(panel) {
|
|
4598
4855
|
return this.gridview.maximizedView() === panel;
|
|
@@ -4603,13 +4860,12 @@
|
|
|
4603
4860
|
hasMaximizedGroup() {
|
|
4604
4861
|
return this.gridview.hasMaximizedView();
|
|
4605
4862
|
}
|
|
4606
|
-
get
|
|
4607
|
-
return this.gridview.
|
|
4863
|
+
get onDidMaximizedGroupChange() {
|
|
4864
|
+
return this.gridview.onDidMaximizedNodeChange;
|
|
4608
4865
|
}
|
|
4609
4866
|
doAddGroup(group, location = [0], size) {
|
|
4610
4867
|
this.gridview.addView(group, size !== null && size !== void 0 ? size : exports.Sizing.Distribute, location);
|
|
4611
|
-
this.
|
|
4612
|
-
this.doSetGroupActive(group);
|
|
4868
|
+
this._onDidAdd.fire(group);
|
|
4613
4869
|
}
|
|
4614
4870
|
doRemoveGroup(group, options) {
|
|
4615
4871
|
if (!this._groups.has(group.id)) {
|
|
@@ -4621,8 +4877,8 @@
|
|
|
4621
4877
|
item.disposable.dispose();
|
|
4622
4878
|
item.value.dispose();
|
|
4623
4879
|
this._groups.delete(group.id);
|
|
4880
|
+
this._onDidRemove.fire(group);
|
|
4624
4881
|
}
|
|
4625
|
-
this._onDidRemoveGroup.fire(group);
|
|
4626
4882
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
4627
4883
|
const groups = Array.from(this._groups.values());
|
|
4628
4884
|
this.doSetGroupActive(groups.length > 0 ? groups[0].value : undefined);
|
|
@@ -4633,25 +4889,18 @@
|
|
|
4633
4889
|
var _a;
|
|
4634
4890
|
return (_a = this._groups.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
4635
4891
|
}
|
|
4636
|
-
doSetGroupActive(group
|
|
4637
|
-
var _a, _b, _c;
|
|
4892
|
+
doSetGroupActive(group) {
|
|
4638
4893
|
if (this._activeGroup === group) {
|
|
4639
4894
|
return;
|
|
4640
4895
|
}
|
|
4641
4896
|
if (this._activeGroup) {
|
|
4642
4897
|
this._activeGroup.setActive(false);
|
|
4643
|
-
if (!skipFocus) {
|
|
4644
|
-
(_b = (_a = this._activeGroup).focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4645
|
-
}
|
|
4646
4898
|
}
|
|
4647
4899
|
if (group) {
|
|
4648
4900
|
group.setActive(true);
|
|
4649
|
-
if (!skipFocus) {
|
|
4650
|
-
(_c = group.focus) === null || _c === void 0 ? void 0 : _c.call(group);
|
|
4651
|
-
}
|
|
4652
4901
|
}
|
|
4653
4902
|
this._activeGroup = group;
|
|
4654
|
-
this.
|
|
4903
|
+
this._onDidActiveChange.fire(group);
|
|
4655
4904
|
}
|
|
4656
4905
|
removeGroup(group) {
|
|
4657
4906
|
this.doRemoveGroup(group);
|
|
@@ -4696,9 +4945,9 @@
|
|
|
4696
4945
|
this.gridview.layout(width, height);
|
|
4697
4946
|
}
|
|
4698
4947
|
dispose() {
|
|
4699
|
-
this.
|
|
4700
|
-
this.
|
|
4701
|
-
this.
|
|
4948
|
+
this._onDidActiveChange.dispose();
|
|
4949
|
+
this._onDidAdd.dispose();
|
|
4950
|
+
this._onDidRemove.dispose();
|
|
4702
4951
|
this._onDidLayoutChange.dispose();
|
|
4703
4952
|
for (const group of this.groups) {
|
|
4704
4953
|
group.dispose();
|
|
@@ -4708,11 +4957,15 @@
|
|
|
4708
4957
|
}
|
|
4709
4958
|
}
|
|
4710
4959
|
|
|
4960
|
+
class WillFocusEvent extends DockviewEvent {
|
|
4961
|
+
constructor() {
|
|
4962
|
+
super();
|
|
4963
|
+
}
|
|
4964
|
+
}
|
|
4711
4965
|
/**
|
|
4712
4966
|
* A core api implementation that should be used across all panel-like objects
|
|
4713
4967
|
*/
|
|
4714
4968
|
class PanelApiImpl extends CompositeDisposable {
|
|
4715
|
-
//
|
|
4716
4969
|
get isFocused() {
|
|
4717
4970
|
return this._isFocused;
|
|
4718
4971
|
}
|
|
@@ -4737,35 +4990,22 @@
|
|
|
4737
4990
|
this._width = 0;
|
|
4738
4991
|
this._height = 0;
|
|
4739
4992
|
this.panelUpdatesDisposable = new MutableDisposable();
|
|
4740
|
-
this._onDidDimensionChange = new Emitter(
|
|
4741
|
-
replay: true,
|
|
4742
|
-
});
|
|
4993
|
+
this._onDidDimensionChange = new Emitter();
|
|
4743
4994
|
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
4744
|
-
|
|
4745
|
-
this._onDidChangeFocus = new Emitter({
|
|
4746
|
-
replay: true,
|
|
4747
|
-
});
|
|
4995
|
+
this._onDidChangeFocus = new Emitter();
|
|
4748
4996
|
this.onDidFocusChange = this._onDidChangeFocus.event;
|
|
4749
4997
|
//
|
|
4750
|
-
this.
|
|
4751
|
-
this.
|
|
4998
|
+
this._onWillFocus = new Emitter();
|
|
4999
|
+
this.onWillFocus = this._onWillFocus.event;
|
|
4752
5000
|
//
|
|
4753
|
-
this._onDidVisibilityChange = new Emitter(
|
|
4754
|
-
replay: true,
|
|
4755
|
-
});
|
|
5001
|
+
this._onDidVisibilityChange = new Emitter();
|
|
4756
5002
|
this.onDidVisibilityChange = this._onDidVisibilityChange.event;
|
|
4757
|
-
|
|
4758
|
-
this.
|
|
4759
|
-
this.
|
|
4760
|
-
//
|
|
4761
|
-
this._onDidActiveChange = new Emitter({
|
|
4762
|
-
replay: true,
|
|
4763
|
-
});
|
|
5003
|
+
this._onWillVisibilityChange = new Emitter();
|
|
5004
|
+
this.onWillVisibilityChange = this._onWillVisibilityChange.event;
|
|
5005
|
+
this._onDidActiveChange = new Emitter();
|
|
4764
5006
|
this.onDidActiveChange = this._onDidActiveChange.event;
|
|
4765
|
-
//
|
|
4766
5007
|
this._onActiveChange = new Emitter();
|
|
4767
5008
|
this.onActiveChange = this._onActiveChange.event;
|
|
4768
|
-
//
|
|
4769
5009
|
this._onUpdateParameters = new Emitter();
|
|
4770
5010
|
this.onUpdateParameters = this._onUpdateParameters.event;
|
|
4771
5011
|
this.addDisposables(this.onDidFocusChange((event) => {
|
|
@@ -4777,7 +5017,7 @@
|
|
|
4777
5017
|
}), this.onDidDimensionsChange((event) => {
|
|
4778
5018
|
this._width = event.width;
|
|
4779
5019
|
this._height = event.height;
|
|
4780
|
-
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this.
|
|
5020
|
+
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onUpdateParameters, this._onWillFocus, this._onWillVisibilityChange, this._onUpdateParameters);
|
|
4781
5021
|
}
|
|
4782
5022
|
initialize(panel) {
|
|
4783
5023
|
this.panelUpdatesDisposable.value = this._onUpdateParameters.event((parameters) => {
|
|
@@ -4787,7 +5027,7 @@
|
|
|
4787
5027
|
});
|
|
4788
5028
|
}
|
|
4789
5029
|
setVisible(isVisible) {
|
|
4790
|
-
this.
|
|
5030
|
+
this._onWillVisibilityChange.fire({ isVisible });
|
|
4791
5031
|
}
|
|
4792
5032
|
setActive() {
|
|
4793
5033
|
this._onActiveChange.fire();
|
|
@@ -4795,9 +5035,6 @@
|
|
|
4795
5035
|
updateParameters(parameters) {
|
|
4796
5036
|
this._onUpdateParameters.fire(parameters);
|
|
4797
5037
|
}
|
|
4798
|
-
dispose() {
|
|
4799
|
-
super.dispose();
|
|
4800
|
-
}
|
|
4801
5038
|
}
|
|
4802
5039
|
|
|
4803
5040
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
@@ -4885,7 +5122,12 @@
|
|
|
4885
5122
|
}), focusTracker);
|
|
4886
5123
|
}
|
|
4887
5124
|
focus() {
|
|
4888
|
-
|
|
5125
|
+
const event = new WillFocusEvent();
|
|
5126
|
+
this.api._onWillFocus.fire(event);
|
|
5127
|
+
if (event.defaultPrevented) {
|
|
5128
|
+
return;
|
|
5129
|
+
}
|
|
5130
|
+
this._element.focus();
|
|
4889
5131
|
}
|
|
4890
5132
|
layout(width, height) {
|
|
4891
5133
|
this._width = width;
|
|
@@ -5003,7 +5245,11 @@
|
|
|
5003
5245
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
5004
5246
|
this._orientation = orientation;
|
|
5005
5247
|
this.element.classList.add('pane');
|
|
5006
|
-
this.addDisposables(this.api.
|
|
5248
|
+
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
5249
|
+
const { isVisible } = event;
|
|
5250
|
+
const { accessor } = this._params;
|
|
5251
|
+
accessor.setVisible(this, isVisible);
|
|
5252
|
+
}), this.api.onDidSizeChange((event) => {
|
|
5007
5253
|
this._onDidChange.fire({ size: event.size });
|
|
5008
5254
|
}), addDisposableListener(this.element, 'mouseenter', (ev) => {
|
|
5009
5255
|
this.api._onMouseEnter.fire(ev);
|
|
@@ -5214,9 +5460,7 @@
|
|
|
5214
5460
|
super(id);
|
|
5215
5461
|
this._onDidConstraintsChangeInternal = new Emitter();
|
|
5216
5462
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
5217
|
-
this._onDidConstraintsChange = new Emitter(
|
|
5218
|
-
replay: true,
|
|
5219
|
-
});
|
|
5463
|
+
this._onDidConstraintsChange = new Emitter();
|
|
5220
5464
|
this.onDidConstraintsChange = this._onDidConstraintsChange.event;
|
|
5221
5465
|
this._onDidSizeChange = new Emitter();
|
|
5222
5466
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
@@ -5309,13 +5553,13 @@
|
|
|
5309
5553
|
this._maximumHeight = options.maximumHeight;
|
|
5310
5554
|
}
|
|
5311
5555
|
this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
|
|
5312
|
-
this.addDisposables(this.api.
|
|
5556
|
+
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
5313
5557
|
const { isVisible } = event;
|
|
5314
5558
|
const { accessor } = this._params;
|
|
5315
5559
|
accessor.setVisible(this, isVisible);
|
|
5316
5560
|
}), this.api.onActiveChange(() => {
|
|
5317
5561
|
const { accessor } = this._params;
|
|
5318
|
-
accessor.
|
|
5562
|
+
accessor.doSetGroupActive(this);
|
|
5319
5563
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
5320
5564
|
if (typeof event.minimumWidth === 'number' ||
|
|
5321
5565
|
typeof event.minimumWidth === 'function') {
|
|
@@ -5398,6 +5642,17 @@
|
|
|
5398
5642
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
5399
5643
|
this.addDisposables(this._onDidLocationChange);
|
|
5400
5644
|
}
|
|
5645
|
+
close() {
|
|
5646
|
+
if (!this._group) {
|
|
5647
|
+
return;
|
|
5648
|
+
}
|
|
5649
|
+
return this.accessor.removeGroup(this._group);
|
|
5650
|
+
}
|
|
5651
|
+
getWindow() {
|
|
5652
|
+
return this.location.type === 'popout'
|
|
5653
|
+
? this.location.getWindow()
|
|
5654
|
+
: window;
|
|
5655
|
+
}
|
|
5401
5656
|
moveTo(options) {
|
|
5402
5657
|
var _a, _b, _c;
|
|
5403
5658
|
if (!this._group) {
|
|
@@ -5405,14 +5660,23 @@
|
|
|
5405
5660
|
}
|
|
5406
5661
|
const group = (_a = options.group) !== null && _a !== void 0 ? _a : this.accessor.addGroup({
|
|
5407
5662
|
direction: positionToDirection((_b = options.position) !== null && _b !== void 0 ? _b : 'right'),
|
|
5663
|
+
skipSetActive: true,
|
|
5664
|
+
});
|
|
5665
|
+
this.accessor.moveGroupOrPanel({
|
|
5666
|
+
from: { groupId: this._group.id },
|
|
5667
|
+
to: {
|
|
5668
|
+
group,
|
|
5669
|
+
position: options.group
|
|
5670
|
+
? (_c = options.position) !== null && _c !== void 0 ? _c : 'center'
|
|
5671
|
+
: 'center',
|
|
5672
|
+
},
|
|
5408
5673
|
});
|
|
5409
|
-
this.accessor.moveGroupOrPanel(group, this._group.id, undefined, options.group ? (_c = options.position) !== null && _c !== void 0 ? _c : 'center' : 'center');
|
|
5410
5674
|
}
|
|
5411
5675
|
maximize() {
|
|
5412
5676
|
if (!this._group) {
|
|
5413
5677
|
throw new Error(NOT_INITIALIZED_MESSAGE);
|
|
5414
5678
|
}
|
|
5415
|
-
if (this.location !== 'grid') {
|
|
5679
|
+
if (this.location.type !== 'grid') {
|
|
5416
5680
|
// only grid groups can be maximized
|
|
5417
5681
|
return;
|
|
5418
5682
|
}
|
|
@@ -5469,6 +5733,12 @@
|
|
|
5469
5733
|
this.api.initialize(this); // cannot use 'this' after after 'super' call
|
|
5470
5734
|
this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
|
|
5471
5735
|
}
|
|
5736
|
+
focus() {
|
|
5737
|
+
if (!this.api.isActive) {
|
|
5738
|
+
this.api.setActive();
|
|
5739
|
+
}
|
|
5740
|
+
super.focus();
|
|
5741
|
+
}
|
|
5472
5742
|
initialize() {
|
|
5473
5743
|
this._model.initialize();
|
|
5474
5744
|
}
|
|
@@ -5514,6 +5784,9 @@
|
|
|
5514
5784
|
}
|
|
5515
5785
|
|
|
5516
5786
|
class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
5787
|
+
get location() {
|
|
5788
|
+
return this.group.api.location;
|
|
5789
|
+
}
|
|
5517
5790
|
get title() {
|
|
5518
5791
|
return this.panel.title;
|
|
5519
5792
|
}
|
|
@@ -5524,16 +5797,14 @@
|
|
|
5524
5797
|
return this.panel.renderer;
|
|
5525
5798
|
}
|
|
5526
5799
|
set group(value) {
|
|
5527
|
-
const
|
|
5528
|
-
this._group
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
this.
|
|
5532
|
-
|
|
5800
|
+
const oldGroup = this._group;
|
|
5801
|
+
if (this._group !== value) {
|
|
5802
|
+
this._group = value;
|
|
5803
|
+
this._onDidGroupChange.fire({});
|
|
5804
|
+
this.setupGroupEventListeners(oldGroup);
|
|
5805
|
+
this._onDidLocationChange.fire({
|
|
5806
|
+
location: this.group.api.location,
|
|
5533
5807
|
});
|
|
5534
|
-
if (this.isGroupActive !== isOldGroupActive) {
|
|
5535
|
-
this._onDidActiveGroupChange.fire();
|
|
5536
|
-
}
|
|
5537
5808
|
}
|
|
5538
5809
|
}
|
|
5539
5810
|
get group() {
|
|
@@ -5551,14 +5822,27 @@
|
|
|
5551
5822
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
5552
5823
|
this._onDidRendererChange = new Emitter();
|
|
5553
5824
|
this.onDidRendererChange = this._onDidRendererChange.event;
|
|
5554
|
-
this.
|
|
5825
|
+
this._onDidLocationChange = new Emitter();
|
|
5826
|
+
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
5827
|
+
this.groupEventsDisposable = new MutableDisposable();
|
|
5555
5828
|
this.initialize(panel);
|
|
5556
5829
|
this._group = group;
|
|
5557
|
-
this.
|
|
5830
|
+
this.setupGroupEventListeners();
|
|
5831
|
+
this.addDisposables(this.groupEventsDisposable, this._onDidRendererChange, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange, this._onDidLocationChange);
|
|
5832
|
+
}
|
|
5833
|
+
getWindow() {
|
|
5834
|
+
return this.group.api.getWindow();
|
|
5558
5835
|
}
|
|
5559
5836
|
moveTo(options) {
|
|
5560
5837
|
var _a;
|
|
5561
|
-
this.accessor.moveGroupOrPanel(
|
|
5838
|
+
this.accessor.moveGroupOrPanel({
|
|
5839
|
+
from: { groupId: this._group.id, panelId: this.panel.id },
|
|
5840
|
+
to: {
|
|
5841
|
+
group: options.group,
|
|
5842
|
+
position: (_a = options.position) !== null && _a !== void 0 ? _a : 'center',
|
|
5843
|
+
index: options.index,
|
|
5844
|
+
},
|
|
5845
|
+
});
|
|
5562
5846
|
}
|
|
5563
5847
|
setTitle(title) {
|
|
5564
5848
|
this.panel.setTitle(title);
|
|
@@ -5578,6 +5862,35 @@
|
|
|
5578
5862
|
exitMaximized() {
|
|
5579
5863
|
this.group.api.exitMaximized();
|
|
5580
5864
|
}
|
|
5865
|
+
setupGroupEventListeners(previousGroup) {
|
|
5866
|
+
var _a;
|
|
5867
|
+
let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
|
|
5868
|
+
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
|
|
5869
|
+
if (!event.isVisible && this.isVisible) {
|
|
5870
|
+
this._onDidVisibilityChange.fire(event);
|
|
5871
|
+
}
|
|
5872
|
+
else if (event.isVisible &&
|
|
5873
|
+
!this.isVisible &&
|
|
5874
|
+
this.group.model.isPanelActive(this.panel)) {
|
|
5875
|
+
this._onDidVisibilityChange.fire(event);
|
|
5876
|
+
}
|
|
5877
|
+
}), this.group.api.onDidLocationChange((event) => {
|
|
5878
|
+
if (this.group !== this.panel.group) {
|
|
5879
|
+
return;
|
|
5880
|
+
}
|
|
5881
|
+
this._onDidLocationChange.fire(event);
|
|
5882
|
+
}), this.group.api.onDidActiveChange(() => {
|
|
5883
|
+
if (this.group !== this.panel.group) {
|
|
5884
|
+
return;
|
|
5885
|
+
}
|
|
5886
|
+
if (_trackGroupActive !== this.isGroupActive) {
|
|
5887
|
+
_trackGroupActive = this.isGroupActive;
|
|
5888
|
+
this._onDidActiveGroupChange.fire({
|
|
5889
|
+
isActive: this.isGroupActive,
|
|
5890
|
+
});
|
|
5891
|
+
}
|
|
5892
|
+
}));
|
|
5893
|
+
}
|
|
5581
5894
|
}
|
|
5582
5895
|
|
|
5583
5896
|
class DockviewPanel extends CompositeDisposable {
|
|
@@ -5619,7 +5932,14 @@
|
|
|
5619
5932
|
this.setTitle(params.title);
|
|
5620
5933
|
}
|
|
5621
5934
|
focus() {
|
|
5622
|
-
|
|
5935
|
+
const event = new WillFocusEvent();
|
|
5936
|
+
this.api._onWillFocus.fire(event);
|
|
5937
|
+
if (event.defaultPrevented) {
|
|
5938
|
+
return;
|
|
5939
|
+
}
|
|
5940
|
+
if (!this.api.isActive) {
|
|
5941
|
+
this.api.setActive();
|
|
5942
|
+
}
|
|
5623
5943
|
}
|
|
5624
5944
|
toJSON() {
|
|
5625
5945
|
return {
|
|
@@ -5676,20 +5996,40 @@
|
|
|
5676
5996
|
},
|
|
5677
5997
|
});
|
|
5678
5998
|
}
|
|
5679
|
-
updateParentGroup(group,
|
|
5999
|
+
updateParentGroup(group, options) {
|
|
5680
6000
|
this._group = group;
|
|
5681
|
-
this.api.group =
|
|
6001
|
+
this.api.group = this._group;
|
|
5682
6002
|
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
5683
|
-
this.api.
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
6003
|
+
const isActive = this.group.api.isActive && isPanelVisible;
|
|
6004
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipSetActive)) {
|
|
6005
|
+
if (this.api.isActive !== isActive) {
|
|
6006
|
+
this.api._onDidActiveChange.fire({
|
|
6007
|
+
isActive: this.group.api.isActive && isPanelVisible,
|
|
6008
|
+
});
|
|
6009
|
+
}
|
|
6010
|
+
}
|
|
6011
|
+
if (this.api.isVisible !== isPanelVisible) {
|
|
6012
|
+
this.api._onDidVisibilityChange.fire({
|
|
6013
|
+
isVisible: isPanelVisible,
|
|
6014
|
+
});
|
|
6015
|
+
}
|
|
6016
|
+
}
|
|
6017
|
+
runEvents() {
|
|
6018
|
+
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
6019
|
+
const isActive = this.group.api.isActive && isPanelVisible;
|
|
6020
|
+
if (this.api.isActive !== isActive) {
|
|
6021
|
+
this.api._onDidActiveChange.fire({
|
|
6022
|
+
isActive: this.group.api.isActive && isPanelVisible,
|
|
6023
|
+
});
|
|
6024
|
+
}
|
|
6025
|
+
if (this.api.isVisible !== isPanelVisible) {
|
|
6026
|
+
this.api._onDidVisibilityChange.fire({
|
|
6027
|
+
isVisible: isPanelVisible,
|
|
6028
|
+
});
|
|
6029
|
+
}
|
|
5690
6030
|
}
|
|
5691
6031
|
layout(width, height) {
|
|
5692
|
-
//
|
|
6032
|
+
// TODO: Can we somehow do height without header height or indicate what the header height is?
|
|
5693
6033
|
this.api._onDidDimensionChange.fire({
|
|
5694
6034
|
width,
|
|
5695
6035
|
height: height,
|
|
@@ -5811,8 +6151,6 @@
|
|
|
5811
6151
|
this.id = id;
|
|
5812
6152
|
this.contentComponent = contentComponent;
|
|
5813
6153
|
this.tabComponent = tabComponent;
|
|
5814
|
-
this._group = null;
|
|
5815
|
-
this._isPanelVisible = null;
|
|
5816
6154
|
this._content = this.createContentComponent(this.id, contentComponent);
|
|
5817
6155
|
this._tab = this.createTabComponent(this.id, tabComponent);
|
|
5818
6156
|
}
|
|
@@ -5820,25 +6158,8 @@
|
|
|
5820
6158
|
this.content.init(Object.assign(Object.assign({}, params), { tab: this.tab }));
|
|
5821
6159
|
this.tab.init(params);
|
|
5822
6160
|
}
|
|
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
|
-
}
|
|
6161
|
+
updateParentGroup(_group, _isPanelVisible) {
|
|
6162
|
+
// noop
|
|
5842
6163
|
}
|
|
5843
6164
|
layout(width, height) {
|
|
5844
6165
|
var _a, _b;
|
|
@@ -6271,117 +6592,6 @@
|
|
|
6271
6592
|
}
|
|
6272
6593
|
}
|
|
6273
6594
|
|
|
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
6595
|
const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
|
|
6386
6596
|
const DEFAULT_FLOATING_GROUP_POSITION = { left: 100, top: 100 };
|
|
6387
6597
|
|
|
@@ -6395,11 +6605,13 @@
|
|
|
6395
6605
|
super();
|
|
6396
6606
|
this.element = element;
|
|
6397
6607
|
this.map = {};
|
|
6608
|
+
this._disposed = false;
|
|
6398
6609
|
this.addDisposables(Disposable.from(() => {
|
|
6399
6610
|
for (const value of Object.values(this.map)) {
|
|
6400
6611
|
value.disposable.dispose();
|
|
6401
6612
|
value.destroy.dispose();
|
|
6402
6613
|
}
|
|
6614
|
+
this._disposed = true;
|
|
6403
6615
|
}));
|
|
6404
6616
|
}
|
|
6405
6617
|
detatch(panel) {
|
|
@@ -6439,7 +6651,7 @@
|
|
|
6439
6651
|
focusContainer.style.top = `${box.top - box2.top}px`;
|
|
6440
6652
|
focusContainer.style.width = `${box.width}px`;
|
|
6441
6653
|
focusContainer.style.height = `${box.height}px`;
|
|
6442
|
-
toggleClass(focusContainer, 'dv-render-overlay-float', panel.group.api.location === 'floating');
|
|
6654
|
+
toggleClass(focusContainer, 'dv-render-overlay-float', panel.group.api.location.type === 'floating');
|
|
6443
6655
|
};
|
|
6444
6656
|
const visibilityChanged = () => {
|
|
6445
6657
|
if (panel.api.isVisible) {
|
|
@@ -6485,8 +6697,11 @@
|
|
|
6485
6697
|
resize();
|
|
6486
6698
|
}));
|
|
6487
6699
|
this.map[panel.api.id].destroy = Disposable.from(() => {
|
|
6488
|
-
|
|
6489
|
-
|
|
6700
|
+
var _a;
|
|
6701
|
+
if (panel.view.content.element.parentElement === focusContainer) {
|
|
6702
|
+
focusContainer.removeChild(panel.view.content.element);
|
|
6703
|
+
}
|
|
6704
|
+
(_a = focusContainer.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(focusContainer);
|
|
6490
6705
|
});
|
|
6491
6706
|
queueMicrotask(() => {
|
|
6492
6707
|
if (this.isDisposed) {
|
|
@@ -6507,11 +6722,187 @@
|
|
|
6507
6722
|
}
|
|
6508
6723
|
}
|
|
6509
6724
|
|
|
6725
|
+
/******************************************************************************
|
|
6726
|
+
Copyright (c) Microsoft Corporation.
|
|
6727
|
+
|
|
6728
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6729
|
+
purpose with or without fee is hereby granted.
|
|
6730
|
+
|
|
6731
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
6732
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
6733
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
6734
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
6735
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
6736
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
6737
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
6738
|
+
***************************************************************************** */
|
|
6739
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
6740
|
+
|
|
6741
|
+
|
|
6742
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
6743
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6744
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6745
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6746
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6747
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6748
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6749
|
+
});
|
|
6750
|
+
}
|
|
6751
|
+
|
|
6752
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
6753
|
+
var e = new Error(message);
|
|
6754
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
6755
|
+
};
|
|
6756
|
+
|
|
6757
|
+
class PopoutWindow extends CompositeDisposable {
|
|
6758
|
+
get window() {
|
|
6759
|
+
var _a, _b;
|
|
6760
|
+
return (_b = (_a = this._window) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null;
|
|
6761
|
+
}
|
|
6762
|
+
constructor(target, className, options) {
|
|
6763
|
+
super();
|
|
6764
|
+
this.target = target;
|
|
6765
|
+
this.className = className;
|
|
6766
|
+
this.options = options;
|
|
6767
|
+
this._onWillClose = new Emitter();
|
|
6768
|
+
this.onWillClose = this._onWillClose.event;
|
|
6769
|
+
this._onDidClose = new Emitter();
|
|
6770
|
+
this.onDidClose = this._onDidClose.event;
|
|
6771
|
+
this._window = null;
|
|
6772
|
+
this.addDisposables(this._onWillClose, this._onDidClose, {
|
|
6773
|
+
dispose: () => {
|
|
6774
|
+
this.close();
|
|
6775
|
+
},
|
|
6776
|
+
});
|
|
6777
|
+
}
|
|
6778
|
+
dimensions() {
|
|
6779
|
+
if (!this._window) {
|
|
6780
|
+
return null;
|
|
6781
|
+
}
|
|
6782
|
+
const left = this._window.value.screenX;
|
|
6783
|
+
const top = this._window.value.screenY;
|
|
6784
|
+
const width = this._window.value.innerWidth;
|
|
6785
|
+
const height = this._window.value.innerHeight;
|
|
6786
|
+
return { top, left, width, height };
|
|
6787
|
+
}
|
|
6788
|
+
close() {
|
|
6789
|
+
var _a, _b;
|
|
6790
|
+
if (this._window) {
|
|
6791
|
+
this._onWillClose.fire();
|
|
6792
|
+
(_b = (_a = this.options).onWillClose) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
6793
|
+
id: this.target,
|
|
6794
|
+
window: this._window.value,
|
|
6795
|
+
});
|
|
6796
|
+
this._window.disposable.dispose();
|
|
6797
|
+
this._window.value.close();
|
|
6798
|
+
this._window = null;
|
|
6799
|
+
this._onDidClose.fire();
|
|
6800
|
+
}
|
|
6801
|
+
}
|
|
6802
|
+
open() {
|
|
6803
|
+
var _a, _b;
|
|
6804
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6805
|
+
if (this._window) {
|
|
6806
|
+
throw new Error('instance of popout window is already open');
|
|
6807
|
+
}
|
|
6808
|
+
const url = `${this.options.url}`;
|
|
6809
|
+
const features = Object.entries({
|
|
6810
|
+
top: this.options.top,
|
|
6811
|
+
left: this.options.left,
|
|
6812
|
+
width: this.options.width,
|
|
6813
|
+
height: this.options.height,
|
|
6814
|
+
})
|
|
6815
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
6816
|
+
.join(',');
|
|
6817
|
+
/**
|
|
6818
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/open
|
|
6819
|
+
*/
|
|
6820
|
+
const externalWindow = window.open(url, this.target, features);
|
|
6821
|
+
if (!externalWindow) {
|
|
6822
|
+
/**
|
|
6823
|
+
* Popup blocked
|
|
6824
|
+
*/
|
|
6825
|
+
return null;
|
|
6826
|
+
}
|
|
6827
|
+
const disposable = new CompositeDisposable();
|
|
6828
|
+
this._window = { value: externalWindow, disposable };
|
|
6829
|
+
disposable.addDisposables(addDisposableWindowListener(window, 'beforeunload', () => {
|
|
6830
|
+
/**
|
|
6831
|
+
* before the main window closes we should close this popup too
|
|
6832
|
+
* to be good citizens
|
|
6833
|
+
*
|
|
6834
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
6835
|
+
*/
|
|
6836
|
+
this.close();
|
|
6837
|
+
}));
|
|
6838
|
+
const container = this.createPopoutWindowContainer();
|
|
6839
|
+
if (this.className) {
|
|
6840
|
+
container.classList.add(this.className);
|
|
6841
|
+
}
|
|
6842
|
+
(_b = (_a = this.options).onDidOpen) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
6843
|
+
id: this.target,
|
|
6844
|
+
window: externalWindow,
|
|
6845
|
+
});
|
|
6846
|
+
return new Promise((resolve) => {
|
|
6847
|
+
externalWindow.addEventListener('unload', (e) => {
|
|
6848
|
+
// if page fails to load before unloading
|
|
6849
|
+
// this.close();
|
|
6850
|
+
});
|
|
6851
|
+
externalWindow.addEventListener('load', () => {
|
|
6852
|
+
/**
|
|
6853
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
|
|
6854
|
+
*/
|
|
6855
|
+
const externalDocument = externalWindow.document;
|
|
6856
|
+
externalDocument.title = document.title;
|
|
6857
|
+
externalDocument.body.appendChild(container);
|
|
6858
|
+
addStyles(externalDocument, window.document.styleSheets);
|
|
6859
|
+
/**
|
|
6860
|
+
* beforeunload must be registered after load for reasons I could not determine
|
|
6861
|
+
* otherwise the beforeunload event will not fire when the window is closed
|
|
6862
|
+
*/
|
|
6863
|
+
addDisposableWindowListener(externalWindow, 'beforeunload', () => {
|
|
6864
|
+
/**
|
|
6865
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
6866
|
+
*/
|
|
6867
|
+
this.close();
|
|
6868
|
+
});
|
|
6869
|
+
resolve(container);
|
|
6870
|
+
});
|
|
6871
|
+
});
|
|
6872
|
+
});
|
|
6873
|
+
}
|
|
6874
|
+
createPopoutWindowContainer() {
|
|
6875
|
+
const el = document.createElement('div');
|
|
6876
|
+
el.classList.add('dv-popout-window');
|
|
6877
|
+
el.id = 'dv-popout-window';
|
|
6878
|
+
el.style.position = 'absolute';
|
|
6879
|
+
el.style.width = '100%';
|
|
6880
|
+
el.style.height = '100%';
|
|
6881
|
+
el.style.top = '0px';
|
|
6882
|
+
el.style.left = '0px';
|
|
6883
|
+
return el;
|
|
6884
|
+
}
|
|
6885
|
+
}
|
|
6886
|
+
|
|
6510
6887
|
const DEFAULT_ROOT_OVERLAY_MODEL = {
|
|
6511
6888
|
activationSize: { type: 'pixels', value: 10 },
|
|
6512
6889
|
size: { type: 'pixels', value: 20 },
|
|
6513
6890
|
};
|
|
6514
|
-
function
|
|
6891
|
+
function moveGroupWithoutDestroying(options) {
|
|
6892
|
+
const activePanel = options.from.activePanel;
|
|
6893
|
+
const panels = [...options.from.panels].map((panel) => {
|
|
6894
|
+
const removedPanel = options.from.model.removePanel(panel);
|
|
6895
|
+
options.from.model.renderContainer.detatch(panel);
|
|
6896
|
+
return removedPanel;
|
|
6897
|
+
});
|
|
6898
|
+
panels.forEach((panel) => {
|
|
6899
|
+
options.to.model.openPanel(panel, {
|
|
6900
|
+
skipSetActive: activePanel !== panel,
|
|
6901
|
+
skipSetGroupActive: true,
|
|
6902
|
+
});
|
|
6903
|
+
});
|
|
6904
|
+
}
|
|
6905
|
+
function getDockviewTheme(element) {
|
|
6515
6906
|
function toClassList(element) {
|
|
6516
6907
|
const list = [];
|
|
6517
6908
|
for (let i = 0; i < element.classList.length; i++) {
|
|
@@ -6562,6 +6953,7 @@
|
|
|
6562
6953
|
styles: options.styles,
|
|
6563
6954
|
parentElement: options.parentElement,
|
|
6564
6955
|
disableAutoResizing: options.disableAutoResizing,
|
|
6956
|
+
locked: options.locked,
|
|
6565
6957
|
});
|
|
6566
6958
|
this.nextGroupId = sequentialNumberGenerator();
|
|
6567
6959
|
this._deserializer = new DefaultDockviewDeserialzier(this);
|
|
@@ -6572,6 +6964,10 @@
|
|
|
6572
6964
|
this.onWillDragGroup = this._onWillDragGroup.event;
|
|
6573
6965
|
this._onDidDrop = new Emitter();
|
|
6574
6966
|
this.onDidDrop = this._onDidDrop.event;
|
|
6967
|
+
this._onWillDrop = new Emitter();
|
|
6968
|
+
this.onWillDrop = this._onWillDrop.event;
|
|
6969
|
+
this._onWillShowOverlay = new Emitter();
|
|
6970
|
+
this.onWillShowOverlay = this._onWillShowOverlay.event;
|
|
6575
6971
|
this._onDidRemovePanel = new Emitter();
|
|
6576
6972
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
6577
6973
|
this._onDidAddPanel = new Emitter();
|
|
@@ -6580,15 +6976,36 @@
|
|
|
6580
6976
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
6581
6977
|
this._onDidActivePanelChange = new Emitter();
|
|
6582
6978
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6979
|
+
this._onDidMovePanel = new Emitter();
|
|
6583
6980
|
this._floatingGroups = [];
|
|
6584
6981
|
this._popoutGroups = [];
|
|
6982
|
+
this._ignoreEvents = 0;
|
|
6983
|
+
this._onDidRemoveGroup = new Emitter();
|
|
6984
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
6985
|
+
this._onDidAddGroup = new Emitter();
|
|
6986
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
6987
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
6988
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
6989
|
+
this._moving = false;
|
|
6585
6990
|
const gready = document.createElement('div');
|
|
6586
6991
|
gready.className = 'dv-overlay-render-container';
|
|
6587
6992
|
this.gridview.element.appendChild(gready);
|
|
6588
6993
|
this.overlayRenderContainer = new OverlayRenderContainer(gready);
|
|
6589
6994
|
toggleClass(this.gridview.element, 'dv-dockview', true);
|
|
6590
6995
|
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,
|
|
6996
|
+
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) => {
|
|
6997
|
+
if (!this._moving) {
|
|
6998
|
+
this._onDidAddGroup.fire(event);
|
|
6999
|
+
}
|
|
7000
|
+
}), this.onDidRemove((event) => {
|
|
7001
|
+
if (!this._moving) {
|
|
7002
|
+
this._onDidRemoveGroup.fire(event);
|
|
7003
|
+
}
|
|
7004
|
+
}), this.onDidActiveChange((event) => {
|
|
7005
|
+
if (!this._moving) {
|
|
7006
|
+
this._onDidActiveGroupChange.fire(event);
|
|
7007
|
+
}
|
|
7008
|
+
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove)(() => {
|
|
6592
7009
|
this.updateWatermark();
|
|
6593
7010
|
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
6594
7011
|
this._bufferOnDidLayoutChange.fire();
|
|
@@ -6599,7 +7016,7 @@
|
|
|
6599
7016
|
}
|
|
6600
7017
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
6601
7018
|
for (const group of [...this._popoutGroups]) {
|
|
6602
|
-
group.dispose();
|
|
7019
|
+
group.disposable.dispose();
|
|
6603
7020
|
}
|
|
6604
7021
|
}));
|
|
6605
7022
|
this._options = options;
|
|
@@ -6645,7 +7062,7 @@
|
|
|
6645
7062
|
return this.options.showDndOverlay({
|
|
6646
7063
|
nativeEvent: event,
|
|
6647
7064
|
position: position,
|
|
6648
|
-
target:
|
|
7065
|
+
target: 'edge',
|
|
6649
7066
|
getData: getPanelData,
|
|
6650
7067
|
});
|
|
6651
7068
|
}
|
|
@@ -6654,88 +7071,259 @@
|
|
|
6654
7071
|
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
6655
7072
|
overlayModel: (_b = this.options.rootOverlayModel) !== null && _b !== void 0 ? _b : DEFAULT_ROOT_OVERLAY_MODEL,
|
|
6656
7073
|
});
|
|
6657
|
-
this.addDisposables(this._rootDropTarget.
|
|
7074
|
+
this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
|
|
7075
|
+
if (this.gridview.length > 0 && event.position === 'center') {
|
|
7076
|
+
// option only available when no panels in primary grid
|
|
7077
|
+
return;
|
|
7078
|
+
}
|
|
7079
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
7080
|
+
kind: 'edge',
|
|
7081
|
+
}));
|
|
7082
|
+
}), this._rootDropTarget.onDrop((event) => {
|
|
6658
7083
|
var _a;
|
|
7084
|
+
const willDropEvent = new DockviewWillDropEvent({
|
|
7085
|
+
nativeEvent: event.nativeEvent,
|
|
7086
|
+
position: event.position,
|
|
7087
|
+
panel: undefined,
|
|
7088
|
+
api: this._api,
|
|
7089
|
+
group: undefined,
|
|
7090
|
+
getData: getPanelData,
|
|
7091
|
+
kind: 'edge',
|
|
7092
|
+
});
|
|
7093
|
+
this._onWillDrop.fire(willDropEvent);
|
|
7094
|
+
if (willDropEvent.defaultPrevented) {
|
|
7095
|
+
return;
|
|
7096
|
+
}
|
|
6659
7097
|
const data = getPanelData();
|
|
6660
7098
|
if (data) {
|
|
6661
|
-
this.moveGroupOrPanel(
|
|
7099
|
+
this.moveGroupOrPanel({
|
|
7100
|
+
from: {
|
|
7101
|
+
groupId: data.groupId,
|
|
7102
|
+
panelId: (_a = data.panelId) !== null && _a !== void 0 ? _a : undefined,
|
|
7103
|
+
},
|
|
7104
|
+
to: {
|
|
7105
|
+
group: this.orthogonalize(event.position),
|
|
7106
|
+
position: 'center',
|
|
7107
|
+
},
|
|
7108
|
+
});
|
|
6662
7109
|
}
|
|
6663
7110
|
else {
|
|
6664
|
-
this._onDidDrop.fire(
|
|
7111
|
+
this._onDidDrop.fire(new DockviewDidDropEvent({
|
|
7112
|
+
nativeEvent: event.nativeEvent,
|
|
7113
|
+
position: event.position,
|
|
7114
|
+
panel: undefined,
|
|
7115
|
+
api: this._api,
|
|
7116
|
+
group: undefined,
|
|
7117
|
+
getData: getPanelData,
|
|
7118
|
+
}));
|
|
6665
7119
|
}
|
|
6666
7120
|
}), this._rootDropTarget);
|
|
6667
7121
|
this._api = new DockviewApi(this);
|
|
6668
7122
|
this.updateWatermark();
|
|
6669
7123
|
}
|
|
6670
|
-
addPopoutGroup(
|
|
6671
|
-
var _a;
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
7124
|
+
addPopoutGroup(itemToPopout, options) {
|
|
7125
|
+
var _a, _b, _c;
|
|
7126
|
+
if (itemToPopout instanceof DockviewPanel &&
|
|
7127
|
+
itemToPopout.group.size === 1) {
|
|
7128
|
+
return this.addPopoutGroup(itemToPopout.group);
|
|
7129
|
+
}
|
|
7130
|
+
const theme = getDockviewTheme(this.gridview.element);
|
|
7131
|
+
const element = this.element;
|
|
7132
|
+
function getBox() {
|
|
7133
|
+
if (options === null || options === void 0 ? void 0 : options.position) {
|
|
7134
|
+
return options.position;
|
|
7135
|
+
}
|
|
7136
|
+
if (itemToPopout instanceof DockviewGroupPanel) {
|
|
7137
|
+
return itemToPopout.element.getBoundingClientRect();
|
|
7138
|
+
}
|
|
7139
|
+
if (itemToPopout.group) {
|
|
7140
|
+
return itemToPopout.group.element.getBoundingClientRect();
|
|
7141
|
+
}
|
|
7142
|
+
return element.getBoundingClientRect();
|
|
7143
|
+
}
|
|
7144
|
+
const box = getBox();
|
|
7145
|
+
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;
|
|
7146
|
+
if (itemToPopout.api.location.type === 'grid') {
|
|
7147
|
+
itemToPopout.api.setVisible(false);
|
|
7148
|
+
}
|
|
7149
|
+
const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
|
|
7150
|
+
theme !== null && theme !== void 0 ? theme : '', {
|
|
7151
|
+
url: (_c = options === null || options === void 0 ? void 0 : options.popoutUrl) !== null && _c !== void 0 ? _c : '/popout.html',
|
|
7152
|
+
left: window.screenX + box.left,
|
|
7153
|
+
top: window.screenY + box.top,
|
|
7154
|
+
width: box.width,
|
|
7155
|
+
height: box.height,
|
|
7156
|
+
onDidOpen: options === null || options === void 0 ? void 0 : options.onDidOpen,
|
|
7157
|
+
onWillClose: options === null || options === void 0 ? void 0 : options.onWillClose,
|
|
7158
|
+
});
|
|
7159
|
+
const popoutWindowDisposable = new CompositeDisposable(_window, _window.onDidClose(() => {
|
|
7160
|
+
popoutWindowDisposable.dispose();
|
|
7161
|
+
}));
|
|
7162
|
+
return _window
|
|
7163
|
+
.open()
|
|
7164
|
+
.then((popoutContainer) => {
|
|
7165
|
+
var _a;
|
|
7166
|
+
if (_window.isDisposed) {
|
|
7167
|
+
return;
|
|
6683
7168
|
}
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
if (!box) {
|
|
6688
|
-
box = group.element.getBoundingClientRect();
|
|
7169
|
+
if (popoutContainer === null) {
|
|
7170
|
+
popoutWindowDisposable.dispose();
|
|
7171
|
+
return;
|
|
6689
7172
|
}
|
|
6690
|
-
const
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
7173
|
+
const gready = document.createElement('div');
|
|
7174
|
+
gready.className = 'dv-overlay-render-container';
|
|
7175
|
+
const overlayRenderContainer = new OverlayRenderContainer(gready);
|
|
7176
|
+
const referenceGroup = itemToPopout instanceof DockviewPanel
|
|
7177
|
+
? itemToPopout.group
|
|
7178
|
+
: itemToPopout;
|
|
7179
|
+
const referenceLocation = itemToPopout.api.location.type;
|
|
7180
|
+
const group = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) !== null && _a !== void 0 ? _a : this.createGroup({ id: groupId });
|
|
7181
|
+
group.model.renderContainer = overlayRenderContainer;
|
|
7182
|
+
if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGroup)) {
|
|
7183
|
+
this._onDidAddGroup.fire(group);
|
|
7184
|
+
}
|
|
7185
|
+
if (itemToPopout instanceof DockviewPanel) {
|
|
7186
|
+
this.movingLock(() => {
|
|
7187
|
+
const panel = referenceGroup.model.removePanel(itemToPopout);
|
|
7188
|
+
group.model.openPanel(panel);
|
|
7189
|
+
});
|
|
7190
|
+
}
|
|
7191
|
+
else {
|
|
7192
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7193
|
+
from: referenceGroup,
|
|
7194
|
+
to: group,
|
|
7195
|
+
}));
|
|
7196
|
+
switch (referenceLocation) {
|
|
7197
|
+
case 'grid':
|
|
7198
|
+
referenceGroup.api.setVisible(false);
|
|
7199
|
+
break;
|
|
7200
|
+
case 'floating':
|
|
7201
|
+
case 'popout':
|
|
7202
|
+
this.removeGroup(referenceGroup);
|
|
7203
|
+
break;
|
|
7204
|
+
}
|
|
7205
|
+
}
|
|
7206
|
+
popoutContainer.classList.add('dv-dockview');
|
|
7207
|
+
popoutContainer.style.overflow = 'hidden';
|
|
7208
|
+
popoutContainer.appendChild(gready);
|
|
7209
|
+
popoutContainer.appendChild(group.element);
|
|
7210
|
+
group.model.location = {
|
|
7211
|
+
type: 'popout',
|
|
7212
|
+
getWindow: () => _window.window,
|
|
7213
|
+
};
|
|
7214
|
+
this.doSetGroupAndPanelActive(group);
|
|
7215
|
+
popoutWindowDisposable.addDisposables(group.api.onDidActiveChange((event) => {
|
|
7216
|
+
var _a;
|
|
7217
|
+
if (event.isActive) {
|
|
7218
|
+
(_a = _window.window) === null || _a === void 0 ? void 0 : _a.focus();
|
|
7219
|
+
}
|
|
7220
|
+
}), group.api.onWillFocus(() => {
|
|
7221
|
+
var _a;
|
|
7222
|
+
(_a = _window.window) === null || _a === void 0 ? void 0 : _a.focus();
|
|
7223
|
+
}));
|
|
7224
|
+
let returnedGroup;
|
|
7225
|
+
const value = {
|
|
7226
|
+
window: _window,
|
|
7227
|
+
popoutGroup: group,
|
|
7228
|
+
referenceGroup: this.getPanel(referenceGroup.id)
|
|
7229
|
+
? referenceGroup.id
|
|
7230
|
+
: undefined,
|
|
7231
|
+
disposable: {
|
|
7232
|
+
dispose: () => {
|
|
7233
|
+
popoutWindowDisposable.dispose();
|
|
7234
|
+
return returnedGroup;
|
|
7235
|
+
},
|
|
7236
|
+
},
|
|
7237
|
+
};
|
|
7238
|
+
popoutWindowDisposable.addDisposables(
|
|
7239
|
+
/**
|
|
7240
|
+
* ResizeObserver seems slow here, I do not know why but we don't need it
|
|
7241
|
+
* since we can reply on the window resize event as we will occupy the full
|
|
7242
|
+
* window dimensions
|
|
7243
|
+
*/
|
|
7244
|
+
addDisposableWindowListener(_window.window, 'resize', () => {
|
|
7245
|
+
group.layout(window.innerWidth, window.innerHeight);
|
|
7246
|
+
}), overlayRenderContainer, Disposable.from(() => {
|
|
7247
|
+
if (this.getPanel(referenceGroup.id)) {
|
|
7248
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7249
|
+
from: group,
|
|
7250
|
+
to: referenceGroup,
|
|
7251
|
+
}));
|
|
7252
|
+
if (!referenceGroup.api.isVisible) {
|
|
7253
|
+
referenceGroup.api.setVisible(true);
|
|
7254
|
+
}
|
|
7255
|
+
if (this.getPanel(group.id)) {
|
|
7256
|
+
this.doRemoveGroup(group, {
|
|
7257
|
+
skipPopoutAssociated: true,
|
|
7258
|
+
});
|
|
7259
|
+
}
|
|
7260
|
+
}
|
|
7261
|
+
else {
|
|
7262
|
+
if (this.getPanel(group.id)) {
|
|
7263
|
+
const removedGroup = this.doRemoveGroup(group, {
|
|
7264
|
+
skipDispose: true,
|
|
7265
|
+
skipActive: true,
|
|
7266
|
+
});
|
|
7267
|
+
removedGroup.model.renderContainer =
|
|
7268
|
+
this.overlayRenderContainer;
|
|
7269
|
+
removedGroup.model.location = { type: 'grid' };
|
|
7270
|
+
returnedGroup = removedGroup;
|
|
7271
|
+
}
|
|
7272
|
+
}
|
|
7273
|
+
}));
|
|
7274
|
+
this._popoutGroups.push(value);
|
|
7275
|
+
this.updateWatermark();
|
|
7276
|
+
})
|
|
7277
|
+
.catch((err) => {
|
|
7278
|
+
console.error(err);
|
|
6707
7279
|
});
|
|
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
7280
|
}
|
|
6719
7281
|
addFloatingGroup(item, coord, options) {
|
|
6720
|
-
var _a, _b, _c, _d, _e, _f;
|
|
7282
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6721
7283
|
let group;
|
|
6722
7284
|
if (item instanceof DockviewPanel) {
|
|
6723
7285
|
group = this.createGroup();
|
|
6724
|
-
this.
|
|
7286
|
+
this._onDidAddGroup.fire(group);
|
|
7287
|
+
this.movingLock(() => this.removePanel(item, {
|
|
6725
7288
|
removeEmptyGroup: true,
|
|
6726
7289
|
skipDispose: true,
|
|
6727
|
-
|
|
6728
|
-
|
|
7290
|
+
skipSetActiveGroup: true,
|
|
7291
|
+
}));
|
|
7292
|
+
group.model.openPanel(item, { skipSetGroupActive: true });
|
|
6729
7293
|
}
|
|
6730
7294
|
else {
|
|
6731
7295
|
group = item;
|
|
7296
|
+
const popoutReferenceGroupId = (_a = this._popoutGroups.find((_) => _.popoutGroup === group)) === null || _a === void 0 ? void 0 : _a.referenceGroup;
|
|
7297
|
+
const popoutReferenceGroup = popoutReferenceGroupId
|
|
7298
|
+
? this.getPanel(popoutReferenceGroupId)
|
|
7299
|
+
: undefined;
|
|
6732
7300
|
const skip = typeof (options === null || options === void 0 ? void 0 : options.skipRemoveGroup) === 'boolean' &&
|
|
6733
7301
|
options.skipRemoveGroup;
|
|
6734
7302
|
if (!skip) {
|
|
6735
|
-
|
|
7303
|
+
if (popoutReferenceGroup) {
|
|
7304
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7305
|
+
from: item,
|
|
7306
|
+
to: popoutReferenceGroup,
|
|
7307
|
+
}));
|
|
7308
|
+
this.doRemoveGroup(item, {
|
|
7309
|
+
skipPopoutReturn: true,
|
|
7310
|
+
skipPopoutAssociated: true,
|
|
7311
|
+
});
|
|
7312
|
+
this.doRemoveGroup(popoutReferenceGroup, {
|
|
7313
|
+
skipDispose: true,
|
|
7314
|
+
});
|
|
7315
|
+
group = popoutReferenceGroup;
|
|
7316
|
+
}
|
|
7317
|
+
else {
|
|
7318
|
+
this.doRemoveGroup(item, {
|
|
7319
|
+
skipDispose: true,
|
|
7320
|
+
skipPopoutReturn: true,
|
|
7321
|
+
skipPopoutAssociated: !!popoutReferenceGroup,
|
|
7322
|
+
});
|
|
7323
|
+
}
|
|
6736
7324
|
}
|
|
6737
7325
|
}
|
|
6738
|
-
group.model.location = 'floating';
|
|
7326
|
+
group.model.location = { type: 'floating' };
|
|
6739
7327
|
const overlayLeft = typeof (coord === null || coord === void 0 ? void 0 : coord.x) === 'number'
|
|
6740
7328
|
? Math.max(coord.x, 0)
|
|
6741
7329
|
: DEFAULT_FLOATING_GROUP_POSITION.left;
|
|
@@ -6745,16 +7333,16 @@
|
|
|
6745
7333
|
const overlay = new Overlay({
|
|
6746
7334
|
container: this.gridview.element,
|
|
6747
7335
|
content: group.element,
|
|
6748
|
-
height: (
|
|
6749
|
-
width: (
|
|
7336
|
+
height: (_b = coord === null || coord === void 0 ? void 0 : coord.height) !== null && _b !== void 0 ? _b : 300,
|
|
7337
|
+
width: (_c = coord === null || coord === void 0 ? void 0 : coord.width) !== null && _c !== void 0 ? _c : 300,
|
|
6750
7338
|
left: overlayLeft,
|
|
6751
7339
|
top: overlayTop,
|
|
6752
7340
|
minimumInViewportWidth: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
6753
7341
|
? undefined
|
|
6754
|
-
: (
|
|
7342
|
+
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumWidthWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
6755
7343
|
minimumInViewportHeight: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
6756
7344
|
? undefined
|
|
6757
|
-
: (
|
|
7345
|
+
: (_g = (_f = this.options.floatingGroupBounds) === null || _f === void 0 ? void 0 : _f.minimumHeightWithinViewport) !== null && _g !== void 0 ? _g : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE,
|
|
6758
7346
|
});
|
|
6759
7347
|
const el = group.element.querySelector('.void-container');
|
|
6760
7348
|
if (!el) {
|
|
@@ -6785,12 +7373,15 @@
|
|
|
6785
7373
|
}), {
|
|
6786
7374
|
dispose: () => {
|
|
6787
7375
|
disposable.dispose();
|
|
6788
|
-
group.model.location = 'grid';
|
|
7376
|
+
group.model.location = { type: 'grid' };
|
|
6789
7377
|
remove(this._floatingGroups, floatingGroupPanel);
|
|
6790
7378
|
this.updateWatermark();
|
|
6791
7379
|
},
|
|
6792
7380
|
});
|
|
6793
7381
|
this._floatingGroups.push(floatingGroupPanel);
|
|
7382
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipActiveGroup)) {
|
|
7383
|
+
this.doSetGroupAndPanelActive(group);
|
|
7384
|
+
}
|
|
6794
7385
|
this.updateWatermark();
|
|
6795
7386
|
}
|
|
6796
7387
|
orthogonalize(position) {
|
|
@@ -6880,8 +7471,8 @@
|
|
|
6880
7471
|
return this.panels.find((panel) => panel.id === id);
|
|
6881
7472
|
}
|
|
6882
7473
|
setActivePanel(panel) {
|
|
6883
|
-
this.doSetGroupActive(panel.group);
|
|
6884
7474
|
panel.group.model.openPanel(panel);
|
|
7475
|
+
this.doSetGroupAndPanelActive(panel.group);
|
|
6885
7476
|
}
|
|
6886
7477
|
moveToNext(options = {}) {
|
|
6887
7478
|
var _a;
|
|
@@ -6942,7 +7533,8 @@
|
|
|
6942
7533
|
});
|
|
6943
7534
|
const popoutGroups = this._popoutGroups.map((group) => {
|
|
6944
7535
|
return {
|
|
6945
|
-
data: group.
|
|
7536
|
+
data: group.popoutGroup.toJSON(),
|
|
7537
|
+
gridReferenceGroup: group.referenceGroup,
|
|
6946
7538
|
position: group.window.dimensions(),
|
|
6947
7539
|
};
|
|
6948
7540
|
});
|
|
@@ -6960,7 +7552,7 @@
|
|
|
6960
7552
|
return result;
|
|
6961
7553
|
}
|
|
6962
7554
|
fromJSON(data) {
|
|
6963
|
-
var _a, _b;
|
|
7555
|
+
var _a, _b, _c;
|
|
6964
7556
|
this.clear();
|
|
6965
7557
|
if (typeof data !== 'object' || data === null) {
|
|
6966
7558
|
throw new Error('serialized layout must be a non-null object');
|
|
@@ -6999,7 +7591,7 @@
|
|
|
6999
7591
|
const isActive = typeof activeView === 'string' &&
|
|
7000
7592
|
activeView === panel.id;
|
|
7001
7593
|
group.model.openPanel(panel, {
|
|
7002
|
-
|
|
7594
|
+
skipSetActive: !isActive,
|
|
7003
7595
|
skipSetGroupActive: true,
|
|
7004
7596
|
});
|
|
7005
7597
|
}
|
|
@@ -7029,11 +7621,16 @@
|
|
|
7029
7621
|
}
|
|
7030
7622
|
const serializedPopoutGroups = (_b = data.popoutGroups) !== null && _b !== void 0 ? _b : [];
|
|
7031
7623
|
for (const serializedPopoutGroup of serializedPopoutGroups) {
|
|
7032
|
-
const { data, position } = serializedPopoutGroup;
|
|
7624
|
+
const { data, position, gridReferenceGroup } = serializedPopoutGroup;
|
|
7033
7625
|
const group = createGroupFromSerializedState(data);
|
|
7034
|
-
this.addPopoutGroup(
|
|
7626
|
+
this.addPopoutGroup((_c = (gridReferenceGroup
|
|
7627
|
+
? this.getPanel(gridReferenceGroup)
|
|
7628
|
+
: undefined)) !== null && _c !== void 0 ? _c : group, {
|
|
7035
7629
|
skipRemoveGroup: true,
|
|
7036
7630
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
7631
|
+
overridePopoutGroup: gridReferenceGroup
|
|
7632
|
+
? group
|
|
7633
|
+
: undefined,
|
|
7037
7634
|
});
|
|
7038
7635
|
}
|
|
7039
7636
|
for (const floatingGroup of this._floatingGroups) {
|
|
@@ -7080,12 +7677,13 @@
|
|
|
7080
7677
|
*/
|
|
7081
7678
|
throw err;
|
|
7082
7679
|
}
|
|
7680
|
+
this.updateWatermark();
|
|
7083
7681
|
this._onDidLayoutFromJSON.fire();
|
|
7084
7682
|
}
|
|
7085
7683
|
clear() {
|
|
7086
7684
|
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
7087
7685
|
const hasActiveGroup = !!this.activeGroup;
|
|
7088
|
-
|
|
7686
|
+
!!this.activePanel;
|
|
7089
7687
|
for (const group of groups) {
|
|
7090
7688
|
// remove the group will automatically remove the panels
|
|
7091
7689
|
this.removeGroup(group, { skipActive: true });
|
|
@@ -7093,9 +7691,6 @@
|
|
|
7093
7691
|
if (hasActiveGroup) {
|
|
7094
7692
|
this.doSetGroupAndPanelActive(undefined);
|
|
7095
7693
|
}
|
|
7096
|
-
if (hasActivePanel) {
|
|
7097
|
-
this._onDidActivePanelChange.fire(undefined);
|
|
7098
|
-
}
|
|
7099
7694
|
this.gridview.clear();
|
|
7100
7695
|
}
|
|
7101
7696
|
closeAllGroups() {
|
|
@@ -7136,6 +7731,7 @@
|
|
|
7136
7731
|
const group = this.orthogonalize(directionToPosition(options.position.direction));
|
|
7137
7732
|
const panel = this.createPanel(options, group);
|
|
7138
7733
|
group.model.openPanel(panel);
|
|
7734
|
+
this.doSetGroupAndPanelActive(group);
|
|
7139
7735
|
return panel;
|
|
7140
7736
|
}
|
|
7141
7737
|
}
|
|
@@ -7147,6 +7743,7 @@
|
|
|
7147
7743
|
const target = toTarget(((_b = options.position) === null || _b === void 0 ? void 0 : _b.direction) || 'within');
|
|
7148
7744
|
if (options.floating) {
|
|
7149
7745
|
const group = this.createGroup();
|
|
7746
|
+
this._onDidAddGroup.fire(group);
|
|
7150
7747
|
const o = typeof options.floating === 'object' &&
|
|
7151
7748
|
options.floating !== null
|
|
7152
7749
|
? options.floating
|
|
@@ -7154,16 +7751,16 @@
|
|
|
7154
7751
|
this.addFloatingGroup(group, o, {
|
|
7155
7752
|
inDragMode: false,
|
|
7156
7753
|
skipRemoveGroup: true,
|
|
7754
|
+
skipActiveGroup: true,
|
|
7157
7755
|
});
|
|
7158
|
-
this._onDidAddGroup.fire(group);
|
|
7159
7756
|
panel = this.createPanel(options, group);
|
|
7160
7757
|
group.model.openPanel(panel);
|
|
7161
|
-
this.doSetGroupAndPanelActive(group);
|
|
7162
7758
|
}
|
|
7163
|
-
else if (referenceGroup.api.location === 'floating' ||
|
|
7759
|
+
else if (referenceGroup.api.location.type === 'floating' ||
|
|
7164
7760
|
target === 'center') {
|
|
7165
7761
|
panel = this.createPanel(options, referenceGroup);
|
|
7166
7762
|
referenceGroup.model.openPanel(panel);
|
|
7763
|
+
this.doSetGroupAndPanelActive(referenceGroup);
|
|
7167
7764
|
}
|
|
7168
7765
|
else {
|
|
7169
7766
|
const location = getGridLocation(referenceGroup.element);
|
|
@@ -7171,10 +7768,12 @@
|
|
|
7171
7768
|
const group = this.createGroupAtLocation(relativeLocation);
|
|
7172
7769
|
panel = this.createPanel(options, group);
|
|
7173
7770
|
group.model.openPanel(panel);
|
|
7771
|
+
this.doSetGroupAndPanelActive(group);
|
|
7174
7772
|
}
|
|
7175
7773
|
}
|
|
7176
7774
|
else if (options.floating) {
|
|
7177
7775
|
const group = this.createGroup();
|
|
7776
|
+
this._onDidAddGroup.fire(group);
|
|
7178
7777
|
const o = typeof options.floating === 'object' &&
|
|
7179
7778
|
options.floating !== null
|
|
7180
7779
|
? options.floating
|
|
@@ -7182,16 +7781,16 @@
|
|
|
7182
7781
|
this.addFloatingGroup(group, o, {
|
|
7183
7782
|
inDragMode: false,
|
|
7184
7783
|
skipRemoveGroup: true,
|
|
7784
|
+
skipActiveGroup: true,
|
|
7185
7785
|
});
|
|
7186
|
-
this._onDidAddGroup.fire(group);
|
|
7187
7786
|
panel = this.createPanel(options, group);
|
|
7188
7787
|
group.model.openPanel(panel);
|
|
7189
|
-
this.doSetGroupAndPanelActive(group);
|
|
7190
7788
|
}
|
|
7191
7789
|
else {
|
|
7192
7790
|
const group = this.createGroupAtLocation();
|
|
7193
7791
|
panel = this.createPanel(options, group);
|
|
7194
7792
|
group.model.openPanel(panel);
|
|
7793
|
+
this.doSetGroupAndPanelActive(group);
|
|
7195
7794
|
}
|
|
7196
7795
|
return panel;
|
|
7197
7796
|
}
|
|
@@ -7203,13 +7802,15 @@
|
|
|
7203
7802
|
if (!group) {
|
|
7204
7803
|
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
7205
7804
|
}
|
|
7206
|
-
group.model.removePanel(panel
|
|
7805
|
+
group.model.removePanel(panel, {
|
|
7806
|
+
skipSetActiveGroup: options.skipSetActiveGroup,
|
|
7807
|
+
});
|
|
7207
7808
|
if (!options.skipDispose) {
|
|
7208
|
-
|
|
7809
|
+
panel.group.model.renderContainer.detatch(panel);
|
|
7209
7810
|
panel.dispose();
|
|
7210
7811
|
}
|
|
7211
7812
|
if (group.size === 0 && options.removeEmptyGroup) {
|
|
7212
|
-
this.removeGroup(group);
|
|
7813
|
+
this.removeGroup(group, { skipActive: options.skipSetActiveGroup });
|
|
7213
7814
|
}
|
|
7214
7815
|
}
|
|
7215
7816
|
createWatermarkComponent() {
|
|
@@ -7222,7 +7823,7 @@
|
|
|
7222
7823
|
}
|
|
7223
7824
|
updateWatermark() {
|
|
7224
7825
|
var _a, _b;
|
|
7225
|
-
if (this.groups.filter((x) => x.api.location === 'grid').length === 0) {
|
|
7826
|
+
if (this.groups.filter((x) => x.api.location.type === 'grid' && x.api.isVisible).length === 0) {
|
|
7226
7827
|
if (!this.watermark) {
|
|
7227
7828
|
this.watermark = this.createWatermarkComponent();
|
|
7228
7829
|
this.watermark.init({
|
|
@@ -7268,36 +7869,42 @@
|
|
|
7268
7869
|
}
|
|
7269
7870
|
else {
|
|
7270
7871
|
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
7872
|
+
if (!options.skipSetActive) {
|
|
7873
|
+
this.doSetGroupAndPanelActive(group);
|
|
7874
|
+
}
|
|
7271
7875
|
return group;
|
|
7272
7876
|
}
|
|
7273
7877
|
const target = toTarget(options.direction || 'within');
|
|
7274
7878
|
const location = getGridLocation(referenceGroup.element);
|
|
7275
7879
|
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
7276
7880
|
this.doAddGroup(group, relativeLocation);
|
|
7881
|
+
if (!options.skipSetActive) {
|
|
7882
|
+
this.doSetGroupAndPanelActive(group);
|
|
7883
|
+
}
|
|
7277
7884
|
return group;
|
|
7278
7885
|
}
|
|
7279
7886
|
else {
|
|
7280
7887
|
this.doAddGroup(group);
|
|
7888
|
+
this.doSetGroupAndPanelActive(group);
|
|
7281
7889
|
return group;
|
|
7282
7890
|
}
|
|
7283
7891
|
}
|
|
7284
7892
|
removeGroup(group, options) {
|
|
7893
|
+
this.doRemoveGroup(group, options);
|
|
7894
|
+
}
|
|
7895
|
+
doRemoveGroup(group, options) {
|
|
7285
7896
|
var _a;
|
|
7286
7897
|
const panels = [...group.panels]; // reassign since group panels will mutate
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7898
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
7899
|
+
for (const panel of panels) {
|
|
7900
|
+
this.removePanel(panel, {
|
|
7901
|
+
removeEmptyGroup: false,
|
|
7902
|
+
skipDispose: (_a = options === null || options === void 0 ? void 0 : options.skipDispose) !== null && _a !== void 0 ? _a : false,
|
|
7903
|
+
});
|
|
7904
|
+
}
|
|
7292
7905
|
}
|
|
7293
7906
|
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') {
|
|
7907
|
+
if (group.api.location.type === 'floating') {
|
|
7301
7908
|
const floatingGroup = this._floatingGroups.find((_) => _.group === group);
|
|
7302
7909
|
if (floatingGroup) {
|
|
7303
7910
|
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
@@ -7309,60 +7916,124 @@
|
|
|
7309
7916
|
floatingGroup.dispose();
|
|
7310
7917
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
7311
7918
|
const groups = Array.from(this._groups.values());
|
|
7312
|
-
this.
|
|
7919
|
+
this.doSetGroupAndPanelActive(groups.length > 0 ? groups[0].value : undefined);
|
|
7313
7920
|
}
|
|
7314
7921
|
return floatingGroup.group;
|
|
7315
7922
|
}
|
|
7316
7923
|
throw new Error('failed to find floating group');
|
|
7317
7924
|
}
|
|
7318
|
-
if (group.api.location === 'popout') {
|
|
7319
|
-
const selectedGroup = this._popoutGroups.find((_) => _.
|
|
7925
|
+
if (group.api.location.type === 'popout') {
|
|
7926
|
+
const selectedGroup = this._popoutGroups.find((_) => _.popoutGroup === group);
|
|
7320
7927
|
if (selectedGroup) {
|
|
7321
7928
|
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
7322
|
-
|
|
7929
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipPopoutAssociated)) {
|
|
7930
|
+
const refGroup = selectedGroup.referenceGroup
|
|
7931
|
+
? this.getPanel(selectedGroup.referenceGroup)
|
|
7932
|
+
: undefined;
|
|
7933
|
+
if (refGroup) {
|
|
7934
|
+
this.removeGroup(refGroup);
|
|
7935
|
+
}
|
|
7936
|
+
}
|
|
7937
|
+
selectedGroup.popoutGroup.dispose();
|
|
7323
7938
|
this._groups.delete(group.id);
|
|
7324
7939
|
this._onDidRemoveGroup.fire(group);
|
|
7325
7940
|
}
|
|
7326
|
-
selectedGroup.dispose();
|
|
7941
|
+
const removedGroup = selectedGroup.disposable.dispose();
|
|
7942
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipPopoutReturn) && removedGroup) {
|
|
7943
|
+
this.doAddGroup(removedGroup, [0]);
|
|
7944
|
+
this.doSetGroupAndPanelActive(removedGroup);
|
|
7945
|
+
}
|
|
7327
7946
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
7328
7947
|
const groups = Array.from(this._groups.values());
|
|
7329
|
-
this.
|
|
7948
|
+
this.doSetGroupAndPanelActive(groups.length > 0 ? groups[0].value : undefined);
|
|
7330
7949
|
}
|
|
7331
|
-
|
|
7950
|
+
this.updateWatermark();
|
|
7951
|
+
return selectedGroup.popoutGroup;
|
|
7332
7952
|
}
|
|
7333
7953
|
throw new Error('failed to find popout group');
|
|
7334
7954
|
}
|
|
7335
|
-
|
|
7955
|
+
const re = super.doRemoveGroup(group, options);
|
|
7956
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipActive)) {
|
|
7957
|
+
if (this.activePanel !== activePanel) {
|
|
7958
|
+
this._onDidActivePanelChange.fire(this.activePanel);
|
|
7959
|
+
}
|
|
7960
|
+
}
|
|
7961
|
+
return re;
|
|
7336
7962
|
}
|
|
7337
|
-
|
|
7338
|
-
|
|
7963
|
+
movingLock(func) {
|
|
7964
|
+
const isMoving = this._moving;
|
|
7965
|
+
try {
|
|
7966
|
+
this._moving = true;
|
|
7967
|
+
return func();
|
|
7968
|
+
}
|
|
7969
|
+
finally {
|
|
7970
|
+
this._moving = isMoving;
|
|
7971
|
+
}
|
|
7972
|
+
}
|
|
7973
|
+
moveGroupOrPanel(options) {
|
|
7974
|
+
var _a;
|
|
7975
|
+
const destinationGroup = options.to.group;
|
|
7976
|
+
const sourceGroupId = options.from.groupId;
|
|
7977
|
+
const sourceItemId = options.from.panelId;
|
|
7978
|
+
const destinationTarget = options.to.position;
|
|
7979
|
+
const destinationIndex = options.to.index;
|
|
7339
7980
|
const sourceGroup = sourceGroupId
|
|
7340
7981
|
? (_a = this._groups.get(sourceGroupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
7341
7982
|
: undefined;
|
|
7983
|
+
if (!sourceGroup) {
|
|
7984
|
+
throw new Error(`Failed to find group id ${sourceGroupId}`);
|
|
7985
|
+
}
|
|
7342
7986
|
if (sourceItemId === undefined) {
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7987
|
+
/**
|
|
7988
|
+
* Moving an entire group into another group
|
|
7989
|
+
*/
|
|
7990
|
+
this.moveGroup({
|
|
7991
|
+
from: { group: sourceGroup },
|
|
7992
|
+
to: {
|
|
7993
|
+
group: destinationGroup,
|
|
7994
|
+
position: destinationTarget,
|
|
7995
|
+
},
|
|
7996
|
+
});
|
|
7346
7997
|
return;
|
|
7347
7998
|
}
|
|
7348
7999
|
if (!destinationTarget || destinationTarget === 'center') {
|
|
7349
|
-
|
|
7350
|
-
|
|
8000
|
+
/**
|
|
8001
|
+
* Dropping a panel within another group
|
|
8002
|
+
*/
|
|
8003
|
+
const removedPanel = this.movingLock(() => sourceGroup.model.removePanel(sourceItemId, {
|
|
8004
|
+
skipSetActive: false,
|
|
8005
|
+
skipSetActiveGroup: true,
|
|
8006
|
+
}));
|
|
8007
|
+
if (!removedPanel) {
|
|
7351
8008
|
throw new Error(`No panel with id ${sourceItemId}`);
|
|
7352
8009
|
}
|
|
7353
|
-
if (
|
|
7354
|
-
|
|
8010
|
+
if (sourceGroup.model.size === 0) {
|
|
8011
|
+
// remove the group and do not set a new group as active
|
|
8012
|
+
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
7355
8013
|
}
|
|
7356
|
-
destinationGroup.model.openPanel(
|
|
8014
|
+
this.movingLock(() => destinationGroup.model.openPanel(removedPanel, {
|
|
7357
8015
|
index: destinationIndex,
|
|
8016
|
+
skipSetGroupActive: true,
|
|
8017
|
+
}));
|
|
8018
|
+
this.doSetGroupAndPanelActive(destinationGroup);
|
|
8019
|
+
this._onDidMovePanel.fire({
|
|
8020
|
+
panel: removedPanel,
|
|
7358
8021
|
});
|
|
7359
8022
|
}
|
|
7360
8023
|
else {
|
|
8024
|
+
/**
|
|
8025
|
+
* Dropping a panel to the extremities of a group which will place that panel
|
|
8026
|
+
* into an adjacent group
|
|
8027
|
+
*/
|
|
7361
8028
|
const referenceLocation = getGridLocation(destinationGroup.element);
|
|
7362
8029
|
const targetLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
7363
|
-
if (sourceGroup
|
|
8030
|
+
if (sourceGroup.size < 2) {
|
|
8031
|
+
/**
|
|
8032
|
+
* If we are moving from a group which only has one panel left we will consider
|
|
8033
|
+
* moving the group itself rather than moving the panel into a newly created group
|
|
8034
|
+
*/
|
|
7364
8035
|
const [targetParentLocation, to] = tail(targetLocation);
|
|
7365
|
-
if (sourceGroup.api.location === 'grid') {
|
|
8036
|
+
if (sourceGroup.api.location.type === 'grid') {
|
|
7366
8037
|
const sourceLocation = getGridLocation(sourceGroup.element);
|
|
7367
8038
|
const [sourceParentLocation, from] = tail(sourceLocation);
|
|
7368
8039
|
if (sequenceEquals(sourceParentLocation, targetParentLocation)) {
|
|
@@ -7370,77 +8041,122 @@
|
|
|
7370
8041
|
// if a group has one tab - we are essentially moving the 'group'
|
|
7371
8042
|
// which is equivalent to swapping two views in this case
|
|
7372
8043
|
this.gridview.moveView(sourceParentLocation, from, to);
|
|
8044
|
+
return;
|
|
7373
8045
|
}
|
|
7374
8046
|
}
|
|
7375
8047
|
// source group will become empty so delete the group
|
|
7376
|
-
const targetGroup = this.doRemoveGroup(sourceGroup, {
|
|
8048
|
+
const targetGroup = this.movingLock(() => this.doRemoveGroup(sourceGroup, {
|
|
7377
8049
|
skipActive: true,
|
|
7378
8050
|
skipDispose: true,
|
|
7379
|
-
});
|
|
8051
|
+
}));
|
|
7380
8052
|
// after deleting the group we need to re-evaulate the ref location
|
|
7381
8053
|
const updatedReferenceLocation = getGridLocation(destinationGroup.element);
|
|
7382
8054
|
const location = getRelativeLocation(this.gridview.orientation, updatedReferenceLocation, destinationTarget);
|
|
7383
|
-
this.doAddGroup(targetGroup, location);
|
|
8055
|
+
this.movingLock(() => this.doAddGroup(targetGroup, location));
|
|
8056
|
+
this.doSetGroupAndPanelActive(targetGroup);
|
|
7384
8057
|
}
|
|
7385
8058
|
else {
|
|
7386
|
-
|
|
7387
|
-
|
|
8059
|
+
/**
|
|
8060
|
+
* The group we are removing from has many panels, we need to remove the panels we are moving,
|
|
8061
|
+
* create a new group, add the panels to that new group and add the new group in an appropiate position
|
|
8062
|
+
*/
|
|
8063
|
+
const removedPanel = this.movingLock(() => sourceGroup.model.removePanel(sourceItemId, {
|
|
8064
|
+
skipSetActive: false,
|
|
8065
|
+
skipSetActiveGroup: true,
|
|
8066
|
+
}));
|
|
8067
|
+
if (!removedPanel) {
|
|
7388
8068
|
throw new Error(`No panel with id ${sourceItemId}`);
|
|
7389
8069
|
}
|
|
7390
8070
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
7391
8071
|
const group = this.createGroupAtLocation(dropLocation);
|
|
7392
|
-
group.model.openPanel(
|
|
8072
|
+
this.movingLock(() => group.model.openPanel(removedPanel, {
|
|
8073
|
+
skipSetGroupActive: true,
|
|
8074
|
+
}));
|
|
8075
|
+
this.doSetGroupAndPanelActive(group);
|
|
7393
8076
|
}
|
|
7394
8077
|
}
|
|
7395
8078
|
}
|
|
7396
|
-
moveGroup(
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
8079
|
+
moveGroup(options) {
|
|
8080
|
+
const from = options.from.group;
|
|
8081
|
+
const to = options.to.group;
|
|
8082
|
+
const target = options.to.position;
|
|
8083
|
+
if (target === 'center') {
|
|
8084
|
+
const activePanel = from.activePanel;
|
|
8085
|
+
const panels = this.movingLock(() => [...from.panels].map((p) => from.model.removePanel(p.id, {
|
|
8086
|
+
skipSetActive: true,
|
|
8087
|
+
})));
|
|
8088
|
+
if ((from === null || from === void 0 ? void 0 : from.model.size) === 0) {
|
|
8089
|
+
this.doRemoveGroup(from, { skipActive: true });
|
|
8090
|
+
}
|
|
8091
|
+
this.movingLock(() => {
|
|
7404
8092
|
for (const panel of panels) {
|
|
7405
|
-
|
|
7406
|
-
|
|
8093
|
+
to.model.openPanel(panel, {
|
|
8094
|
+
skipSetActive: panel !== activePanel,
|
|
8095
|
+
skipSetGroupActive: true,
|
|
7407
8096
|
});
|
|
7408
8097
|
}
|
|
7409
|
-
}
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
8098
|
+
});
|
|
8099
|
+
this.doSetGroupAndPanelActive(to);
|
|
8100
|
+
panels.forEach((panel) => {
|
|
8101
|
+
this._onDidMovePanel.fire({ panel });
|
|
8102
|
+
});
|
|
8103
|
+
}
|
|
8104
|
+
else {
|
|
8105
|
+
switch (from.api.location.type) {
|
|
8106
|
+
case 'grid':
|
|
8107
|
+
this.gridview.removeView(getGridLocation(from.element));
|
|
8108
|
+
break;
|
|
8109
|
+
case 'floating': {
|
|
8110
|
+
const selectedFloatingGroup = this._floatingGroups.find((x) => x.group === from);
|
|
8111
|
+
if (!selectedFloatingGroup) {
|
|
8112
|
+
throw new Error('failed to find floating group');
|
|
7422
8113
|
}
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
8114
|
+
selectedFloatingGroup.dispose();
|
|
8115
|
+
break;
|
|
8116
|
+
}
|
|
8117
|
+
case 'popout': {
|
|
8118
|
+
const selectedPopoutGroup = this._popoutGroups.find((x) => x.popoutGroup === from);
|
|
8119
|
+
if (!selectedPopoutGroup) {
|
|
8120
|
+
throw new Error('failed to find popout group');
|
|
7429
8121
|
}
|
|
8122
|
+
selectedPopoutGroup.disposable.dispose();
|
|
7430
8123
|
}
|
|
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
8124
|
}
|
|
8125
|
+
const referenceLocation = getGridLocation(to.element);
|
|
8126
|
+
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
8127
|
+
this.gridview.addView(from, exports.Sizing.Distribute, dropLocation);
|
|
8128
|
+
from.panels.forEach((panel) => {
|
|
8129
|
+
this._onDidMovePanel.fire({ panel });
|
|
8130
|
+
});
|
|
7435
8131
|
}
|
|
7436
8132
|
}
|
|
7437
|
-
|
|
7438
|
-
|
|
8133
|
+
doSetGroupActive(group) {
|
|
8134
|
+
super.doSetGroupActive(group);
|
|
8135
|
+
const activePanel = this.activePanel;
|
|
8136
|
+
if (!this._moving &&
|
|
8137
|
+
activePanel !== this._onDidActivePanelChange.value) {
|
|
8138
|
+
this._onDidActivePanelChange.fire(activePanel);
|
|
8139
|
+
}
|
|
8140
|
+
}
|
|
8141
|
+
doSetGroupAndPanelActive(group) {
|
|
8142
|
+
super.doSetGroupActive(group);
|
|
7439
8143
|
const activePanel = this.activePanel;
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
this.
|
|
8144
|
+
if (group &&
|
|
8145
|
+
this.hasMaximizedGroup() &&
|
|
8146
|
+
!this.isMaximizedGroup(group)) {
|
|
8147
|
+
this.exitMaximizedGroup();
|
|
8148
|
+
}
|
|
8149
|
+
if (!this._moving &&
|
|
8150
|
+
activePanel !== this._onDidActivePanelChange.value) {
|
|
8151
|
+
this._onDidActivePanelChange.fire(activePanel);
|
|
8152
|
+
}
|
|
8153
|
+
}
|
|
8154
|
+
getNextGroupId() {
|
|
8155
|
+
let id = this.nextGroupId.next();
|
|
8156
|
+
while (this._groups.has(id)) {
|
|
8157
|
+
id = this.nextGroupId.next();
|
|
7443
8158
|
}
|
|
8159
|
+
return id;
|
|
7444
8160
|
}
|
|
7445
8161
|
createGroup(options) {
|
|
7446
8162
|
if (!options) {
|
|
@@ -7458,7 +8174,7 @@
|
|
|
7458
8174
|
}
|
|
7459
8175
|
}
|
|
7460
8176
|
const view = new DockviewGroupPanel(this, id, options);
|
|
7461
|
-
view.init({ params: {}, accessor:
|
|
8177
|
+
view.init({ params: {}, accessor: this });
|
|
7462
8178
|
if (!this._groups.has(view.id)) {
|
|
7463
8179
|
const disposable = new CompositeDisposable(view.model.onTabDragStart((event) => {
|
|
7464
8180
|
this._onWillDragPanel.fire(event);
|
|
@@ -7466,20 +8182,48 @@
|
|
|
7466
8182
|
this._onWillDragGroup.fire(event);
|
|
7467
8183
|
}), view.model.onMove((event) => {
|
|
7468
8184
|
const { groupId, itemId, target, index } = event;
|
|
7469
|
-
this.moveGroupOrPanel(
|
|
8185
|
+
this.moveGroupOrPanel({
|
|
8186
|
+
from: { groupId: groupId, panelId: itemId },
|
|
8187
|
+
to: {
|
|
8188
|
+
group: view,
|
|
8189
|
+
position: target,
|
|
8190
|
+
index,
|
|
8191
|
+
},
|
|
8192
|
+
});
|
|
7470
8193
|
}), view.model.onDidDrop((event) => {
|
|
7471
|
-
this._onDidDrop.fire(
|
|
8194
|
+
this._onDidDrop.fire(event);
|
|
8195
|
+
}), view.model.onWillDrop((event) => {
|
|
8196
|
+
this._onWillDrop.fire(event);
|
|
8197
|
+
}), view.model.onWillShowOverlay((event) => {
|
|
8198
|
+
if (this.options.disableDnd) {
|
|
8199
|
+
event.preventDefault();
|
|
8200
|
+
return;
|
|
8201
|
+
}
|
|
8202
|
+
this._onWillShowOverlay.fire(event);
|
|
7472
8203
|
}), view.model.onDidAddPanel((event) => {
|
|
8204
|
+
if (this._moving) {
|
|
8205
|
+
return;
|
|
8206
|
+
}
|
|
7473
8207
|
this._onDidAddPanel.fire(event.panel);
|
|
7474
8208
|
}), view.model.onDidRemovePanel((event) => {
|
|
8209
|
+
if (this._moving) {
|
|
8210
|
+
return;
|
|
8211
|
+
}
|
|
7475
8212
|
this._onDidRemovePanel.fire(event.panel);
|
|
7476
8213
|
}), view.model.onDidActivePanelChange((event) => {
|
|
7477
|
-
this.
|
|
8214
|
+
if (this._moving) {
|
|
8215
|
+
return;
|
|
8216
|
+
}
|
|
8217
|
+
if (event.panel !== this.activePanel) {
|
|
8218
|
+
return;
|
|
8219
|
+
}
|
|
8220
|
+
if (this._onDidActivePanelChange.value !== event.panel) {
|
|
8221
|
+
this._onDidActivePanelChange.fire(event.panel);
|
|
8222
|
+
}
|
|
7478
8223
|
}));
|
|
7479
8224
|
this._groups.set(view.id, { value: view, disposable });
|
|
7480
8225
|
}
|
|
7481
|
-
// TODO: must be called after the above listeners have been setup,
|
|
7482
|
-
// not an ideal pattern
|
|
8226
|
+
// TODO: must be called after the above listeners have been setup, not an ideal pattern
|
|
7483
8227
|
view.initialize();
|
|
7484
8228
|
return view;
|
|
7485
8229
|
}
|
|
@@ -7532,7 +8276,20 @@
|
|
|
7532
8276
|
});
|
|
7533
8277
|
this._onDidLayoutfromJSON = new Emitter();
|
|
7534
8278
|
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
8279
|
+
this._onDidRemoveGroup = new Emitter();
|
|
8280
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
8281
|
+
this._onDidAddGroup = new Emitter();
|
|
8282
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
8283
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
8284
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
7535
8285
|
this._options = options;
|
|
8286
|
+
this.addDisposables(this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this.onDidAdd((event) => {
|
|
8287
|
+
this._onDidAddGroup.fire(event);
|
|
8288
|
+
}), this.onDidRemove((event) => {
|
|
8289
|
+
this._onDidRemoveGroup.fire(event);
|
|
8290
|
+
}), this.onDidActiveChange((event) => {
|
|
8291
|
+
this._onDidActiveGroupChange.fire(event);
|
|
8292
|
+
}));
|
|
7536
8293
|
if (!this.options.components) {
|
|
7537
8294
|
this.options.components = {};
|
|
7538
8295
|
}
|
|
@@ -7707,6 +8464,7 @@
|
|
|
7707
8464
|
});
|
|
7708
8465
|
this.registerPanel(view);
|
|
7709
8466
|
this.doAddGroup(view, relativeLocation, options.size);
|
|
8467
|
+
this.doSetGroupActive(view);
|
|
7710
8468
|
return view;
|
|
7711
8469
|
}
|
|
7712
8470
|
registerPanel(panel) {
|
|
@@ -7848,19 +8606,19 @@
|
|
|
7848
8606
|
const index = this.panels.indexOf(panel);
|
|
7849
8607
|
this.splitview.setViewVisible(index, visible);
|
|
7850
8608
|
}
|
|
7851
|
-
setActive(
|
|
7852
|
-
this._activePanel =
|
|
8609
|
+
setActive(panel, skipFocus) {
|
|
8610
|
+
this._activePanel = panel;
|
|
7853
8611
|
this.panels
|
|
7854
|
-
.filter((v) => v !==
|
|
8612
|
+
.filter((v) => v !== panel)
|
|
7855
8613
|
.forEach((v) => {
|
|
7856
8614
|
v.api._onDidActiveChange.fire({ isActive: false });
|
|
7857
8615
|
if (!skipFocus) {
|
|
7858
8616
|
v.focus();
|
|
7859
8617
|
}
|
|
7860
8618
|
});
|
|
7861
|
-
|
|
8619
|
+
panel.api._onDidActiveChange.fire({ isActive: true });
|
|
7862
8620
|
if (!skipFocus) {
|
|
7863
|
-
|
|
8621
|
+
panel.focus();
|
|
7864
8622
|
}
|
|
7865
8623
|
}
|
|
7866
8624
|
removePanel(panel, sizing) {
|
|
@@ -8159,6 +8917,10 @@
|
|
|
8159
8917
|
});
|
|
8160
8918
|
this.addDisposables(this._disposable);
|
|
8161
8919
|
}
|
|
8920
|
+
setVisible(panel, visible) {
|
|
8921
|
+
const index = this.panels.indexOf(panel);
|
|
8922
|
+
this.paneview.setViewVisible(index, visible);
|
|
8923
|
+
}
|
|
8162
8924
|
focus() {
|
|
8163
8925
|
//noop
|
|
8164
8926
|
}
|
|
@@ -8205,6 +8967,7 @@
|
|
|
8205
8967
|
isExpanded: options.isExpanded,
|
|
8206
8968
|
title: options.title,
|
|
8207
8969
|
containerApi: new PaneviewApi(this),
|
|
8970
|
+
accessor: this,
|
|
8208
8971
|
});
|
|
8209
8972
|
this.paneview.addPane(view, size, index);
|
|
8210
8973
|
view.orientation = this.paneview.orientation;
|
|
@@ -8304,6 +9067,7 @@
|
|
|
8304
9067
|
title: data.title,
|
|
8305
9068
|
isExpanded: !!view.expanded,
|
|
8306
9069
|
containerApi: new PaneviewApi(this),
|
|
9070
|
+
accessor: this,
|
|
8307
9071
|
});
|
|
8308
9072
|
panel.orientation = this.paneview.orientation;
|
|
8309
9073
|
});
|
|
@@ -8392,7 +9156,7 @@
|
|
|
8392
9156
|
this._onDidChange = new Emitter();
|
|
8393
9157
|
this.onDidChange = this._onDidChange.event;
|
|
8394
9158
|
this.api.initialize(this);
|
|
8395
|
-
this.addDisposables(this._onDidChange, this.api.
|
|
9159
|
+
this.addDisposables(this._onDidChange, this.api.onWillVisibilityChange((event) => {
|
|
8396
9160
|
const { isVisible } = event;
|
|
8397
9161
|
const { accessor } = this._params;
|
|
8398
9162
|
accessor.setVisible(this, isVisible);
|
|
@@ -8461,11 +9225,13 @@
|
|
|
8461
9225
|
exports.DockviewApi = DockviewApi;
|
|
8462
9226
|
exports.DockviewComponent = DockviewComponent;
|
|
8463
9227
|
exports.DockviewCompositeDisposable = CompositeDisposable;
|
|
9228
|
+
exports.DockviewDidDropEvent = DockviewDidDropEvent;
|
|
8464
9229
|
exports.DockviewEmitter = Emitter;
|
|
8465
9230
|
exports.DockviewGroupPanel = DockviewGroupPanel;
|
|
8466
9231
|
exports.DockviewGroupPanelModel = DockviewGroupPanelModel;
|
|
8467
9232
|
exports.DockviewMutableDisposable = MutableDisposable;
|
|
8468
9233
|
exports.DockviewPanel = DockviewPanel;
|
|
9234
|
+
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
8469
9235
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
8470
9236
|
exports.Gridview = Gridview;
|
|
8471
9237
|
exports.GridviewApi = GridviewApi;
|
|
@@ -8484,6 +9250,7 @@
|
|
|
8484
9250
|
exports.SplitviewComponent = SplitviewComponent;
|
|
8485
9251
|
exports.SplitviewPanel = SplitviewPanel;
|
|
8486
9252
|
exports.Tab = Tab;
|
|
9253
|
+
exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
|
|
8487
9254
|
exports.createComponent = createComponent;
|
|
8488
9255
|
exports.directionToPosition = directionToPosition;
|
|
8489
9256
|
exports.getDirectionOrientation = getDirectionOrientation;
|