dockview 1.5.1 → 1.6.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/LICENSE +21 -21
- package/README.md +52 -52
- package/dist/cjs/actionbar/actionsContainer.d.ts +7 -7
- package/dist/cjs/actionbar/actionsContainer.js +26 -26
- package/dist/cjs/api/component.api.d.ts +145 -144
- package/dist/cjs/api/component.api.js +578 -571
- package/dist/cjs/api/component.api.js.map +1 -1
- package/dist/cjs/api/{groupPanelApi.d.ts → dockviewPanelApi.d.ts} +34 -34
- package/dist/cjs/api/{groupPanelApi.js → dockviewPanelApi.js} +84 -86
- package/dist/cjs/api/dockviewPanelApi.js.map +1 -0
- package/dist/cjs/api/gridviewPanelApi.d.ts +37 -36
- package/dist/cjs/api/gridviewPanelApi.js +47 -47
- package/dist/cjs/api/gridviewPanelApi.js.map +1 -1
- package/dist/cjs/api/panelApi.d.ts +88 -81
- package/dist/cjs/api/panelApi.js +137 -121
- package/dist/cjs/api/panelApi.js.map +1 -1
- package/dist/cjs/api/paneviewPanelApi.d.ts +26 -26
- package/dist/cjs/api/paneviewPanelApi.js +57 -57
- package/dist/cjs/api/splitviewPanelApi.d.ts +32 -32
- package/dist/cjs/api/splitviewPanelApi.js +47 -47
- package/dist/cjs/array.d.ts +13 -13
- package/dist/cjs/array.js +77 -77
- package/dist/cjs/dnd/abstractDragHandler.d.ts +11 -11
- package/dist/cjs/dnd/abstractDragHandler.js +115 -115
- package/dist/cjs/dnd/abstractDragHandler.js.map +1 -1
- package/dist/cjs/dnd/dataTransfer.d.ts +31 -31
- package/dist/cjs/dnd/dataTransfer.js +100 -100
- package/dist/cjs/dnd/dataTransfer.js.map +1 -1
- package/dist/cjs/dnd/dnd.d.ts +27 -27
- package/dist/cjs/dnd/dnd.js +59 -64
- package/dist/cjs/dnd/dnd.js.map +1 -1
- package/dist/cjs/dnd/droptarget.d.ts +42 -37
- package/dist/cjs/dnd/droptarget.js +279 -201
- package/dist/cjs/dnd/droptarget.js.map +1 -1
- package/dist/cjs/dnd/ghost.d.ts +1 -0
- package/dist/cjs/dnd/ghost.js +15 -0
- package/dist/cjs/dnd/ghost.js.map +1 -0
- package/dist/cjs/dnd/groupDragHandler.d.ts +11 -0
- package/dist/cjs/dnd/groupDragHandler.js +62 -0
- package/dist/cjs/dnd/groupDragHandler.js.map +1 -0
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +27 -27
- package/dist/cjs/dockview/components/tab/defaultTab.js +121 -121
- package/dist/cjs/dockview/components/watermark/watermark.d.ts +20 -20
- package/dist/cjs/dockview/components/watermark/watermark.js +101 -101
- package/dist/cjs/dockview/defaultGroupPanelView.d.ts +29 -29
- package/dist/cjs/dockview/defaultGroupPanelView.js +68 -68
- package/dist/cjs/dockview/deserializer.d.ts +6 -5
- package/dist/cjs/dockview/deserializer.js +2 -2
- package/dist/cjs/dockview/dockviewComponent.d.ts +133 -125
- package/dist/cjs/dockview/dockviewComponent.js +795 -614
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/{esm/dockview/dockviewGroupPanel.d.ts → cjs/dockview/dockviewPanel.d.ts} +42 -31
- package/dist/cjs/dockview/{dockviewGroupPanel.js → dockviewPanel.js} +161 -157
- package/dist/cjs/dockview/dockviewPanel.js.map +1 -0
- package/dist/cjs/dockview/options.d.ts +110 -88
- package/dist/cjs/dockview/options.js +31 -2
- package/dist/cjs/dockview/options.js.map +1 -1
- package/dist/cjs/dockview/validation.d.ts +2 -0
- package/dist/cjs/dockview/validation.js +135 -0
- package/dist/cjs/dockview/validation.js.map +1 -0
- package/dist/cjs/dom.d.ts +14 -14
- package/dist/cjs/dom.js +182 -182
- package/dist/cjs/events.d.ts +30 -30
- package/dist/cjs/events.js +129 -129
- package/dist/cjs/gridview/baseComponentGridview.d.ts +87 -87
- package/dist/cjs/gridview/baseComponentGridview.js +278 -279
- package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
- package/dist/cjs/gridview/basePanelView.d.ts +43 -43
- package/dist/cjs/gridview/basePanelView.js +123 -123
- package/dist/cjs/gridview/branchNode.d.ts +49 -46
- package/dist/cjs/gridview/branchNode.js +342 -342
- package/dist/cjs/gridview/branchNode.js.map +1 -1
- package/dist/cjs/gridview/gridview.d.ts +132 -123
- package/dist/cjs/gridview/gridview.js +510 -479
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +85 -85
- package/dist/cjs/gridview/gridviewComponent.js +324 -325
- package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts +60 -60
- package/dist/cjs/gridview/gridviewPanel.js +201 -202
- package/dist/cjs/gridview/gridviewPanel.js.map +1 -1
- package/dist/cjs/gridview/leafNode.d.ts +34 -31
- package/dist/cjs/gridview/leafNode.js +170 -165
- package/dist/cjs/gridview/leafNode.js.map +1 -1
- package/dist/cjs/gridview/options.d.ts +18 -18
- package/dist/cjs/gridview/options.js +2 -2
- package/dist/cjs/gridview/types.d.ts +3 -3
- package/dist/cjs/gridview/types.js +2 -2
- package/dist/cjs/groupview/dnd.d.ts +6 -5
- package/dist/cjs/groupview/dnd.js +10 -9
- package/dist/cjs/groupview/dnd.js.map +1 -1
- package/dist/cjs/groupview/groupview.d.ts +177 -177
- package/dist/cjs/groupview/groupview.js +607 -589
- package/dist/cjs/groupview/groupview.js.map +1 -1
- package/dist/cjs/groupview/groupviewPanel.d.ts +35 -35
- package/dist/cjs/groupview/groupviewPanel.js +128 -128
- package/dist/cjs/groupview/panel/content.d.ts +30 -30
- package/dist/cjs/groupview/panel/content.js +100 -100
- package/dist/cjs/groupview/tab.d.ts +31 -41
- package/dist/cjs/groupview/tab.js +124 -120
- package/dist/cjs/groupview/tab.js.map +1 -1
- package/dist/cjs/groupview/titlebar/tabsContainer.d.ts +65 -68
- package/dist/cjs/groupview/titlebar/tabsContainer.js +251 -258
- package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
- package/dist/cjs/groupview/titlebar/voidContainer.d.ts +15 -0
- package/dist/cjs/groupview/titlebar/voidContainer.js +74 -0
- package/dist/cjs/groupview/titlebar/voidContainer.js.map +1 -0
- package/dist/cjs/groupview/types.d.ts +68 -52
- package/dist/cjs/groupview/types.js +2 -2
- package/dist/cjs/hostedContainer.d.ts +23 -23
- package/dist/cjs/hostedContainer.js +73 -73
- package/dist/cjs/index.d.ts +30 -30
- package/dist/cjs/index.js +47 -46
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lifecycle.d.ts +22 -22
- package/dist/cjs/lifecycle.js +88 -88
- package/dist/cjs/math.d.ts +4 -4
- package/dist/cjs/math.js +15 -15
- package/dist/cjs/panel/componentFactory.d.ts +8 -8
- package/dist/cjs/panel/componentFactory.js +30 -30
- package/dist/cjs/panel/types.d.ts +33 -33
- package/dist/cjs/panel/types.js +2 -2
- package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +21 -21
- package/dist/cjs/paneview/defaultPaneviewHeader.js +90 -90
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +19 -19
- package/dist/cjs/paneview/draggablePaneviewPanel.js +130 -129
- package/dist/cjs/paneview/draggablePaneviewPanel.js.map +1 -1
- package/dist/cjs/paneview/options.d.ts +27 -27
- package/dist/cjs/paneview/options.js +2 -2
- package/dist/cjs/paneview/paneview.d.ts +40 -40
- package/dist/cjs/paneview/paneview.js +201 -201
- package/dist/cjs/paneview/paneviewComponent.d.ts +129 -129
- package/dist/cjs/paneview/paneviewComponent.js +394 -394
- package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
- package/dist/cjs/paneview/paneviewPanel.d.ts +92 -89
- package/dist/cjs/paneview/paneviewPanel.js +275 -274
- package/dist/cjs/paneview/paneviewPanel.js.map +1 -1
- package/dist/cjs/react/deserializer.d.ts +10 -9
- package/dist/cjs/react/deserializer.js +43 -43
- package/dist/cjs/react/deserializer.js.map +1 -1
- package/dist/cjs/react/dockview/defaultTab.d.ts +4 -4
- package/dist/cjs/react/dockview/defaultTab.js +72 -72
- package/dist/cjs/react/dockview/dockview.d.ts +35 -34
- package/dist/cjs/react/dockview/dockview.js +213 -212
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/cjs/react/dockview/groupControlsRenderer.d.ts +43 -43
- package/dist/cjs/react/dockview/groupControlsRenderer.js +86 -86
- package/dist/cjs/react/dockview/reactContentPart.d.ts +30 -30
- package/dist/cjs/react/dockview/reactContentPart.js +58 -58
- package/dist/cjs/react/dockview/reactHeaderPart.d.ts +26 -26
- package/dist/cjs/react/dockview/reactHeaderPart.js +55 -55
- package/dist/cjs/react/dockview/reactWatermarkPart.d.ts +29 -29
- package/dist/cjs/react/dockview/reactWatermarkPart.js +65 -65
- package/dist/cjs/react/dockview/v2/reactContentRenderer.d.ts +29 -29
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js +87 -87
- package/dist/cjs/react/dockview/v2/reactGroupPanelView.d.ts +7 -7
- package/dist/cjs/react/dockview/v2/reactGroupPanelView.js +34 -34
- package/dist/cjs/react/dockview/v2/webviewContentRenderer.d.ts +18 -18
- package/dist/cjs/react/dockview/v2/webviewContentRenderer.js +45 -45
- package/dist/cjs/react/gridview/gridview.d.ts +24 -24
- package/dist/cjs/react/gridview/gridview.js +112 -112
- package/dist/cjs/react/gridview/view.d.ts +11 -11
- package/dist/cjs/react/gridview/view.js +41 -40
- package/dist/cjs/react/gridview/view.js.map +1 -1
- package/dist/cjs/react/index.d.ts +9 -9
- package/dist/cjs/react/index.js +23 -23
- package/dist/cjs/react/paneview/paneview.d.ts +30 -30
- package/dist/cjs/react/paneview/paneview.js +155 -155
- package/dist/cjs/react/paneview/view.d.ts +20 -20
- package/dist/cjs/react/paneview/view.js +44 -44
- package/dist/cjs/react/react.d.ts +36 -36
- package/dist/cjs/react/react.js +194 -194
- package/dist/cjs/react/splitview/splitview.d.ts +24 -24
- package/dist/cjs/react/splitview/splitview.js +108 -108
- package/dist/cjs/react/splitview/view.d.ts +10 -10
- package/dist/cjs/react/splitview/view.js +40 -40
- package/dist/cjs/react/svg.d.ts +3 -3
- package/dist/cjs/react/svg.js +35 -35
- package/dist/cjs/react/types.d.ts +7 -7
- package/dist/cjs/react/types.js +2 -2
- package/dist/cjs/splitview/core/options.d.ts +26 -26
- package/dist/cjs/splitview/core/options.js +2 -2
- package/dist/cjs/splitview/core/splitview.d.ts +127 -124
- package/dist/cjs/splitview/core/splitview.js +908 -908
- package/dist/cjs/splitview/core/splitview.js.map +1 -1
- package/dist/cjs/splitview/core/viewItem.d.ts +25 -25
- package/dist/cjs/splitview/core/viewItem.js +124 -124
- package/dist/cjs/splitview/splitviewComponent.d.ts +101 -101
- package/dist/cjs/splitview/splitviewComponent.js +373 -373
- package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
- package/dist/cjs/splitview/splitviewPanel.d.ts +45 -42
- package/dist/cjs/splitview/splitviewPanel.js +179 -178
- package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
- package/dist/cjs/svg.d.ts +3 -3
- package/dist/cjs/svg.js +43 -43
- package/dist/cjs/types.d.ts +8 -7
- package/dist/cjs/types.js +7 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/dockview.amd.js +7168 -6739
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.noStyle.js +7176 -6747
- package/dist/dockview.cjs.js +7167 -6738
- package/dist/dockview.esm.js +7152 -6726
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.js +7168 -6739
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.noStyle.js +7176 -6747
- package/dist/esm/actionbar/actionsContainer.d.ts +7 -7
- package/dist/esm/actionbar/actionsContainer.js +17 -17
- package/dist/esm/api/component.api.d.ts +145 -144
- package/dist/esm/api/component.api.js +329 -326
- package/dist/esm/api/{groupPanelApi.d.ts → dockviewPanelApi.d.ts} +34 -34
- package/dist/esm/api/{groupPanelApi.js → dockviewPanelApi.js} +48 -50
- package/dist/esm/api/gridviewPanelApi.d.ts +37 -36
- package/dist/esm/api/gridviewPanelApi.js +25 -25
- package/dist/esm/api/panelApi.d.ts +88 -81
- package/dist/esm/api/panelApi.js +95 -79
- package/dist/esm/api/paneviewPanelApi.d.ts +26 -26
- package/dist/esm/api/paneviewPanelApi.js +27 -27
- package/dist/esm/api/splitviewPanelApi.d.ts +32 -32
- package/dist/esm/api/splitviewPanelApi.js +25 -25
- package/dist/esm/array.d.ts +13 -13
- package/dist/esm/array.js +67 -67
- package/dist/esm/dnd/abstractDragHandler.d.ts +11 -11
- package/dist/esm/dnd/abstractDragHandler.js +37 -37
- package/dist/esm/dnd/dataTransfer.d.ts +31 -31
- package/dist/esm/dnd/dataTransfer.js +69 -69
- package/dist/esm/dnd/dnd.d.ts +27 -27
- package/dist/esm/dnd/dnd.js +36 -41
- package/dist/esm/dnd/droptarget.d.ts +42 -37
- package/dist/esm/dnd/droptarget.js +249 -167
- package/dist/esm/dnd/ghost.d.ts +1 -0
- package/dist/esm/dnd/ghost.js +10 -0
- package/dist/esm/dnd/groupDragHandler.d.ts +11 -0
- package/dist/esm/dnd/groupDragHandler.js +38 -0
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +27 -27
- package/dist/esm/dockview/components/tab/defaultTab.js +79 -79
- package/dist/esm/dockview/components/watermark/watermark.d.ts +20 -20
- package/dist/esm/dockview/components/watermark/watermark.js +70 -70
- package/dist/esm/dockview/defaultGroupPanelView.d.ts +29 -29
- package/dist/esm/dockview/defaultGroupPanelView.js +44 -44
- package/dist/esm/dockview/deserializer.d.ts +6 -5
- package/dist/esm/dockview/deserializer.js +1 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +133 -125
- package/dist/esm/dockview/dockviewComponent.js +632 -468
- package/dist/{cjs/dockview/dockviewGroupPanel.d.ts → esm/dockview/dockviewPanel.d.ts} +42 -31
- package/dist/esm/dockview/{dockviewGroupPanel.js → dockviewPanel.js} +111 -107
- package/dist/esm/dockview/options.d.ts +110 -88
- package/dist/esm/dockview/options.js +24 -1
- package/dist/esm/dockview/validation.d.ts +2 -0
- package/dist/esm/dockview/validation.js +86 -0
- package/dist/esm/dom.d.ts +14 -14
- package/dist/esm/dom.js +113 -113
- package/dist/esm/events.d.ts +30 -30
- package/dist/esm/events.js +88 -88
- package/dist/esm/gridview/baseComponentGridview.d.ts +87 -87
- package/dist/esm/gridview/baseComponentGridview.js +188 -189
- package/dist/esm/gridview/basePanelView.d.ts +43 -43
- package/dist/esm/gridview/basePanelView.js +74 -74
- package/dist/esm/gridview/branchNode.d.ts +49 -46
- package/dist/esm/gridview/branchNode.js +218 -218
- package/dist/esm/gridview/gridview.d.ts +132 -123
- package/dist/esm/gridview/gridview.js +423 -397
- package/dist/esm/gridview/gridviewComponent.d.ts +85 -85
- package/dist/esm/gridview/gridviewComponent.js +237 -238
- package/dist/esm/gridview/gridviewPanel.d.ts +60 -60
- package/dist/esm/gridview/gridviewPanel.js +138 -138
- package/dist/esm/gridview/leafNode.d.ts +34 -31
- package/dist/esm/gridview/leafNode.js +103 -98
- package/dist/esm/gridview/options.d.ts +18 -18
- package/dist/esm/gridview/options.js +1 -1
- package/dist/esm/gridview/types.d.ts +3 -3
- package/dist/esm/gridview/types.js +1 -1
- package/dist/esm/groupview/dnd.d.ts +6 -5
- package/dist/esm/groupview/dnd.js +7 -6
- package/dist/esm/groupview/groupview.d.ts +177 -177
- package/dist/esm/groupview/groupview.js +462 -444
- package/dist/esm/groupview/groupviewPanel.d.ts +35 -35
- package/dist/esm/groupview/groupviewPanel.js +61 -61
- package/dist/esm/groupview/panel/content.d.ts +30 -30
- package/dist/esm/groupview/panel/content.js +73 -73
- package/dist/esm/groupview/tab.d.ts +31 -41
- package/dist/esm/groupview/tab.js +94 -90
- package/dist/esm/groupview/titlebar/tabsContainer.d.ts +65 -68
- package/dist/esm/groupview/titlebar/tabsContainer.js +183 -190
- package/dist/esm/groupview/titlebar/voidContainer.d.ts +15 -0
- package/dist/esm/groupview/titlebar/voidContainer.js +47 -0
- package/dist/esm/groupview/types.d.ts +68 -52
- package/dist/esm/groupview/types.js +1 -1
- package/dist/esm/hostedContainer.d.ts +23 -23
- package/dist/esm/hostedContainer.js +63 -63
- package/dist/esm/index.d.ts +30 -30
- package/dist/esm/index.js +23 -23
- package/dist/esm/lifecycle.d.ts +22 -22
- package/dist/esm/lifecycle.js +39 -39
- package/dist/esm/math.d.ts +4 -4
- package/dist/esm/math.js +10 -10
- package/dist/esm/panel/componentFactory.d.ts +8 -8
- package/dist/esm/panel/componentFactory.js +24 -24
- package/dist/esm/panel/types.d.ts +33 -33
- package/dist/esm/panel/types.js +1 -1
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +21 -21
- package/dist/esm/paneview/defaultPaneviewHeader.js +63 -63
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +19 -19
- package/dist/esm/paneview/draggablePaneviewPanel.js +91 -90
- package/dist/esm/paneview/options.d.ts +27 -27
- package/dist/esm/paneview/options.js +1 -1
- package/dist/esm/paneview/paneview.d.ts +40 -40
- package/dist/esm/paneview/paneview.js +145 -145
- package/dist/esm/paneview/paneviewComponent.d.ts +129 -129
- package/dist/esm/paneview/paneviewComponent.js +270 -270
- package/dist/esm/paneview/paneviewPanel.d.ts +92 -89
- package/dist/esm/paneview/paneviewPanel.js +192 -191
- package/dist/esm/react/deserializer.d.ts +10 -9
- package/dist/esm/react/deserializer.js +38 -38
- package/dist/esm/react/dockview/defaultTab.d.ts +4 -4
- package/dist/esm/react/dockview/defaultTab.js +34 -34
- package/dist/esm/react/dockview/dockview.d.ts +35 -34
- package/dist/esm/react/dockview/dockview.js +158 -157
- package/dist/esm/react/dockview/groupControlsRenderer.d.ts +43 -43
- package/dist/esm/react/dockview/groupControlsRenderer.js +68 -68
- package/dist/esm/react/dockview/reactContentPart.d.ts +30 -30
- package/dist/esm/react/dockview/reactContentPart.js +49 -49
- package/dist/esm/react/dockview/reactHeaderPart.d.ts +26 -26
- package/dist/esm/react/dockview/reactHeaderPart.js +46 -46
- package/dist/esm/react/dockview/reactWatermarkPart.d.ts +29 -29
- package/dist/esm/react/dockview/reactWatermarkPart.js +55 -55
- package/dist/esm/react/dockview/v2/reactContentRenderer.d.ts +29 -29
- package/dist/esm/react/dockview/v2/reactContentRenderer.js +69 -69
- package/dist/esm/react/dockview/v2/reactGroupPanelView.d.ts +7 -7
- package/dist/esm/react/dockview/v2/reactGroupPanelView.js +12 -12
- package/dist/esm/react/dockview/v2/webviewContentRenderer.d.ts +18 -18
- package/dist/esm/react/dockview/v2/webviewContentRenderer.js +36 -36
- package/dist/esm/react/gridview/gridview.d.ts +24 -24
- package/dist/esm/react/gridview/gridview.js +70 -70
- package/dist/esm/react/gridview/view.d.ts +11 -11
- package/dist/esm/react/gridview/view.js +19 -18
- package/dist/esm/react/index.d.ts +9 -9
- package/dist/esm/react/index.js +7 -7
- package/dist/esm/react/paneview/paneview.d.ts +30 -30
- package/dist/esm/react/paneview/paneview.js +100 -100
- package/dist/esm/react/paneview/view.d.ts +20 -20
- package/dist/esm/react/paneview/view.js +35 -35
- package/dist/esm/react/react.d.ts +36 -36
- package/dist/esm/react/react.js +125 -125
- package/dist/esm/react/splitview/splitview.d.ts +24 -24
- package/dist/esm/react/splitview/splitview.js +66 -66
- package/dist/esm/react/splitview/view.d.ts +10 -10
- package/dist/esm/react/splitview/view.js +18 -18
- package/dist/esm/react/svg.d.ts +3 -3
- package/dist/esm/react/svg.js +7 -7
- package/dist/esm/react/types.d.ts +7 -7
- package/dist/esm/react/types.js +1 -1
- package/dist/esm/splitview/core/options.d.ts +26 -26
- package/dist/esm/splitview/core/options.js +1 -1
- package/dist/esm/splitview/core/splitview.d.ts +127 -124
- package/dist/esm/splitview/core/splitview.js +689 -689
- package/dist/esm/splitview/core/viewItem.d.ts +25 -25
- package/dist/esm/splitview/core/viewItem.js +79 -79
- package/dist/esm/splitview/splitviewComponent.d.ts +101 -101
- package/dist/esm/splitview/splitviewComponent.js +249 -249
- package/dist/esm/splitview/splitviewPanel.d.ts +45 -42
- package/dist/esm/splitview/splitviewPanel.js +108 -107
- package/dist/esm/svg.d.ts +3 -3
- package/dist/esm/svg.js +31 -31
- package/dist/esm/types.d.ts +8 -7
- package/dist/esm/types.js +3 -1
- package/dist/styles/dockview.css +23 -26
- package/package.json +12 -16
- package/dist/cjs/api/groupPanelApi.js.map +0 -1
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +0 -1
- package/dist/cjs/groupview/groupPanel.d.ts +0 -32
- package/dist/cjs/groupview/groupPanel.js +0 -3
- package/dist/cjs/groupview/groupPanel.js.map +0 -1
- package/dist/esm/groupview/groupPanel.d.ts +0 -32
- package/dist/esm/groupview/groupPanel.js +0 -1
|
@@ -1,468 +1,632 @@
|
|
|
1
|
-
import { getRelativeLocation, getGridLocation, } from '../gridview/gridview';
|
|
2
|
-
import {
|
|
3
|
-
import { tail, sequenceEquals } from '../array';
|
|
4
|
-
import {
|
|
5
|
-
import { CompositeDisposable } from '../lifecycle';
|
|
6
|
-
import { Event, Emitter } from '../events';
|
|
7
|
-
import { Watermark } from './components/watermark/watermark';
|
|
8
|
-
import { sequentialNumberGenerator } from '../math';
|
|
9
|
-
import { createComponent } from '../panel/componentFactory';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
this.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
this.options.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
this.
|
|
90
|
-
|
|
91
|
-
if (
|
|
92
|
-
this.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
this.
|
|
168
|
-
if (
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
this.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
1
|
+
import { getRelativeLocation, getGridLocation, } from '../gridview/gridview';
|
|
2
|
+
import { directionToPosition, Droptarget } from '../dnd/droptarget';
|
|
3
|
+
import { tail, sequenceEquals } from '../array';
|
|
4
|
+
import { DockviewPanel } from './dockviewPanel';
|
|
5
|
+
import { CompositeDisposable } from '../lifecycle';
|
|
6
|
+
import { Event, Emitter } from '../events';
|
|
7
|
+
import { Watermark } from './components/watermark/watermark';
|
|
8
|
+
import { sequentialNumberGenerator } from '../math';
|
|
9
|
+
import { createComponent } from '../panel/componentFactory';
|
|
10
|
+
import { isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, } from './options';
|
|
11
|
+
import { BaseGrid, toTarget, } from '../gridview/baseComponentGridview';
|
|
12
|
+
import { DockviewApi } from '../api/component.api';
|
|
13
|
+
import { Orientation, Sizing } from '../splitview/core/splitview';
|
|
14
|
+
import { DefaultTab } from './components/tab/defaultTab';
|
|
15
|
+
import { GroupPanel } from '../groupview/groupviewPanel';
|
|
16
|
+
import { DefaultGroupPanelView } from './defaultGroupPanelView';
|
|
17
|
+
import { getPanelData } from '../dnd/dataTransfer';
|
|
18
|
+
import { DockviewDropTargets } from '../groupview/dnd';
|
|
19
|
+
export class DockviewComponent extends BaseGrid {
|
|
20
|
+
get orientation() {
|
|
21
|
+
return this.gridview.orientation;
|
|
22
|
+
}
|
|
23
|
+
get totalPanels() {
|
|
24
|
+
return this.panels.length;
|
|
25
|
+
}
|
|
26
|
+
get panels() {
|
|
27
|
+
return this.groups.flatMap((group) => group.panels);
|
|
28
|
+
}
|
|
29
|
+
get deserializer() {
|
|
30
|
+
return this._deserializer;
|
|
31
|
+
}
|
|
32
|
+
set deserializer(value) {
|
|
33
|
+
this._deserializer = value;
|
|
34
|
+
}
|
|
35
|
+
get options() {
|
|
36
|
+
return this._options;
|
|
37
|
+
}
|
|
38
|
+
get activePanel() {
|
|
39
|
+
const activeGroup = this.activeGroup;
|
|
40
|
+
if (!activeGroup) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return activeGroup.activePanel;
|
|
44
|
+
}
|
|
45
|
+
set tabHeight(height) {
|
|
46
|
+
this.options.tabHeight = height;
|
|
47
|
+
this._groups.forEach((value) => {
|
|
48
|
+
value.value.model.header.height = height;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
get tabHeight() {
|
|
52
|
+
return this.options.tabHeight;
|
|
53
|
+
}
|
|
54
|
+
constructor(element, options) {
|
|
55
|
+
super(element, {
|
|
56
|
+
proportionalLayout: true,
|
|
57
|
+
orientation: options.orientation || Orientation.HORIZONTAL,
|
|
58
|
+
styles: options.styles,
|
|
59
|
+
});
|
|
60
|
+
this.nextGroupId = sequentialNumberGenerator();
|
|
61
|
+
this.watermark = null;
|
|
62
|
+
this._onDidDrop = new Emitter();
|
|
63
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
64
|
+
this._onDidRemovePanel = new Emitter();
|
|
65
|
+
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
66
|
+
this._onDidAddPanel = new Emitter();
|
|
67
|
+
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
68
|
+
this._onDidLayoutFromJSON = new Emitter();
|
|
69
|
+
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
70
|
+
this._onDidActivePanelChange = new Emitter();
|
|
71
|
+
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
72
|
+
this.element.classList.add('dv-dockview');
|
|
73
|
+
this.addDisposables(this._onDidDrop, Event.any(this.onDidAddGroup, this.onDidRemoveGroup)(() => {
|
|
74
|
+
this.updateWatermark();
|
|
75
|
+
}), Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
76
|
+
this._bufferOnDidLayoutChange.fire();
|
|
77
|
+
}));
|
|
78
|
+
this._options = options;
|
|
79
|
+
if (!this.options.components) {
|
|
80
|
+
this.options.components = {};
|
|
81
|
+
}
|
|
82
|
+
if (!this.options.frameworkComponents) {
|
|
83
|
+
this.options.frameworkComponents = {};
|
|
84
|
+
}
|
|
85
|
+
if (!this.options.frameworkTabComponents) {
|
|
86
|
+
this.options.frameworkTabComponents = {};
|
|
87
|
+
}
|
|
88
|
+
if (!this.options.tabComponents) {
|
|
89
|
+
this.options.tabComponents = {};
|
|
90
|
+
}
|
|
91
|
+
if (!this.options.watermarkComponent &&
|
|
92
|
+
!this.options.watermarkFrameworkComponent) {
|
|
93
|
+
this.options.watermarkComponent = Watermark;
|
|
94
|
+
}
|
|
95
|
+
const dropTarget = new Droptarget(this.element, {
|
|
96
|
+
canDisplayOverlay: (event, position) => {
|
|
97
|
+
const data = getPanelData();
|
|
98
|
+
if (data) {
|
|
99
|
+
if (data.viewId !== this.id) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
if (this.options.showDndOverlay) {
|
|
105
|
+
return this.options.showDndOverlay({
|
|
106
|
+
nativeEvent: event,
|
|
107
|
+
position: position,
|
|
108
|
+
target: DockviewDropTargets.Edge,
|
|
109
|
+
getData: getPanelData,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return false;
|
|
113
|
+
},
|
|
114
|
+
acceptedTargetZones: ['top', 'bottom', 'left', 'right'],
|
|
115
|
+
overlayModel: {
|
|
116
|
+
activationSize: { type: 'pixels', value: 10 },
|
|
117
|
+
size: { type: 'pixels', value: 20 },
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
this.addDisposables(dropTarget, dropTarget.onDrop((event) => {
|
|
121
|
+
const data = getPanelData();
|
|
122
|
+
if (data) {
|
|
123
|
+
this.moveGroupOrPanel(this.orthogonalize(event.position), data.groupId, data.panelId || undefined, 'center');
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api, group: null, getData: getPanelData }));
|
|
127
|
+
}
|
|
128
|
+
}));
|
|
129
|
+
this._api = new DockviewApi(this);
|
|
130
|
+
this.updateWatermark();
|
|
131
|
+
}
|
|
132
|
+
orthogonalize(position) {
|
|
133
|
+
switch (position) {
|
|
134
|
+
case 'top':
|
|
135
|
+
case 'bottom':
|
|
136
|
+
if (this.gridview.orientation === Orientation.HORIZONTAL) {
|
|
137
|
+
// we need to add to a vertical splitview but the current root is a horizontal splitview.
|
|
138
|
+
// insert a vertical splitview at the root level and add the existing view as a child
|
|
139
|
+
this.gridview.insertOrthogonalSplitviewAtRoot();
|
|
140
|
+
}
|
|
141
|
+
break;
|
|
142
|
+
case 'left':
|
|
143
|
+
case 'right':
|
|
144
|
+
if (this.gridview.orientation === Orientation.VERTICAL) {
|
|
145
|
+
// we need to add to a horizontal splitview but the current root is a vertical splitview.
|
|
146
|
+
// insert a horiziontal splitview at the root level and add the existing view as a child
|
|
147
|
+
this.gridview.insertOrthogonalSplitviewAtRoot();
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
150
|
+
default:
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
switch (position) {
|
|
154
|
+
case 'top':
|
|
155
|
+
case 'left':
|
|
156
|
+
return this.createGroupAtLocation([0]); // insert into first position
|
|
157
|
+
case 'bottom':
|
|
158
|
+
case 'right':
|
|
159
|
+
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
|
160
|
+
default:
|
|
161
|
+
throw new Error(`unsupported position ${position}`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
updateOptions(options) {
|
|
165
|
+
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
166
|
+
this.gridview.orientation !== options.orientation;
|
|
167
|
+
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
168
|
+
if (hasOrientationChanged) {
|
|
169
|
+
this.gridview.orientation = options.orientation;
|
|
170
|
+
}
|
|
171
|
+
this.layout(this.gridview.width, this.gridview.height, true);
|
|
172
|
+
}
|
|
173
|
+
focus() {
|
|
174
|
+
var _a;
|
|
175
|
+
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
176
|
+
}
|
|
177
|
+
getGroupPanel(id) {
|
|
178
|
+
return this.panels.find((panel) => panel.id === id);
|
|
179
|
+
}
|
|
180
|
+
setActivePanel(panel) {
|
|
181
|
+
this.doSetGroupActive(panel.group);
|
|
182
|
+
panel.group.model.openPanel(panel);
|
|
183
|
+
}
|
|
184
|
+
moveToNext(options = {}) {
|
|
185
|
+
var _a;
|
|
186
|
+
if (!options.group) {
|
|
187
|
+
if (!this.activeGroup) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
options.group = this.activeGroup;
|
|
191
|
+
}
|
|
192
|
+
if (options.includePanel && options.group) {
|
|
193
|
+
if (options.group.activePanel !==
|
|
194
|
+
options.group.panels[options.group.panels.length - 1]) {
|
|
195
|
+
options.group.model.moveToNext({ suppressRoll: true });
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const location = getGridLocation(options.group.element);
|
|
200
|
+
const next = (_a = this.gridview.next(location)) === null || _a === void 0 ? void 0 : _a.view;
|
|
201
|
+
this.doSetGroupActive(next);
|
|
202
|
+
}
|
|
203
|
+
moveToPrevious(options = {}) {
|
|
204
|
+
var _a;
|
|
205
|
+
if (!options.group) {
|
|
206
|
+
if (!this.activeGroup) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
options.group = this.activeGroup;
|
|
210
|
+
}
|
|
211
|
+
if (options.includePanel && options.group) {
|
|
212
|
+
if (options.group.activePanel !== options.group.panels[0]) {
|
|
213
|
+
options.group.model.moveToPrevious({ suppressRoll: true });
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const location = getGridLocation(options.group.element);
|
|
218
|
+
const next = (_a = this.gridview.previous(location)) === null || _a === void 0 ? void 0 : _a.view;
|
|
219
|
+
if (next) {
|
|
220
|
+
this.doSetGroupActive(next);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Serialize the current state of the layout
|
|
225
|
+
*
|
|
226
|
+
* @returns A JSON respresentation of the layout
|
|
227
|
+
*/
|
|
228
|
+
toJSON() {
|
|
229
|
+
var _a;
|
|
230
|
+
const data = this.gridview.serialize();
|
|
231
|
+
const panels = this.panels.reduce((collection, panel) => {
|
|
232
|
+
collection[panel.id] = panel.toJSON();
|
|
233
|
+
return collection;
|
|
234
|
+
}, {});
|
|
235
|
+
return {
|
|
236
|
+
grid: data,
|
|
237
|
+
panels,
|
|
238
|
+
activeGroup: (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.id,
|
|
239
|
+
options: { tabHeight: this.tabHeight },
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
fromJSON(data) {
|
|
243
|
+
this.clear();
|
|
244
|
+
if (!this.deserializer) {
|
|
245
|
+
throw new Error('no deserializer provided');
|
|
246
|
+
}
|
|
247
|
+
const { grid, panels, options, activeGroup } = data;
|
|
248
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.tabHeight) === 'number') {
|
|
249
|
+
this.tabHeight = options.tabHeight;
|
|
250
|
+
}
|
|
251
|
+
if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
|
|
252
|
+
throw new Error('root must be of type branch');
|
|
253
|
+
}
|
|
254
|
+
this.gridview.deserialize(grid, {
|
|
255
|
+
fromJSON: (node) => {
|
|
256
|
+
const { id, locked, hideHeader, views, activeView } = node.data;
|
|
257
|
+
const group = this.createGroup({
|
|
258
|
+
id,
|
|
259
|
+
locked: !!locked,
|
|
260
|
+
hideHeader: !!hideHeader,
|
|
261
|
+
});
|
|
262
|
+
this._onDidAddGroup.fire(group);
|
|
263
|
+
for (const child of views) {
|
|
264
|
+
const panel = this.deserializer.fromJSON(panels[child], group);
|
|
265
|
+
const isActive = typeof activeView === 'string' &&
|
|
266
|
+
activeView === panel.id;
|
|
267
|
+
group.model.openPanel(panel, {
|
|
268
|
+
skipSetPanelActive: !isActive,
|
|
269
|
+
skipSetGroupActive: true,
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
if (!group.activePanel && group.panels.length > 0) {
|
|
273
|
+
group.model.openPanel(group.panels[group.panels.length - 1], {
|
|
274
|
+
skipSetGroupActive: true,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return group;
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
if (typeof activeGroup === 'string') {
|
|
281
|
+
const panel = this.getPanel(activeGroup);
|
|
282
|
+
if (panel) {
|
|
283
|
+
this.doSetGroupActive(panel);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
this.gridview.layout(this.width, this.height);
|
|
287
|
+
this._onDidLayoutFromJSON.fire();
|
|
288
|
+
}
|
|
289
|
+
clear() {
|
|
290
|
+
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
291
|
+
const hasActiveGroup = !!this.activeGroup;
|
|
292
|
+
const hasActivePanel = !!this.activePanel;
|
|
293
|
+
for (const group of groups) {
|
|
294
|
+
// remove the group will automatically remove the panels
|
|
295
|
+
this.removeGroup(group, true);
|
|
296
|
+
}
|
|
297
|
+
if (hasActiveGroup) {
|
|
298
|
+
this.doSetGroupActive(undefined);
|
|
299
|
+
}
|
|
300
|
+
if (hasActivePanel) {
|
|
301
|
+
this._onDidActivePanelChange.fire(undefined);
|
|
302
|
+
}
|
|
303
|
+
this.gridview.clear();
|
|
304
|
+
}
|
|
305
|
+
closeAllGroups() {
|
|
306
|
+
for (const entry of this._groups.entries()) {
|
|
307
|
+
const [_, group] = entry;
|
|
308
|
+
group.value.model.closeAllPanels();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
addPanel(options) {
|
|
312
|
+
var _a, _b;
|
|
313
|
+
if (this.panels.find((_) => _.id === options.id)) {
|
|
314
|
+
throw new Error(`panel with id ${options.id} already exists`);
|
|
315
|
+
}
|
|
316
|
+
let referenceGroup;
|
|
317
|
+
if (options.position) {
|
|
318
|
+
if (isPanelOptionsWithPanel(options.position)) {
|
|
319
|
+
const referencePanel = typeof options.position.referencePanel === 'string'
|
|
320
|
+
? this.getGroupPanel(options.position.referencePanel)
|
|
321
|
+
: options.position.referencePanel;
|
|
322
|
+
if (!referencePanel) {
|
|
323
|
+
throw new Error(`referencePanel ${options.position.referencePanel} does not exist`);
|
|
324
|
+
}
|
|
325
|
+
referenceGroup = this.findGroup(referencePanel);
|
|
326
|
+
}
|
|
327
|
+
else if (isPanelOptionsWithGroup(options.position)) {
|
|
328
|
+
referenceGroup =
|
|
329
|
+
typeof options.position.referenceGroup === 'string'
|
|
330
|
+
? (_a = this._groups.get(options.position.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
331
|
+
: options.position.referenceGroup;
|
|
332
|
+
if (!referenceGroup) {
|
|
333
|
+
throw new Error(`referencePanel ${options.position.referenceGroup} does not exist`);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
const group = this.orthogonalize(directionToPosition(options.position.direction));
|
|
338
|
+
const panel = this.createPanel(options, group);
|
|
339
|
+
group.model.openPanel(panel);
|
|
340
|
+
return panel;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
referenceGroup = this.activeGroup;
|
|
345
|
+
}
|
|
346
|
+
let panel;
|
|
347
|
+
if (referenceGroup) {
|
|
348
|
+
const target = toTarget(((_b = options.position) === null || _b === void 0 ? void 0 : _b.direction) || 'within');
|
|
349
|
+
if (target === 'center') {
|
|
350
|
+
panel = this.createPanel(options, referenceGroup);
|
|
351
|
+
referenceGroup.model.openPanel(panel);
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
const location = getGridLocation(referenceGroup.element);
|
|
355
|
+
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
356
|
+
const group = this.createGroupAtLocation(relativeLocation);
|
|
357
|
+
panel = this.createPanel(options, group);
|
|
358
|
+
group.model.openPanel(panel);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
const group = this.createGroupAtLocation();
|
|
363
|
+
panel = this.createPanel(options, group);
|
|
364
|
+
group.model.openPanel(panel);
|
|
365
|
+
}
|
|
366
|
+
return panel;
|
|
367
|
+
}
|
|
368
|
+
removePanel(panel, options = {
|
|
369
|
+
removeEmptyGroup: true,
|
|
370
|
+
skipDispose: false,
|
|
371
|
+
}) {
|
|
372
|
+
const group = panel.group;
|
|
373
|
+
if (!group) {
|
|
374
|
+
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
375
|
+
}
|
|
376
|
+
group.model.removePanel(panel);
|
|
377
|
+
panel.dispose();
|
|
378
|
+
if (group.size === 0 && options.removeEmptyGroup) {
|
|
379
|
+
this.removeGroup(group);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
createWatermarkComponent() {
|
|
383
|
+
var _a;
|
|
384
|
+
return createComponent('watermark-id', 'watermark-name', this.options.watermarkComponent
|
|
385
|
+
? { 'watermark-name': this.options.watermarkComponent }
|
|
386
|
+
: {}, this.options.watermarkFrameworkComponent
|
|
387
|
+
? { 'watermark-name': this.options.watermarkFrameworkComponent }
|
|
388
|
+
: {}, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.watermark);
|
|
389
|
+
}
|
|
390
|
+
updateWatermark() {
|
|
391
|
+
if (this.groups.length === 0) {
|
|
392
|
+
if (!this.watermark) {
|
|
393
|
+
this.watermark = this.createWatermarkComponent();
|
|
394
|
+
this.watermark.init({
|
|
395
|
+
containerApi: new DockviewApi(this),
|
|
396
|
+
params: {},
|
|
397
|
+
title: '',
|
|
398
|
+
api: null,
|
|
399
|
+
});
|
|
400
|
+
const watermarkContainer = document.createElement('div');
|
|
401
|
+
watermarkContainer.className = 'dv-watermark-container';
|
|
402
|
+
watermarkContainer.appendChild(this.watermark.element);
|
|
403
|
+
this.element.appendChild(watermarkContainer);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
else if (this.watermark) {
|
|
407
|
+
this.watermark.element.parentElement.remove();
|
|
408
|
+
this.watermark.dispose();
|
|
409
|
+
this.watermark = null;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
addGroup(options) {
|
|
413
|
+
var _a;
|
|
414
|
+
const group = this.createGroup();
|
|
415
|
+
if (options) {
|
|
416
|
+
let referenceGroup;
|
|
417
|
+
if (isGroupOptionsWithPanel(options)) {
|
|
418
|
+
const referencePanel = typeof options.referencePanel === 'string'
|
|
419
|
+
? this.panels.find((panel) => panel.id === options.referencePanel)
|
|
420
|
+
: options.referencePanel;
|
|
421
|
+
if (!referencePanel) {
|
|
422
|
+
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
423
|
+
}
|
|
424
|
+
referenceGroup = this.findGroup(referencePanel);
|
|
425
|
+
if (!referenceGroup) {
|
|
426
|
+
throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
else if (isGroupOptionsWithGroup(options)) {
|
|
430
|
+
referenceGroup =
|
|
431
|
+
typeof options.referenceGroup === 'string'
|
|
432
|
+
? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
433
|
+
: options.referenceGroup;
|
|
434
|
+
if (!referenceGroup) {
|
|
435
|
+
throw new Error(`reference group ${options.referenceGroup} does not exist`);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
440
|
+
return group;
|
|
441
|
+
}
|
|
442
|
+
const target = toTarget(options.direction || 'within');
|
|
443
|
+
const location = getGridLocation(referenceGroup.element);
|
|
444
|
+
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
445
|
+
this.doAddGroup(group, relativeLocation);
|
|
446
|
+
return group;
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
this.doAddGroup(group);
|
|
450
|
+
return group;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
removeGroup(group, skipActive = false) {
|
|
454
|
+
const panels = [...group.panels]; // reassign since group panels will mutate
|
|
455
|
+
for (const panel of panels) {
|
|
456
|
+
this.removePanel(panel, {
|
|
457
|
+
removeEmptyGroup: false,
|
|
458
|
+
skipDispose: false,
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
super.doRemoveGroup(group, { skipActive });
|
|
462
|
+
}
|
|
463
|
+
moveGroupOrPanel(referenceGroup, groupId, itemId, target, index) {
|
|
464
|
+
var _a;
|
|
465
|
+
const sourceGroup = groupId
|
|
466
|
+
? (_a = this._groups.get(groupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
467
|
+
: undefined;
|
|
468
|
+
if (itemId === undefined) {
|
|
469
|
+
if (sourceGroup) {
|
|
470
|
+
this.moveGroup(sourceGroup, referenceGroup, target);
|
|
471
|
+
}
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
if (!target || target === 'center') {
|
|
475
|
+
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
476
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
477
|
+
if (!groupItem) {
|
|
478
|
+
throw new Error(`No panel with id ${itemId}`);
|
|
479
|
+
}
|
|
480
|
+
if ((sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.size) === 0) {
|
|
481
|
+
this.doRemoveGroup(sourceGroup);
|
|
482
|
+
}
|
|
483
|
+
referenceGroup.model.openPanel(groupItem, { index });
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
const referenceLocation = getGridLocation(referenceGroup.element);
|
|
487
|
+
const targetLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
488
|
+
if (sourceGroup && sourceGroup.size < 2) {
|
|
489
|
+
const [targetParentLocation, to] = tail(targetLocation);
|
|
490
|
+
const sourceLocation = getGridLocation(sourceGroup.element);
|
|
491
|
+
const [sourceParentLocation, from] = tail(sourceLocation);
|
|
492
|
+
if (sequenceEquals(sourceParentLocation, targetParentLocation)) {
|
|
493
|
+
// special case when 'swapping' two views within same grid location
|
|
494
|
+
// if a group has one tab - we are essentially moving the 'group'
|
|
495
|
+
// which is equivalent to swapping two views in this case
|
|
496
|
+
this.gridview.moveView(sourceParentLocation, from, to);
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
// source group will become empty so delete the group
|
|
500
|
+
const targetGroup = this.doRemoveGroup(sourceGroup, {
|
|
501
|
+
skipActive: true,
|
|
502
|
+
skipDispose: true,
|
|
503
|
+
});
|
|
504
|
+
// after deleting the group we need to re-evaulate the ref location
|
|
505
|
+
const updatedReferenceLocation = getGridLocation(referenceGroup.element);
|
|
506
|
+
const location = getRelativeLocation(this.gridview.orientation, updatedReferenceLocation, target);
|
|
507
|
+
this.doAddGroup(targetGroup, location);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
512
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
513
|
+
if (!groupItem) {
|
|
514
|
+
throw new Error(`No panel with id ${itemId}`);
|
|
515
|
+
}
|
|
516
|
+
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
517
|
+
const group = this.createGroupAtLocation(dropLocation);
|
|
518
|
+
group.model.openPanel(groupItem);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
moveGroup(sourceGroup, referenceGroup, target) {
|
|
523
|
+
if (sourceGroup) {
|
|
524
|
+
if (!target || target === 'center') {
|
|
525
|
+
const activePanel = sourceGroup.activePanel;
|
|
526
|
+
const panels = [...sourceGroup.panels].map((p) => sourceGroup.model.removePanel(p.id));
|
|
527
|
+
if ((sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.size) === 0) {
|
|
528
|
+
this.doRemoveGroup(sourceGroup);
|
|
529
|
+
}
|
|
530
|
+
for (const panel of panels) {
|
|
531
|
+
referenceGroup.model.openPanel(panel, {
|
|
532
|
+
skipSetPanelActive: panel !== activePanel,
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
this.gridview.removeView(getGridLocation(sourceGroup.element));
|
|
538
|
+
const referenceLocation = getGridLocation(referenceGroup.element);
|
|
539
|
+
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
540
|
+
this.gridview.addView(sourceGroup, Sizing.Distribute, dropLocation);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
doSetGroupActive(group, skipFocus) {
|
|
545
|
+
var _a, _b;
|
|
546
|
+
const isGroupAlreadyFocused = this._activeGroup === group;
|
|
547
|
+
super.doSetGroupActive(group, skipFocus);
|
|
548
|
+
if (!isGroupAlreadyFocused && ((_a = this._activeGroup) === null || _a === void 0 ? void 0 : _a.activePanel)) {
|
|
549
|
+
this._onDidActivePanelChange.fire((_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.activePanel);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
createGroup(options) {
|
|
553
|
+
if (!options) {
|
|
554
|
+
options = { tabHeight: this.tabHeight };
|
|
555
|
+
}
|
|
556
|
+
if (typeof options.tabHeight !== 'number') {
|
|
557
|
+
options.tabHeight = this.tabHeight;
|
|
558
|
+
}
|
|
559
|
+
let id = options === null || options === void 0 ? void 0 : options.id;
|
|
560
|
+
if (id && this._groups.has(options.id)) {
|
|
561
|
+
console.warn(`Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
|
|
562
|
+
id = undefined;
|
|
563
|
+
}
|
|
564
|
+
if (!id) {
|
|
565
|
+
id = this.nextGroupId.next();
|
|
566
|
+
while (this._groups.has(id)) {
|
|
567
|
+
id = this.nextGroupId.next();
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
const view = new GroupPanel(this, id, options);
|
|
571
|
+
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
572
|
+
if (!this._groups.has(view.id)) {
|
|
573
|
+
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
574
|
+
const { groupId, itemId, target, index } = event;
|
|
575
|
+
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
576
|
+
}), view.model.onDidDrop((event) => {
|
|
577
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api, group: view }));
|
|
578
|
+
}), view.model.onDidAddPanel((event) => {
|
|
579
|
+
this._onDidAddPanel.fire(event.panel);
|
|
580
|
+
}), view.model.onDidRemovePanel((event) => {
|
|
581
|
+
this._onDidRemovePanel.fire(event.panel);
|
|
582
|
+
}), view.model.onDidActivePanelChange((event) => {
|
|
583
|
+
this._onDidActivePanelChange.fire(event.panel);
|
|
584
|
+
}));
|
|
585
|
+
this._groups.set(view.id, { value: view, disposable });
|
|
586
|
+
}
|
|
587
|
+
// TODO: must be called after the above listeners have been setup,
|
|
588
|
+
// not an ideal pattern
|
|
589
|
+
view.initialize();
|
|
590
|
+
if (typeof this.options.tabHeight === 'number') {
|
|
591
|
+
view.model.header.height = this.options.tabHeight;
|
|
592
|
+
}
|
|
593
|
+
return view;
|
|
594
|
+
}
|
|
595
|
+
createPanel(options, group) {
|
|
596
|
+
const view = new DefaultGroupPanelView({
|
|
597
|
+
content: this.createContentComponent(options.id, options.component),
|
|
598
|
+
tab: this.createTabComponent(options.id, options.tabComponent || this.options.defaultTabComponent),
|
|
599
|
+
});
|
|
600
|
+
const panel = new DockviewPanel(options.id, this, this._api, group);
|
|
601
|
+
panel.init({
|
|
602
|
+
view,
|
|
603
|
+
title: options.title || options.id,
|
|
604
|
+
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
605
|
+
});
|
|
606
|
+
return panel;
|
|
607
|
+
}
|
|
608
|
+
createContentComponent(id, componentName) {
|
|
609
|
+
var _a;
|
|
610
|
+
return createComponent(id, componentName, this.options.components || {}, this.options.frameworkComponents, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.content);
|
|
611
|
+
}
|
|
612
|
+
createTabComponent(id, componentName) {
|
|
613
|
+
var _a;
|
|
614
|
+
return createComponent(id, componentName, this.options.tabComponents || {}, this.options.frameworkTabComponents, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.tab, () => new DefaultTab());
|
|
615
|
+
}
|
|
616
|
+
createGroupAtLocation(location = [0]) {
|
|
617
|
+
const group = this.createGroup();
|
|
618
|
+
this.doAddGroup(group, location);
|
|
619
|
+
return group;
|
|
620
|
+
}
|
|
621
|
+
findGroup(panel) {
|
|
622
|
+
var _a;
|
|
623
|
+
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
624
|
+
}
|
|
625
|
+
dispose() {
|
|
626
|
+
super.dispose();
|
|
627
|
+
this._onDidActivePanelChange.dispose();
|
|
628
|
+
this._onDidAddPanel.dispose();
|
|
629
|
+
this._onDidRemovePanel.dispose();
|
|
630
|
+
this._onDidLayoutFromJSON.dispose();
|
|
631
|
+
}
|
|
632
|
+
}
|