dockview 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dockview/defaultTab.js.map +1 -0
- package/dist/{esm/react → cjs}/dockview/dockview.d.ts +1 -4
- package/dist/cjs/{react/dockview → dockview}/dockview.js +25 -28
- package/dist/cjs/dockview/dockview.js.map +1 -0
- package/dist/cjs/{react/dockview → dockview}/groupControlsRenderer.d.ts +5 -16
- package/dist/cjs/{react/dockview → dockview}/groupControlsRenderer.js +3 -3
- package/dist/cjs/dockview/groupControlsRenderer.js.map +1 -0
- package/dist/{esm/react → cjs}/dockview/reactContentPart.d.ts +3 -11
- package/dist/cjs/{react/dockview → dockview}/reactContentPart.js +3 -11
- package/dist/cjs/dockview/reactContentPart.js.map +1 -0
- package/dist/cjs/{react/dockview → dockview}/reactHeaderPart.d.ts +1 -9
- package/dist/cjs/{react/dockview → dockview}/reactHeaderPart.js +0 -12
- package/dist/cjs/dockview/reactHeaderPart.js.map +1 -0
- package/dist/cjs/{react/dockview → dockview}/reactWatermarkPart.d.ts +6 -11
- package/dist/cjs/{react/dockview → dockview}/reactWatermarkPart.js +5 -17
- package/dist/cjs/dockview/reactWatermarkPart.js.map +1 -0
- package/dist/cjs/gridview/gridview.d.ts +22 -132
- package/dist/cjs/gridview/gridview.js +85 -486
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/{react/gridview → gridview}/view.d.ts +1 -2
- package/dist/cjs/{react/gridview → gridview}/view.js +4 -6
- package/dist/cjs/gridview/view.js.map +1 -0
- package/dist/cjs/index.d.ts +8 -28
- package/dist/cjs/index.js +7 -30
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/paneview/paneview.d.ts +22 -38
- package/dist/cjs/paneview/paneview.js +138 -186
- package/dist/cjs/paneview/paneview.js.map +1 -1
- package/dist/cjs/{react/paneview → paneview}/view.d.ts +1 -2
- package/dist/cjs/paneview/view.js.map +1 -0
- package/dist/{esm/react → cjs}/react.d.ts +3 -4
- package/dist/cjs/{react/react.js → react.js} +4 -2
- package/dist/cjs/react.js.map +1 -0
- package/dist/{esm/react → cjs}/splitview/splitview.d.ts +1 -3
- package/dist/cjs/{react/splitview → splitview}/splitview.js +5 -8
- package/dist/cjs/splitview/splitview.js.map +1 -0
- package/dist/{esm/react → cjs}/splitview/view.d.ts +2 -2
- package/dist/cjs/{react/splitview → splitview}/view.js +3 -4
- package/dist/cjs/splitview/view.js.map +1 -0
- package/dist/cjs/svg.d.ts +3 -3
- package/dist/cjs/svg.js +32 -40
- package/dist/cjs/svg.js.map +1 -1
- package/dist/cjs/types.d.ts +5 -6
- package/dist/cjs/types.js +0 -5
- package/dist/cjs/types.js.map +1 -1
- package/dist/dockview.amd.js +1442 -1497
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.noStyle.js +1441 -1496
- package/dist/dockview.cjs.js +1442 -1497
- package/dist/dockview.esm.js +1426 -1491
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.js +1442 -1497
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.noStyle.js +1441 -1496
- package/dist/{cjs/react → esm}/dockview/dockview.d.ts +1 -4
- package/dist/esm/{react/dockview → dockview}/dockview.js +20 -10
- package/dist/esm/{react/dockview → dockview}/groupControlsRenderer.d.ts +5 -16
- package/dist/esm/{react/dockview → dockview}/groupControlsRenderer.js +3 -3
- package/dist/{cjs/react → esm}/dockview/reactContentPart.d.ts +3 -11
- package/dist/esm/{react/dockview → dockview}/reactContentPart.js +3 -11
- package/dist/esm/{react/dockview → dockview}/reactHeaderPart.d.ts +1 -9
- package/dist/esm/{react/dockview → dockview}/reactHeaderPart.js +0 -12
- package/dist/esm/{react/dockview → dockview}/reactWatermarkPart.d.ts +6 -11
- package/dist/esm/{react/dockview → dockview}/reactWatermarkPart.js +5 -16
- package/dist/esm/gridview/gridview.d.ts +22 -132
- package/dist/esm/gridview/gridview.js +60 -416
- package/dist/esm/{react/gridview → gridview}/view.d.ts +1 -2
- package/dist/esm/{react/gridview → gridview}/view.js +2 -4
- package/dist/esm/index.d.ts +8 -28
- package/dist/esm/index.js +7 -22
- package/dist/esm/paneview/paneview.d.ts +22 -38
- package/dist/esm/paneview/paneview.js +85 -132
- package/dist/esm/{react/paneview → paneview}/view.d.ts +1 -2
- package/dist/{cjs/react → esm}/react.d.ts +3 -4
- package/dist/esm/{react/react.js → react.js} +4 -2
- package/dist/{cjs/react → esm}/splitview/splitview.d.ts +1 -3
- package/dist/esm/{react/splitview → splitview}/splitview.js +1 -4
- package/dist/{cjs/react → esm}/splitview/view.d.ts +2 -2
- package/dist/esm/{react/splitview → splitview}/view.js +1 -2
- package/dist/esm/svg.d.ts +3 -3
- package/dist/esm/svg.js +6 -30
- package/dist/esm/types.d.ts +5 -6
- package/dist/esm/types.js +1 -3
- package/dist/styles/dockview.css +1 -617
- package/package.json +7 -3
- package/LICENSE +0 -21
- package/dist/cjs/actionbar/actionsContainer.d.ts +0 -7
- package/dist/cjs/actionbar/actionsContainer.js +0 -27
- package/dist/cjs/actionbar/actionsContainer.js.map +0 -1
- package/dist/cjs/api/component.api.d.ts +0 -145
- package/dist/cjs/api/component.api.js +0 -579
- package/dist/cjs/api/component.api.js.map +0 -1
- package/dist/cjs/api/dockviewPanelApi.d.ts +0 -34
- package/dist/cjs/api/dockviewPanelApi.js +0 -84
- package/dist/cjs/api/dockviewPanelApi.js.map +0 -1
- package/dist/cjs/api/gridviewPanelApi.d.ts +0 -37
- package/dist/cjs/api/gridviewPanelApi.js +0 -48
- package/dist/cjs/api/gridviewPanelApi.js.map +0 -1
- package/dist/cjs/api/panelApi.d.ts +0 -88
- package/dist/cjs/api/panelApi.js +0 -138
- package/dist/cjs/api/panelApi.js.map +0 -1
- package/dist/cjs/api/paneviewPanelApi.d.ts +0 -26
- package/dist/cjs/api/paneviewPanelApi.js +0 -58
- package/dist/cjs/api/paneviewPanelApi.js.map +0 -1
- package/dist/cjs/api/splitviewPanelApi.d.ts +0 -32
- package/dist/cjs/api/splitviewPanelApi.js +0 -48
- package/dist/cjs/api/splitviewPanelApi.js.map +0 -1
- package/dist/cjs/array.d.ts +0 -13
- package/dist/cjs/array.js +0 -78
- package/dist/cjs/array.js.map +0 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts +0 -11
- package/dist/cjs/dnd/abstractDragHandler.js +0 -116
- package/dist/cjs/dnd/abstractDragHandler.js.map +0 -1
- package/dist/cjs/dnd/dataTransfer.d.ts +0 -31
- package/dist/cjs/dnd/dataTransfer.js +0 -101
- package/dist/cjs/dnd/dataTransfer.js.map +0 -1
- package/dist/cjs/dnd/dnd.d.ts +0 -27
- package/dist/cjs/dnd/dnd.js +0 -60
- package/dist/cjs/dnd/dnd.js.map +0 -1
- package/dist/cjs/dnd/droptarget.d.ts +0 -42
- package/dist/cjs/dnd/droptarget.js +0 -280
- package/dist/cjs/dnd/droptarget.js.map +0 -1
- package/dist/cjs/dnd/ghost.d.ts +0 -1
- package/dist/cjs/dnd/ghost.js +0 -15
- package/dist/cjs/dnd/ghost.js.map +0 -1
- package/dist/cjs/dnd/groupDragHandler.d.ts +0 -11
- package/dist/cjs/dnd/groupDragHandler.js +0 -62
- package/dist/cjs/dnd/groupDragHandler.js.map +0 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +0 -27
- package/dist/cjs/dockview/components/tab/defaultTab.js +0 -122
- package/dist/cjs/dockview/components/tab/defaultTab.js.map +0 -1
- package/dist/cjs/dockview/components/watermark/watermark.d.ts +0 -20
- package/dist/cjs/dockview/components/watermark/watermark.js +0 -102
- package/dist/cjs/dockview/components/watermark/watermark.js.map +0 -1
- package/dist/cjs/dockview/defaultGroupPanelView.d.ts +0 -29
- package/dist/cjs/dockview/defaultGroupPanelView.js +0 -69
- package/dist/cjs/dockview/defaultGroupPanelView.js.map +0 -1
- package/dist/cjs/dockview/deserializer.d.ts +0 -6
- package/dist/cjs/dockview/deserializer.js +0 -3
- package/dist/cjs/dockview/deserializer.js.map +0 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +0 -133
- package/dist/cjs/dockview/dockviewComponent.js +0 -796
- package/dist/cjs/dockview/dockviewComponent.js.map +0 -1
- package/dist/cjs/dockview/dockviewPanel.d.ts +0 -42
- package/dist/cjs/dockview/dockviewPanel.js +0 -161
- package/dist/cjs/dockview/dockviewPanel.js.map +0 -1
- package/dist/cjs/dockview/options.d.ts +0 -110
- package/dist/cjs/dockview/options.js +0 -32
- package/dist/cjs/dockview/options.js.map +0 -1
- package/dist/cjs/dockview/validation.d.ts +0 -2
- package/dist/cjs/dockview/validation.js +0 -135
- package/dist/cjs/dockview/validation.js.map +0 -1
- package/dist/cjs/dom.d.ts +0 -14
- package/dist/cjs/dom.js +0 -183
- package/dist/cjs/dom.js.map +0 -1
- package/dist/cjs/events.d.ts +0 -30
- package/dist/cjs/events.js +0 -130
- package/dist/cjs/events.js.map +0 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +0 -87
- package/dist/cjs/gridview/baseComponentGridview.js +0 -279
- package/dist/cjs/gridview/baseComponentGridview.js.map +0 -1
- package/dist/cjs/gridview/basePanelView.d.ts +0 -43
- package/dist/cjs/gridview/basePanelView.js +0 -124
- package/dist/cjs/gridview/basePanelView.js.map +0 -1
- package/dist/cjs/gridview/branchNode.d.ts +0 -49
- package/dist/cjs/gridview/branchNode.js +0 -343
- package/dist/cjs/gridview/branchNode.js.map +0 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +0 -85
- package/dist/cjs/gridview/gridviewComponent.js +0 -325
- package/dist/cjs/gridview/gridviewComponent.js.map +0 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts +0 -60
- package/dist/cjs/gridview/gridviewPanel.js +0 -202
- package/dist/cjs/gridview/gridviewPanel.js.map +0 -1
- package/dist/cjs/gridview/leafNode.d.ts +0 -34
- package/dist/cjs/gridview/leafNode.js +0 -171
- package/dist/cjs/gridview/leafNode.js.map +0 -1
- package/dist/cjs/gridview/options.d.ts +0 -18
- package/dist/cjs/gridview/options.js +0 -3
- package/dist/cjs/gridview/options.js.map +0 -1
- package/dist/cjs/gridview/types.d.ts +0 -3
- package/dist/cjs/gridview/types.js +0 -3
- package/dist/cjs/gridview/types.js.map +0 -1
- package/dist/cjs/groupview/dnd.d.ts +0 -6
- package/dist/cjs/groupview/dnd.js +0 -11
- package/dist/cjs/groupview/dnd.js.map +0 -1
- package/dist/cjs/groupview/groupview.d.ts +0 -177
- package/dist/cjs/groupview/groupview.js +0 -608
- package/dist/cjs/groupview/groupview.js.map +0 -1
- package/dist/cjs/groupview/groupviewPanel.d.ts +0 -35
- package/dist/cjs/groupview/groupviewPanel.js +0 -129
- package/dist/cjs/groupview/groupviewPanel.js.map +0 -1
- package/dist/cjs/groupview/panel/content.d.ts +0 -30
- package/dist/cjs/groupview/panel/content.js +0 -101
- package/dist/cjs/groupview/panel/content.js.map +0 -1
- package/dist/cjs/groupview/tab.d.ts +0 -31
- package/dist/cjs/groupview/tab.js +0 -125
- package/dist/cjs/groupview/tab.js.map +0 -1
- package/dist/cjs/groupview/titlebar/tabsContainer.d.ts +0 -65
- package/dist/cjs/groupview/titlebar/tabsContainer.js +0 -252
- package/dist/cjs/groupview/titlebar/tabsContainer.js.map +0 -1
- package/dist/cjs/groupview/titlebar/voidContainer.d.ts +0 -15
- package/dist/cjs/groupview/titlebar/voidContainer.js +0 -74
- package/dist/cjs/groupview/titlebar/voidContainer.js.map +0 -1
- package/dist/cjs/groupview/types.d.ts +0 -68
- package/dist/cjs/groupview/types.js +0 -3
- package/dist/cjs/groupview/types.js.map +0 -1
- package/dist/cjs/hostedContainer.d.ts +0 -23
- package/dist/cjs/hostedContainer.js +0 -74
- package/dist/cjs/hostedContainer.js.map +0 -1
- package/dist/cjs/lifecycle.d.ts +0 -22
- package/dist/cjs/lifecycle.js +0 -89
- package/dist/cjs/lifecycle.js.map +0 -1
- package/dist/cjs/math.d.ts +0 -4
- package/dist/cjs/math.js +0 -16
- package/dist/cjs/math.js.map +0 -1
- package/dist/cjs/panel/componentFactory.d.ts +0 -8
- package/dist/cjs/panel/componentFactory.js +0 -31
- package/dist/cjs/panel/componentFactory.js.map +0 -1
- package/dist/cjs/panel/types.d.ts +0 -33
- package/dist/cjs/panel/types.js +0 -3
- package/dist/cjs/panel/types.js.map +0 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +0 -21
- package/dist/cjs/paneview/defaultPaneviewHeader.js +0 -91
- package/dist/cjs/paneview/defaultPaneviewHeader.js.map +0 -1
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +0 -19
- package/dist/cjs/paneview/draggablePaneviewPanel.js +0 -131
- package/dist/cjs/paneview/draggablePaneviewPanel.js.map +0 -1
- package/dist/cjs/paneview/options.d.ts +0 -27
- package/dist/cjs/paneview/options.js +0 -3
- package/dist/cjs/paneview/options.js.map +0 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +0 -129
- package/dist/cjs/paneview/paneviewComponent.js +0 -395
- package/dist/cjs/paneview/paneviewComponent.js.map +0 -1
- package/dist/cjs/paneview/paneviewPanel.d.ts +0 -92
- package/dist/cjs/paneview/paneviewPanel.js +0 -276
- package/dist/cjs/paneview/paneviewPanel.js.map +0 -1
- package/dist/cjs/react/deserializer.d.ts +0 -10
- package/dist/cjs/react/deserializer.js +0 -44
- package/dist/cjs/react/deserializer.js.map +0 -1
- package/dist/cjs/react/dockview/defaultTab.js.map +0 -1
- package/dist/cjs/react/dockview/dockview.js.map +0 -1
- package/dist/cjs/react/dockview/groupControlsRenderer.js.map +0 -1
- package/dist/cjs/react/dockview/reactContentPart.js.map +0 -1
- package/dist/cjs/react/dockview/reactHeaderPart.js.map +0 -1
- package/dist/cjs/react/dockview/reactWatermarkPart.js.map +0 -1
- package/dist/cjs/react/dockview/v2/reactContentRenderer.d.ts +0 -29
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js +0 -88
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js.map +0 -1
- package/dist/cjs/react/dockview/v2/reactGroupPanelView.d.ts +0 -7
- package/dist/cjs/react/dockview/v2/reactGroupPanelView.js +0 -35
- package/dist/cjs/react/dockview/v2/reactGroupPanelView.js.map +0 -1
- package/dist/cjs/react/dockview/v2/webviewContentRenderer.d.ts +0 -18
- package/dist/cjs/react/dockview/v2/webviewContentRenderer.js +0 -46
- package/dist/cjs/react/dockview/v2/webviewContentRenderer.js.map +0 -1
- package/dist/cjs/react/gridview/gridview.d.ts +0 -24
- package/dist/cjs/react/gridview/gridview.js +0 -113
- package/dist/cjs/react/gridview/gridview.js.map +0 -1
- package/dist/cjs/react/gridview/view.js.map +0 -1
- package/dist/cjs/react/index.d.ts +0 -9
- package/dist/cjs/react/index.js +0 -24
- package/dist/cjs/react/index.js.map +0 -1
- package/dist/cjs/react/paneview/paneview.d.ts +0 -30
- package/dist/cjs/react/paneview/paneview.js +0 -156
- package/dist/cjs/react/paneview/paneview.js.map +0 -1
- package/dist/cjs/react/paneview/view.js.map +0 -1
- package/dist/cjs/react/react.js.map +0 -1
- package/dist/cjs/react/splitview/splitview.js.map +0 -1
- package/dist/cjs/react/splitview/view.js.map +0 -1
- package/dist/cjs/react/svg.d.ts +0 -3
- package/dist/cjs/react/svg.js +0 -36
- package/dist/cjs/react/svg.js.map +0 -1
- package/dist/cjs/react/types.d.ts +0 -7
- package/dist/cjs/react/types.js +0 -3
- package/dist/cjs/react/types.js.map +0 -1
- package/dist/cjs/splitview/core/options.d.ts +0 -26
- package/dist/cjs/splitview/core/options.js +0 -3
- package/dist/cjs/splitview/core/options.js.map +0 -1
- package/dist/cjs/splitview/core/splitview.d.ts +0 -127
- package/dist/cjs/splitview/core/splitview.js +0 -909
- package/dist/cjs/splitview/core/splitview.js.map +0 -1
- package/dist/cjs/splitview/core/viewItem.d.ts +0 -25
- package/dist/cjs/splitview/core/viewItem.js +0 -125
- package/dist/cjs/splitview/core/viewItem.js.map +0 -1
- package/dist/cjs/splitview/splitviewComponent.d.ts +0 -101
- package/dist/cjs/splitview/splitviewComponent.js +0 -374
- package/dist/cjs/splitview/splitviewComponent.js.map +0 -1
- package/dist/cjs/splitview/splitviewPanel.d.ts +0 -45
- package/dist/cjs/splitview/splitviewPanel.js +0 -180
- package/dist/cjs/splitview/splitviewPanel.js.map +0 -1
- package/dist/esm/actionbar/actionsContainer.d.ts +0 -7
- package/dist/esm/actionbar/actionsContainer.js +0 -17
- package/dist/esm/api/component.api.d.ts +0 -145
- package/dist/esm/api/component.api.js +0 -329
- package/dist/esm/api/dockviewPanelApi.d.ts +0 -34
- package/dist/esm/api/dockviewPanelApi.js +0 -48
- package/dist/esm/api/gridviewPanelApi.d.ts +0 -37
- package/dist/esm/api/gridviewPanelApi.js +0 -25
- package/dist/esm/api/panelApi.d.ts +0 -88
- package/dist/esm/api/panelApi.js +0 -95
- package/dist/esm/api/paneviewPanelApi.d.ts +0 -26
- package/dist/esm/api/paneviewPanelApi.js +0 -27
- package/dist/esm/api/splitviewPanelApi.d.ts +0 -32
- package/dist/esm/api/splitviewPanelApi.js +0 -25
- package/dist/esm/array.d.ts +0 -13
- package/dist/esm/array.js +0 -67
- package/dist/esm/dnd/abstractDragHandler.d.ts +0 -11
- package/dist/esm/dnd/abstractDragHandler.js +0 -37
- package/dist/esm/dnd/dataTransfer.d.ts +0 -31
- package/dist/esm/dnd/dataTransfer.js +0 -69
- package/dist/esm/dnd/dnd.d.ts +0 -27
- package/dist/esm/dnd/dnd.js +0 -36
- package/dist/esm/dnd/droptarget.d.ts +0 -42
- package/dist/esm/dnd/droptarget.js +0 -249
- package/dist/esm/dnd/ghost.d.ts +0 -1
- package/dist/esm/dnd/ghost.js +0 -10
- package/dist/esm/dnd/groupDragHandler.d.ts +0 -11
- package/dist/esm/dnd/groupDragHandler.js +0 -38
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +0 -27
- package/dist/esm/dockview/components/tab/defaultTab.js +0 -79
- package/dist/esm/dockview/components/watermark/watermark.d.ts +0 -20
- package/dist/esm/dockview/components/watermark/watermark.js +0 -70
- package/dist/esm/dockview/defaultGroupPanelView.d.ts +0 -29
- package/dist/esm/dockview/defaultGroupPanelView.js +0 -44
- package/dist/esm/dockview/deserializer.d.ts +0 -6
- package/dist/esm/dockview/deserializer.js +0 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +0 -133
- package/dist/esm/dockview/dockviewComponent.js +0 -632
- package/dist/esm/dockview/dockviewPanel.d.ts +0 -42
- package/dist/esm/dockview/dockviewPanel.js +0 -111
- package/dist/esm/dockview/options.d.ts +0 -110
- package/dist/esm/dockview/options.js +0 -24
- package/dist/esm/dockview/validation.d.ts +0 -2
- package/dist/esm/dockview/validation.js +0 -86
- package/dist/esm/dom.d.ts +0 -14
- package/dist/esm/dom.js +0 -113
- package/dist/esm/events.d.ts +0 -30
- package/dist/esm/events.js +0 -88
- package/dist/esm/gridview/baseComponentGridview.d.ts +0 -87
- package/dist/esm/gridview/baseComponentGridview.js +0 -188
- package/dist/esm/gridview/basePanelView.d.ts +0 -43
- package/dist/esm/gridview/basePanelView.js +0 -74
- package/dist/esm/gridview/branchNode.d.ts +0 -49
- package/dist/esm/gridview/branchNode.js +0 -218
- package/dist/esm/gridview/gridviewComponent.d.ts +0 -85
- package/dist/esm/gridview/gridviewComponent.js +0 -237
- package/dist/esm/gridview/gridviewPanel.d.ts +0 -60
- package/dist/esm/gridview/gridviewPanel.js +0 -138
- package/dist/esm/gridview/leafNode.d.ts +0 -34
- package/dist/esm/gridview/leafNode.js +0 -103
- package/dist/esm/gridview/options.d.ts +0 -18
- package/dist/esm/gridview/options.js +0 -1
- package/dist/esm/gridview/types.d.ts +0 -3
- package/dist/esm/gridview/types.js +0 -1
- package/dist/esm/groupview/dnd.d.ts +0 -6
- package/dist/esm/groupview/dnd.js +0 -7
- package/dist/esm/groupview/groupview.d.ts +0 -177
- package/dist/esm/groupview/groupview.js +0 -462
- package/dist/esm/groupview/groupviewPanel.d.ts +0 -35
- package/dist/esm/groupview/groupviewPanel.js +0 -61
- package/dist/esm/groupview/panel/content.d.ts +0 -30
- package/dist/esm/groupview/panel/content.js +0 -73
- package/dist/esm/groupview/tab.d.ts +0 -31
- package/dist/esm/groupview/tab.js +0 -94
- package/dist/esm/groupview/titlebar/tabsContainer.d.ts +0 -65
- package/dist/esm/groupview/titlebar/tabsContainer.js +0 -183
- package/dist/esm/groupview/titlebar/voidContainer.d.ts +0 -15
- package/dist/esm/groupview/titlebar/voidContainer.js +0 -47
- package/dist/esm/groupview/types.d.ts +0 -68
- package/dist/esm/groupview/types.js +0 -1
- package/dist/esm/hostedContainer.d.ts +0 -23
- package/dist/esm/hostedContainer.js +0 -63
- package/dist/esm/lifecycle.d.ts +0 -22
- package/dist/esm/lifecycle.js +0 -39
- package/dist/esm/math.d.ts +0 -4
- package/dist/esm/math.js +0 -10
- package/dist/esm/panel/componentFactory.d.ts +0 -8
- package/dist/esm/panel/componentFactory.js +0 -24
- package/dist/esm/panel/types.d.ts +0 -33
- package/dist/esm/panel/types.js +0 -1
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +0 -21
- package/dist/esm/paneview/defaultPaneviewHeader.js +0 -63
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +0 -19
- package/dist/esm/paneview/draggablePaneviewPanel.js +0 -91
- package/dist/esm/paneview/options.d.ts +0 -27
- package/dist/esm/paneview/options.js +0 -1
- package/dist/esm/paneview/paneviewComponent.d.ts +0 -129
- package/dist/esm/paneview/paneviewComponent.js +0 -270
- package/dist/esm/paneview/paneviewPanel.d.ts +0 -92
- package/dist/esm/paneview/paneviewPanel.js +0 -192
- package/dist/esm/react/deserializer.d.ts +0 -10
- package/dist/esm/react/deserializer.js +0 -38
- package/dist/esm/react/dockview/v2/reactContentRenderer.d.ts +0 -29
- package/dist/esm/react/dockview/v2/reactContentRenderer.js +0 -69
- package/dist/esm/react/dockview/v2/reactGroupPanelView.d.ts +0 -7
- package/dist/esm/react/dockview/v2/reactGroupPanelView.js +0 -12
- package/dist/esm/react/dockview/v2/webviewContentRenderer.d.ts +0 -18
- package/dist/esm/react/dockview/v2/webviewContentRenderer.js +0 -36
- package/dist/esm/react/gridview/gridview.d.ts +0 -24
- package/dist/esm/react/gridview/gridview.js +0 -70
- package/dist/esm/react/index.d.ts +0 -9
- package/dist/esm/react/index.js +0 -7
- package/dist/esm/react/paneview/paneview.d.ts +0 -30
- package/dist/esm/react/paneview/paneview.js +0 -100
- package/dist/esm/react/svg.d.ts +0 -3
- package/dist/esm/react/svg.js +0 -7
- package/dist/esm/react/types.d.ts +0 -7
- package/dist/esm/react/types.js +0 -1
- package/dist/esm/splitview/core/options.d.ts +0 -26
- package/dist/esm/splitview/core/options.js +0 -1
- package/dist/esm/splitview/core/splitview.d.ts +0 -127
- package/dist/esm/splitview/core/splitview.js +0 -689
- package/dist/esm/splitview/core/viewItem.d.ts +0 -25
- package/dist/esm/splitview/core/viewItem.js +0 -79
- package/dist/esm/splitview/splitviewComponent.d.ts +0 -101
- package/dist/esm/splitview/splitviewComponent.js +0 -249
- package/dist/esm/splitview/splitviewPanel.d.ts +0 -45
- package/dist/esm/splitview/splitviewPanel.js +0 -108
- /package/dist/cjs/{react/dockview → dockview}/defaultTab.d.ts +0 -0
- /package/dist/cjs/{react/dockview → dockview}/defaultTab.js +0 -0
- /package/dist/cjs/{react/paneview → paneview}/view.js +0 -0
- /package/dist/esm/{react/dockview → dockview}/defaultTab.d.ts +0 -0
- /package/dist/esm/{react/dockview → dockview}/defaultTab.js +0 -0
- /package/dist/esm/{react/paneview → paneview}/view.js +0 -0
package/dist/dockview.amd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 1.
|
|
3
|
+
* @version 1.7.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -53,7 +53,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
var css_248z = ".dockview-svg {\n display: inline-block;\n fill: currentcolor;\n line-height: 1;\n stroke: currentcolor;\n stroke-width: 0;\n}\n.dockview-theme-dark {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n}\n\n.dockview-theme-light {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-group-view-background-color: white;\n --dv-tabs-and-actions-container-background-color: #f3f3f3;\n --dv-activegroup-visiblepanel-tab-background-color: white;\n --dv-activegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-inactivegroup-visiblepanel-tab-background-color: white;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-tab-divider-color: white;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.35);\n --dv-separator-border: rgba(128, 128, 128, 0.35);\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n}\n\n.dockview-theme-vs {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n --dv-tabs-and-actions-container-background-color: #2d2d30;\n --dv-tabs-and-actions-container-height: 20px;\n --dv-tabs-and-actions-container-font-size: 11px;\n --dv-activegroup-visiblepanel-tab-background-color: #007acc;\n --dv-inactivegroup-visiblepanel-tab-background-color: #3f3f46;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: white;\n --dv-inactivegroup-visiblepanel-tab-color: white;\n --dv-inactivegroup-hiddenpanel-tab-color: white;\n}\n.dockview-theme-vs .groupview.active-group > .tabs-and-actions-container {\n box-sizing: content-box;\n border-bottom: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.active-group > .tabs-and-actions-container .tab.active-tab {\n border-top: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.active-group > .tabs-and-actions-container .tab.inactive-tab {\n border-top: 2px solid var(--dv-activegroup-hiddenpanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.inactive-group > .tabs-and-actions-container {\n box-sizing: content-box;\n border-bottom: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.inactive-group > .tabs-and-actions-container .tab.active-tab {\n border-top: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .groupview.inactive-group > .tabs-and-actions-container .tab.inactive-tab {\n border-top: 2px solid var(--dv-inactivegroup-hiddenpanel-tab-background-color);\n}\n\n.dockview-theme-abyss {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-group-view-background-color: #000c18;\n --dv-tabs-and-actions-container-background-color: #1c1c2a;\n --dv-activegroup-visiblepanel-tab-background-color: #000c18;\n --dv-activegroup-hiddenpanel-tab-background-color: #10192c;\n --dv-inactivegroup-visiblepanel-tab-background-color: #000c18;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #10192c;\n --dv-tab-divider-color: #2b2b4a;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: rgba(255, 255, 255, 0.5);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(255, 255, 255, 0.5);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(255, 255, 255, 0.25);\n --dv-separator-border: #2b2b4a;\n --dv-paneview-header-border-color: #2b2b4a;\n --dv-paneview-active-outline-color: #596f99;\n}\n\n.dockview-theme-dracula {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: white;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-group-view-background-color: #282a36;\n --dv-tabs-and-actions-container-background-color: #191a21;\n --dv-activegroup-visiblepanel-tab-background-color: #282a36;\n --dv-activegroup-hiddenpanel-tab-background-color: #21222c;\n --dv-inactivegroup-visiblepanel-tab-background-color: #282a36;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #21222c;\n --dv-tab-divider-color: #191a21;\n --dv-activegroup-visiblepanel-tab-color: rgb(248, 248, 242);\n --dv-activegroup-hiddenpanel-tab-color: rgb(98, 114, 164);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(248, 248, 242, 0.5);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(98, 114, 164, 0.5);\n --dv-separator-border: #bd93f9;\n --dv-paneview-header-border-color: #bd93f9;\n --dv-paneview-active-outline-color: #6272a4;\n}\n.dockview-theme-dracula .groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n position: relative;\n}\n.dockview-theme-dracula .groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab::after {\n position: absolute;\n left: 0px;\n top: 0px;\n content: \"\";\n width: 100%;\n height: 1px;\n background-color: #94527e;\n z-index: 999;\n}\n.dockview-theme-dracula .groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n position: relative;\n}\n.dockview-theme-dracula .groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab::after {\n position: absolute;\n left: 0px;\n bottom: 0px;\n content: \"\";\n width: 100%;\n height: 1px;\n background-color: #5e3d5a;\n z-index: 999;\n}\n.actions-bar {\n text-align: right;\n width: 28px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n.actions-bar .actions-container {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.actions-bar .actions-container .close-action {\n padding: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n cursor: pointer;\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.actions-bar .actions-container .close-action:hover {\n border-radius: 2px;\n background-color: var(--dv-icon-hover-background-color);\n}\n.drop-target {\n position: relative;\n}\n.drop-target > .drop-target-dropzone {\n position: absolute;\n left: 0px;\n top: 0px;\n height: 100%;\n width: 100%;\n z-index: 10000;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection {\n position: relative;\n box-sizing: border-box;\n height: 100%;\n width: 100%;\n background-color: var(--dv-drag-over-background-color);\n transition: top 70ms ease-out, left 70ms ease-out, width 70ms ease-out, height 70ms ease-out, opacity 0.15s ease-out;\n will-change: transform;\n pointer-events: none;\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-top {\n border-top: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-bottom {\n border-bottom: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-left {\n border-left: 1px solid var(--dv-drag-over-border-color);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.small-right {\n border-right: 1px solid var(--dv-drag-over-border-color);\n}\n.dv-dockview {\n position: relative;\n background-color: var(--dv-group-view-background-color);\n}\n.dv-dockview .dv-watermark-container {\n position: absolute;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n}\n\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {\n background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-background-color);\n color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-background-color);\n color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n\n/**\n * when a tab is dragged we lose the above stylings because they are conditional on parent elements\n * therefore we also set some stylings for the dragging event\n **/\n.tab.dv-tab-dragging {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.grid-view,\n.branch-node {\n height: 100%;\n width: 100%;\n}\n.groupview {\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: var(--dv-group-view-background-color);\n overflow: hidden;\n}\n.groupview:focus {\n outline: none;\n}\n.groupview.empty > .tabs-and-actions-container {\n display: none;\n}\n.groupview > .content-container {\n flex-grow: 1;\n overflow: hidden;\n outline: none;\n}\n.pane-container {\n height: 100%;\n width: 100%;\n}\n.pane-container.animated .view {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.pane-container .view {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n padding: 0px !important;\n}\n.pane-container .view:not(:first-child)::before {\n background-color: transparent !important;\n}\n.pane-container .view:not(:first-child) .pane > .pane-header {\n border-top: 1px solid var(--dv-paneview-header-border-color);\n}\n.pane-container .view .default-header {\n background-color: var(--dv-group-view-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n display: flex;\n padding: 0px 8px;\n cursor: pointer;\n}\n.pane-container .view .default-header .dockview-pane-header-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.pane-container .view .default-header > span {\n padding-left: 8px;\n flex-grow: 1;\n}\n.pane-container:first-of-type > .pane > .pane-header {\n border-top: none !important;\n}\n.pane-container .pane {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n height: 100%;\n}\n.pane-container .pane .pane-header {\n box-sizing: border-box;\n user-select: none;\n position: relative;\n outline: none;\n}\n.pane-container .pane .pane-header.pane-draggable {\n cursor: pointer;\n}\n.pane-container .pane .pane-header:focus:before, .pane-container .pane .pane-header:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: \"\";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.pane-container .pane .pane-body {\n overflow-y: auto;\n overflow-x: hidden;\n flex-grow: 1;\n position: relative;\n outline: none;\n}\n.pane-container .pane .pane-body:focus:before, .pane-container .pane .pane-body:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: \"\";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.tabs-and-actions-container {\n display: flex;\n background-color: var(--dv-tabs-and-actions-container-background-color);\n flex-shrink: 0;\n box-sizing: border-box;\n height: var(--dv-tabs-and-actions-container-height);\n font-size: var(--dv-tabs-and-actions-container-font-size);\n}\n.tabs-and-actions-container.hidden {\n display: none;\n}\n.tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .tabs-container {\n flex-grow: 1;\n}\n.tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .tabs-container .tab {\n flex-grow: 1;\n}\n.tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .void-container {\n flex-grow: 0;\n}\n.tabs-and-actions-container .void-container {\n display: flex;\n flex-grow: 1;\n cursor: grab;\n}\n.tabs-and-actions-container .tabs-container {\n display: flex;\n overflow-x: overlay;\n overflow-y: hidden;\n scrollbar-width: thin;\n /* Track */\n /* Handle */\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar {\n height: 3px;\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar-track {\n background: transparent;\n}\n.tabs-and-actions-container .tabs-container::-webkit-scrollbar-thumb {\n background: var(--dv-tabs-container-scrollbar-color);\n}\n.tabs-and-actions-container .tabs-container .tab {\n -webkit-user-drag: element;\n outline: none;\n min-width: 75px;\n cursor: pointer;\n position: relative;\n box-sizing: border-box;\n}\n.tabs-and-actions-container .tabs-container .tab:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-tab-divider-color);\n width: 1px;\n height: 100%;\n}\n.tab .dockview-react-tab {\n display: flex;\n padding: 0px 8px;\n align-items: center;\n height: 100%;\n}\n.tab .dockview-react-tab .dockview-react-tab-title {\n padding: 0px 8px;\n flex-grow: 1;\n}\n.tab .dockview-react-tab .dockview-react-tab-action {\n padding: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n}\n.tab .dockview-react-tab .dockview-react-tab-action:hover {\n border-radius: 2px;\n background-color: var(--dv-icon-hover-background-color);\n}\n.tab.inactive-tab:not(:hover) .dockview-react-tab-action {\n visibility: hidden;\n}\n.dockview-react-part {\n height: 100%;\n width: 100%;\n}\n.split-view-container {\n position: relative;\n overflow: hidden;\n height: 100%;\n width: 100%;\n}\n.split-view-container.animation .view,\n.split-view-container.animation .sash {\n transition-duration: 0.15s;\n transition-timing-function: ease-out;\n}\n.split-view-container.horizontal {\n height: 100%;\n}\n.split-view-container.horizontal > .sash-container > .sash {\n height: 100%;\n width: 4px;\n}\n.split-view-container.horizontal > .sash-container > .sash.enabled {\n cursor: ew-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.horizontal > .sash-container > .sash.maximum {\n cursor: w-resize;\n}\n.split-view-container.horizontal > .sash-container > .sash.minimum {\n cursor: e-resize;\n}\n.split-view-container.horizontal > .view-container > .view:not(:first-child)::before {\n height: 100%;\n width: 1px;\n}\n.split-view-container.vertical {\n width: 100%;\n}\n.split-view-container.vertical > .sash-container > .sash {\n width: 100%;\n height: 4px;\n}\n.split-view-container.vertical > .sash-container > .sash.enabled {\n cursor: ns-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.disabled {\n cursor: default;\n}\n.split-view-container.vertical > .sash-container > .sash.maximum {\n cursor: n-resize;\n}\n.split-view-container.vertical > .sash-container > .sash.minimum {\n cursor: s-resize;\n}\n.split-view-container.vertical > .view-container > .view {\n width: 100%;\n}\n.split-view-container.vertical > .view-container > .view:not(:first-child)::before {\n height: 1px;\n width: 100%;\n}\n.split-view-container .sash-container {\n height: 100%;\n width: 100%;\n position: absolute;\n}\n.split-view-container .sash-container .sash {\n position: absolute;\n z-index: 99;\n outline: none;\n}\n.split-view-container .sash-container .sash:active {\n transition: background-color 0.1s ease-in-out;\n background-color: var(--dv-active-sash-color, transparent);\n}\n.split-view-container .sash-container .sash:hover {\n background-color: var(--dv-active-sash-color, transparent);\n transition: background-color 0.1s ease-in-out;\n transition-delay: 0.5s;\n}\n.split-view-container .view-container {\n position: relative;\n height: 100%;\n width: 100%;\n}\n.split-view-container .view-container .view {\n height: 100%;\n box-sizing: border-box;\n overflow: auto;\n position: absolute;\n}\n.split-view-container.separator-border .view:not(:first-child)::before {\n content: \" \";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-separator-border);\n}\n.dv-dragged {\n transform: translate3d(0px, 0px, 0px); /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */\n}\n\n.tab {\n flex-shrink: 0;\n}\n.tab.dv-tab-dragging .tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.tab.active-tab > .default-tab .tab-action {\n visibility: visible;\n}\n.tab.inactive-tab > .default-tab .tab-action {\n visibility: hidden;\n}\n.tab.inactive-tab > .default-tab:hover .tab-action {\n visibility: visible;\n}\n.tab .default-tab {\n position: relative;\n height: 100%;\n display: flex;\n min-width: 80px;\n align-items: center;\n padding: 0px 8px;\n white-space: nowrap;\n text-overflow: elipsis;\n}\n.tab .default-tab .tab-content {\n padding: 0px 8px;\n flex-grow: 1;\n}\n.tab .default-tab .action-container {\n text-align: right;\n display: flex;\n}\n.tab .default-tab .action-container .tab-list {\n display: flex;\n padding: 0px;\n margin: 0px;\n justify-content: flex-end;\n}\n.tab .default-tab .action-container .tab-list .tab-action {\n padding: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n}\n.tab .default-tab .action-container .tab-list .tab-action:hover {\n border-radius: 2px;\n background-color: var(--dv-icon-hover-background-color);\n}\n.watermark {\n display: flex;\n width: 100%;\n}\n.watermark.has-actions .watermark-title .actions-bar {\n display: none;\n}\n.watermark .watermark-title {\n height: 35px;\n width: 100%;\n display: flex;\n}\n.watermark .watermark-content {\n flex-grow: 1;\n}";
|
|
56
|
+
var css_248z = "@import \"dockview-core/dist/styles/dockview.css\";\n.tab .dockview-react-tab {\n display: flex;\n padding: 0px 8px;\n align-items: center;\n height: 100%;\n}\n.tab .dockview-react-tab .dockview-react-tab-title {\n padding: 0px 8px;\n flex-grow: 1;\n}\n.tab .dockview-react-tab .dockview-react-tab-action {\n padding: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n}\n.tab .dockview-react-tab .dockview-react-tab-action:hover {\n border-radius: 2px;\n background-color: var(--dv-icon-hover-background-color);\n}\n.tab.inactive-tab:not(:hover) .dockview-react-tab-action {\n visibility: hidden;\n}\n.dockview-react-part {\n height: 100%;\n width: 100%;\n}";
|
|
57
57
|
styleInject(css_248z);
|
|
58
58
|
|
|
59
59
|
class TransferObject {
|
|
@@ -126,7 +126,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
126
126
|
return paneTransfer.getData(PaneTransfer.prototype)[0];
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
exports.
|
|
129
|
+
exports.DockviewEvent = void 0;
|
|
130
130
|
(function (Event) {
|
|
131
131
|
Event.any = (...children) => {
|
|
132
132
|
return (listener) => {
|
|
@@ -140,7 +140,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
142
|
};
|
|
143
|
-
})(exports.
|
|
143
|
+
})(exports.DockviewEvent || (exports.DockviewEvent = {}));
|
|
144
144
|
// dumb event emitter with better typings than nodes event emitter
|
|
145
145
|
// https://github.com/microsoft/vscode/blob/master/src/vs/base/common/event.ts
|
|
146
146
|
class Emitter {
|
|
@@ -367,16 +367,30 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
370
|
+
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
371
|
+
const Component = typeof componentName === 'string'
|
|
372
|
+
? components[componentName]
|
|
373
|
+
: undefined;
|
|
374
|
+
const FrameworkComponent = typeof componentName === 'string'
|
|
375
|
+
? frameworkComponents[componentName]
|
|
376
|
+
: undefined;
|
|
377
|
+
if (Component && FrameworkComponent) {
|
|
378
|
+
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
373
379
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
+
if (FrameworkComponent) {
|
|
381
|
+
if (!createFrameworkComponent) {
|
|
382
|
+
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
383
|
+
}
|
|
384
|
+
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
385
|
+
}
|
|
386
|
+
if (!Component) {
|
|
387
|
+
if (fallback) {
|
|
388
|
+
return fallback();
|
|
389
|
+
}
|
|
390
|
+
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
391
|
+
}
|
|
392
|
+
return new Component(id, componentName);
|
|
393
|
+
}
|
|
380
394
|
|
|
381
395
|
function tail(arr) {
|
|
382
396
|
if (arr.length === 0) {
|
|
@@ -418,6 +432,26 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
418
432
|
arr.push(value);
|
|
419
433
|
}
|
|
420
434
|
}
|
|
435
|
+
function firstIndex(array, fn) {
|
|
436
|
+
for (let i = 0; i < array.length; i++) {
|
|
437
|
+
const element = array[i];
|
|
438
|
+
if (fn(element)) {
|
|
439
|
+
return i;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return -1;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
const clamp = (value, min, max) => {
|
|
446
|
+
if (min > max) {
|
|
447
|
+
throw new Error(`${min} > ${max} is an invalid condition`);
|
|
448
|
+
}
|
|
449
|
+
return Math.min(max, Math.max(value, min));
|
|
450
|
+
};
|
|
451
|
+
const sequentialNumberGenerator = () => {
|
|
452
|
+
let value = 1;
|
|
453
|
+
return { next: () => (value++).toString() };
|
|
454
|
+
};
|
|
421
455
|
const range = (from, to) => {
|
|
422
456
|
const result = [];
|
|
423
457
|
if (typeof to !== 'number') {
|
|
@@ -436,15 +470,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
436
470
|
}
|
|
437
471
|
return result;
|
|
438
472
|
};
|
|
439
|
-
function firstIndex(array, fn) {
|
|
440
|
-
for (let i = 0; i < array.length; i++) {
|
|
441
|
-
const element = array[i];
|
|
442
|
-
if (fn(element)) {
|
|
443
|
-
return i;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
return -1;
|
|
447
|
-
}
|
|
448
473
|
|
|
449
474
|
class ViewItem {
|
|
450
475
|
set size(size) {
|
|
@@ -459,25 +484,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
459
484
|
get visible() {
|
|
460
485
|
return typeof this._cachedVisibleSize === 'undefined';
|
|
461
486
|
}
|
|
462
|
-
setVisible(visible, size) {
|
|
463
|
-
var _a;
|
|
464
|
-
if (visible === this.visible) {
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
if (visible) {
|
|
468
|
-
this.size = clamp((_a = this._cachedVisibleSize) !== null && _a !== void 0 ? _a : 0, this.viewMinimumSize, this.viewMaximumSize);
|
|
469
|
-
this._cachedVisibleSize = undefined;
|
|
470
|
-
}
|
|
471
|
-
else {
|
|
472
|
-
this._cachedVisibleSize =
|
|
473
|
-
typeof size === 'number' ? size : this.size;
|
|
474
|
-
this.size = 0;
|
|
475
|
-
}
|
|
476
|
-
this.container.classList.toggle('visible', visible);
|
|
477
|
-
if (this.view.setVisible) {
|
|
478
|
-
this.view.setVisible(visible);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
487
|
get minimumSize() {
|
|
482
488
|
return this.visible ? this.view.minimumSize : 0;
|
|
483
489
|
}
|
|
@@ -514,11 +520,25 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
514
520
|
this._cachedVisibleSize = size.cachedVisibleSize;
|
|
515
521
|
}
|
|
516
522
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
523
|
+
setVisible(visible, size) {
|
|
524
|
+
var _a;
|
|
525
|
+
if (visible === this.visible) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
if (visible) {
|
|
529
|
+
this.size = clamp((_a = this._cachedVisibleSize) !== null && _a !== void 0 ? _a : 0, this.viewMinimumSize, this.viewMaximumSize);
|
|
530
|
+
this._cachedVisibleSize = undefined;
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
this._cachedVisibleSize =
|
|
534
|
+
typeof size === 'number' ? size : this.size;
|
|
535
|
+
this.size = 0;
|
|
536
|
+
}
|
|
537
|
+
this.container.classList.toggle('visible', visible);
|
|
538
|
+
if (this.view.setVisible) {
|
|
539
|
+
this.view.setVisible(visible);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
522
542
|
dispose() {
|
|
523
543
|
this.disposable.dispose();
|
|
524
544
|
return this.view;
|
|
@@ -627,14 +647,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
627
647
|
this._orthogonalSize = 0;
|
|
628
648
|
this.contentSize = 0;
|
|
629
649
|
this._proportions = undefined;
|
|
650
|
+
this._startSnappingEnabled = true;
|
|
651
|
+
this._endSnappingEnabled = true;
|
|
630
652
|
this._onDidSashEnd = new Emitter();
|
|
631
653
|
this.onDidSashEnd = this._onDidSashEnd.event;
|
|
632
654
|
this._onDidAddView = new Emitter();
|
|
633
655
|
this.onDidAddView = this._onDidAddView.event;
|
|
634
656
|
this._onDidRemoveView = new Emitter();
|
|
635
657
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
636
|
-
this._startSnappingEnabled = true;
|
|
637
|
-
this._endSnappingEnabled = true;
|
|
638
658
|
this.resize = (index, delta, sizes = this.views.map((x) => x.size), lowPriorityIndexes, highPriorityIndexes, overloadMinDelta = Number.NEGATIVE_INFINITY, overloadMaxDelta = Number.POSITIVE_INFINITY, snapBefore, snapAfter) => {
|
|
639
659
|
if (index < 0 || index > this.views.length) {
|
|
640
660
|
return 0;
|
|
@@ -1529,10 +1549,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1529
1549
|
this.orientation = orientation;
|
|
1530
1550
|
this.proportionalLayout = proportionalLayout;
|
|
1531
1551
|
this.styles = styles;
|
|
1552
|
+
this._childrenDisposable = Disposable.NONE;
|
|
1532
1553
|
this.children = [];
|
|
1533
1554
|
this._onDidChange = new Emitter();
|
|
1534
1555
|
this.onDidChange = this._onDidChange.event;
|
|
1535
|
-
this._childrenDisposable = Disposable.NONE;
|
|
1536
1556
|
this._orthogonalSize = orthogonalSize;
|
|
1537
1557
|
this._size = size;
|
|
1538
1558
|
this.element = document.createElement('div');
|
|
@@ -1653,7 +1673,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1653
1673
|
}
|
|
1654
1674
|
setupChildrenEvents() {
|
|
1655
1675
|
this._childrenDisposable.dispose();
|
|
1656
|
-
this._childrenDisposable = exports.
|
|
1676
|
+
this._childrenDisposable = exports.DockviewEvent.any(...this.children.map((c) => c.onDidChange))((e) => {
|
|
1657
1677
|
/**
|
|
1658
1678
|
* indicate a change has occured to allows any re-rendering but don't bubble
|
|
1659
1679
|
* event because that was specific to this branch
|
|
@@ -1791,6 +1811,35 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1791
1811
|
get length() {
|
|
1792
1812
|
return this._root ? this._root.children.length : 0;
|
|
1793
1813
|
}
|
|
1814
|
+
get orientation() {
|
|
1815
|
+
return this.root.orientation;
|
|
1816
|
+
}
|
|
1817
|
+
set orientation(orientation) {
|
|
1818
|
+
if (this.root.orientation === orientation) {
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
const { size, orthogonalSize } = this.root;
|
|
1822
|
+
this.root = flipNode(this.root, orthogonalSize, size);
|
|
1823
|
+
this.root.layout(size, orthogonalSize);
|
|
1824
|
+
}
|
|
1825
|
+
get width() {
|
|
1826
|
+
return this.root.width;
|
|
1827
|
+
}
|
|
1828
|
+
get height() {
|
|
1829
|
+
return this.root.height;
|
|
1830
|
+
}
|
|
1831
|
+
get minimumWidth() {
|
|
1832
|
+
return this.root.minimumWidth;
|
|
1833
|
+
}
|
|
1834
|
+
get minimumHeight() {
|
|
1835
|
+
return this.root.minimumHeight;
|
|
1836
|
+
}
|
|
1837
|
+
get maximumWidth() {
|
|
1838
|
+
return this.root.maximumHeight;
|
|
1839
|
+
}
|
|
1840
|
+
get maximumHeight() {
|
|
1841
|
+
return this.root.maximumHeight;
|
|
1842
|
+
}
|
|
1794
1843
|
serialize() {
|
|
1795
1844
|
const root = serializeBranchNode(this.getView(), this.orientation);
|
|
1796
1845
|
return {
|
|
@@ -1837,17 +1886,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1837
1886
|
}
|
|
1838
1887
|
return result;
|
|
1839
1888
|
}
|
|
1840
|
-
get orientation() {
|
|
1841
|
-
return this.root.orientation;
|
|
1842
|
-
}
|
|
1843
|
-
set orientation(orientation) {
|
|
1844
|
-
if (this.root.orientation === orientation) {
|
|
1845
|
-
return;
|
|
1846
|
-
}
|
|
1847
|
-
const { size, orthogonalSize } = this.root;
|
|
1848
|
-
this.root = flipNode(this.root, orthogonalSize, size);
|
|
1849
|
-
this.root.layout(size, orthogonalSize);
|
|
1850
|
-
}
|
|
1851
1889
|
get root() {
|
|
1852
1890
|
return this._root;
|
|
1853
1891
|
}
|
|
@@ -1929,24 +1967,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1929
1967
|
}
|
|
1930
1968
|
return findLeaf(this.root, reverse);
|
|
1931
1969
|
}
|
|
1932
|
-
get width() {
|
|
1933
|
-
return this.root.width;
|
|
1934
|
-
}
|
|
1935
|
-
get height() {
|
|
1936
|
-
return this.root.height;
|
|
1937
|
-
}
|
|
1938
|
-
get minimumWidth() {
|
|
1939
|
-
return this.root.minimumWidth;
|
|
1940
|
-
}
|
|
1941
|
-
get minimumHeight() {
|
|
1942
|
-
return this.root.minimumHeight;
|
|
1943
|
-
}
|
|
1944
|
-
get maximumWidth() {
|
|
1945
|
-
return this.root.maximumHeight;
|
|
1946
|
-
}
|
|
1947
|
-
get maximumHeight() {
|
|
1948
|
-
return this.root.maximumHeight;
|
|
1949
|
-
}
|
|
1950
1970
|
constructor(proportionalLayout, styles, orientation) {
|
|
1951
1971
|
this.proportionalLayout = proportionalLayout;
|
|
1952
1972
|
this.styles = styles;
|
|
@@ -2451,10 +2471,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2451
2471
|
}
|
|
2452
2472
|
}
|
|
2453
2473
|
|
|
2454
|
-
function isBooleanValue(value) {
|
|
2455
|
-
return typeof value === 'boolean';
|
|
2456
|
-
}
|
|
2457
|
-
|
|
2458
2474
|
function numberOrFallback(maybeNumber, fallback) {
|
|
2459
2475
|
return typeof maybeNumber === 'number' ? maybeNumber : fallback;
|
|
2460
2476
|
}
|
|
@@ -2519,7 +2535,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2519
2535
|
this.removeDropTarget();
|
|
2520
2536
|
return;
|
|
2521
2537
|
}
|
|
2522
|
-
if (
|
|
2538
|
+
if (typeof this.options.canDisplayOverlay === 'boolean') {
|
|
2523
2539
|
if (!this.options.canDisplayOverlay) {
|
|
2524
2540
|
return;
|
|
2525
2541
|
}
|
|
@@ -2527,20 +2543,20 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2527
2543
|
else if (!this.options.canDisplayOverlay(e, quadrant)) {
|
|
2528
2544
|
return;
|
|
2529
2545
|
}
|
|
2530
|
-
if (!this.
|
|
2531
|
-
this.
|
|
2532
|
-
this.
|
|
2533
|
-
this.
|
|
2534
|
-
this.
|
|
2546
|
+
if (!this.targetElement) {
|
|
2547
|
+
this.targetElement = document.createElement('div');
|
|
2548
|
+
this.targetElement.className = 'drop-target-dropzone';
|
|
2549
|
+
this.overlayElement = document.createElement('div');
|
|
2550
|
+
this.overlayElement.className = 'drop-target-selection';
|
|
2535
2551
|
this._state = 'center';
|
|
2536
|
-
this.
|
|
2552
|
+
this.targetElement.appendChild(this.overlayElement);
|
|
2537
2553
|
this.element.classList.add('drop-target');
|
|
2538
|
-
this.element.append(this.
|
|
2554
|
+
this.element.append(this.targetElement);
|
|
2539
2555
|
}
|
|
2540
2556
|
if (this.options.acceptedTargetZones.length === 0) {
|
|
2541
2557
|
return;
|
|
2542
2558
|
}
|
|
2543
|
-
if (!this.
|
|
2559
|
+
if (!this.targetElement || !this.overlayElement) {
|
|
2544
2560
|
return;
|
|
2545
2561
|
}
|
|
2546
2562
|
this.toggleClasses(quadrant, width, height);
|
|
@@ -2554,10 +2570,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2554
2570
|
},
|
|
2555
2571
|
onDrop: (e) => {
|
|
2556
2572
|
e.preventDefault();
|
|
2557
|
-
e.stopPropagation();
|
|
2558
2573
|
const state = this._state;
|
|
2559
2574
|
this.removeDropTarget();
|
|
2560
2575
|
if (state) {
|
|
2576
|
+
// only stop the propagation of the event if we are dealing with it
|
|
2577
|
+
// which is only when the target has state
|
|
2578
|
+
e.stopPropagation();
|
|
2561
2579
|
this._onDrop.fire({ position: state, nativeEvent: e });
|
|
2562
2580
|
}
|
|
2563
2581
|
},
|
|
@@ -2568,7 +2586,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2568
2586
|
}
|
|
2569
2587
|
toggleClasses(quadrant, width, height) {
|
|
2570
2588
|
var _a, _b, _c, _d;
|
|
2571
|
-
if (!this.
|
|
2589
|
+
if (!this.overlayElement) {
|
|
2572
2590
|
return;
|
|
2573
2591
|
}
|
|
2574
2592
|
const isSmallX = width < 100;
|
|
@@ -2615,11 +2633,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2615
2633
|
else {
|
|
2616
2634
|
transform = '';
|
|
2617
2635
|
}
|
|
2618
|
-
this.
|
|
2619
|
-
toggleClass(this.
|
|
2620
|
-
toggleClass(this.
|
|
2621
|
-
toggleClass(this.
|
|
2622
|
-
toggleClass(this.
|
|
2636
|
+
this.overlayElement.style.transform = transform;
|
|
2637
|
+
toggleClass(this.overlayElement, 'small-right', isSmallX && isRight);
|
|
2638
|
+
toggleClass(this.overlayElement, 'small-left', isSmallX && isLeft);
|
|
2639
|
+
toggleClass(this.overlayElement, 'small-top', isSmallY && isTop);
|
|
2640
|
+
toggleClass(this.overlayElement, 'small-bottom', isSmallY && isBottom);
|
|
2623
2641
|
}
|
|
2624
2642
|
setState(quadrant) {
|
|
2625
2643
|
switch (quadrant) {
|
|
@@ -2651,11 +2669,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2651
2669
|
return calculateQuadrantAsPixels(overlayType, x, y, width, height, value);
|
|
2652
2670
|
}
|
|
2653
2671
|
removeDropTarget() {
|
|
2654
|
-
if (this.
|
|
2672
|
+
if (this.targetElement) {
|
|
2655
2673
|
this._state = undefined;
|
|
2656
|
-
this.element.removeChild(this.
|
|
2657
|
-
this.
|
|
2658
|
-
this.
|
|
2674
|
+
this.element.removeChild(this.targetElement);
|
|
2675
|
+
this.targetElement = undefined;
|
|
2676
|
+
this.overlayElement = undefined;
|
|
2659
2677
|
this.element.classList.remove('drop-target');
|
|
2660
2678
|
}
|
|
2661
2679
|
}
|
|
@@ -2802,6 +2820,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2802
2820
|
this.disposable.value = this.getData(event.dataTransfer);
|
|
2803
2821
|
if (event.dataTransfer) {
|
|
2804
2822
|
event.dataTransfer.effectAllowed = 'move';
|
|
2823
|
+
/**
|
|
2824
|
+
* Although this is not used by dockview many third party dnd libraries will check
|
|
2825
|
+
* dataTransfer.types to determine valid drag events.
|
|
2826
|
+
*
|
|
2827
|
+
* For example: in react-dnd if dataTransfer.types is not set then the dragStart event will be cancelled
|
|
2828
|
+
* through .preventDefault(). Since this is applied globally to all drag events this would break dockviews
|
|
2829
|
+
* dnd logic. You can see the code at
|
|
2830
|
+
* https://github.com/react-dnd/react-dnd/blob/main/packages/backend-html5/src/HTML5BackendImpl.ts#L542
|
|
2831
|
+
*/
|
|
2832
|
+
event.dataTransfer.setData('text/plain', '__dockview_internal_drag_event__');
|
|
2805
2833
|
}
|
|
2806
2834
|
}), addDisposableListener(this.el, 'dragend', () => {
|
|
2807
2835
|
for (const iframe of this.iframes) {
|
|
@@ -2907,6 +2935,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2907
2935
|
document.body.appendChild(ghostElement);
|
|
2908
2936
|
dataTransfer.setDragImage(ghostElement, 0, 0);
|
|
2909
2937
|
setTimeout(() => {
|
|
2938
|
+
removeClasses(ghostElement, 'dv-dragged');
|
|
2910
2939
|
ghostElement.remove();
|
|
2911
2940
|
}, 0);
|
|
2912
2941
|
}
|
|
@@ -3042,10 +3071,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3042
3071
|
return (this.selectedIndex > -1 &&
|
|
3043
3072
|
this.tabs[this.selectedIndex].value === tab);
|
|
3044
3073
|
}
|
|
3045
|
-
at(index) {
|
|
3046
|
-
var _a;
|
|
3047
|
-
return (_a = this.tabs[index]) === null || _a === void 0 ? void 0 : _a.value;
|
|
3048
|
-
}
|
|
3049
3074
|
indexOf(id) {
|
|
3050
3075
|
return this.tabs.findIndex((tab) => tab.value.panelId === id);
|
|
3051
3076
|
}
|
|
@@ -3167,7 +3192,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3167
3192
|
}
|
|
3168
3193
|
}
|
|
3169
3194
|
|
|
3170
|
-
class
|
|
3195
|
+
class DockviewGroupPanelModel extends CompositeDisposable {
|
|
3171
3196
|
get element() {
|
|
3172
3197
|
throw new Error('not supported');
|
|
3173
3198
|
}
|
|
@@ -3193,18 +3218,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3193
3218
|
get isEmpty() {
|
|
3194
3219
|
return this._panels.length === 0;
|
|
3195
3220
|
}
|
|
3196
|
-
get minimumHeight() {
|
|
3197
|
-
return 100;
|
|
3198
|
-
}
|
|
3199
|
-
get maximumHeight() {
|
|
3200
|
-
return Number.MAX_SAFE_INTEGER;
|
|
3201
|
-
}
|
|
3202
|
-
get minimumWidth() {
|
|
3203
|
-
return 100;
|
|
3204
|
-
}
|
|
3205
|
-
get maximumWidth() {
|
|
3206
|
-
return Number.MAX_SAFE_INTEGER;
|
|
3207
|
-
}
|
|
3208
3221
|
get hasWatermark() {
|
|
3209
3222
|
return !!(this.watermark && this.container.contains(this.watermark.element));
|
|
3210
3223
|
}
|
|
@@ -3377,8 +3390,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3377
3390
|
//noop
|
|
3378
3391
|
}
|
|
3379
3392
|
focus() {
|
|
3380
|
-
var _a;
|
|
3381
|
-
(_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3393
|
+
var _a, _b;
|
|
3394
|
+
(_b = (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3382
3395
|
}
|
|
3383
3396
|
openPanel(panel, options = {}) {
|
|
3384
3397
|
if (typeof options.index !== 'number' ||
|
|
@@ -3439,10 +3452,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3439
3452
|
this.tabsContainer.setActionElement(element);
|
|
3440
3453
|
}
|
|
3441
3454
|
setActive(isGroupActive, skipFocus = false, force = false) {
|
|
3442
|
-
var _a, _b;
|
|
3455
|
+
var _a, _b, _c, _d;
|
|
3443
3456
|
if (!force && this.isActive === isGroupActive) {
|
|
3444
3457
|
if (!skipFocus) {
|
|
3445
|
-
(_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3458
|
+
(_b = (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3446
3459
|
}
|
|
3447
3460
|
return;
|
|
3448
3461
|
}
|
|
@@ -3456,7 +3469,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3456
3469
|
this.updateContainer();
|
|
3457
3470
|
if (isGroupActive) {
|
|
3458
3471
|
if (!skipFocus) {
|
|
3459
|
-
(
|
|
3472
|
+
(_d = (_c = this._activePanel) === null || _c === void 0 ? void 0 : _c.focus) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
3460
3473
|
}
|
|
3461
3474
|
}
|
|
3462
3475
|
}
|
|
@@ -3527,15 +3540,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3527
3540
|
this.mostRecentlyUsed = [panel, ...this.mostRecentlyUsed];
|
|
3528
3541
|
}
|
|
3529
3542
|
updateContainer() {
|
|
3543
|
+
var _a, _b;
|
|
3530
3544
|
toggleClass(this.container, 'empty', this.isEmpty);
|
|
3531
3545
|
this.panels.forEach((panel) => panel.updateParentGroup(this.groupPanel, this.isActive));
|
|
3532
3546
|
if (this.isEmpty && !this.watermark) {
|
|
3533
3547
|
const watermark = this.accessor.createWatermarkComponent();
|
|
3534
3548
|
watermark.init({
|
|
3535
3549
|
containerApi: new DockviewApi(this.accessor),
|
|
3536
|
-
|
|
3537
|
-
title: '',
|
|
3538
|
-
api: null,
|
|
3550
|
+
group: this.groupPanel,
|
|
3539
3551
|
});
|
|
3540
3552
|
this.watermark = watermark;
|
|
3541
3553
|
addDisposableListener(this.watermark.element, 'click', () => {
|
|
@@ -3549,7 +3561,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3549
3561
|
}
|
|
3550
3562
|
if (!this.isEmpty && this.watermark) {
|
|
3551
3563
|
this.watermark.element.remove();
|
|
3552
|
-
this.watermark.dispose();
|
|
3564
|
+
(_b = (_a = this.watermark).dispose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3553
3565
|
this.watermark = undefined;
|
|
3554
3566
|
this.tabsContainer.show();
|
|
3555
3567
|
}
|
|
@@ -3609,9 +3621,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3609
3621
|
}
|
|
3610
3622
|
}
|
|
3611
3623
|
dispose() {
|
|
3612
|
-
var _a;
|
|
3624
|
+
var _a, _b;
|
|
3613
3625
|
super.dispose();
|
|
3614
|
-
(_a = this.watermark) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
3626
|
+
(_b = (_a = this.watermark) === null || _a === void 0 ? void 0 : _a.dispose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3615
3627
|
for (const panel of this.panels) {
|
|
3616
3628
|
panel.dispose();
|
|
3617
3629
|
}
|
|
@@ -3691,7 +3703,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3691
3703
|
this.addDisposables(this.gridview.onDidChange(() => {
|
|
3692
3704
|
this._bufferOnDidLayoutChange.fire();
|
|
3693
3705
|
}));
|
|
3694
|
-
this.addDisposables(exports.
|
|
3706
|
+
this.addDisposables(exports.DockviewEvent.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
|
|
3695
3707
|
this._bufferOnDidLayoutChange.fire();
|
|
3696
3708
|
}), this._bufferOnDidLayoutChange.onEvent(() => {
|
|
3697
3709
|
this._onDidLayoutChange.fire();
|
|
@@ -3732,19 +3744,20 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3732
3744
|
return (_a = this._groups.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
3733
3745
|
}
|
|
3734
3746
|
doSetGroupActive(group, skipFocus) {
|
|
3747
|
+
var _a, _b, _c;
|
|
3735
3748
|
if (this._activeGroup === group) {
|
|
3736
3749
|
return;
|
|
3737
3750
|
}
|
|
3738
3751
|
if (this._activeGroup) {
|
|
3739
3752
|
this._activeGroup.setActive(false);
|
|
3740
3753
|
if (!skipFocus) {
|
|
3741
|
-
this._activeGroup.focus();
|
|
3754
|
+
(_b = (_a = this._activeGroup).focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3742
3755
|
}
|
|
3743
3756
|
}
|
|
3744
3757
|
if (group) {
|
|
3745
3758
|
group.setActive(true);
|
|
3746
3759
|
if (!skipFocus) {
|
|
3747
|
-
group.focus();
|
|
3760
|
+
(_c = group.focus) === null || _c === void 0 ? void 0 : _c.call(group);
|
|
3748
3761
|
}
|
|
3749
3762
|
}
|
|
3750
3763
|
this._activeGroup = group;
|
|
@@ -3805,31 +3818,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3805
3818
|
}
|
|
3806
3819
|
}
|
|
3807
3820
|
|
|
3808
|
-
function isPanelOptionsWithPanel(data) {
|
|
3809
|
-
if (data.referencePanel) {
|
|
3810
|
-
return true;
|
|
3811
|
-
}
|
|
3812
|
-
return false;
|
|
3813
|
-
}
|
|
3814
|
-
function isPanelOptionsWithGroup(data) {
|
|
3815
|
-
if (data.referenceGroup) {
|
|
3816
|
-
return true;
|
|
3817
|
-
}
|
|
3818
|
-
return false;
|
|
3819
|
-
}
|
|
3820
|
-
function isGroupOptionsWithPanel(data) {
|
|
3821
|
-
if (data.referencePanel) {
|
|
3822
|
-
return true;
|
|
3823
|
-
}
|
|
3824
|
-
return false;
|
|
3825
|
-
}
|
|
3826
|
-
function isGroupOptionsWithGroup(data) {
|
|
3827
|
-
if (data.referenceGroup) {
|
|
3828
|
-
return true;
|
|
3829
|
-
}
|
|
3830
|
-
return false;
|
|
3831
|
-
}
|
|
3832
|
-
|
|
3833
3821
|
/**
|
|
3834
3822
|
* A core api implementation that should be used across all panel-like objects
|
|
3835
3823
|
*/
|
|
@@ -3924,21 +3912,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3924
3912
|
}
|
|
3925
3913
|
}
|
|
3926
3914
|
|
|
3927
|
-
class
|
|
3928
|
-
|
|
3915
|
+
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
3916
|
+
//
|
|
3917
|
+
constructor(id) {
|
|
3929
3918
|
super(id);
|
|
3930
3919
|
this._onDidConstraintsChangeInternal = new Emitter();
|
|
3931
3920
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
3921
|
+
//
|
|
3932
3922
|
this._onDidConstraintsChange = new Emitter({
|
|
3933
3923
|
replay: true,
|
|
3934
3924
|
});
|
|
3935
3925
|
this.onDidConstraintsChange = this._onDidConstraintsChange.event;
|
|
3926
|
+
//
|
|
3936
3927
|
this._onDidSizeChange = new Emitter();
|
|
3937
3928
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
3938
3929
|
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
3939
|
-
if (panel) {
|
|
3940
|
-
this.initialize(panel);
|
|
3941
|
-
}
|
|
3942
3930
|
}
|
|
3943
3931
|
setConstraints(value) {
|
|
3944
3932
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -3948,450 +3936,401 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3948
3936
|
}
|
|
3949
3937
|
}
|
|
3950
3938
|
|
|
3951
|
-
class
|
|
3952
|
-
|
|
3953
|
-
|
|
3939
|
+
class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
3940
|
+
set pane(pane) {
|
|
3941
|
+
this._pane = pane;
|
|
3954
3942
|
}
|
|
3955
|
-
|
|
3943
|
+
constructor(id) {
|
|
3944
|
+
super(id);
|
|
3945
|
+
this._onDidExpansionChange = new Emitter({
|
|
3946
|
+
replay: true,
|
|
3947
|
+
});
|
|
3948
|
+
this.onDidExpansionChange = this._onDidExpansionChange.event;
|
|
3949
|
+
this._onMouseEnter = new Emitter({});
|
|
3950
|
+
this.onMouseEnter = this._onMouseEnter.event;
|
|
3951
|
+
this._onMouseLeave = new Emitter({});
|
|
3952
|
+
this.onMouseLeave = this._onMouseLeave.event;
|
|
3953
|
+
this.addDisposables(this._onDidExpansionChange, this._onMouseEnter, this._onMouseLeave);
|
|
3954
|
+
}
|
|
3955
|
+
setExpanded(isExpanded) {
|
|
3956
3956
|
var _a;
|
|
3957
|
-
|
|
3957
|
+
(_a = this._pane) === null || _a === void 0 ? void 0 : _a.setExpanded(isExpanded);
|
|
3958
3958
|
}
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
this.
|
|
3962
|
-
this._onDidGroupChange.fire();
|
|
3963
|
-
if (this._group) {
|
|
3964
|
-
this.disposable.value = this._group.api.onDidActiveChange(() => {
|
|
3965
|
-
this._onDidActiveGroupChange.fire();
|
|
3966
|
-
});
|
|
3967
|
-
if (this.isGroupActive !== isOldGroupActive) {
|
|
3968
|
-
this._onDidActiveGroupChange.fire();
|
|
3969
|
-
}
|
|
3970
|
-
}
|
|
3971
|
-
}
|
|
3972
|
-
get group() {
|
|
3973
|
-
return this._group;
|
|
3974
|
-
}
|
|
3975
|
-
constructor(panel, group) {
|
|
3976
|
-
super(panel.id);
|
|
3977
|
-
this.panel = panel;
|
|
3978
|
-
this._onDidTitleChange = new Emitter();
|
|
3979
|
-
this.onDidTitleChange = this._onDidTitleChange.event;
|
|
3980
|
-
this._onDidActiveGroupChange = new Emitter();
|
|
3981
|
-
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3982
|
-
this._onDidGroupChange = new Emitter();
|
|
3983
|
-
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
3984
|
-
this.disposable = new MutableDisposable();
|
|
3985
|
-
this.initialize(panel);
|
|
3986
|
-
this._group = group;
|
|
3987
|
-
this.addDisposables(this.disposable, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange);
|
|
3988
|
-
}
|
|
3989
|
-
setTitle(title) {
|
|
3990
|
-
this.panel.update({ params: { title } });
|
|
3991
|
-
}
|
|
3992
|
-
close() {
|
|
3993
|
-
this.group.model.closePanel(this.panel);
|
|
3959
|
+
get isExpanded() {
|
|
3960
|
+
var _a;
|
|
3961
|
+
return !!((_a = this._pane) === null || _a === void 0 ? void 0 : _a.isExpanded());
|
|
3994
3962
|
}
|
|
3995
3963
|
}
|
|
3996
3964
|
|
|
3997
|
-
class
|
|
3998
|
-
get
|
|
3999
|
-
return this.
|
|
3965
|
+
class BasePanelView extends CompositeDisposable {
|
|
3966
|
+
get element() {
|
|
3967
|
+
return this._element;
|
|
4000
3968
|
}
|
|
4001
|
-
get
|
|
4002
|
-
return this.
|
|
3969
|
+
get width() {
|
|
3970
|
+
return this._width;
|
|
4003
3971
|
}
|
|
4004
|
-
get
|
|
4005
|
-
return this.
|
|
3972
|
+
get height() {
|
|
3973
|
+
return this._height;
|
|
4006
3974
|
}
|
|
4007
|
-
get
|
|
4008
|
-
|
|
3975
|
+
get params() {
|
|
3976
|
+
var _a;
|
|
3977
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
4009
3978
|
}
|
|
4010
|
-
constructor(id,
|
|
3979
|
+
constructor(id, component, api) {
|
|
4011
3980
|
super();
|
|
4012
3981
|
this.id = id;
|
|
4013
|
-
this.
|
|
4014
|
-
this.
|
|
4015
|
-
this.
|
|
4016
|
-
this.
|
|
4017
|
-
this.
|
|
4018
|
-
this.
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
3982
|
+
this.component = component;
|
|
3983
|
+
this.api = api;
|
|
3984
|
+
this._height = 0;
|
|
3985
|
+
this._width = 0;
|
|
3986
|
+
this._element = document.createElement('div');
|
|
3987
|
+
this._element.tabIndex = -1;
|
|
3988
|
+
this._element.style.outline = 'none';
|
|
3989
|
+
this._element.style.height = '100%';
|
|
3990
|
+
this._element.style.width = '100%';
|
|
3991
|
+
this._element.style.overflow = 'hidden';
|
|
3992
|
+
const { onDidFocus, onDidBlur } = trackFocus(this._element);
|
|
3993
|
+
this.addDisposables(this.api, onDidFocus(() => {
|
|
3994
|
+
this.api._onDidChangeFocus.fire({ isFocused: true });
|
|
3995
|
+
}), onDidBlur(() => {
|
|
3996
|
+
this.api._onDidChangeFocus.fire({ isFocused: false });
|
|
4024
3997
|
}));
|
|
4025
3998
|
}
|
|
4026
|
-
init(params) {
|
|
4027
|
-
var _a;
|
|
4028
|
-
this._params = params.params;
|
|
4029
|
-
this._view = params.view;
|
|
4030
|
-
this.setTitle(params.title);
|
|
4031
|
-
(_a = this.view) === null || _a === void 0 ? void 0 : _a.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
4032
|
-
}
|
|
4033
3999
|
focus() {
|
|
4034
4000
|
this.api._onFocusEvent.fire();
|
|
4035
4001
|
}
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
title: this.title,
|
|
4044
|
-
};
|
|
4045
|
-
}
|
|
4046
|
-
setTitle(title) {
|
|
4047
|
-
var _a, _b;
|
|
4048
|
-
const didTitleChange = title !== ((_a = this._params) === null || _a === void 0 ? void 0 : _a.title);
|
|
4049
|
-
if (didTitleChange) {
|
|
4050
|
-
this._title = title;
|
|
4051
|
-
(_b = this.view) === null || _b === void 0 ? void 0 : _b.update({
|
|
4052
|
-
params: {
|
|
4053
|
-
params: this._params,
|
|
4054
|
-
title: this.title,
|
|
4055
|
-
},
|
|
4056
|
-
});
|
|
4057
|
-
this.api._onDidTitleChange.fire({ title });
|
|
4058
|
-
}
|
|
4059
|
-
}
|
|
4060
|
-
update(event) {
|
|
4061
|
-
var _a;
|
|
4062
|
-
const params = event.params;
|
|
4063
|
-
this._params = Object.assign(Object.assign({}, (this._params || {})), event.params.params);
|
|
4064
|
-
if (typeof params.title === 'string') {
|
|
4065
|
-
if (params.title !== this.title) {
|
|
4066
|
-
this._title = params.title;
|
|
4067
|
-
this.api._onDidTitleChange.fire({ title: this.title });
|
|
4002
|
+
layout(width, height) {
|
|
4003
|
+
this._width = width;
|
|
4004
|
+
this._height = height;
|
|
4005
|
+
this.api._onDidDimensionChange.fire({ width, height });
|
|
4006
|
+
if (this.part) {
|
|
4007
|
+
if (this._params) {
|
|
4008
|
+
this.part.update(this._params.params);
|
|
4068
4009
|
}
|
|
4069
4010
|
}
|
|
4070
|
-
(_a = this.view) === null || _a === void 0 ? void 0 : _a.update({
|
|
4071
|
-
params: {
|
|
4072
|
-
params: this._params,
|
|
4073
|
-
title: this.title,
|
|
4074
|
-
},
|
|
4075
|
-
});
|
|
4076
4011
|
}
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
this.
|
|
4080
|
-
this.api.group = group;
|
|
4081
|
-
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
4082
|
-
this.api._onDidActiveChange.fire({
|
|
4083
|
-
isActive: isGroupActive && isPanelVisible,
|
|
4084
|
-
});
|
|
4085
|
-
this.api._onDidVisibilityChange.fire({
|
|
4086
|
-
isVisible: isPanelVisible,
|
|
4087
|
-
});
|
|
4088
|
-
(_a = this.view) === null || _a === void 0 ? void 0 : _a.updateParentGroup(this._group, this._group.model.isPanelActive(this));
|
|
4012
|
+
init(parameters) {
|
|
4013
|
+
this._params = parameters;
|
|
4014
|
+
this.part = this.getComponent();
|
|
4089
4015
|
}
|
|
4090
|
-
|
|
4091
|
-
var _a;
|
|
4092
|
-
|
|
4093
|
-
this.
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
(_a = this.
|
|
4016
|
+
update(event) {
|
|
4017
|
+
var _a, _b;
|
|
4018
|
+
this._params = Object.assign(Object.assign({}, this._params), { params: Object.assign(Object.assign({}, (_a = this._params) === null || _a === void 0 ? void 0 : _a.params), event.params) });
|
|
4019
|
+
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this._params.params });
|
|
4020
|
+
}
|
|
4021
|
+
toJSON() {
|
|
4022
|
+
var _a, _b;
|
|
4023
|
+
const params = (_b = (_a = this._params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4024
|
+
return {
|
|
4025
|
+
id: this.id,
|
|
4026
|
+
component: this.component,
|
|
4027
|
+
params: Object.keys(params).length > 0 ? params : undefined,
|
|
4028
|
+
};
|
|
4098
4029
|
}
|
|
4099
4030
|
dispose() {
|
|
4100
4031
|
var _a;
|
|
4032
|
+
super.dispose();
|
|
4101
4033
|
this.api.dispose();
|
|
4102
|
-
this.
|
|
4103
|
-
(_a = this.view) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
4034
|
+
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
4104
4035
|
}
|
|
4105
4036
|
}
|
|
4106
4037
|
|
|
4107
|
-
class
|
|
4108
|
-
|
|
4109
|
-
|
|
4038
|
+
class PaneviewPanel extends BasePanelView {
|
|
4039
|
+
set orientation(value) {
|
|
4040
|
+
this._orientation = value;
|
|
4110
4041
|
}
|
|
4111
|
-
|
|
4112
|
-
this.
|
|
4113
|
-
this._element.className = 'actions-bar';
|
|
4114
|
-
this._list = document.createElement('ul');
|
|
4115
|
-
this._list.className = 'actions-container';
|
|
4116
|
-
this._element.appendChild(this._list);
|
|
4042
|
+
get orientation() {
|
|
4043
|
+
return this._orientation;
|
|
4117
4044
|
}
|
|
4118
|
-
|
|
4119
|
-
const
|
|
4120
|
-
|
|
4121
|
-
this.
|
|
4045
|
+
get minimumSize() {
|
|
4046
|
+
const headerSize = this.headerSize;
|
|
4047
|
+
const expanded = this.isExpanded();
|
|
4048
|
+
const minimumBodySize = expanded ? this._minimumBodySize : 0;
|
|
4049
|
+
return headerSize + minimumBodySize;
|
|
4122
4050
|
}
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
svg.setAttributeNS(null, 'width', params.width);
|
|
4129
|
-
svg.setAttributeNS(null, 'viewBox', params.viewbox);
|
|
4130
|
-
svg.setAttributeNS(null, 'aria-hidden', 'false');
|
|
4131
|
-
svg.setAttributeNS(null, 'focusable', 'false');
|
|
4132
|
-
svg.classList.add('dockview-svg');
|
|
4133
|
-
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
4134
|
-
path.setAttributeNS(null, 'd', params.path);
|
|
4135
|
-
svg.appendChild(path);
|
|
4136
|
-
return svg;
|
|
4137
|
-
};
|
|
4138
|
-
const createCloseButton = () => createSvgElementFromPath({
|
|
4139
|
-
width: '11',
|
|
4140
|
-
height: '11',
|
|
4141
|
-
viewbox: '0 0 28 28',
|
|
4142
|
-
path: 'M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z',
|
|
4143
|
-
});
|
|
4144
|
-
const createExpandMoreButton = () => createSvgElementFromPath({
|
|
4145
|
-
width: '11',
|
|
4146
|
-
height: '11',
|
|
4147
|
-
viewbox: '0 0 24 15',
|
|
4148
|
-
path: 'M12 14.15L0 2.15L2.15 0L12 9.9L21.85 0.0499992L24 2.2L12 14.15Z',
|
|
4149
|
-
});
|
|
4150
|
-
const createChevronRightButton = () => createSvgElementFromPath({
|
|
4151
|
-
width: '11',
|
|
4152
|
-
height: '11',
|
|
4153
|
-
viewbox: '0 0 15 25',
|
|
4154
|
-
path: 'M2.15 24.1L0 21.95L9.9 12.05L0 2.15L2.15 0L14.2 12.05L2.15 24.1Z',
|
|
4155
|
-
});
|
|
4156
|
-
|
|
4157
|
-
class Watermark extends CompositeDisposable {
|
|
4158
|
-
get id() {
|
|
4159
|
-
return 'watermark';
|
|
4051
|
+
get maximumSize() {
|
|
4052
|
+
const headerSize = this.headerSize;
|
|
4053
|
+
const expanded = this.isExpanded();
|
|
4054
|
+
const maximumBodySize = expanded ? this._maximumBodySize : 0;
|
|
4055
|
+
return headerSize + maximumBodySize;
|
|
4160
4056
|
}
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
this._element = document.createElement('div');
|
|
4164
|
-
this._element.className = 'watermark';
|
|
4165
|
-
const title = document.createElement('div');
|
|
4166
|
-
title.className = 'watermark-title';
|
|
4167
|
-
const emptySpace = document.createElement('span');
|
|
4168
|
-
emptySpace.style.flexGrow = '1';
|
|
4169
|
-
const content = document.createElement('div');
|
|
4170
|
-
content.className = 'watermark-content';
|
|
4171
|
-
this._element.appendChild(title);
|
|
4172
|
-
this._element.appendChild(content);
|
|
4173
|
-
const actions = new ActionContainer();
|
|
4174
|
-
title.appendChild(emptySpace);
|
|
4175
|
-
title.appendChild(actions.element);
|
|
4176
|
-
const closeAnchor = document.createElement('div');
|
|
4177
|
-
closeAnchor.className = 'close-action';
|
|
4178
|
-
closeAnchor.appendChild(createCloseButton());
|
|
4179
|
-
actions.add(closeAnchor);
|
|
4180
|
-
this.addDisposables(addDisposableListener(closeAnchor, 'click', (ev) => {
|
|
4181
|
-
var _a;
|
|
4182
|
-
ev.preventDefault();
|
|
4183
|
-
if (this.group) {
|
|
4184
|
-
(_a = this.params) === null || _a === void 0 ? void 0 : _a.containerApi.removeGroup(this.group);
|
|
4185
|
-
}
|
|
4186
|
-
}));
|
|
4057
|
+
get size() {
|
|
4058
|
+
return this._size;
|
|
4187
4059
|
}
|
|
4188
|
-
|
|
4189
|
-
|
|
4060
|
+
get orthogonalSize() {
|
|
4061
|
+
return this._orthogonalSize;
|
|
4190
4062
|
}
|
|
4191
|
-
|
|
4192
|
-
|
|
4063
|
+
set orthogonalSize(size) {
|
|
4064
|
+
this._orthogonalSize = size;
|
|
4193
4065
|
}
|
|
4194
|
-
|
|
4195
|
-
return
|
|
4066
|
+
get minimumBodySize() {
|
|
4067
|
+
return this._minimumBodySize;
|
|
4196
4068
|
}
|
|
4197
|
-
|
|
4198
|
-
|
|
4069
|
+
set minimumBodySize(value) {
|
|
4070
|
+
this._minimumBodySize = typeof value === 'number' ? value : 0;
|
|
4199
4071
|
}
|
|
4200
|
-
|
|
4201
|
-
this.
|
|
4202
|
-
this.addDisposables(this.params.containerApi.onDidLayoutChange(() => {
|
|
4203
|
-
this.render();
|
|
4204
|
-
}));
|
|
4205
|
-
this.render();
|
|
4072
|
+
get maximumBodySize() {
|
|
4073
|
+
return this._maximumBodySize;
|
|
4206
4074
|
}
|
|
4207
|
-
|
|
4208
|
-
this.
|
|
4209
|
-
|
|
4210
|
-
}
|
|
4211
|
-
get element() {
|
|
4212
|
-
return this._element;
|
|
4213
|
-
}
|
|
4214
|
-
render() {
|
|
4215
|
-
const isOneGroup = !!(this.params && this.params.containerApi.size <= 1);
|
|
4216
|
-
toggleClass(this.element, 'has-actions', isOneGroup);
|
|
4217
|
-
}
|
|
4218
|
-
dispose() {
|
|
4219
|
-
super.dispose();
|
|
4220
|
-
}
|
|
4221
|
-
}
|
|
4222
|
-
|
|
4223
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
4224
|
-
const Component = typeof componentName === 'string'
|
|
4225
|
-
? components[componentName]
|
|
4226
|
-
: undefined;
|
|
4227
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
4228
|
-
? frameworkComponents[componentName]
|
|
4229
|
-
: undefined;
|
|
4230
|
-
if (Component && FrameworkComponent) {
|
|
4231
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
4232
|
-
}
|
|
4233
|
-
if (FrameworkComponent) {
|
|
4234
|
-
if (!createFrameworkComponent) {
|
|
4235
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
4236
|
-
}
|
|
4237
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
4238
|
-
}
|
|
4239
|
-
if (!Component) {
|
|
4240
|
-
if (fallback) {
|
|
4241
|
-
return fallback();
|
|
4242
|
-
}
|
|
4243
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
4075
|
+
set maximumBodySize(value) {
|
|
4076
|
+
this._maximumBodySize =
|
|
4077
|
+
typeof value === 'number' ? value : Number.POSITIVE_INFINITY;
|
|
4244
4078
|
}
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
const DEFAULT_TAB_IDENTIFIER = '__default__tab__';
|
|
4249
|
-
class DefaultTab extends CompositeDisposable {
|
|
4250
|
-
get element() {
|
|
4251
|
-
return this._element;
|
|
4079
|
+
get headerVisible() {
|
|
4080
|
+
return this._headerVisible;
|
|
4252
4081
|
}
|
|
4253
|
-
|
|
4254
|
-
|
|
4082
|
+
set headerVisible(value) {
|
|
4083
|
+
this._headerVisible = value;
|
|
4084
|
+
this.header.style.display = value ? '' : 'none';
|
|
4255
4085
|
}
|
|
4256
|
-
constructor() {
|
|
4257
|
-
super();
|
|
4258
|
-
this.
|
|
4259
|
-
this.
|
|
4260
|
-
|
|
4261
|
-
this.
|
|
4262
|
-
this.
|
|
4263
|
-
this.
|
|
4264
|
-
|
|
4265
|
-
this.
|
|
4266
|
-
this.
|
|
4267
|
-
|
|
4268
|
-
this.
|
|
4269
|
-
this.
|
|
4270
|
-
//
|
|
4271
|
-
this.
|
|
4272
|
-
this.
|
|
4273
|
-
|
|
4274
|
-
this.
|
|
4275
|
-
this.
|
|
4276
|
-
this.
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
this.
|
|
4280
|
-
|
|
4281
|
-
this.
|
|
4282
|
-
|
|
4283
|
-
this.addDisposables(addDisposableListener(this._actionContainer, 'mousedown', (ev) => {
|
|
4284
|
-
ev.preventDefault();
|
|
4086
|
+
constructor(id, component, headerComponent, orientation, isExpanded, isHeaderVisible) {
|
|
4087
|
+
super(id, component, new PaneviewPanelApiImpl(id));
|
|
4088
|
+
this.headerComponent = headerComponent;
|
|
4089
|
+
this._onDidChangeExpansionState = new Emitter({ replay: true });
|
|
4090
|
+
this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
|
|
4091
|
+
this._onDidChange = new Emitter();
|
|
4092
|
+
this.onDidChange = this._onDidChange.event;
|
|
4093
|
+
this.headerSize = 22;
|
|
4094
|
+
this._orthogonalSize = 0;
|
|
4095
|
+
this._size = 0;
|
|
4096
|
+
this._minimumBodySize = 100;
|
|
4097
|
+
this._maximumBodySize = Number.POSITIVE_INFINITY;
|
|
4098
|
+
this._isExpanded = false;
|
|
4099
|
+
this.expandedSize = 0;
|
|
4100
|
+
this.api.pane = this; // TODO cannot use 'this' before 'super'
|
|
4101
|
+
this.api.initialize(this);
|
|
4102
|
+
this._isExpanded = isExpanded;
|
|
4103
|
+
this._headerVisible = isHeaderVisible;
|
|
4104
|
+
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
4105
|
+
this._orientation = orientation;
|
|
4106
|
+
this.element.classList.add('pane');
|
|
4107
|
+
this.addDisposables(this.api.onDidSizeChange((event) => {
|
|
4108
|
+
this._onDidChange.fire({ size: event.size });
|
|
4109
|
+
}), addDisposableListener(this.element, 'mouseenter', (ev) => {
|
|
4110
|
+
this.api._onMouseEnter.fire(ev);
|
|
4111
|
+
}), addDisposableListener(this.element, 'mouseleave', (ev) => {
|
|
4112
|
+
this.api._onMouseLeave.fire(ev);
|
|
4285
4113
|
}));
|
|
4286
|
-
this.
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
this.
|
|
4114
|
+
this.addDisposables(this._onDidChangeExpansionState, this.onDidChangeExpansionState((isPanelExpanded) => {
|
|
4115
|
+
this.api._onDidExpansionChange.fire({
|
|
4116
|
+
isExpanded: isPanelExpanded,
|
|
4117
|
+
});
|
|
4118
|
+
}), this.api.onDidFocusChange((e) => {
|
|
4119
|
+
if (!this.header) {
|
|
4120
|
+
return;
|
|
4121
|
+
}
|
|
4122
|
+
if (e.isFocused) {
|
|
4123
|
+
addClasses(this.header, 'focused');
|
|
4124
|
+
}
|
|
4125
|
+
else {
|
|
4126
|
+
removeClasses(this.header, 'focused');
|
|
4127
|
+
}
|
|
4128
|
+
}));
|
|
4129
|
+
this.renderOnce();
|
|
4291
4130
|
}
|
|
4292
|
-
|
|
4293
|
-
|
|
4131
|
+
setVisible(isVisible) {
|
|
4132
|
+
this.api._onDidVisibilityChange.fire({ isVisible });
|
|
4294
4133
|
}
|
|
4295
|
-
|
|
4296
|
-
|
|
4134
|
+
setActive(isActive) {
|
|
4135
|
+
this.api._onDidActiveChange.fire({ isActive });
|
|
4297
4136
|
}
|
|
4298
|
-
|
|
4299
|
-
this.
|
|
4300
|
-
this._content.textContent = params.title;
|
|
4301
|
-
addDisposableListener(this.action, 'click', (ev) => {
|
|
4302
|
-
ev.preventDefault(); //
|
|
4303
|
-
this.params.api.close();
|
|
4304
|
-
});
|
|
4137
|
+
isExpanded() {
|
|
4138
|
+
return this._isExpanded;
|
|
4305
4139
|
}
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
this.
|
|
4311
|
-
if (
|
|
4312
|
-
this.
|
|
4140
|
+
setExpanded(expanded) {
|
|
4141
|
+
if (this._isExpanded === expanded) {
|
|
4142
|
+
return;
|
|
4143
|
+
}
|
|
4144
|
+
this._isExpanded = expanded;
|
|
4145
|
+
if (expanded) {
|
|
4146
|
+
if (this.animationTimer) {
|
|
4147
|
+
clearTimeout(this.animationTimer);
|
|
4148
|
+
}
|
|
4149
|
+
if (this.body) {
|
|
4150
|
+
this.element.appendChild(this.body);
|
|
4151
|
+
}
|
|
4313
4152
|
}
|
|
4153
|
+
else {
|
|
4154
|
+
this.animationTimer = setTimeout(() => {
|
|
4155
|
+
var _a;
|
|
4156
|
+
(_a = this.body) === null || _a === void 0 ? void 0 : _a.remove();
|
|
4157
|
+
}, 200);
|
|
4158
|
+
}
|
|
4159
|
+
this._onDidChange.fire(expanded ? { size: this.width } : {});
|
|
4160
|
+
this._onDidChangeExpansionState.fire(expanded);
|
|
4314
4161
|
}
|
|
4315
|
-
layout(
|
|
4316
|
-
|
|
4162
|
+
layout(size, orthogonalSize) {
|
|
4163
|
+
this._size = size;
|
|
4164
|
+
this._orthogonalSize = orthogonalSize;
|
|
4165
|
+
const [width, height] = this.orientation === exports.Orientation.HORIZONTAL
|
|
4166
|
+
? [size, orthogonalSize]
|
|
4167
|
+
: [orthogonalSize, size];
|
|
4168
|
+
if (this.isExpanded()) {
|
|
4169
|
+
this.expandedSize = width;
|
|
4170
|
+
}
|
|
4171
|
+
super.layout(width, height);
|
|
4317
4172
|
}
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4173
|
+
init(parameters) {
|
|
4174
|
+
var _a, _b;
|
|
4175
|
+
super.init(parameters);
|
|
4176
|
+
if (typeof parameters.minimumBodySize === 'number') {
|
|
4177
|
+
this.minimumBodySize = parameters.minimumBodySize;
|
|
4178
|
+
}
|
|
4179
|
+
if (typeof parameters.maximumBodySize === 'number') {
|
|
4180
|
+
this.maximumBodySize = parameters.maximumBodySize;
|
|
4181
|
+
}
|
|
4182
|
+
this.bodyPart = this.getBodyComponent();
|
|
4183
|
+
this.headerPart = this.getHeaderComponent();
|
|
4184
|
+
this.bodyPart.init(Object.assign(Object.assign({}, parameters), { api: this.api }));
|
|
4185
|
+
this.headerPart.init(Object.assign(Object.assign({}, parameters), { api: this.api }));
|
|
4186
|
+
(_a = this.body) === null || _a === void 0 ? void 0 : _a.append(this.bodyPart.element);
|
|
4187
|
+
(_b = this.header) === null || _b === void 0 ? void 0 : _b.append(this.headerPart.element);
|
|
4188
|
+
if (typeof parameters.isExpanded === 'boolean') {
|
|
4189
|
+
this.setExpanded(parameters.isExpanded);
|
|
4321
4190
|
}
|
|
4322
4191
|
}
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
get element() {
|
|
4327
|
-
return this._element;
|
|
4192
|
+
toJSON() {
|
|
4193
|
+
const params = this._params;
|
|
4194
|
+
return Object.assign(Object.assign({}, super.toJSON()), { headerComponent: this.headerComponent, title: params.title });
|
|
4328
4195
|
}
|
|
4329
|
-
|
|
4330
|
-
|
|
4196
|
+
renderOnce() {
|
|
4197
|
+
this.header = document.createElement('div');
|
|
4198
|
+
this.header.tabIndex = 0;
|
|
4199
|
+
this.header.className = 'pane-header';
|
|
4200
|
+
this.header.style.height = `${this.headerSize}px`;
|
|
4201
|
+
this.header.style.lineHeight = `${this.headerSize}px`;
|
|
4202
|
+
this.header.style.minHeight = `${this.headerSize}px`;
|
|
4203
|
+
this.header.style.maxHeight = `${this.headerSize}px`;
|
|
4204
|
+
this.element.appendChild(this.header);
|
|
4205
|
+
this.body = document.createElement('div');
|
|
4206
|
+
this.body.className = 'pane-body';
|
|
4207
|
+
this.element.appendChild(this.body);
|
|
4331
4208
|
}
|
|
4332
|
-
|
|
4333
|
-
|
|
4209
|
+
// TODO slightly hacky by-pass of the component to create a body and header component
|
|
4210
|
+
getComponent() {
|
|
4211
|
+
return {
|
|
4212
|
+
update: (params) => {
|
|
4213
|
+
var _a, _b;
|
|
4214
|
+
(_a = this.bodyPart) === null || _a === void 0 ? void 0 : _a.update({ params });
|
|
4215
|
+
(_b = this.headerPart) === null || _b === void 0 ? void 0 : _b.update({ params });
|
|
4216
|
+
},
|
|
4217
|
+
dispose: () => {
|
|
4218
|
+
var _a, _b;
|
|
4219
|
+
(_a = this.bodyPart) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
4220
|
+
(_b = this.headerPart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
4221
|
+
},
|
|
4222
|
+
};
|
|
4334
4223
|
}
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4224
|
+
}
|
|
4225
|
+
|
|
4226
|
+
class DraggablePaneviewPanel extends PaneviewPanel {
|
|
4227
|
+
constructor(accessor, id, component, headerComponent, orientation, isExpanded, disableDnd) {
|
|
4228
|
+
super(id, component, headerComponent, orientation, isExpanded, true);
|
|
4229
|
+
this.accessor = accessor;
|
|
4230
|
+
this._onDidDrop = new Emitter();
|
|
4231
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
4232
|
+
if (!disableDnd) {
|
|
4233
|
+
this.initDragFeatures();
|
|
4234
|
+
}
|
|
4338
4235
|
}
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
this.
|
|
4346
|
-
this.
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
})
|
|
4356
|
-
|
|
4236
|
+
initDragFeatures() {
|
|
4237
|
+
if (!this.header) {
|
|
4238
|
+
return;
|
|
4239
|
+
}
|
|
4240
|
+
const id = this.id;
|
|
4241
|
+
const accessorId = this.accessor.id;
|
|
4242
|
+
this.header.draggable = true;
|
|
4243
|
+
this.handler = new (class PaneDragHandler extends DragHandler {
|
|
4244
|
+
getData() {
|
|
4245
|
+
LocalSelectionTransfer.getInstance().setData([new PaneTransfer(accessorId, id)], PaneTransfer.prototype);
|
|
4246
|
+
return {
|
|
4247
|
+
dispose: () => {
|
|
4248
|
+
LocalSelectionTransfer.getInstance().clearData(PaneTransfer.prototype);
|
|
4249
|
+
},
|
|
4250
|
+
};
|
|
4251
|
+
}
|
|
4252
|
+
})(this.header);
|
|
4253
|
+
this.target = new Droptarget(this.element, {
|
|
4254
|
+
acceptedTargetZones: ['top', 'bottom'],
|
|
4255
|
+
overlayModel: {
|
|
4256
|
+
activationSize: { type: 'percentage', value: 50 },
|
|
4257
|
+
},
|
|
4258
|
+
canDisplayOverlay: (event) => {
|
|
4259
|
+
const data = getPaneData();
|
|
4260
|
+
if (data) {
|
|
4261
|
+
if (data.paneId !== this.id &&
|
|
4262
|
+
data.viewId === this.accessor.id) {
|
|
4263
|
+
return true;
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
if (this.accessor.options.showDndOverlay) {
|
|
4267
|
+
return this.accessor.options.showDndOverlay({
|
|
4268
|
+
nativeEvent: event,
|
|
4269
|
+
getData: getPaneData,
|
|
4270
|
+
panel: this,
|
|
4271
|
+
});
|
|
4272
|
+
}
|
|
4273
|
+
return false;
|
|
4274
|
+
},
|
|
4275
|
+
});
|
|
4276
|
+
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
4277
|
+
this.onDrop(event);
|
|
4357
4278
|
}));
|
|
4358
4279
|
}
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4280
|
+
onDrop(event) {
|
|
4281
|
+
const data = getPaneData();
|
|
4282
|
+
if (!data || data.viewId !== this.accessor.id) {
|
|
4283
|
+
// if there is no local drag event for this panel
|
|
4284
|
+
// or if the drag event was creating by another Paneview instance
|
|
4285
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, api: new PaneviewApi(this.accessor), getData: getPaneData }));
|
|
4286
|
+
return;
|
|
4287
|
+
}
|
|
4288
|
+
const containerApi = this._params
|
|
4289
|
+
.containerApi;
|
|
4290
|
+
const panelId = data.paneId;
|
|
4291
|
+
const existingPanel = containerApi.getPanel(panelId);
|
|
4292
|
+
if (!existingPanel) {
|
|
4293
|
+
// if the panel doesn't exist
|
|
4294
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: getPaneData, api: new PaneviewApi(this.accessor) }));
|
|
4295
|
+
return;
|
|
4296
|
+
}
|
|
4297
|
+
const allPanels = containerApi.panels;
|
|
4298
|
+
const fromIndex = allPanels.indexOf(existingPanel);
|
|
4299
|
+
let toIndex = containerApi.panels.indexOf(this);
|
|
4300
|
+
if (event.position === 'left' || event.position === 'top') {
|
|
4301
|
+
toIndex = Math.max(0, toIndex - 1);
|
|
4302
|
+
}
|
|
4303
|
+
if (event.position === 'right' || event.position === 'bottom') {
|
|
4304
|
+
if (fromIndex > toIndex) {
|
|
4305
|
+
toIndex++;
|
|
4369
4306
|
}
|
|
4307
|
+
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
4370
4308
|
}
|
|
4309
|
+
containerApi.movePanel(fromIndex, toIndex);
|
|
4371
4310
|
}
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
this.
|
|
4379
|
-
|
|
4311
|
+
}
|
|
4312
|
+
|
|
4313
|
+
class GridviewPanelApiImpl extends PanelApiImpl {
|
|
4314
|
+
constructor(id, panel) {
|
|
4315
|
+
super(id);
|
|
4316
|
+
this._onDidConstraintsChangeInternal = new Emitter();
|
|
4317
|
+
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
4318
|
+
this._onDidConstraintsChange = new Emitter({
|
|
4319
|
+
replay: true,
|
|
4320
|
+
});
|
|
4321
|
+
this.onDidConstraintsChange = this._onDidConstraintsChange.event;
|
|
4322
|
+
this._onDidSizeChange = new Emitter();
|
|
4323
|
+
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
4324
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
4325
|
+
if (panel) {
|
|
4326
|
+
this.initialize(panel);
|
|
4327
|
+
}
|
|
4380
4328
|
}
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
const params = (_b = (_a = this._params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4384
|
-
return {
|
|
4385
|
-
id: this.id,
|
|
4386
|
-
component: this.component,
|
|
4387
|
-
params: Object.keys(params).length > 0 ? params : undefined,
|
|
4388
|
-
};
|
|
4329
|
+
setConstraints(value) {
|
|
4330
|
+
this._onDidConstraintsChangeInternal.fire(value);
|
|
4389
4331
|
}
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
super.dispose();
|
|
4393
|
-
this.api.dispose();
|
|
4394
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
4332
|
+
setSize(event) {
|
|
4333
|
+
this._onDidSizeChange.fire(event);
|
|
4395
4334
|
}
|
|
4396
4335
|
}
|
|
4397
4336
|
|
|
@@ -4445,8 +4384,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4445
4384
|
get isActive() {
|
|
4446
4385
|
return this.api.isActive;
|
|
4447
4386
|
}
|
|
4448
|
-
constructor(id, component,
|
|
4449
|
-
super(id, component,
|
|
4387
|
+
constructor(id, component, options) {
|
|
4388
|
+
super(id, component, new GridviewPanelApiImpl(id));
|
|
4450
4389
|
this._evaluatedMinimumWidth = 0;
|
|
4451
4390
|
this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
|
|
4452
4391
|
this._evaluatedMinimumHeight = 0;
|
|
@@ -4458,6 +4397,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4458
4397
|
this._snap = false;
|
|
4459
4398
|
this._onDidChange = new Emitter();
|
|
4460
4399
|
this.onDidChange = this._onDidChange.event;
|
|
4400
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.minimumWidth) === 'number') {
|
|
4401
|
+
this._minimumWidth = options.minimumWidth;
|
|
4402
|
+
}
|
|
4403
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.maximumWidth) === 'number') {
|
|
4404
|
+
this._maximumWidth = options.maximumWidth;
|
|
4405
|
+
}
|
|
4406
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.minimumHeight) === 'number') {
|
|
4407
|
+
this._minimumHeight = options.minimumHeight;
|
|
4408
|
+
}
|
|
4409
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.maximumHeight) === 'number') {
|
|
4410
|
+
this._maximumHeight = options.maximumHeight;
|
|
4411
|
+
}
|
|
4461
4412
|
this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
|
|
4462
4413
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4463
4414
|
const { isVisible } = event;
|
|
@@ -4496,142 +4447,518 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4496
4447
|
setActive(isActive) {
|
|
4497
4448
|
this.api._onDidActiveChange.fire({ isActive });
|
|
4498
4449
|
}
|
|
4499
|
-
init(parameters) {
|
|
4500
|
-
if (parameters.maximumHeight) {
|
|
4501
|
-
this._maximumHeight = parameters.maximumHeight;
|
|
4502
|
-
}
|
|
4503
|
-
if (parameters.minimumHeight) {
|
|
4504
|
-
this._minimumHeight = parameters.minimumHeight;
|
|
4505
|
-
}
|
|
4506
|
-
if (parameters.maximumWidth) {
|
|
4507
|
-
this._maximumWidth = parameters.maximumWidth;
|
|
4508
|
-
}
|
|
4509
|
-
if (parameters.minimumWidth) {
|
|
4510
|
-
this._minimumWidth = parameters.minimumWidth;
|
|
4450
|
+
init(parameters) {
|
|
4451
|
+
if (parameters.maximumHeight) {
|
|
4452
|
+
this._maximumHeight = parameters.maximumHeight;
|
|
4453
|
+
}
|
|
4454
|
+
if (parameters.minimumHeight) {
|
|
4455
|
+
this._minimumHeight = parameters.minimumHeight;
|
|
4456
|
+
}
|
|
4457
|
+
if (parameters.maximumWidth) {
|
|
4458
|
+
this._maximumWidth = parameters.maximumWidth;
|
|
4459
|
+
}
|
|
4460
|
+
if (parameters.minimumWidth) {
|
|
4461
|
+
this._minimumWidth = parameters.minimumWidth;
|
|
4462
|
+
}
|
|
4463
|
+
this._priority = parameters.priority;
|
|
4464
|
+
this._snap = !!parameters.snap;
|
|
4465
|
+
super.init(parameters);
|
|
4466
|
+
if (typeof parameters.isVisible === 'boolean') {
|
|
4467
|
+
this.setVisible(parameters.isVisible);
|
|
4468
|
+
}
|
|
4469
|
+
}
|
|
4470
|
+
updateConstraints() {
|
|
4471
|
+
this.api._onDidConstraintsChange.fire({
|
|
4472
|
+
minimumWidth: this._evaluatedMinimumWidth,
|
|
4473
|
+
maximumWidth: this._evaluatedMaximumWidth,
|
|
4474
|
+
minimumHeight: this._evaluatedMinimumHeight,
|
|
4475
|
+
maximumHeight: this._evaluatedMaximumHeight,
|
|
4476
|
+
});
|
|
4477
|
+
}
|
|
4478
|
+
toJSON() {
|
|
4479
|
+
const state = super.toJSON();
|
|
4480
|
+
const maximum = (value) => value === Number.MAX_SAFE_INTEGER ? undefined : value;
|
|
4481
|
+
const minimum = (value) => (value <= 0 ? undefined : value);
|
|
4482
|
+
return Object.assign(Object.assign({}, state), { minimumHeight: minimum(this.minimumHeight), maximumHeight: maximum(this.maximumHeight), minimumWidth: minimum(this.minimumWidth), maximumWidth: maximum(this.maximumWidth), snap: this.snap, priority: this.priority });
|
|
4483
|
+
}
|
|
4484
|
+
}
|
|
4485
|
+
|
|
4486
|
+
class DockviewGroupPanel extends GridviewPanel {
|
|
4487
|
+
get panels() {
|
|
4488
|
+
return this._model.panels;
|
|
4489
|
+
}
|
|
4490
|
+
get activePanel() {
|
|
4491
|
+
return this._model.activePanel;
|
|
4492
|
+
}
|
|
4493
|
+
get size() {
|
|
4494
|
+
return this._model.size;
|
|
4495
|
+
}
|
|
4496
|
+
get model() {
|
|
4497
|
+
return this._model;
|
|
4498
|
+
}
|
|
4499
|
+
get locked() {
|
|
4500
|
+
return this._model.locked;
|
|
4501
|
+
}
|
|
4502
|
+
set locked(value) {
|
|
4503
|
+
this._model.locked = value;
|
|
4504
|
+
}
|
|
4505
|
+
get header() {
|
|
4506
|
+
return this._model.header;
|
|
4507
|
+
}
|
|
4508
|
+
constructor(accessor, id, options) {
|
|
4509
|
+
super(id, 'groupview_default', {
|
|
4510
|
+
minimumHeight: 100,
|
|
4511
|
+
minimumWidth: 100,
|
|
4512
|
+
});
|
|
4513
|
+
this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
|
|
4514
|
+
}
|
|
4515
|
+
initialize() {
|
|
4516
|
+
this._model.initialize();
|
|
4517
|
+
}
|
|
4518
|
+
setActive(isActive) {
|
|
4519
|
+
super.setActive(isActive);
|
|
4520
|
+
this.model.setActive(isActive);
|
|
4521
|
+
}
|
|
4522
|
+
layout(width, height) {
|
|
4523
|
+
super.layout(width, height);
|
|
4524
|
+
this.model.layout(width, height);
|
|
4525
|
+
}
|
|
4526
|
+
getComponent() {
|
|
4527
|
+
return this._model;
|
|
4528
|
+
}
|
|
4529
|
+
toJSON() {
|
|
4530
|
+
// TODO fix typing
|
|
4531
|
+
return this.model.toJSON();
|
|
4532
|
+
}
|
|
4533
|
+
}
|
|
4534
|
+
|
|
4535
|
+
function isPanelOptionsWithPanel(data) {
|
|
4536
|
+
if (data.referencePanel) {
|
|
4537
|
+
return true;
|
|
4538
|
+
}
|
|
4539
|
+
return false;
|
|
4540
|
+
}
|
|
4541
|
+
function isPanelOptionsWithGroup(data) {
|
|
4542
|
+
if (data.referenceGroup) {
|
|
4543
|
+
return true;
|
|
4544
|
+
}
|
|
4545
|
+
return false;
|
|
4546
|
+
}
|
|
4547
|
+
function isGroupOptionsWithPanel(data) {
|
|
4548
|
+
if (data.referencePanel) {
|
|
4549
|
+
return true;
|
|
4550
|
+
}
|
|
4551
|
+
return false;
|
|
4552
|
+
}
|
|
4553
|
+
function isGroupOptionsWithGroup(data) {
|
|
4554
|
+
if (data.referenceGroup) {
|
|
4555
|
+
return true;
|
|
4556
|
+
}
|
|
4557
|
+
return false;
|
|
4558
|
+
}
|
|
4559
|
+
|
|
4560
|
+
class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
4561
|
+
get title() {
|
|
4562
|
+
return this.panel.title;
|
|
4563
|
+
}
|
|
4564
|
+
get isGroupActive() {
|
|
4565
|
+
var _a;
|
|
4566
|
+
return !!((_a = this.group) === null || _a === void 0 ? void 0 : _a.isActive);
|
|
4567
|
+
}
|
|
4568
|
+
set group(value) {
|
|
4569
|
+
const isOldGroupActive = this.isGroupActive;
|
|
4570
|
+
this._group = value;
|
|
4571
|
+
this._onDidGroupChange.fire();
|
|
4572
|
+
if (this._group) {
|
|
4573
|
+
this.disposable.value = this._group.api.onDidActiveChange(() => {
|
|
4574
|
+
this._onDidActiveGroupChange.fire();
|
|
4575
|
+
});
|
|
4576
|
+
if (this.isGroupActive !== isOldGroupActive) {
|
|
4577
|
+
this._onDidActiveGroupChange.fire();
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
}
|
|
4581
|
+
get group() {
|
|
4582
|
+
return this._group;
|
|
4583
|
+
}
|
|
4584
|
+
constructor(panel, group) {
|
|
4585
|
+
super(panel.id);
|
|
4586
|
+
this.panel = panel;
|
|
4587
|
+
this._onDidTitleChange = new Emitter();
|
|
4588
|
+
this.onDidTitleChange = this._onDidTitleChange.event;
|
|
4589
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
4590
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
4591
|
+
this._onDidGroupChange = new Emitter();
|
|
4592
|
+
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
4593
|
+
this.disposable = new MutableDisposable();
|
|
4594
|
+
this.initialize(panel);
|
|
4595
|
+
this._group = group;
|
|
4596
|
+
this.addDisposables(this.disposable, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange);
|
|
4597
|
+
}
|
|
4598
|
+
setTitle(title) {
|
|
4599
|
+
this.panel.update({ params: { title } });
|
|
4600
|
+
}
|
|
4601
|
+
close() {
|
|
4602
|
+
this.group.model.closePanel(this.panel);
|
|
4603
|
+
}
|
|
4604
|
+
}
|
|
4605
|
+
|
|
4606
|
+
class DockviewPanel extends CompositeDisposable {
|
|
4607
|
+
get params() {
|
|
4608
|
+
return this._params;
|
|
4609
|
+
}
|
|
4610
|
+
get title() {
|
|
4611
|
+
return this._title;
|
|
4612
|
+
}
|
|
4613
|
+
get group() {
|
|
4614
|
+
return this._group;
|
|
4615
|
+
}
|
|
4616
|
+
constructor(id, accessor, containerApi, group, view) {
|
|
4617
|
+
super();
|
|
4618
|
+
this.id = id;
|
|
4619
|
+
this.containerApi = containerApi;
|
|
4620
|
+
this.view = view;
|
|
4621
|
+
this._title = '';
|
|
4622
|
+
this._group = group;
|
|
4623
|
+
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
4624
|
+
this.addDisposables(this.api.onActiveChange(() => {
|
|
4625
|
+
accessor.setActivePanel(this);
|
|
4626
|
+
}), this.api.onDidSizeChange((event) => {
|
|
4627
|
+
// forward the resize event to the group since if you want to resize a panel
|
|
4628
|
+
// you are actually just resizing the panels parent which is the group
|
|
4629
|
+
this.group.api.setSize(event);
|
|
4630
|
+
}));
|
|
4631
|
+
}
|
|
4632
|
+
init(params) {
|
|
4633
|
+
var _a;
|
|
4634
|
+
this._params = params.params;
|
|
4635
|
+
this.setTitle(params.title);
|
|
4636
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
4637
|
+
}
|
|
4638
|
+
focus() {
|
|
4639
|
+
this.api._onFocusEvent.fire();
|
|
4640
|
+
}
|
|
4641
|
+
toJSON() {
|
|
4642
|
+
return {
|
|
4643
|
+
id: this.id,
|
|
4644
|
+
contentComponent: this.view.contentComponent,
|
|
4645
|
+
tabComponent: this.view.tabComponent,
|
|
4646
|
+
params: Object.keys(this._params || {}).length > 0
|
|
4647
|
+
? this._params
|
|
4648
|
+
: undefined,
|
|
4649
|
+
title: this.title,
|
|
4650
|
+
};
|
|
4651
|
+
}
|
|
4652
|
+
setTitle(title) {
|
|
4653
|
+
var _a, _b;
|
|
4654
|
+
const didTitleChange = title !== ((_a = this._params) === null || _a === void 0 ? void 0 : _a.title);
|
|
4655
|
+
if (didTitleChange) {
|
|
4656
|
+
this._title = title;
|
|
4657
|
+
(_b = this.view) === null || _b === void 0 ? void 0 : _b.update({
|
|
4658
|
+
params: {
|
|
4659
|
+
params: this._params,
|
|
4660
|
+
title: this.title,
|
|
4661
|
+
},
|
|
4662
|
+
});
|
|
4663
|
+
this.api._onDidTitleChange.fire({ title });
|
|
4511
4664
|
}
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4665
|
+
}
|
|
4666
|
+
update(event) {
|
|
4667
|
+
var _a;
|
|
4668
|
+
const params = event.params;
|
|
4669
|
+
this._params = Object.assign(Object.assign({}, (this._params || {})), event.params.params);
|
|
4670
|
+
if (params.title !== this.title) {
|
|
4671
|
+
this._title = params.title;
|
|
4672
|
+
this.api._onDidTitleChange.fire({ title: this.title });
|
|
4517
4673
|
}
|
|
4674
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.update({
|
|
4675
|
+
params: {
|
|
4676
|
+
params: this._params,
|
|
4677
|
+
title: this.title,
|
|
4678
|
+
},
|
|
4679
|
+
});
|
|
4518
4680
|
}
|
|
4519
|
-
|
|
4520
|
-
this.
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4681
|
+
updateParentGroup(group, isGroupActive) {
|
|
4682
|
+
this._group = group;
|
|
4683
|
+
this.api.group = group;
|
|
4684
|
+
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
4685
|
+
this.api._onDidActiveChange.fire({
|
|
4686
|
+
isActive: isGroupActive && isPanelVisible,
|
|
4687
|
+
});
|
|
4688
|
+
this.api._onDidVisibilityChange.fire({
|
|
4689
|
+
isVisible: isPanelVisible,
|
|
4525
4690
|
});
|
|
4691
|
+
this.view.updateParentGroup(this._group, this._group.model.isPanelActive(this));
|
|
4526
4692
|
}
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4693
|
+
layout(width, height) {
|
|
4694
|
+
var _a;
|
|
4695
|
+
// the obtain the correct dimensions of the content panel we must deduct the tab height
|
|
4696
|
+
this.api._onDidDimensionChange.fire({
|
|
4697
|
+
width,
|
|
4698
|
+
height: height - (this.group.model.header.height || 0),
|
|
4699
|
+
});
|
|
4700
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.layout(width, height);
|
|
4701
|
+
}
|
|
4702
|
+
dispose() {
|
|
4703
|
+
var _a;
|
|
4704
|
+
this.api.dispose();
|
|
4705
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
4532
4706
|
}
|
|
4533
4707
|
}
|
|
4534
4708
|
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4709
|
+
const createSvgElementFromPath = (params) => {
|
|
4710
|
+
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
4711
|
+
svg.setAttributeNS(null, 'height', params.height);
|
|
4712
|
+
svg.setAttributeNS(null, 'width', params.width);
|
|
4713
|
+
svg.setAttributeNS(null, 'viewBox', params.viewbox);
|
|
4714
|
+
svg.setAttributeNS(null, 'aria-hidden', 'false');
|
|
4715
|
+
svg.setAttributeNS(null, 'focusable', 'false');
|
|
4716
|
+
svg.classList.add('dockview-svg');
|
|
4717
|
+
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
4718
|
+
path.setAttributeNS(null, 'd', params.path);
|
|
4719
|
+
svg.appendChild(path);
|
|
4720
|
+
return svg;
|
|
4721
|
+
};
|
|
4722
|
+
const createCloseButton = () => createSvgElementFromPath({
|
|
4723
|
+
width: '11',
|
|
4724
|
+
height: '11',
|
|
4725
|
+
viewbox: '0 0 28 28',
|
|
4726
|
+
path: 'M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z',
|
|
4727
|
+
});
|
|
4728
|
+
const createExpandMoreButton = () => createSvgElementFromPath({
|
|
4729
|
+
width: '11',
|
|
4730
|
+
height: '11',
|
|
4731
|
+
viewbox: '0 0 24 15',
|
|
4732
|
+
path: 'M12 14.15L0 2.15L2.15 0L12 9.9L21.85 0.0499992L24 2.2L12 14.15Z',
|
|
4733
|
+
});
|
|
4734
|
+
const createChevronRightButton = () => createSvgElementFromPath({
|
|
4735
|
+
width: '11',
|
|
4736
|
+
height: '11',
|
|
4737
|
+
viewbox: '0 0 15 25',
|
|
4738
|
+
path: 'M2.15 24.1L0 21.95L9.9 12.05L0 2.15L2.15 0L14.2 12.05L2.15 24.1Z',
|
|
4739
|
+
});
|
|
4740
|
+
|
|
4741
|
+
class DefaultTab extends CompositeDisposable {
|
|
4742
|
+
get element() {
|
|
4743
|
+
return this._element;
|
|
4540
4744
|
}
|
|
4541
|
-
|
|
4542
|
-
|
|
4745
|
+
constructor() {
|
|
4746
|
+
super();
|
|
4747
|
+
//
|
|
4748
|
+
this.params = {};
|
|
4749
|
+
this._element = document.createElement('div');
|
|
4750
|
+
this._element.className = 'default-tab';
|
|
4751
|
+
//
|
|
4752
|
+
this._content = document.createElement('div');
|
|
4753
|
+
this._content.className = 'tab-content';
|
|
4754
|
+
//
|
|
4755
|
+
this._actionContainer = document.createElement('div');
|
|
4756
|
+
this._actionContainer.className = 'action-container';
|
|
4757
|
+
//
|
|
4758
|
+
this._list = document.createElement('ul');
|
|
4759
|
+
this._list.className = 'tab-list';
|
|
4760
|
+
//
|
|
4761
|
+
this.action = document.createElement('div');
|
|
4762
|
+
this.action.className = 'tab-action';
|
|
4763
|
+
this.action.appendChild(createCloseButton());
|
|
4764
|
+
//
|
|
4765
|
+
this._element.appendChild(this._content);
|
|
4766
|
+
this._element.appendChild(this._actionContainer);
|
|
4767
|
+
this._actionContainer.appendChild(this._list);
|
|
4768
|
+
this._list.appendChild(this.action);
|
|
4769
|
+
//
|
|
4770
|
+
this.addDisposables(addDisposableListener(this._actionContainer, 'mousedown', (ev) => {
|
|
4771
|
+
ev.preventDefault();
|
|
4772
|
+
}));
|
|
4773
|
+
this.render();
|
|
4543
4774
|
}
|
|
4544
|
-
|
|
4545
|
-
|
|
4775
|
+
update(event) {
|
|
4776
|
+
this.params = Object.assign(Object.assign({}, this.params), event.params);
|
|
4777
|
+
this.render();
|
|
4546
4778
|
}
|
|
4547
|
-
|
|
4548
|
-
|
|
4779
|
+
focus() {
|
|
4780
|
+
//noop
|
|
4549
4781
|
}
|
|
4550
|
-
|
|
4551
|
-
|
|
4782
|
+
init(params) {
|
|
4783
|
+
this.params = params;
|
|
4784
|
+
this._content.textContent = params.title;
|
|
4785
|
+
addDisposableListener(this.action, 'click', (ev) => {
|
|
4786
|
+
ev.preventDefault(); //
|
|
4787
|
+
this.params.api.close();
|
|
4788
|
+
});
|
|
4552
4789
|
}
|
|
4553
|
-
|
|
4554
|
-
|
|
4790
|
+
onGroupChange(_group) {
|
|
4791
|
+
this.render();
|
|
4555
4792
|
}
|
|
4556
|
-
|
|
4557
|
-
|
|
4793
|
+
onPanelVisibleChange(_isPanelVisible) {
|
|
4794
|
+
this.render();
|
|
4558
4795
|
}
|
|
4559
|
-
|
|
4560
|
-
|
|
4796
|
+
layout(_width, _height) {
|
|
4797
|
+
// noop
|
|
4561
4798
|
}
|
|
4562
|
-
|
|
4563
|
-
|
|
4799
|
+
render() {
|
|
4800
|
+
if (this._content.textContent !== this.params.title) {
|
|
4801
|
+
this._content.textContent = this.params.title;
|
|
4802
|
+
}
|
|
4564
4803
|
}
|
|
4565
|
-
|
|
4566
|
-
|
|
4804
|
+
}
|
|
4805
|
+
|
|
4806
|
+
class DockviewPanelModel {
|
|
4807
|
+
get content() {
|
|
4808
|
+
return this._content;
|
|
4567
4809
|
}
|
|
4568
|
-
get
|
|
4569
|
-
return this.
|
|
4810
|
+
get tab() {
|
|
4811
|
+
return this._tab;
|
|
4570
4812
|
}
|
|
4571
|
-
constructor(accessor, id,
|
|
4572
|
-
|
|
4573
|
-
this.
|
|
4813
|
+
constructor(accessor, id, contentComponent, tabComponent) {
|
|
4814
|
+
var _a;
|
|
4815
|
+
this.accessor = accessor;
|
|
4816
|
+
this.id = id;
|
|
4817
|
+
this.contentComponent = contentComponent;
|
|
4818
|
+
this.tabComponent = tabComponent;
|
|
4819
|
+
this._group = null;
|
|
4820
|
+
this._isPanelVisible = null;
|
|
4821
|
+
this._content = this.createContentComponent(this.id, contentComponent);
|
|
4822
|
+
this._tab =
|
|
4823
|
+
(_a = this.createTabComponent(this.id, tabComponent)) !== null && _a !== void 0 ? _a : new DefaultTab();
|
|
4574
4824
|
}
|
|
4575
|
-
|
|
4576
|
-
this.
|
|
4825
|
+
init(params) {
|
|
4826
|
+
this.content.init(Object.assign(Object.assign({}, params), { tab: this.tab }));
|
|
4827
|
+
this.tab.init(params);
|
|
4577
4828
|
}
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4829
|
+
updateParentGroup(group, isPanelVisible) {
|
|
4830
|
+
if (group !== this._group) {
|
|
4831
|
+
this._group = group;
|
|
4832
|
+
if (this._content.onGroupChange) {
|
|
4833
|
+
this._content.onGroupChange(group);
|
|
4834
|
+
}
|
|
4835
|
+
if (this._tab.onGroupChange) {
|
|
4836
|
+
this._tab.onGroupChange(group);
|
|
4837
|
+
}
|
|
4838
|
+
}
|
|
4839
|
+
if (isPanelVisible !== this._isPanelVisible) {
|
|
4840
|
+
this._isPanelVisible = isPanelVisible;
|
|
4841
|
+
if (this._content.onPanelVisibleChange) {
|
|
4842
|
+
this._content.onPanelVisibleChange(isPanelVisible);
|
|
4843
|
+
}
|
|
4844
|
+
if (this._tab.onPanelVisibleChange) {
|
|
4845
|
+
this._tab.onPanelVisibleChange(isPanelVisible);
|
|
4846
|
+
}
|
|
4847
|
+
}
|
|
4581
4848
|
}
|
|
4582
4849
|
layout(width, height) {
|
|
4583
|
-
|
|
4584
|
-
this.
|
|
4850
|
+
var _a, _b;
|
|
4851
|
+
(_b = (_a = this.content).layout) === null || _b === void 0 ? void 0 : _b.call(_a, width, height);
|
|
4585
4852
|
}
|
|
4586
|
-
|
|
4587
|
-
|
|
4853
|
+
update(event) {
|
|
4854
|
+
var _a, _b, _c, _d;
|
|
4855
|
+
(_b = (_a = this.content).update) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
4856
|
+
(_d = (_c = this.tab).update) === null || _d === void 0 ? void 0 : _d.call(_c, event);
|
|
4588
4857
|
}
|
|
4589
|
-
|
|
4590
|
-
|
|
4858
|
+
dispose() {
|
|
4859
|
+
var _a, _b, _c, _d;
|
|
4860
|
+
(_b = (_a = this.content).dispose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
4861
|
+
(_d = (_c = this.tab).dispose) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
4862
|
+
}
|
|
4863
|
+
createContentComponent(id, componentName) {
|
|
4864
|
+
var _a;
|
|
4865
|
+
return createComponent(id, componentName, this.accessor.options.components || {}, this.accessor.options.frameworkComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.content);
|
|
4866
|
+
}
|
|
4867
|
+
createTabComponent(id, componentName) {
|
|
4868
|
+
var _a;
|
|
4869
|
+
return createComponent(id, componentName, this.accessor.options.tabComponents || {}, this.accessor.options.frameworkTabComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.tab, () => new DefaultTab());
|
|
4591
4870
|
}
|
|
4592
4871
|
}
|
|
4593
4872
|
|
|
4594
|
-
class
|
|
4595
|
-
|
|
4596
|
-
|
|
4873
|
+
class DefaultDockviewDeserialzier {
|
|
4874
|
+
constructor(layout) {
|
|
4875
|
+
this.layout = layout;
|
|
4597
4876
|
}
|
|
4598
|
-
|
|
4599
|
-
|
|
4877
|
+
fromJSON(panelData, group) {
|
|
4878
|
+
var _a, _b, _c;
|
|
4879
|
+
const panelId = panelData.id;
|
|
4880
|
+
const params = panelData.params;
|
|
4881
|
+
const title = panelData.title;
|
|
4882
|
+
const viewData = panelData.view;
|
|
4883
|
+
const contentComponent = viewData
|
|
4884
|
+
? viewData.content.id
|
|
4885
|
+
: panelData.contentComponent || 'unknown';
|
|
4886
|
+
const tabComponent = viewData
|
|
4887
|
+
? (_a = viewData.tab) === null || _a === void 0 ? void 0 : _a.id
|
|
4888
|
+
: panelData.tabComponent;
|
|
4889
|
+
if (tabComponent) {
|
|
4890
|
+
createComponent(panelId, tabComponent, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_b = this.layout.options.frameworkComponentFactory) === null || _b === void 0 ? void 0 : _b.tab, () => new DefaultTab());
|
|
4891
|
+
}
|
|
4892
|
+
else if (this.layout.options.defaultTabComponent) {
|
|
4893
|
+
createComponent(panelId, this.layout.options.defaultTabComponent, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab, () => new DefaultTab());
|
|
4894
|
+
}
|
|
4895
|
+
else {
|
|
4896
|
+
new DefaultTab();
|
|
4897
|
+
}
|
|
4898
|
+
const view = new DockviewPanelModel(this.layout, panelId, contentComponent, tabComponent);
|
|
4899
|
+
const panel = new DockviewPanel(panelId, this.layout, new DockviewApi(this.layout), group, view);
|
|
4900
|
+
panel.init({
|
|
4901
|
+
title: title || panelId,
|
|
4902
|
+
params: params || {},
|
|
4903
|
+
});
|
|
4904
|
+
return panel;
|
|
4600
4905
|
}
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4906
|
+
}
|
|
4907
|
+
|
|
4908
|
+
class Watermark extends CompositeDisposable {
|
|
4909
|
+
get element() {
|
|
4910
|
+
return this._element;
|
|
4911
|
+
}
|
|
4912
|
+
constructor() {
|
|
4913
|
+
super();
|
|
4914
|
+
this._element = document.createElement('div');
|
|
4915
|
+
this._element.className = 'watermark';
|
|
4916
|
+
const title = document.createElement('div');
|
|
4917
|
+
title.className = 'watermark-title';
|
|
4918
|
+
const emptySpace = document.createElement('span');
|
|
4919
|
+
emptySpace.style.flexGrow = '1';
|
|
4920
|
+
const content = document.createElement('div');
|
|
4921
|
+
content.className = 'watermark-content';
|
|
4922
|
+
this._element.appendChild(title);
|
|
4923
|
+
this._element.appendChild(content);
|
|
4924
|
+
const actionsContainer = document.createElement('div');
|
|
4925
|
+
actionsContainer.className = 'actions-container';
|
|
4926
|
+
const closeAnchor = document.createElement('div');
|
|
4927
|
+
closeAnchor.className = 'close-action';
|
|
4928
|
+
closeAnchor.appendChild(createCloseButton());
|
|
4929
|
+
actionsContainer.appendChild(closeAnchor);
|
|
4930
|
+
title.appendChild(emptySpace);
|
|
4931
|
+
title.appendChild(actionsContainer);
|
|
4932
|
+
this.addDisposables(addDisposableListener(closeAnchor, 'click', (ev) => {
|
|
4933
|
+
var _a;
|
|
4934
|
+
ev.preventDefault();
|
|
4935
|
+
if (this.group) {
|
|
4936
|
+
(_a = this.params) === null || _a === void 0 ? void 0 : _a.containerApi.removeGroup(this.group);
|
|
4937
|
+
}
|
|
4938
|
+
}));
|
|
4605
4939
|
}
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
this.tab.init(params);
|
|
4940
|
+
update(_event) {
|
|
4941
|
+
// noop
|
|
4609
4942
|
}
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
this._content.updateParentGroup(group, isPanelVisible);
|
|
4613
|
-
(_a = this._tab) === null || _a === void 0 ? void 0 : _a.updateParentGroup(group, isPanelVisible);
|
|
4943
|
+
focus() {
|
|
4944
|
+
// noop
|
|
4614
4945
|
}
|
|
4615
|
-
layout(
|
|
4616
|
-
|
|
4946
|
+
layout(_width, _height) {
|
|
4947
|
+
// noop
|
|
4617
4948
|
}
|
|
4618
|
-
|
|
4619
|
-
this.
|
|
4620
|
-
this.tab.update(event);
|
|
4949
|
+
init(_params) {
|
|
4950
|
+
this.render();
|
|
4621
4951
|
}
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
tab = undefined;
|
|
4626
|
-
}
|
|
4627
|
-
return {
|
|
4628
|
-
content: this.content.toJSON(),
|
|
4629
|
-
tab,
|
|
4630
|
-
};
|
|
4952
|
+
updateParentGroup(group, _visible) {
|
|
4953
|
+
this.group = group;
|
|
4954
|
+
this.render();
|
|
4631
4955
|
}
|
|
4632
4956
|
dispose() {
|
|
4633
|
-
|
|
4634
|
-
|
|
4957
|
+
super.dispose();
|
|
4958
|
+
}
|
|
4959
|
+
render() {
|
|
4960
|
+
const isOneGroup = !!(this.params && this.params.containerApi.size <= 1);
|
|
4961
|
+
toggleClass(this.element, 'has-actions', isOneGroup);
|
|
4635
4962
|
}
|
|
4636
4963
|
}
|
|
4637
4964
|
|
|
@@ -4645,12 +4972,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4645
4972
|
get panels() {
|
|
4646
4973
|
return this.groups.flatMap((group) => group.panels);
|
|
4647
4974
|
}
|
|
4648
|
-
get deserializer() {
|
|
4649
|
-
return this._deserializer;
|
|
4650
|
-
}
|
|
4651
|
-
set deserializer(value) {
|
|
4652
|
-
this._deserializer = value;
|
|
4653
|
-
}
|
|
4654
4975
|
get options() {
|
|
4655
4976
|
return this._options;
|
|
4656
4977
|
}
|
|
@@ -4677,6 +4998,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4677
4998
|
styles: options.styles,
|
|
4678
4999
|
});
|
|
4679
5000
|
this.nextGroupId = sequentialNumberGenerator();
|
|
5001
|
+
this._deserializer = new DefaultDockviewDeserialzier(this);
|
|
4680
5002
|
this.watermark = null;
|
|
4681
5003
|
this._onDidDrop = new Emitter();
|
|
4682
5004
|
this.onDidDrop = this._onDidDrop.event;
|
|
@@ -4689,9 +5011,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4689
5011
|
this._onDidActivePanelChange = new Emitter();
|
|
4690
5012
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4691
5013
|
this.element.classList.add('dv-dockview');
|
|
4692
|
-
this.addDisposables(this._onDidDrop, exports.
|
|
5014
|
+
this.addDisposables(this._onDidDrop, exports.DockviewEvent.any(this.onDidAddGroup, this.onDidRemoveGroup)(() => {
|
|
4693
5015
|
this.updateWatermark();
|
|
4694
|
-
}), exports.
|
|
5016
|
+
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
4695
5017
|
this._bufferOnDidLayoutChange.fire();
|
|
4696
5018
|
}));
|
|
4697
5019
|
this._options = options;
|
|
@@ -4858,9 +5180,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4858
5180
|
}
|
|
4859
5181
|
fromJSON(data) {
|
|
4860
5182
|
this.clear();
|
|
4861
|
-
if (!this.deserializer) {
|
|
4862
|
-
throw new Error('no deserializer provided');
|
|
4863
|
-
}
|
|
4864
5183
|
const { grid, panels, options, activeGroup } = data;
|
|
4865
5184
|
if (typeof (options === null || options === void 0 ? void 0 : options.tabHeight) === 'number') {
|
|
4866
5185
|
this.tabHeight = options.tabHeight;
|
|
@@ -4878,7 +5197,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4878
5197
|
});
|
|
4879
5198
|
this._onDidAddGroup.fire(group);
|
|
4880
5199
|
for (const child of views) {
|
|
4881
|
-
const panel = this.
|
|
5200
|
+
const panel = this._deserializer.fromJSON(panels[child], group);
|
|
4882
5201
|
const isActive = typeof activeView === 'string' &&
|
|
4883
5202
|
activeView === panel.id;
|
|
4884
5203
|
group.model.openPanel(panel, {
|
|
@@ -5005,14 +5324,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5005
5324
|
: {}, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.watermark);
|
|
5006
5325
|
}
|
|
5007
5326
|
updateWatermark() {
|
|
5327
|
+
var _a, _b;
|
|
5008
5328
|
if (this.groups.length === 0) {
|
|
5009
5329
|
if (!this.watermark) {
|
|
5010
5330
|
this.watermark = this.createWatermarkComponent();
|
|
5011
5331
|
this.watermark.init({
|
|
5012
5332
|
containerApi: new DockviewApi(this),
|
|
5013
|
-
params: {},
|
|
5014
|
-
title: '',
|
|
5015
|
-
api: null,
|
|
5016
5333
|
});
|
|
5017
5334
|
const watermarkContainer = document.createElement('div');
|
|
5018
5335
|
watermarkContainer.className = 'dv-watermark-container';
|
|
@@ -5022,7 +5339,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5022
5339
|
}
|
|
5023
5340
|
else if (this.watermark) {
|
|
5024
5341
|
this.watermark.element.parentElement.remove();
|
|
5025
|
-
this.watermark.dispose();
|
|
5342
|
+
(_b = (_a = this.watermark).dispose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
5026
5343
|
this.watermark = null;
|
|
5027
5344
|
}
|
|
5028
5345
|
}
|
|
@@ -5184,7 +5501,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5184
5501
|
id = this.nextGroupId.next();
|
|
5185
5502
|
}
|
|
5186
5503
|
}
|
|
5187
|
-
const view = new
|
|
5504
|
+
const view = new DockviewGroupPanel(this, id, options);
|
|
5188
5505
|
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
5189
5506
|
if (!this._groups.has(view.id)) {
|
|
5190
5507
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
@@ -5197,857 +5514,522 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5197
5514
|
}), view.model.onDidRemovePanel((event) => {
|
|
5198
5515
|
this._onDidRemovePanel.fire(event.panel);
|
|
5199
5516
|
}), view.model.onDidActivePanelChange((event) => {
|
|
5200
|
-
this._onDidActivePanelChange.fire(event.panel);
|
|
5201
|
-
}));
|
|
5202
|
-
this._groups.set(view.id, { value: view, disposable });
|
|
5203
|
-
}
|
|
5204
|
-
// TODO: must be called after the above listeners have been setup,
|
|
5205
|
-
// not an ideal pattern
|
|
5206
|
-
view.initialize();
|
|
5207
|
-
if (typeof this.options.tabHeight === 'number') {
|
|
5208
|
-
view.model.header.height = this.options.tabHeight;
|
|
5209
|
-
}
|
|
5210
|
-
return view;
|
|
5211
|
-
}
|
|
5212
|
-
createPanel(options, group) {
|
|
5213
|
-
const view = new DefaultGroupPanelView({
|
|
5214
|
-
content: this.createContentComponent(options.id, options.component),
|
|
5215
|
-
tab: this.createTabComponent(options.id, options.tabComponent || this.options.defaultTabComponent),
|
|
5216
|
-
});
|
|
5217
|
-
const panel = new DockviewPanel(options.id, this, this._api, group);
|
|
5218
|
-
panel.init({
|
|
5219
|
-
view,
|
|
5220
|
-
title: options.title || options.id,
|
|
5221
|
-
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
5222
|
-
});
|
|
5223
|
-
return panel;
|
|
5224
|
-
}
|
|
5225
|
-
createContentComponent(id, componentName) {
|
|
5226
|
-
var _a;
|
|
5227
|
-
return createComponent(id, componentName, this.options.components || {}, this.options.frameworkComponents, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.content);
|
|
5228
|
-
}
|
|
5229
|
-
createTabComponent(id, componentName) {
|
|
5230
|
-
var _a;
|
|
5231
|
-
return createComponent(id, componentName, this.options.tabComponents || {}, this.options.frameworkTabComponents, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.tab, () => new DefaultTab());
|
|
5232
|
-
}
|
|
5233
|
-
createGroupAtLocation(location = [0]) {
|
|
5234
|
-
const group = this.createGroup();
|
|
5235
|
-
this.doAddGroup(group, location);
|
|
5236
|
-
return group;
|
|
5237
|
-
}
|
|
5238
|
-
findGroup(panel) {
|
|
5239
|
-
var _a;
|
|
5240
|
-
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
5241
|
-
}
|
|
5242
|
-
dispose() {
|
|
5243
|
-
super.dispose();
|
|
5244
|
-
this._onDidActivePanelChange.dispose();
|
|
5245
|
-
this._onDidAddPanel.dispose();
|
|
5246
|
-
this._onDidRemovePanel.dispose();
|
|
5247
|
-
this._onDidLayoutFromJSON.dispose();
|
|
5248
|
-
}
|
|
5249
|
-
}
|
|
5250
|
-
|
|
5251
|
-
class GridviewComponent extends BaseGrid {
|
|
5252
|
-
get orientation() {
|
|
5253
|
-
return this.gridview.orientation;
|
|
5254
|
-
}
|
|
5255
|
-
set orientation(value) {
|
|
5256
|
-
this.gridview.orientation = value;
|
|
5257
|
-
}
|
|
5258
|
-
get options() {
|
|
5259
|
-
return this._options;
|
|
5260
|
-
}
|
|
5261
|
-
get deserializer() {
|
|
5262
|
-
return this._deserializer;
|
|
5263
|
-
}
|
|
5264
|
-
set deserializer(value) {
|
|
5265
|
-
this._deserializer = value;
|
|
5266
|
-
}
|
|
5267
|
-
constructor(element, options) {
|
|
5268
|
-
super(element, {
|
|
5269
|
-
proportionalLayout: options.proportionalLayout,
|
|
5270
|
-
orientation: options.orientation,
|
|
5271
|
-
styles: options.styles,
|
|
5272
|
-
});
|
|
5273
|
-
this._onDidLayoutfromJSON = new Emitter();
|
|
5274
|
-
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
5275
|
-
this._options = options;
|
|
5276
|
-
if (!this.options.components) {
|
|
5277
|
-
this.options.components = {};
|
|
5278
|
-
}
|
|
5279
|
-
if (!this.options.frameworkComponents) {
|
|
5280
|
-
this.options.frameworkComponents = {};
|
|
5281
|
-
}
|
|
5282
|
-
}
|
|
5283
|
-
updateOptions(options) {
|
|
5284
|
-
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
5285
|
-
this.gridview.orientation !== options.orientation;
|
|
5286
|
-
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
5287
|
-
if (hasOrientationChanged) {
|
|
5288
|
-
this.gridview.orientation = options.orientation;
|
|
5289
|
-
}
|
|
5290
|
-
this.layout(this.gridview.width, this.gridview.height, true);
|
|
5291
|
-
}
|
|
5292
|
-
removePanel(panel) {
|
|
5293
|
-
this.removeGroup(panel);
|
|
5294
|
-
}
|
|
5295
|
-
/**
|
|
5296
|
-
* Serialize the current state of the layout
|
|
5297
|
-
*
|
|
5298
|
-
* @returns A JSON respresentation of the layout
|
|
5299
|
-
*/
|
|
5300
|
-
toJSON() {
|
|
5301
|
-
var _a;
|
|
5302
|
-
const data = this.gridview.serialize();
|
|
5303
|
-
return {
|
|
5304
|
-
grid: data,
|
|
5305
|
-
activePanel: (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.id,
|
|
5306
|
-
};
|
|
5307
|
-
}
|
|
5308
|
-
setVisible(panel, visible) {
|
|
5309
|
-
this.gridview.setViewVisible(getGridLocation(panel.element), visible);
|
|
5310
|
-
}
|
|
5311
|
-
setActive(panel) {
|
|
5312
|
-
this._groups.forEach((value, _key) => {
|
|
5313
|
-
value.value.setActive(panel === value.value);
|
|
5314
|
-
});
|
|
5315
|
-
}
|
|
5316
|
-
focus() {
|
|
5317
|
-
var _a;
|
|
5318
|
-
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
5319
|
-
}
|
|
5320
|
-
fromJSON(serializedGridview) {
|
|
5321
|
-
this.clear();
|
|
5322
|
-
const { grid, activePanel } = serializedGridview;
|
|
5323
|
-
const queue = [];
|
|
5324
|
-
this.gridview.deserialize(grid, {
|
|
5325
|
-
fromJSON: (node) => {
|
|
5326
|
-
const { data } = node;
|
|
5327
|
-
const view = createComponent(data.id, data.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory
|
|
5328
|
-
? {
|
|
5329
|
-
createComponent: this.options.frameworkComponentFactory
|
|
5330
|
-
.createComponent,
|
|
5331
|
-
}
|
|
5332
|
-
: undefined);
|
|
5333
|
-
queue.push(() => view.init({
|
|
5334
|
-
params: data.params,
|
|
5335
|
-
minimumWidth: data.minimumWidth,
|
|
5336
|
-
maximumWidth: data.maximumWidth,
|
|
5337
|
-
minimumHeight: data.minimumHeight,
|
|
5338
|
-
maximumHeight: data.maximumHeight,
|
|
5339
|
-
priority: data.priority,
|
|
5340
|
-
snap: !!data.snap,
|
|
5341
|
-
accessor: this,
|
|
5342
|
-
isVisible: node.visible,
|
|
5343
|
-
}));
|
|
5344
|
-
this._onDidAddGroup.fire(view);
|
|
5345
|
-
this.registerPanel(view);
|
|
5346
|
-
return view;
|
|
5347
|
-
},
|
|
5348
|
-
});
|
|
5349
|
-
this.layout(this.width, this.height, true);
|
|
5350
|
-
queue.forEach((f) => f());
|
|
5351
|
-
if (typeof activePanel === 'string') {
|
|
5352
|
-
const panel = this.getPanel(activePanel);
|
|
5353
|
-
if (panel) {
|
|
5354
|
-
this.doSetGroupActive(panel);
|
|
5355
|
-
}
|
|
5356
|
-
}
|
|
5357
|
-
this._onDidLayoutfromJSON.fire();
|
|
5358
|
-
}
|
|
5359
|
-
clear() {
|
|
5360
|
-
const hasActiveGroup = this.activeGroup;
|
|
5361
|
-
const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
|
|
5362
|
-
for (const group of groups) {
|
|
5363
|
-
group.disposable.dispose();
|
|
5364
|
-
this.doRemoveGroup(group.value, { skipActive: true });
|
|
5365
|
-
}
|
|
5366
|
-
if (hasActiveGroup) {
|
|
5367
|
-
this.doSetGroupActive(undefined);
|
|
5368
|
-
}
|
|
5369
|
-
this.gridview.clear();
|
|
5370
|
-
}
|
|
5371
|
-
movePanel(panel, options) {
|
|
5372
|
-
var _a;
|
|
5373
|
-
let relativeLocation;
|
|
5374
|
-
const removedPanel = this.gridview.remove(panel);
|
|
5375
|
-
const referenceGroup = (_a = this._groups.get(options.reference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
5376
|
-
if (!referenceGroup) {
|
|
5377
|
-
throw new Error(`reference group ${options.reference} does not exist`);
|
|
5378
|
-
}
|
|
5379
|
-
const target = toTarget(options.direction);
|
|
5380
|
-
if (target === 'center') {
|
|
5381
|
-
throw new Error(`${target} not supported as an option`);
|
|
5382
|
-
}
|
|
5383
|
-
else {
|
|
5384
|
-
const location = getGridLocation(referenceGroup.element);
|
|
5385
|
-
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
5386
|
-
}
|
|
5387
|
-
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
5388
|
-
}
|
|
5389
|
-
addPanel(options) {
|
|
5390
|
-
var _a, _b;
|
|
5391
|
-
let relativeLocation = options.location || [0];
|
|
5392
|
-
if ((_a = options.position) === null || _a === void 0 ? void 0 : _a.referencePanel) {
|
|
5393
|
-
const referenceGroup = (_b = this._groups.get(options.position.referencePanel)) === null || _b === void 0 ? void 0 : _b.value;
|
|
5394
|
-
if (!referenceGroup) {
|
|
5395
|
-
throw new Error(`reference group ${options.position.referencePanel} does not exist`);
|
|
5396
|
-
}
|
|
5397
|
-
const target = toTarget(options.position.direction);
|
|
5398
|
-
if (target === 'center') {
|
|
5399
|
-
throw new Error(`${target} not supported as an option`);
|
|
5400
|
-
}
|
|
5401
|
-
else {
|
|
5402
|
-
const location = getGridLocation(referenceGroup.element);
|
|
5403
|
-
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
5404
|
-
}
|
|
5517
|
+
this._onDidActivePanelChange.fire(event.panel);
|
|
5518
|
+
}));
|
|
5519
|
+
this._groups.set(view.id, { value: view, disposable });
|
|
5520
|
+
}
|
|
5521
|
+
// TODO: must be called after the above listeners have been setup,
|
|
5522
|
+
// not an ideal pattern
|
|
5523
|
+
view.initialize();
|
|
5524
|
+
if (typeof this.options.tabHeight === 'number') {
|
|
5525
|
+
view.model.header.height = this.options.tabHeight;
|
|
5405
5526
|
}
|
|
5406
|
-
const view = createComponent(options.id, options.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory
|
|
5407
|
-
? {
|
|
5408
|
-
createComponent: this.options.frameworkComponentFactory
|
|
5409
|
-
.createComponent,
|
|
5410
|
-
}
|
|
5411
|
-
: undefined);
|
|
5412
|
-
view.init({
|
|
5413
|
-
params: options.params || {},
|
|
5414
|
-
minimumWidth: options.minimumWidth,
|
|
5415
|
-
maximumWidth: options.maximumWidth,
|
|
5416
|
-
minimumHeight: options.minimumHeight,
|
|
5417
|
-
maximumHeight: options.maximumHeight,
|
|
5418
|
-
priority: options.priority,
|
|
5419
|
-
snap: !!options.snap,
|
|
5420
|
-
accessor: this,
|
|
5421
|
-
isVisible: true,
|
|
5422
|
-
});
|
|
5423
|
-
this.registerPanel(view);
|
|
5424
|
-
this.doAddGroup(view, relativeLocation, options.size);
|
|
5425
5527
|
return view;
|
|
5426
5528
|
}
|
|
5427
|
-
|
|
5428
|
-
const
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
group.setActive(false);
|
|
5436
|
-
}
|
|
5437
|
-
else {
|
|
5438
|
-
group.setActive(true);
|
|
5439
|
-
}
|
|
5440
|
-
});
|
|
5441
|
-
}));
|
|
5442
|
-
this._groups.set(panel.id, {
|
|
5443
|
-
value: panel,
|
|
5444
|
-
disposable,
|
|
5529
|
+
createPanel(options, group) {
|
|
5530
|
+
const contentComponent = options.component;
|
|
5531
|
+
const tabComponent = options.tabComponent || this.options.defaultTabComponent;
|
|
5532
|
+
const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
|
|
5533
|
+
const panel = new DockviewPanel(options.id, this, this._api, group, view);
|
|
5534
|
+
panel.init({
|
|
5535
|
+
title: options.title || options.id,
|
|
5536
|
+
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
5445
5537
|
});
|
|
5538
|
+
return panel;
|
|
5446
5539
|
}
|
|
5447
|
-
|
|
5448
|
-
const
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
}
|
|
5452
|
-
const referenceLocation = getGridLocation(referenceGroup.element);
|
|
5453
|
-
const targetLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
5454
|
-
const [targetParentLocation, to] = tail(targetLocation);
|
|
5455
|
-
const sourceLocation = getGridLocation(sourceGroup.element);
|
|
5456
|
-
const [sourceParentLocation, from] = tail(sourceLocation);
|
|
5457
|
-
if (sequenceEquals(sourceParentLocation, targetParentLocation)) {
|
|
5458
|
-
// special case when 'swapping' two views within same grid location
|
|
5459
|
-
// if a group has one tab - we are essentially moving the 'group'
|
|
5460
|
-
// which is equivalent to swapping two views in this case
|
|
5461
|
-
this.gridview.moveView(sourceParentLocation, from, to);
|
|
5462
|
-
return;
|
|
5463
|
-
}
|
|
5464
|
-
// source group will become empty so delete the group
|
|
5465
|
-
const targetGroup = this.doRemoveGroup(sourceGroup, {
|
|
5466
|
-
skipActive: true,
|
|
5467
|
-
skipDispose: true,
|
|
5468
|
-
});
|
|
5469
|
-
// after deleting the group we need to re-evaulate the ref location
|
|
5470
|
-
const updatedReferenceLocation = getGridLocation(referenceGroup.element);
|
|
5471
|
-
const location = getRelativeLocation(this.gridview.orientation, updatedReferenceLocation, target);
|
|
5472
|
-
this.doAddGroup(targetGroup, location);
|
|
5540
|
+
createGroupAtLocation(location = [0]) {
|
|
5541
|
+
const group = this.createGroup();
|
|
5542
|
+
this.doAddGroup(group, location);
|
|
5543
|
+
return group;
|
|
5473
5544
|
}
|
|
5474
|
-
|
|
5475
|
-
|
|
5545
|
+
findGroup(panel) {
|
|
5546
|
+
var _a;
|
|
5547
|
+
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
5476
5548
|
}
|
|
5477
5549
|
dispose() {
|
|
5478
5550
|
super.dispose();
|
|
5479
|
-
this.
|
|
5551
|
+
this._onDidActivePanelChange.dispose();
|
|
5552
|
+
this._onDidAddPanel.dispose();
|
|
5553
|
+
this._onDidRemovePanel.dispose();
|
|
5554
|
+
this._onDidLayoutFromJSON.dispose();
|
|
5480
5555
|
}
|
|
5481
5556
|
}
|
|
5482
5557
|
|
|
5483
|
-
|
|
5484
|
-
* A high-level implementation of splitview that works using 'panels'
|
|
5485
|
-
*/
|
|
5486
|
-
class SplitviewComponent extends CompositeDisposable {
|
|
5487
|
-
get panels() {
|
|
5488
|
-
return this.splitview.getViews();
|
|
5489
|
-
}
|
|
5490
|
-
get options() {
|
|
5491
|
-
return this._options;
|
|
5492
|
-
}
|
|
5493
|
-
get length() {
|
|
5494
|
-
return this._panels.size;
|
|
5495
|
-
}
|
|
5558
|
+
class GridviewComponent extends BaseGrid {
|
|
5496
5559
|
get orientation() {
|
|
5497
|
-
return this.
|
|
5498
|
-
}
|
|
5499
|
-
get splitview() {
|
|
5500
|
-
return this._splitview;
|
|
5501
|
-
}
|
|
5502
|
-
set splitview(value) {
|
|
5503
|
-
this._splitview = value;
|
|
5504
|
-
this._disposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
5505
|
-
this._onDidLayoutChange.fire(undefined);
|
|
5506
|
-
}), this._splitview.onDidAddView((e) => this._onDidAddView.fire(e)), this._splitview.onDidRemoveView((e) => this._onDidRemoveView.fire(e)));
|
|
5560
|
+
return this.gridview.orientation;
|
|
5507
5561
|
}
|
|
5508
|
-
|
|
5509
|
-
|
|
5562
|
+
set orientation(value) {
|
|
5563
|
+
this.gridview.orientation = value;
|
|
5510
5564
|
}
|
|
5511
|
-
get
|
|
5512
|
-
return this.
|
|
5565
|
+
get options() {
|
|
5566
|
+
return this._options;
|
|
5513
5567
|
}
|
|
5514
|
-
get
|
|
5515
|
-
return this.
|
|
5516
|
-
? this.splitview.orthogonalSize
|
|
5517
|
-
: this.splitview.size;
|
|
5568
|
+
get deserializer() {
|
|
5569
|
+
return this._deserializer;
|
|
5518
5570
|
}
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
? this.splitview.size
|
|
5522
|
-
: this.splitview.orthogonalSize;
|
|
5571
|
+
set deserializer(value) {
|
|
5572
|
+
this._deserializer = value;
|
|
5523
5573
|
}
|
|
5524
5574
|
constructor(element, options) {
|
|
5525
|
-
super(
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5575
|
+
super(element, {
|
|
5576
|
+
proportionalLayout: options.proportionalLayout,
|
|
5577
|
+
orientation: options.orientation,
|
|
5578
|
+
styles: options.styles,
|
|
5579
|
+
});
|
|
5529
5580
|
this._onDidLayoutfromJSON = new Emitter();
|
|
5530
5581
|
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
5531
|
-
this._onDidAddView = new Emitter();
|
|
5532
|
-
this.onDidAddView = this._onDidAddView.event;
|
|
5533
|
-
this._onDidRemoveView = new Emitter();
|
|
5534
|
-
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
5535
|
-
this._onDidLayoutChange = new Emitter();
|
|
5536
|
-
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
5537
5582
|
this._options = options;
|
|
5538
|
-
if (!options.components) {
|
|
5539
|
-
options.components = {};
|
|
5583
|
+
if (!this.options.components) {
|
|
5584
|
+
this.options.components = {};
|
|
5540
5585
|
}
|
|
5541
|
-
if (!options.frameworkComponents) {
|
|
5542
|
-
options.frameworkComponents = {};
|
|
5586
|
+
if (!this.options.frameworkComponents) {
|
|
5587
|
+
this.options.frameworkComponents = {};
|
|
5543
5588
|
}
|
|
5544
|
-
this.splitview = new Splitview(this.element, options);
|
|
5545
|
-
this.addDisposables(this._disposable, this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
5546
5589
|
}
|
|
5547
5590
|
updateOptions(options) {
|
|
5548
5591
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
5549
|
-
this.
|
|
5592
|
+
this.gridview.orientation !== options.orientation;
|
|
5550
5593
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
5551
5594
|
if (hasOrientationChanged) {
|
|
5552
|
-
this.
|
|
5553
|
-
}
|
|
5554
|
-
this.splitview.layout(this.splitview.size, this.splitview.orthogonalSize);
|
|
5555
|
-
}
|
|
5556
|
-
focus() {
|
|
5557
|
-
var _a;
|
|
5558
|
-
(_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus();
|
|
5559
|
-
}
|
|
5560
|
-
movePanel(from, to) {
|
|
5561
|
-
this.splitview.moveView(from, to);
|
|
5562
|
-
}
|
|
5563
|
-
setVisible(panel, visible) {
|
|
5564
|
-
const index = this.panels.indexOf(panel);
|
|
5565
|
-
this.splitview.setViewVisible(index, visible);
|
|
5566
|
-
}
|
|
5567
|
-
setActive(view, skipFocus) {
|
|
5568
|
-
this._activePanel = view;
|
|
5569
|
-
this.panels
|
|
5570
|
-
.filter((v) => v !== view)
|
|
5571
|
-
.forEach((v) => {
|
|
5572
|
-
v.api._onDidActiveChange.fire({ isActive: false });
|
|
5573
|
-
if (!skipFocus) {
|
|
5574
|
-
v.focus();
|
|
5575
|
-
}
|
|
5576
|
-
});
|
|
5577
|
-
view.api._onDidActiveChange.fire({ isActive: true });
|
|
5578
|
-
if (!skipFocus) {
|
|
5579
|
-
view.focus();
|
|
5580
|
-
}
|
|
5581
|
-
}
|
|
5582
|
-
removePanel(panel, sizing) {
|
|
5583
|
-
const disposable = this._panels.get(panel.id);
|
|
5584
|
-
if (!disposable) {
|
|
5585
|
-
throw new Error(`unknown splitview panel ${panel.id}`);
|
|
5586
|
-
}
|
|
5587
|
-
disposable.disposable.dispose();
|
|
5588
|
-
disposable.value.dispose();
|
|
5589
|
-
this._panels.delete(panel.id);
|
|
5590
|
-
const index = this.panels.findIndex((_) => _ === panel);
|
|
5591
|
-
this.splitview.removeView(index, sizing);
|
|
5592
|
-
const panels = this.panels;
|
|
5593
|
-
if (panels.length > 0) {
|
|
5594
|
-
this.setActive(panels[panels.length - 1]);
|
|
5595
|
-
}
|
|
5596
|
-
}
|
|
5597
|
-
getPanel(id) {
|
|
5598
|
-
return this.panels.find((view) => view.id === id);
|
|
5599
|
-
}
|
|
5600
|
-
addPanel(options) {
|
|
5601
|
-
if (this._panels.has(options.id)) {
|
|
5602
|
-
throw new Error(`panel ${options.id} already exists`);
|
|
5595
|
+
this.gridview.orientation = options.orientation;
|
|
5603
5596
|
}
|
|
5604
|
-
|
|
5605
|
-
? {
|
|
5606
|
-
createComponent: this.options.frameworkWrapper.createComponent,
|
|
5607
|
-
}
|
|
5608
|
-
: undefined);
|
|
5609
|
-
view.orientation = this.splitview.orientation;
|
|
5610
|
-
view.init({
|
|
5611
|
-
params: options.params || {},
|
|
5612
|
-
minimumSize: options.minimumSize,
|
|
5613
|
-
maximumSize: options.maximumSize,
|
|
5614
|
-
snap: options.snap,
|
|
5615
|
-
priority: options.priority,
|
|
5616
|
-
accessor: this,
|
|
5617
|
-
});
|
|
5618
|
-
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
5619
|
-
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
5620
|
-
this.splitview.addView(view, size, index);
|
|
5621
|
-
this.doAddView(view);
|
|
5622
|
-
this.setActive(view);
|
|
5623
|
-
return view;
|
|
5624
|
-
}
|
|
5625
|
-
layout(width, height) {
|
|
5626
|
-
const [size, orthogonalSize] = this.splitview.orientation === exports.Orientation.HORIZONTAL
|
|
5627
|
-
? [width, height]
|
|
5628
|
-
: [height, width];
|
|
5629
|
-
this.splitview.layout(size, orthogonalSize);
|
|
5597
|
+
this.layout(this.gridview.width, this.gridview.height, true);
|
|
5630
5598
|
}
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
if (!event.isFocused) {
|
|
5634
|
-
return;
|
|
5635
|
-
}
|
|
5636
|
-
this.setActive(view, true);
|
|
5637
|
-
});
|
|
5638
|
-
this._panels.set(view.id, { disposable, value: view });
|
|
5599
|
+
removePanel(panel) {
|
|
5600
|
+
this.removeGroup(panel);
|
|
5639
5601
|
}
|
|
5602
|
+
/**
|
|
5603
|
+
* Serialize the current state of the layout
|
|
5604
|
+
*
|
|
5605
|
+
* @returns A JSON respresentation of the layout
|
|
5606
|
+
*/
|
|
5640
5607
|
toJSON() {
|
|
5641
5608
|
var _a;
|
|
5642
|
-
const
|
|
5643
|
-
.getViews()
|
|
5644
|
-
.map((view, i) => {
|
|
5645
|
-
const size = this.splitview.getViewSize(i);
|
|
5646
|
-
return {
|
|
5647
|
-
size,
|
|
5648
|
-
data: view.toJSON(),
|
|
5649
|
-
snap: !!view.snap,
|
|
5650
|
-
priority: view.priority,
|
|
5651
|
-
};
|
|
5652
|
-
});
|
|
5609
|
+
const data = this.gridview.serialize();
|
|
5653
5610
|
return {
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
size: this.splitview.size,
|
|
5657
|
-
orientation: this.splitview.orientation,
|
|
5611
|
+
grid: data,
|
|
5612
|
+
activePanel: (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.id,
|
|
5658
5613
|
};
|
|
5659
5614
|
}
|
|
5660
|
-
|
|
5615
|
+
setVisible(panel, visible) {
|
|
5616
|
+
this.gridview.setViewVisible(getGridLocation(panel.element), visible);
|
|
5617
|
+
}
|
|
5618
|
+
setActive(panel) {
|
|
5619
|
+
this._groups.forEach((value, _key) => {
|
|
5620
|
+
value.value.setActive(panel === value.value);
|
|
5621
|
+
});
|
|
5622
|
+
}
|
|
5623
|
+
focus() {
|
|
5624
|
+
var _a;
|
|
5625
|
+
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
5626
|
+
}
|
|
5627
|
+
fromJSON(serializedGridview) {
|
|
5661
5628
|
this.clear();
|
|
5662
|
-
const {
|
|
5629
|
+
const { grid, activePanel } = serializedGridview;
|
|
5663
5630
|
const queue = [];
|
|
5664
|
-
this.
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
if (this._panels.has(data.id)) {
|
|
5672
|
-
throw new Error(`panel ${data.id} already exists`);
|
|
5631
|
+
this.gridview.deserialize(grid, {
|
|
5632
|
+
fromJSON: (node) => {
|
|
5633
|
+
const { data } = node;
|
|
5634
|
+
const view = createComponent(data.id, data.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory
|
|
5635
|
+
? {
|
|
5636
|
+
createComponent: this.options.frameworkComponentFactory
|
|
5637
|
+
.createComponent,
|
|
5673
5638
|
}
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
});
|
|
5690
|
-
panel.orientation = orientation;
|
|
5691
|
-
this.doAddView(panel);
|
|
5692
|
-
setTimeout(() => {
|
|
5693
|
-
// the original onDidAddView events are missed since they are fired before we can subcribe to them
|
|
5694
|
-
this._onDidAddView.fire(panel);
|
|
5695
|
-
}, 0);
|
|
5696
|
-
return { size: view.size, view: panel };
|
|
5697
|
-
}),
|
|
5639
|
+
: undefined);
|
|
5640
|
+
queue.push(() => view.init({
|
|
5641
|
+
params: data.params,
|
|
5642
|
+
minimumWidth: data.minimumWidth,
|
|
5643
|
+
maximumWidth: data.maximumWidth,
|
|
5644
|
+
minimumHeight: data.minimumHeight,
|
|
5645
|
+
maximumHeight: data.maximumHeight,
|
|
5646
|
+
priority: data.priority,
|
|
5647
|
+
snap: !!data.snap,
|
|
5648
|
+
accessor: this,
|
|
5649
|
+
isVisible: node.visible,
|
|
5650
|
+
}));
|
|
5651
|
+
this._onDidAddGroup.fire(view);
|
|
5652
|
+
this.registerPanel(view);
|
|
5653
|
+
return view;
|
|
5698
5654
|
},
|
|
5699
5655
|
});
|
|
5700
|
-
this.layout(this.width, this.height);
|
|
5656
|
+
this.layout(this.width, this.height, true);
|
|
5701
5657
|
queue.forEach((f) => f());
|
|
5702
|
-
if (typeof
|
|
5703
|
-
const panel = this.getPanel(
|
|
5658
|
+
if (typeof activePanel === 'string') {
|
|
5659
|
+
const panel = this.getPanel(activePanel);
|
|
5704
5660
|
if (panel) {
|
|
5705
|
-
this.
|
|
5661
|
+
this.doSetGroupActive(panel);
|
|
5706
5662
|
}
|
|
5707
5663
|
}
|
|
5708
5664
|
this._onDidLayoutfromJSON.fire();
|
|
5709
5665
|
}
|
|
5710
5666
|
clear() {
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5667
|
+
const hasActiveGroup = this.activeGroup;
|
|
5668
|
+
const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
|
|
5669
|
+
for (const group of groups) {
|
|
5670
|
+
group.disposable.dispose();
|
|
5671
|
+
this.doRemoveGroup(group.value, { skipActive: true });
|
|
5714
5672
|
}
|
|
5715
|
-
|
|
5716
|
-
|
|
5673
|
+
if (hasActiveGroup) {
|
|
5674
|
+
this.doSetGroupActive(undefined);
|
|
5675
|
+
}
|
|
5676
|
+
this.gridview.clear();
|
|
5717
5677
|
}
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5678
|
+
movePanel(panel, options) {
|
|
5679
|
+
var _a;
|
|
5680
|
+
let relativeLocation;
|
|
5681
|
+
const removedPanel = this.gridview.remove(panel);
|
|
5682
|
+
const referenceGroup = (_a = this._groups.get(options.reference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
5683
|
+
if (!referenceGroup) {
|
|
5684
|
+
throw new Error(`reference group ${options.reference} does not exist`);
|
|
5722
5685
|
}
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5686
|
+
const target = toTarget(options.direction);
|
|
5687
|
+
if (target === 'center') {
|
|
5688
|
+
throw new Error(`${target} not supported as an option`);
|
|
5689
|
+
}
|
|
5690
|
+
else {
|
|
5691
|
+
const location = getGridLocation(referenceGroup.element);
|
|
5692
|
+
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
5693
|
+
}
|
|
5694
|
+
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
5726
5695
|
}
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5696
|
+
addPanel(options) {
|
|
5697
|
+
var _a, _b;
|
|
5698
|
+
let relativeLocation = options.location || [0];
|
|
5699
|
+
if ((_a = options.position) === null || _a === void 0 ? void 0 : _a.referencePanel) {
|
|
5700
|
+
const referenceGroup = (_b = this._groups.get(options.position.referencePanel)) === null || _b === void 0 ? void 0 : _b.value;
|
|
5701
|
+
if (!referenceGroup) {
|
|
5702
|
+
throw new Error(`reference group ${options.position.referencePanel} does not exist`);
|
|
5703
|
+
}
|
|
5704
|
+
const target = toTarget(options.position.direction);
|
|
5705
|
+
if (target === 'center') {
|
|
5706
|
+
throw new Error(`${target} not supported as an option`);
|
|
5707
|
+
}
|
|
5708
|
+
else {
|
|
5709
|
+
const location = getGridLocation(referenceGroup.element);
|
|
5710
|
+
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
5711
|
+
}
|
|
5712
|
+
}
|
|
5713
|
+
const view = createComponent(options.id, options.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory
|
|
5714
|
+
? {
|
|
5715
|
+
createComponent: this.options.frameworkComponentFactory
|
|
5716
|
+
.createComponent,
|
|
5717
|
+
}
|
|
5718
|
+
: undefined);
|
|
5719
|
+
view.init({
|
|
5720
|
+
params: options.params || {},
|
|
5721
|
+
minimumWidth: options.minimumWidth,
|
|
5722
|
+
maximumWidth: options.maximumWidth,
|
|
5723
|
+
minimumHeight: options.minimumHeight,
|
|
5724
|
+
maximumHeight: options.maximumHeight,
|
|
5725
|
+
priority: options.priority,
|
|
5726
|
+
snap: !!options.snap,
|
|
5727
|
+
accessor: this,
|
|
5728
|
+
isVisible: true,
|
|
5738
5729
|
});
|
|
5739
|
-
this.
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
5743
|
-
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
5744
|
-
}
|
|
5745
|
-
setConstraints(value) {
|
|
5746
|
-
this._onDidConstraintsChangeInternal.fire(value);
|
|
5747
|
-
}
|
|
5748
|
-
setSize(event) {
|
|
5749
|
-
this._onDidSizeChange.fire(event);
|
|
5730
|
+
this.registerPanel(view);
|
|
5731
|
+
this.doAddGroup(view, relativeLocation, options.size);
|
|
5732
|
+
return view;
|
|
5750
5733
|
}
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5734
|
+
registerPanel(panel) {
|
|
5735
|
+
const disposable = new CompositeDisposable(panel.api.onDidFocusChange((event) => {
|
|
5736
|
+
if (!event.isFocused) {
|
|
5737
|
+
return;
|
|
5738
|
+
}
|
|
5739
|
+
this._groups.forEach((groupItem) => {
|
|
5740
|
+
const group = groupItem.value;
|
|
5741
|
+
if (group !== panel) {
|
|
5742
|
+
group.setActive(false);
|
|
5743
|
+
}
|
|
5744
|
+
else {
|
|
5745
|
+
group.setActive(true);
|
|
5746
|
+
}
|
|
5747
|
+
});
|
|
5748
|
+
}));
|
|
5749
|
+
this._groups.set(panel.id, {
|
|
5750
|
+
value: panel,
|
|
5751
|
+
disposable,
|
|
5752
|
+
});
|
|
5756
5753
|
}
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5754
|
+
moveGroup(referenceGroup, groupId, target) {
|
|
5755
|
+
const sourceGroup = this.getPanel(groupId);
|
|
5756
|
+
if (!sourceGroup) {
|
|
5757
|
+
throw new Error('invalid operation');
|
|
5758
|
+
}
|
|
5759
|
+
const referenceLocation = getGridLocation(referenceGroup.element);
|
|
5760
|
+
const targetLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
5761
|
+
const [targetParentLocation, to] = tail(targetLocation);
|
|
5762
|
+
const sourceLocation = getGridLocation(sourceGroup.element);
|
|
5763
|
+
const [sourceParentLocation, from] = tail(sourceLocation);
|
|
5764
|
+
if (sequenceEquals(sourceParentLocation, targetParentLocation)) {
|
|
5765
|
+
// special case when 'swapping' two views within same grid location
|
|
5766
|
+
// if a group has one tab - we are essentially moving the 'group'
|
|
5767
|
+
// which is equivalent to swapping two views in this case
|
|
5768
|
+
this.gridview.moveView(sourceParentLocation, from, to);
|
|
5769
|
+
return;
|
|
5770
|
+
}
|
|
5771
|
+
// source group will become empty so delete the group
|
|
5772
|
+
const targetGroup = this.doRemoveGroup(sourceGroup, {
|
|
5773
|
+
skipActive: true,
|
|
5774
|
+
skipDispose: true,
|
|
5761
5775
|
});
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
this.
|
|
5766
|
-
this.onMouseLeave = this._onMouseLeave.event;
|
|
5767
|
-
this.addDisposables(this._onDidExpansionChange, this._onMouseEnter, this._onMouseLeave);
|
|
5776
|
+
// after deleting the group we need to re-evaulate the ref location
|
|
5777
|
+
const updatedReferenceLocation = getGridLocation(referenceGroup.element);
|
|
5778
|
+
const location = getRelativeLocation(this.gridview.orientation, updatedReferenceLocation, target);
|
|
5779
|
+
this.doAddGroup(targetGroup, location);
|
|
5768
5780
|
}
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
(_a = this._pane) === null || _a === void 0 ? void 0 : _a.setExpanded(isExpanded);
|
|
5781
|
+
removeGroup(group) {
|
|
5782
|
+
super.removeGroup(group);
|
|
5772
5783
|
}
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5784
|
+
dispose() {
|
|
5785
|
+
super.dispose();
|
|
5786
|
+
this._onDidLayoutfromJSON.dispose();
|
|
5776
5787
|
}
|
|
5777
5788
|
}
|
|
5778
5789
|
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
get
|
|
5784
|
-
return this.
|
|
5785
|
-
}
|
|
5786
|
-
get minimumSize() {
|
|
5787
|
-
const headerSize = this.headerSize;
|
|
5788
|
-
const expanded = this.isExpanded();
|
|
5789
|
-
const minimumBodySize = expanded ? this._minimumBodySize : 0;
|
|
5790
|
-
return headerSize + minimumBodySize;
|
|
5790
|
+
/**
|
|
5791
|
+
* A high-level implementation of splitview that works using 'panels'
|
|
5792
|
+
*/
|
|
5793
|
+
class SplitviewComponent extends CompositeDisposable {
|
|
5794
|
+
get panels() {
|
|
5795
|
+
return this.splitview.getViews();
|
|
5791
5796
|
}
|
|
5792
|
-
get
|
|
5793
|
-
|
|
5794
|
-
const expanded = this.isExpanded();
|
|
5795
|
-
const maximumBodySize = expanded ? this._maximumBodySize : 0;
|
|
5796
|
-
return headerSize + maximumBodySize;
|
|
5797
|
+
get options() {
|
|
5798
|
+
return this._options;
|
|
5797
5799
|
}
|
|
5798
|
-
get
|
|
5799
|
-
return this.
|
|
5800
|
+
get length() {
|
|
5801
|
+
return this._panels.size;
|
|
5800
5802
|
}
|
|
5801
|
-
get
|
|
5802
|
-
return this.
|
|
5803
|
+
get orientation() {
|
|
5804
|
+
return this.splitview.orientation;
|
|
5803
5805
|
}
|
|
5804
|
-
|
|
5805
|
-
this.
|
|
5806
|
+
get splitview() {
|
|
5807
|
+
return this._splitview;
|
|
5806
5808
|
}
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
+
set splitview(value) {
|
|
5810
|
+
this._splitview = value;
|
|
5811
|
+
this._disposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
5812
|
+
this._onDidLayoutChange.fire(undefined);
|
|
5813
|
+
}), this._splitview.onDidAddView((e) => this._onDidAddView.fire(e)), this._splitview.onDidRemoveView((e) => this._onDidRemoveView.fire(e)));
|
|
5809
5814
|
}
|
|
5810
|
-
|
|
5811
|
-
this.
|
|
5815
|
+
get minimumSize() {
|
|
5816
|
+
return this.splitview.minimumSize;
|
|
5812
5817
|
}
|
|
5813
|
-
get
|
|
5814
|
-
return this.
|
|
5818
|
+
get maximumSize() {
|
|
5819
|
+
return this.splitview.maximumSize;
|
|
5815
5820
|
}
|
|
5816
|
-
|
|
5817
|
-
this.
|
|
5818
|
-
|
|
5821
|
+
get height() {
|
|
5822
|
+
return this.splitview.orientation === exports.Orientation.HORIZONTAL
|
|
5823
|
+
? this.splitview.orthogonalSize
|
|
5824
|
+
: this.splitview.size;
|
|
5819
5825
|
}
|
|
5820
|
-
get
|
|
5821
|
-
return this.
|
|
5826
|
+
get width() {
|
|
5827
|
+
return this.splitview.orientation === exports.Orientation.HORIZONTAL
|
|
5828
|
+
? this.splitview.size
|
|
5829
|
+
: this.splitview.orthogonalSize;
|
|
5822
5830
|
}
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
this.
|
|
5831
|
+
constructor(element, options) {
|
|
5832
|
+
super();
|
|
5833
|
+
this.element = element;
|
|
5834
|
+
this._disposable = new MutableDisposable();
|
|
5835
|
+
this._panels = new Map();
|
|
5836
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
5837
|
+
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
5838
|
+
this._onDidAddView = new Emitter();
|
|
5839
|
+
this.onDidAddView = this._onDidAddView.event;
|
|
5840
|
+
this._onDidRemoveView = new Emitter();
|
|
5841
|
+
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
5842
|
+
this._onDidLayoutChange = new Emitter();
|
|
5843
|
+
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
5844
|
+
this._options = options;
|
|
5845
|
+
if (!options.components) {
|
|
5846
|
+
options.components = {};
|
|
5847
|
+
}
|
|
5848
|
+
if (!options.frameworkComponents) {
|
|
5849
|
+
options.frameworkComponents = {};
|
|
5850
|
+
}
|
|
5851
|
+
this.splitview = new Splitview(this.element, options);
|
|
5852
|
+
this.addDisposables(this._disposable, this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
5826
5853
|
}
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
this.
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
this.
|
|
5835
|
-
this._orthogonalSize = 0;
|
|
5836
|
-
this._size = 0;
|
|
5837
|
-
this._minimumBodySize = 100;
|
|
5838
|
-
this._maximumBodySize = Number.POSITIVE_INFINITY;
|
|
5839
|
-
this._isExpanded = false;
|
|
5840
|
-
this.expandedSize = 0;
|
|
5841
|
-
this.api.pane = this; // TODO cannot use 'this' before 'super'
|
|
5842
|
-
this.api.initialize(this);
|
|
5843
|
-
this._isExpanded = isExpanded;
|
|
5844
|
-
this._headerVisible = isHeaderVisible;
|
|
5845
|
-
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
5846
|
-
this._orientation = orientation;
|
|
5847
|
-
this.element.classList.add('pane');
|
|
5848
|
-
this.addDisposables(this.api.onDidSizeChange((event) => {
|
|
5849
|
-
this._onDidChange.fire({ size: event.size });
|
|
5850
|
-
}), addDisposableListener(this.element, 'mouseenter', (ev) => {
|
|
5851
|
-
this.api._onMouseEnter.fire(ev);
|
|
5852
|
-
}), addDisposableListener(this.element, 'mouseleave', (ev) => {
|
|
5853
|
-
this.api._onMouseLeave.fire(ev);
|
|
5854
|
-
}));
|
|
5855
|
-
this.addDisposables(this._onDidChangeExpansionState, this.onDidChangeExpansionState((isPanelExpanded) => {
|
|
5856
|
-
this.api._onDidExpansionChange.fire({
|
|
5857
|
-
isExpanded: isPanelExpanded,
|
|
5858
|
-
});
|
|
5859
|
-
}), this.api.onDidFocusChange((e) => {
|
|
5860
|
-
if (!this.header) {
|
|
5861
|
-
return;
|
|
5862
|
-
}
|
|
5863
|
-
if (e.isFocused) {
|
|
5864
|
-
addClasses(this.header, 'focused');
|
|
5865
|
-
}
|
|
5866
|
-
else {
|
|
5867
|
-
removeClasses(this.header, 'focused');
|
|
5868
|
-
}
|
|
5869
|
-
}));
|
|
5870
|
-
this.renderOnce();
|
|
5854
|
+
updateOptions(options) {
|
|
5855
|
+
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
5856
|
+
this.options.orientation !== options.orientation;
|
|
5857
|
+
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
5858
|
+
if (hasOrientationChanged) {
|
|
5859
|
+
this.splitview.orientation = options.orientation;
|
|
5860
|
+
}
|
|
5861
|
+
this.splitview.layout(this.splitview.size, this.splitview.orthogonalSize);
|
|
5871
5862
|
}
|
|
5872
|
-
|
|
5873
|
-
|
|
5863
|
+
focus() {
|
|
5864
|
+
var _a;
|
|
5865
|
+
(_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus();
|
|
5874
5866
|
}
|
|
5875
|
-
|
|
5876
|
-
this.
|
|
5867
|
+
movePanel(from, to) {
|
|
5868
|
+
this.splitview.moveView(from, to);
|
|
5877
5869
|
}
|
|
5878
|
-
|
|
5879
|
-
|
|
5870
|
+
setVisible(panel, visible) {
|
|
5871
|
+
const index = this.panels.indexOf(panel);
|
|
5872
|
+
this.splitview.setViewVisible(index, visible);
|
|
5880
5873
|
}
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
if (
|
|
5888
|
-
|
|
5889
|
-
}
|
|
5890
|
-
if (this.body) {
|
|
5891
|
-
this.element.appendChild(this.body);
|
|
5874
|
+
setActive(view, skipFocus) {
|
|
5875
|
+
this._activePanel = view;
|
|
5876
|
+
this.panels
|
|
5877
|
+
.filter((v) => v !== view)
|
|
5878
|
+
.forEach((v) => {
|
|
5879
|
+
v.api._onDidActiveChange.fire({ isActive: false });
|
|
5880
|
+
if (!skipFocus) {
|
|
5881
|
+
v.focus();
|
|
5892
5882
|
}
|
|
5883
|
+
});
|
|
5884
|
+
view.api._onDidActiveChange.fire({ isActive: true });
|
|
5885
|
+
if (!skipFocus) {
|
|
5886
|
+
view.focus();
|
|
5893
5887
|
}
|
|
5894
|
-
else {
|
|
5895
|
-
this.animationTimer = setTimeout(() => {
|
|
5896
|
-
var _a;
|
|
5897
|
-
(_a = this.body) === null || _a === void 0 ? void 0 : _a.remove();
|
|
5898
|
-
}, 200);
|
|
5899
|
-
}
|
|
5900
|
-
this._onDidChange.fire(expanded ? { size: this.width } : {});
|
|
5901
|
-
this._onDidChangeExpansionState.fire(expanded);
|
|
5902
|
-
}
|
|
5903
|
-
layout(size, orthogonalSize) {
|
|
5904
|
-
this._size = size;
|
|
5905
|
-
this._orthogonalSize = orthogonalSize;
|
|
5906
|
-
const [width, height] = this.orientation === exports.Orientation.HORIZONTAL
|
|
5907
|
-
? [size, orthogonalSize]
|
|
5908
|
-
: [orthogonalSize, size];
|
|
5909
|
-
if (this.isExpanded()) {
|
|
5910
|
-
this.expandedSize = width;
|
|
5911
|
-
}
|
|
5912
|
-
super.layout(width, height);
|
|
5913
5888
|
}
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
this.minimumBodySize = parameters.minimumBodySize;
|
|
5889
|
+
removePanel(panel, sizing) {
|
|
5890
|
+
const disposable = this._panels.get(panel.id);
|
|
5891
|
+
if (!disposable) {
|
|
5892
|
+
throw new Error(`unknown splitview panel ${panel.id}`);
|
|
5919
5893
|
}
|
|
5920
|
-
|
|
5921
|
-
|
|
5894
|
+
disposable.disposable.dispose();
|
|
5895
|
+
disposable.value.dispose();
|
|
5896
|
+
this._panels.delete(panel.id);
|
|
5897
|
+
const index = this.panels.findIndex((_) => _ === panel);
|
|
5898
|
+
this.splitview.removeView(index, sizing);
|
|
5899
|
+
const panels = this.panels;
|
|
5900
|
+
if (panels.length > 0) {
|
|
5901
|
+
this.setActive(panels[panels.length - 1]);
|
|
5922
5902
|
}
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
this.
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
(
|
|
5929
|
-
|
|
5930
|
-
this.setExpanded(parameters.isExpanded);
|
|
5903
|
+
}
|
|
5904
|
+
getPanel(id) {
|
|
5905
|
+
return this.panels.find((view) => view.id === id);
|
|
5906
|
+
}
|
|
5907
|
+
addPanel(options) {
|
|
5908
|
+
if (this._panels.has(options.id)) {
|
|
5909
|
+
throw new Error(`panel ${options.id} already exists`);
|
|
5931
5910
|
}
|
|
5911
|
+
const view = createComponent(options.id, options.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkWrapper
|
|
5912
|
+
? {
|
|
5913
|
+
createComponent: this.options.frameworkWrapper.createComponent,
|
|
5914
|
+
}
|
|
5915
|
+
: undefined);
|
|
5916
|
+
view.orientation = this.splitview.orientation;
|
|
5917
|
+
view.init({
|
|
5918
|
+
params: options.params || {},
|
|
5919
|
+
minimumSize: options.minimumSize,
|
|
5920
|
+
maximumSize: options.maximumSize,
|
|
5921
|
+
snap: options.snap,
|
|
5922
|
+
priority: options.priority,
|
|
5923
|
+
accessor: this,
|
|
5924
|
+
});
|
|
5925
|
+
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
5926
|
+
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
5927
|
+
this.splitview.addView(view, size, index);
|
|
5928
|
+
this.doAddView(view);
|
|
5929
|
+
this.setActive(view);
|
|
5930
|
+
return view;
|
|
5932
5931
|
}
|
|
5933
|
-
|
|
5934
|
-
const
|
|
5935
|
-
|
|
5932
|
+
layout(width, height) {
|
|
5933
|
+
const [size, orthogonalSize] = this.splitview.orientation === exports.Orientation.HORIZONTAL
|
|
5934
|
+
? [width, height]
|
|
5935
|
+
: [height, width];
|
|
5936
|
+
this.splitview.layout(size, orthogonalSize);
|
|
5936
5937
|
}
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
this.
|
|
5945
|
-
this.element.appendChild(this.header);
|
|
5946
|
-
this.body = document.createElement('div');
|
|
5947
|
-
this.body.className = 'pane-body';
|
|
5948
|
-
this.element.appendChild(this.body);
|
|
5938
|
+
doAddView(view) {
|
|
5939
|
+
const disposable = view.api.onDidFocusChange((event) => {
|
|
5940
|
+
if (!event.isFocused) {
|
|
5941
|
+
return;
|
|
5942
|
+
}
|
|
5943
|
+
this.setActive(view, true);
|
|
5944
|
+
});
|
|
5945
|
+
this._panels.set(view.id, { disposable, value: view });
|
|
5949
5946
|
}
|
|
5950
|
-
|
|
5951
|
-
|
|
5947
|
+
toJSON() {
|
|
5948
|
+
var _a;
|
|
5949
|
+
const views = this.splitview
|
|
5950
|
+
.getViews()
|
|
5951
|
+
.map((view, i) => {
|
|
5952
|
+
const size = this.splitview.getViewSize(i);
|
|
5953
|
+
return {
|
|
5954
|
+
size,
|
|
5955
|
+
data: view.toJSON(),
|
|
5956
|
+
snap: !!view.snap,
|
|
5957
|
+
priority: view.priority,
|
|
5958
|
+
};
|
|
5959
|
+
});
|
|
5952
5960
|
return {
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
},
|
|
5958
|
-
dispose: () => {
|
|
5959
|
-
var _a, _b;
|
|
5960
|
-
(_a = this.bodyPart) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5961
|
-
(_b = this.headerPart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
5962
|
-
},
|
|
5961
|
+
views,
|
|
5962
|
+
activeView: (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.id,
|
|
5963
|
+
size: this.splitview.size,
|
|
5964
|
+
orientation: this.splitview.orientation,
|
|
5963
5965
|
};
|
|
5964
5966
|
}
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
if (!this.header) {
|
|
5979
|
-
return;
|
|
5980
|
-
}
|
|
5981
|
-
const id = this.id;
|
|
5982
|
-
const accessorId = this.accessor.id;
|
|
5983
|
-
this.header.draggable = true;
|
|
5984
|
-
this.handler = new (class PaneDragHandler extends DragHandler {
|
|
5985
|
-
getData() {
|
|
5986
|
-
LocalSelectionTransfer.getInstance().setData([new PaneTransfer(accessorId, id)], PaneTransfer.prototype);
|
|
5987
|
-
return {
|
|
5988
|
-
dispose: () => {
|
|
5989
|
-
LocalSelectionTransfer.getInstance().clearData(PaneTransfer.prototype);
|
|
5990
|
-
},
|
|
5991
|
-
};
|
|
5992
|
-
}
|
|
5993
|
-
})(this.header);
|
|
5994
|
-
this.target = new Droptarget(this.element, {
|
|
5995
|
-
acceptedTargetZones: ['top', 'bottom'],
|
|
5996
|
-
overlayModel: {
|
|
5997
|
-
activationSize: { type: 'percentage', value: 50 },
|
|
5998
|
-
},
|
|
5999
|
-
canDisplayOverlay: (event) => {
|
|
6000
|
-
const data = getPaneData();
|
|
6001
|
-
if (data) {
|
|
6002
|
-
if (data.paneId !== this.id &&
|
|
6003
|
-
data.viewId === this.accessor.id) {
|
|
6004
|
-
return true;
|
|
5967
|
+
fromJSON(serializedSplitview) {
|
|
5968
|
+
this.clear();
|
|
5969
|
+
const { views, orientation, size, activeView } = serializedSplitview;
|
|
5970
|
+
const queue = [];
|
|
5971
|
+
this.splitview = new Splitview(this.element, {
|
|
5972
|
+
orientation,
|
|
5973
|
+
proportionalLayout: this.options.proportionalLayout,
|
|
5974
|
+
descriptor: {
|
|
5975
|
+
size,
|
|
5976
|
+
views: views.map((view) => {
|
|
5977
|
+
const data = view.data;
|
|
5978
|
+
if (this._panels.has(data.id)) {
|
|
5979
|
+
throw new Error(`panel ${data.id} already exists`);
|
|
6005
5980
|
}
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
5981
|
+
const panel = createComponent(data.id, data.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkWrapper
|
|
5982
|
+
? {
|
|
5983
|
+
createComponent: this.options.frameworkWrapper
|
|
5984
|
+
.createComponent,
|
|
5985
|
+
}
|
|
5986
|
+
: undefined);
|
|
5987
|
+
queue.push(() => {
|
|
5988
|
+
panel.init({
|
|
5989
|
+
params: data.params || {},
|
|
5990
|
+
minimumSize: data.minimumSize,
|
|
5991
|
+
maximumSize: data.maximumSize,
|
|
5992
|
+
snap: view.snap,
|
|
5993
|
+
priority: view.priority,
|
|
5994
|
+
accessor: this,
|
|
5995
|
+
});
|
|
6012
5996
|
});
|
|
6013
|
-
|
|
6014
|
-
|
|
5997
|
+
panel.orientation = orientation;
|
|
5998
|
+
this.doAddView(panel);
|
|
5999
|
+
setTimeout(() => {
|
|
6000
|
+
// the original onDidAddView events are missed since they are fired before we can subcribe to them
|
|
6001
|
+
this._onDidAddView.fire(panel);
|
|
6002
|
+
}, 0);
|
|
6003
|
+
return { size: view.size, view: panel };
|
|
6004
|
+
}),
|
|
6015
6005
|
},
|
|
6016
6006
|
});
|
|
6017
|
-
this.
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
// if there is no local drag event for this panel
|
|
6025
|
-
// or if the drag event was creating by another Paneview instance
|
|
6026
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: getPaneData }));
|
|
6027
|
-
return;
|
|
6028
|
-
}
|
|
6029
|
-
const containerApi = this._params
|
|
6030
|
-
.containerApi;
|
|
6031
|
-
const panelId = data.paneId;
|
|
6032
|
-
const existingPanel = containerApi.getPanel(panelId);
|
|
6033
|
-
if (!existingPanel) {
|
|
6034
|
-
// if the panel doesn't exist
|
|
6035
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: getPaneData }));
|
|
6036
|
-
return;
|
|
6007
|
+
this.layout(this.width, this.height);
|
|
6008
|
+
queue.forEach((f) => f());
|
|
6009
|
+
if (typeof activeView === 'string') {
|
|
6010
|
+
const panel = this.getPanel(activeView);
|
|
6011
|
+
if (panel) {
|
|
6012
|
+
this.setActive(panel);
|
|
6013
|
+
}
|
|
6037
6014
|
}
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6015
|
+
this._onDidLayoutfromJSON.fire();
|
|
6016
|
+
}
|
|
6017
|
+
clear() {
|
|
6018
|
+
for (const [_, value] of this._panels.entries()) {
|
|
6019
|
+
value.disposable.dispose();
|
|
6020
|
+
value.value.dispose();
|
|
6043
6021
|
}
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6022
|
+
this._panels.clear();
|
|
6023
|
+
this.splitview.dispose();
|
|
6024
|
+
}
|
|
6025
|
+
dispose() {
|
|
6026
|
+
for (const [_, value] of this._panels.entries()) {
|
|
6027
|
+
value.disposable.dispose();
|
|
6028
|
+
value.value.dispose();
|
|
6049
6029
|
}
|
|
6050
|
-
|
|
6030
|
+
this._panels.clear();
|
|
6031
|
+
this.splitview.dispose();
|
|
6032
|
+
super.dispose();
|
|
6051
6033
|
}
|
|
6052
6034
|
}
|
|
6053
6035
|
|
|
@@ -6190,7 +6172,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6190
6172
|
this.addDisposables(this._disposable);
|
|
6191
6173
|
}
|
|
6192
6174
|
focus() {
|
|
6193
|
-
//
|
|
6175
|
+
//noop
|
|
6194
6176
|
}
|
|
6195
6177
|
updateOptions(options) {
|
|
6196
6178
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
@@ -6509,7 +6491,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6509
6491
|
* require a key property like any other React element rendered in an array
|
|
6510
6492
|
* to prevent excessive re-rendering
|
|
6511
6493
|
*/
|
|
6512
|
-
const uniquePortalKeyGenerator =
|
|
6494
|
+
const uniquePortalKeyGenerator = (() => {
|
|
6495
|
+
let value = 1;
|
|
6496
|
+
return { next: () => `dockview_react_portal_key_${(value++).toString()}` };
|
|
6497
|
+
})();
|
|
6513
6498
|
const ReactPartContext = React__namespace.createContext({});
|
|
6514
6499
|
class ReactPart {
|
|
6515
6500
|
constructor(parent, portalStore, component, parameters, context) {
|
|
@@ -6626,18 +6611,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6626
6611
|
containerApi: parameters.containerApi,
|
|
6627
6612
|
});
|
|
6628
6613
|
}
|
|
6629
|
-
toJSON() {
|
|
6630
|
-
return {
|
|
6631
|
-
id: this.id,
|
|
6632
|
-
};
|
|
6633
|
-
}
|
|
6634
6614
|
update(event) {
|
|
6635
6615
|
var _a;
|
|
6636
6616
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
6637
6617
|
}
|
|
6638
|
-
updateParentGroup(group, _isPanelVisible) {
|
|
6639
|
-
this._group = group;
|
|
6640
|
-
}
|
|
6641
6618
|
layout(_width, _height) {
|
|
6642
6619
|
// noop
|
|
6643
6620
|
}
|
|
@@ -6674,60 +6651,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6674
6651
|
var _a;
|
|
6675
6652
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
6676
6653
|
}
|
|
6677
|
-
toJSON() {
|
|
6678
|
-
if (this.id === DEFAULT_TAB_IDENTIFIER) {
|
|
6679
|
-
return {};
|
|
6680
|
-
}
|
|
6681
|
-
return {
|
|
6682
|
-
id: this.id,
|
|
6683
|
-
};
|
|
6684
|
-
}
|
|
6685
6654
|
layout(_width, _height) {
|
|
6686
6655
|
// noop - retrieval from api
|
|
6687
6656
|
}
|
|
6688
|
-
updateParentGroup(_group, _isPanelVisible) {
|
|
6689
|
-
// noop - retrieval from api
|
|
6690
|
-
}
|
|
6691
6657
|
dispose() {
|
|
6692
6658
|
var _a;
|
|
6693
6659
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
6694
6660
|
}
|
|
6695
6661
|
}
|
|
6696
6662
|
|
|
6697
|
-
class ReactPanelDeserialzier {
|
|
6698
|
-
constructor(layout) {
|
|
6699
|
-
this.layout = layout;
|
|
6700
|
-
}
|
|
6701
|
-
fromJSON(panelData, group) {
|
|
6702
|
-
var _a, _b, _c, _d;
|
|
6703
|
-
const panelId = panelData.id;
|
|
6704
|
-
const params = panelData.params;
|
|
6705
|
-
const title = panelData.title;
|
|
6706
|
-
const viewData = panelData.view;
|
|
6707
|
-
let tab;
|
|
6708
|
-
if ((_a = viewData.tab) === null || _a === void 0 ? void 0 : _a.id) {
|
|
6709
|
-
tab = createComponent(viewData.tab.id, viewData.tab.id, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_b = this.layout.options.frameworkComponentFactory) === null || _b === void 0 ? void 0 : _b.tab, () => new DefaultTab());
|
|
6710
|
-
}
|
|
6711
|
-
else if (this.layout.options.defaultTabComponent) {
|
|
6712
|
-
tab = createComponent(this.layout.options.defaultTabComponent, this.layout.options.defaultTabComponent, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab, () => new DefaultTab());
|
|
6713
|
-
}
|
|
6714
|
-
else {
|
|
6715
|
-
tab = new DefaultTab();
|
|
6716
|
-
}
|
|
6717
|
-
const view = new DefaultGroupPanelView({
|
|
6718
|
-
content: createComponent(viewData.content.id, viewData.content.id, this.layout.options.components, this.layout.options.frameworkComponents, (_d = this.layout.options.frameworkComponentFactory) === null || _d === void 0 ? void 0 : _d.content),
|
|
6719
|
-
tab,
|
|
6720
|
-
});
|
|
6721
|
-
const panel = new DockviewPanel(panelId, this.layout, new DockviewApi(this.layout), group);
|
|
6722
|
-
panel.init({
|
|
6723
|
-
view,
|
|
6724
|
-
title,
|
|
6725
|
-
params: params || {},
|
|
6726
|
-
});
|
|
6727
|
-
return panel;
|
|
6728
|
-
}
|
|
6729
|
-
}
|
|
6730
|
-
|
|
6731
6663
|
class ReactWatermarkPart {
|
|
6732
6664
|
get element() {
|
|
6733
6665
|
return this._element;
|
|
@@ -6736,21 +6668,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6736
6668
|
this.id = id;
|
|
6737
6669
|
this.component = component;
|
|
6738
6670
|
this.reactPortalStore = reactPortalStore;
|
|
6739
|
-
this._groupRef = {
|
|
6740
|
-
value: undefined,
|
|
6741
|
-
};
|
|
6742
6671
|
this._element = document.createElement('div');
|
|
6743
6672
|
this._element.className = 'dockview-react-part';
|
|
6744
6673
|
}
|
|
6745
6674
|
init(parameters) {
|
|
6746
|
-
this.parameters = parameters;
|
|
6747
6675
|
this.part = new ReactPart(this.element, this.reactPortalStore, this.component, {
|
|
6748
|
-
|
|
6749
|
-
api: parameters.api,
|
|
6676
|
+
group: parameters.group,
|
|
6750
6677
|
containerApi: parameters.containerApi,
|
|
6751
6678
|
close: () => {
|
|
6752
|
-
if (
|
|
6753
|
-
parameters.containerApi.removeGroup(
|
|
6679
|
+
if (parameters.group) {
|
|
6680
|
+
parameters.containerApi.removeGroup(parameters.group);
|
|
6754
6681
|
}
|
|
6755
6682
|
},
|
|
6756
6683
|
});
|
|
@@ -6765,17 +6692,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6765
6692
|
}
|
|
6766
6693
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update({ params: ((_b = this.parameters) === null || _b === void 0 ? void 0 : _b.params) || {} });
|
|
6767
6694
|
}
|
|
6768
|
-
toJSON() {
|
|
6769
|
-
return {
|
|
6770
|
-
id: this.id,
|
|
6771
|
-
};
|
|
6772
|
-
}
|
|
6773
6695
|
layout(_width, _height) {
|
|
6774
6696
|
// noop - retrieval from api
|
|
6775
6697
|
}
|
|
6776
|
-
updateParentGroup(
|
|
6777
|
-
// noop
|
|
6778
|
-
this._groupRef.value = group;
|
|
6698
|
+
updateParentGroup(_group, _isPanelVisible) {
|
|
6699
|
+
// noop
|
|
6779
6700
|
}
|
|
6780
6701
|
dispose() {
|
|
6781
6702
|
var _a;
|
|
@@ -6857,6 +6778,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6857
6778
|
}
|
|
6858
6779
|
: undefined;
|
|
6859
6780
|
}
|
|
6781
|
+
const DEFAULT_REACT_TAB = 'props.defaultTabComponent';
|
|
6860
6782
|
const DockviewReact = React__namespace.forwardRef((props, ref) => {
|
|
6861
6783
|
const domRef = React__namespace.useRef(null);
|
|
6862
6784
|
const dockviewRef = React__namespace.useRef();
|
|
@@ -6903,13 +6825,20 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6903
6825
|
},
|
|
6904
6826
|
};
|
|
6905
6827
|
const element = document.createElement('div');
|
|
6828
|
+
const frameworkTabComponents = props.tabComponents || {};
|
|
6829
|
+
if (props.defaultTabComponent) {
|
|
6830
|
+
frameworkTabComponents[DEFAULT_REACT_TAB] =
|
|
6831
|
+
props.defaultTabComponent;
|
|
6832
|
+
}
|
|
6906
6833
|
const dockview = new DockviewComponent(element, {
|
|
6907
6834
|
frameworkComponentFactory: factory,
|
|
6908
6835
|
frameworkComponents: props.components,
|
|
6909
|
-
frameworkTabComponents
|
|
6836
|
+
frameworkTabComponents,
|
|
6910
6837
|
tabHeight: props.tabHeight,
|
|
6911
6838
|
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6912
|
-
defaultTabComponent:
|
|
6839
|
+
defaultTabComponent: props.defaultTabComponent
|
|
6840
|
+
? DEFAULT_REACT_TAB
|
|
6841
|
+
: undefined,
|
|
6913
6842
|
styles: props.hideBorders
|
|
6914
6843
|
? { separatorBorder: 'transparent' }
|
|
6915
6844
|
: undefined,
|
|
@@ -6918,7 +6847,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6918
6847
|
singleTabMode: props.singleTabMode,
|
|
6919
6848
|
});
|
|
6920
6849
|
(_a = domRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(dockview.element);
|
|
6921
|
-
dockview.deserializer = new ReactPanelDeserialzier(dockview);
|
|
6922
6850
|
const { clientWidth, clientHeight } = domRef.current;
|
|
6923
6851
|
dockview.layout(clientWidth, clientHeight);
|
|
6924
6852
|
if (props.onReady) {
|
|
@@ -6981,9 +6909,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6981
6909
|
if (!dockviewRef.current) {
|
|
6982
6910
|
return;
|
|
6983
6911
|
}
|
|
6912
|
+
const frameworkTabComponents = props.tabComponents || {};
|
|
6913
|
+
if (props.defaultTabComponent) {
|
|
6914
|
+
frameworkTabComponents[DEFAULT_REACT_TAB] =
|
|
6915
|
+
props.defaultTabComponent;
|
|
6916
|
+
}
|
|
6984
6917
|
dockviewRef.current.updateOptions({
|
|
6985
|
-
defaultTabComponent:
|
|
6986
|
-
|
|
6918
|
+
defaultTabComponent: props.defaultTabComponent
|
|
6919
|
+
? DEFAULT_REACT_TAB
|
|
6920
|
+
: undefined,
|
|
6921
|
+
frameworkTabComponents,
|
|
6987
6922
|
});
|
|
6988
6923
|
}, [props.defaultTabComponent]);
|
|
6989
6924
|
React__namespace.useEffect(() => {
|
|
@@ -7128,7 +7063,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7128
7063
|
|
|
7129
7064
|
class ReactGridPanelView extends GridviewPanel {
|
|
7130
7065
|
constructor(id, component, reactComponent, reactPortalStore) {
|
|
7131
|
-
super(id, component
|
|
7066
|
+
super(id, component);
|
|
7132
7067
|
this.reactComponent = reactComponent;
|
|
7133
7068
|
this.reactPortalStore = reactPortalStore;
|
|
7134
7069
|
}
|
|
@@ -7338,16 +7273,24 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7338
7273
|
|
|
7339
7274
|
exports.BaseGrid = BaseGrid;
|
|
7340
7275
|
exports.ContentContainer = ContentContainer;
|
|
7276
|
+
exports.DefaultDockviewDeserialzier = DefaultDockviewDeserialzier;
|
|
7277
|
+
exports.DefaultTab = DefaultTab;
|
|
7341
7278
|
exports.DockviewApi = DockviewApi;
|
|
7342
7279
|
exports.DockviewComponent = DockviewComponent;
|
|
7280
|
+
exports.DockviewCompositeDisposable = CompositeDisposable;
|
|
7343
7281
|
exports.DockviewDefaultTab = DockviewDefaultTab;
|
|
7282
|
+
exports.DockviewEmitter = Emitter;
|
|
7283
|
+
exports.DockviewGroupPanel = DockviewGroupPanel;
|
|
7284
|
+
exports.DockviewGroupPanelModel = DockviewGroupPanelModel;
|
|
7285
|
+
exports.DockviewMutableDisposable = MutableDisposable;
|
|
7286
|
+
exports.DockviewPanel = DockviewPanel;
|
|
7344
7287
|
exports.DockviewReact = DockviewReact;
|
|
7288
|
+
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
7345
7289
|
exports.Gridview = Gridview;
|
|
7346
7290
|
exports.GridviewApi = GridviewApi;
|
|
7347
7291
|
exports.GridviewComponent = GridviewComponent;
|
|
7348
7292
|
exports.GridviewPanel = GridviewPanel;
|
|
7349
7293
|
exports.GridviewReact = GridviewReact;
|
|
7350
|
-
exports.Groupview = Groupview;
|
|
7351
7294
|
exports.LocalSelectionTransfer = LocalSelectionTransfer;
|
|
7352
7295
|
exports.PaneFramework = PaneFramework;
|
|
7353
7296
|
exports.PaneTransfer = PaneTransfer;
|
|
@@ -7365,6 +7308,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7365
7308
|
exports.SplitviewPanel = SplitviewPanel;
|
|
7366
7309
|
exports.SplitviewReact = SplitviewReact;
|
|
7367
7310
|
exports.Tab = Tab;
|
|
7311
|
+
exports.createComponent = createComponent;
|
|
7368
7312
|
exports.directionToPosition = directionToPosition;
|
|
7369
7313
|
exports.getDirectionOrientation = getDirectionOrientation;
|
|
7370
7314
|
exports.getGridLocation = getGridLocation;
|
|
@@ -7383,5 +7327,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7383
7327
|
exports.positionToDirection = positionToDirection;
|
|
7384
7328
|
exports.toTarget = toTarget;
|
|
7385
7329
|
exports.usePortalsLifecycle = usePortalsLifecycle;
|
|
7330
|
+
exports.watchElementResize = watchElementResize;
|
|
7386
7331
|
|
|
7387
7332
|
}));
|