dockview 1.5.2 → 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.
Files changed (220) hide show
  1. package/dist/cjs/api/component.api.d.ts +3 -2
  2. package/dist/cjs/api/component.api.js +9 -2
  3. package/dist/cjs/api/component.api.js.map +1 -1
  4. package/dist/cjs/api/{groupPanelApi.d.ts → dockviewPanelApi.d.ts} +2 -2
  5. package/dist/cjs/api/{groupPanelApi.js → dockviewPanelApi.js} +4 -6
  6. package/dist/cjs/api/dockviewPanelApi.js.map +1 -0
  7. package/dist/cjs/api/gridviewPanelApi.d.ts +4 -3
  8. package/dist/cjs/api/gridviewPanelApi.js +4 -4
  9. package/dist/cjs/api/gridviewPanelApi.js.map +1 -1
  10. package/dist/cjs/api/panelApi.d.ts +7 -0
  11. package/dist/cjs/api/panelApi.js +17 -1
  12. package/dist/cjs/api/panelApi.js.map +1 -1
  13. package/dist/cjs/array.d.ts +1 -1
  14. package/dist/cjs/dnd/abstractDragHandler.d.ts +2 -2
  15. package/dist/cjs/dnd/abstractDragHandler.js +3 -3
  16. package/dist/cjs/dnd/abstractDragHandler.js.map +1 -1
  17. package/dist/cjs/dnd/dataTransfer.d.ts +2 -2
  18. package/dist/cjs/dnd/dataTransfer.js.map +1 -1
  19. package/dist/cjs/dnd/dnd.d.ts +1 -1
  20. package/dist/cjs/dnd/dnd.js +7 -12
  21. package/dist/cjs/dnd/dnd.js.map +1 -1
  22. package/dist/cjs/dnd/droptarget.d.ts +20 -15
  23. package/dist/cjs/dnd/droptarget.js +152 -74
  24. package/dist/cjs/dnd/droptarget.js.map +1 -1
  25. package/dist/cjs/dnd/ghost.d.ts +1 -0
  26. package/dist/cjs/dnd/ghost.js +15 -0
  27. package/dist/cjs/dnd/ghost.js.map +1 -0
  28. package/dist/cjs/dnd/groupDragHandler.d.ts +11 -0
  29. package/dist/cjs/dnd/groupDragHandler.js +62 -0
  30. package/dist/cjs/dnd/groupDragHandler.js.map +1 -0
  31. package/dist/cjs/dockview/defaultGroupPanelView.d.ts +1 -1
  32. package/dist/cjs/dockview/deserializer.d.ts +2 -1
  33. package/dist/cjs/dockview/dockviewComponent.d.ts +15 -7
  34. package/dist/cjs/dockview/dockviewComponent.js +215 -34
  35. package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
  36. package/dist/{esm/dockview/dockviewGroupPanel.d.ts → cjs/dockview/dockviewPanel.d.ts} +16 -5
  37. package/dist/cjs/dockview/{dockviewGroupPanel.js → dockviewPanel.js} +25 -21
  38. package/dist/cjs/dockview/dockviewPanel.js.map +1 -0
  39. package/dist/cjs/dockview/options.d.ts +32 -10
  40. package/dist/cjs/dockview/options.js +29 -0
  41. package/dist/cjs/dockview/options.js.map +1 -1
  42. package/dist/cjs/dockview/validation.d.ts +2 -0
  43. package/dist/cjs/dockview/validation.js +135 -0
  44. package/dist/cjs/dockview/validation.js.map +1 -0
  45. package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -1
  46. package/dist/cjs/gridview/baseComponentGridview.js +5 -6
  47. package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
  48. package/dist/cjs/gridview/basePanelView.d.ts +2 -2
  49. package/dist/cjs/gridview/gridview.d.ts +9 -3
  50. package/dist/cjs/gridview/gridview.js +38 -7
  51. package/dist/cjs/gridview/gridview.js.map +1 -1
  52. package/dist/cjs/gridview/gridviewComponent.d.ts +2 -2
  53. package/dist/cjs/gridview/gridviewComponent.js +2 -3
  54. package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
  55. package/dist/cjs/gridview/gridviewPanel.d.ts +3 -3
  56. package/dist/cjs/gridview/gridviewPanel.js +1 -2
  57. package/dist/cjs/gridview/gridviewPanel.js.map +1 -1
  58. package/dist/cjs/gridview/types.d.ts +1 -1
  59. package/dist/cjs/groupview/dnd.d.ts +2 -1
  60. package/dist/cjs/groupview/dnd.js +1 -0
  61. package/dist/cjs/groupview/dnd.js.map +1 -1
  62. package/dist/cjs/groupview/groupview.d.ts +6 -6
  63. package/dist/cjs/groupview/groupview.js +43 -25
  64. package/dist/cjs/groupview/groupview.js.map +1 -1
  65. package/dist/cjs/groupview/groupviewPanel.d.ts +3 -3
  66. package/dist/cjs/groupview/panel/content.d.ts +1 -1
  67. package/dist/cjs/groupview/tab.d.ts +2 -12
  68. package/dist/cjs/groupview/tab.js +13 -9
  69. package/dist/cjs/groupview/tab.js.map +1 -1
  70. package/dist/cjs/groupview/titlebar/tabsContainer.d.ts +5 -8
  71. package/dist/cjs/groupview/titlebar/tabsContainer.js +23 -30
  72. package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
  73. package/dist/cjs/groupview/titlebar/voidContainer.d.ts +15 -0
  74. package/dist/cjs/groupview/titlebar/voidContainer.js +74 -0
  75. package/dist/cjs/groupview/titlebar/voidContainer.js.map +1 -0
  76. package/dist/cjs/groupview/types.d.ts +18 -2
  77. package/dist/cjs/index.d.ts +3 -3
  78. package/dist/cjs/index.js +4 -3
  79. package/dist/cjs/index.js.map +1 -1
  80. package/dist/cjs/paneview/draggablePaneviewPanel.js +6 -5
  81. package/dist/cjs/paneview/draggablePaneviewPanel.js.map +1 -1
  82. package/dist/cjs/paneview/paneviewComponent.js +2 -2
  83. package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
  84. package/dist/cjs/paneview/paneviewPanel.js +1 -0
  85. package/dist/cjs/paneview/paneviewPanel.js.map +1 -1
  86. package/dist/cjs/react/deserializer.d.ts +2 -1
  87. package/dist/cjs/react/deserializer.js +2 -2
  88. package/dist/cjs/react/deserializer.js.map +1 -1
  89. package/dist/cjs/react/dockview/defaultTab.d.ts +1 -1
  90. package/dist/cjs/react/dockview/dockview.d.ts +5 -4
  91. package/dist/cjs/react/dockview/dockview.js +1 -0
  92. package/dist/cjs/react/dockview/dockview.js.map +1 -1
  93. package/dist/cjs/react/dockview/groupControlsRenderer.d.ts +1 -1
  94. package/dist/cjs/react/gridview/view.js +2 -1
  95. package/dist/cjs/react/gridview/view.js.map +1 -1
  96. package/dist/cjs/react/react.d.ts +1 -1
  97. package/dist/cjs/splitview/core/splitview.d.ts +4 -4
  98. package/dist/cjs/splitview/splitviewComponent.d.ts +1 -1
  99. package/dist/cjs/splitview/splitviewComponent.js +2 -2
  100. package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
  101. package/dist/cjs/splitview/splitviewPanel.js +1 -0
  102. package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
  103. package/dist/cjs/types.d.ts +2 -1
  104. package/dist/cjs/types.js +5 -0
  105. package/dist/cjs/types.js.map +1 -1
  106. package/dist/dockview.amd.js +1411 -987
  107. package/dist/dockview.amd.min.js +2 -2
  108. package/dist/dockview.amd.min.noStyle.js +2 -2
  109. package/dist/dockview.amd.noStyle.js +1410 -986
  110. package/dist/dockview.cjs.js +1394 -970
  111. package/dist/dockview.esm.js +1385 -964
  112. package/dist/dockview.esm.min.js +2 -2
  113. package/dist/dockview.js +1411 -987
  114. package/dist/dockview.min.js +2 -2
  115. package/dist/dockview.min.noStyle.js +2 -2
  116. package/dist/dockview.noStyle.js +1410 -986
  117. package/dist/esm/actionbar/actionsContainer.js +3 -3
  118. package/dist/esm/api/component.api.d.ts +3 -2
  119. package/dist/esm/api/component.api.js +16 -13
  120. package/dist/esm/api/{groupPanelApi.d.ts → dockviewPanelApi.d.ts} +2 -2
  121. package/dist/esm/api/{groupPanelApi.js → dockviewPanelApi.js} +16 -18
  122. package/dist/esm/api/gridviewPanelApi.d.ts +4 -3
  123. package/dist/esm/api/gridviewPanelApi.js +4 -4
  124. package/dist/esm/api/panelApi.d.ts +7 -0
  125. package/dist/esm/api/panelApi.js +33 -17
  126. package/dist/esm/api/paneviewPanelApi.js +3 -3
  127. package/dist/esm/array.d.ts +1 -1
  128. package/dist/esm/dnd/abstractDragHandler.d.ts +2 -2
  129. package/dist/esm/dnd/abstractDragHandler.js +3 -3
  130. package/dist/esm/dnd/dataTransfer.d.ts +2 -2
  131. package/dist/esm/dnd/dnd.d.ts +1 -1
  132. package/dist/esm/dnd/dnd.js +7 -12
  133. package/dist/esm/dnd/droptarget.d.ts +20 -15
  134. package/dist/esm/dnd/droptarget.js +149 -67
  135. package/dist/esm/dnd/ghost.d.ts +1 -0
  136. package/dist/esm/dnd/ghost.js +10 -0
  137. package/dist/esm/dnd/groupDragHandler.d.ts +11 -0
  138. package/dist/esm/dnd/groupDragHandler.js +38 -0
  139. package/dist/esm/dockview/components/tab/defaultTab.js +6 -6
  140. package/dist/esm/dockview/components/watermark/watermark.js +3 -3
  141. package/dist/esm/dockview/defaultGroupPanelView.d.ts +1 -1
  142. package/dist/esm/dockview/defaultGroupPanelView.js +5 -5
  143. package/dist/esm/dockview/deserializer.d.ts +2 -1
  144. package/dist/esm/dockview/dockviewComponent.d.ts +15 -7
  145. package/dist/esm/dockview/dockviewComponent.js +229 -65
  146. package/dist/{cjs/dockview/dockviewGroupPanel.d.ts → esm/dockview/dockviewPanel.d.ts} +16 -5
  147. package/dist/esm/dockview/{dockviewGroupPanel.js → dockviewPanel.js} +19 -15
  148. package/dist/esm/dockview/options.d.ts +32 -10
  149. package/dist/esm/dockview/options.js +24 -1
  150. package/dist/esm/dockview/validation.d.ts +2 -0
  151. package/dist/esm/dockview/validation.js +86 -0
  152. package/dist/esm/gridview/baseComponentGridview.d.ts +1 -1
  153. package/dist/esm/gridview/baseComponentGridview.js +31 -32
  154. package/dist/esm/gridview/basePanelView.d.ts +2 -2
  155. package/dist/esm/gridview/basePanelView.js +13 -13
  156. package/dist/esm/gridview/branchNode.js +47 -47
  157. package/dist/esm/gridview/gridview.d.ts +9 -3
  158. package/dist/esm/gridview/gridview.js +41 -15
  159. package/dist/esm/gridview/gridviewComponent.d.ts +2 -2
  160. package/dist/esm/gridview/gridviewComponent.js +17 -18
  161. package/dist/esm/gridview/gridviewPanel.d.ts +3 -3
  162. package/dist/esm/gridview/gridviewPanel.js +45 -45
  163. package/dist/esm/gridview/leafNode.js +23 -23
  164. package/dist/esm/gridview/types.d.ts +1 -1
  165. package/dist/esm/groupview/dnd.d.ts +2 -1
  166. package/dist/esm/groupview/dnd.js +1 -0
  167. package/dist/esm/groupview/groupview.d.ts +6 -6
  168. package/dist/esm/groupview/groupview.js +90 -72
  169. package/dist/esm/groupview/groupviewPanel.d.ts +3 -3
  170. package/dist/esm/groupview/groupviewPanel.js +4 -4
  171. package/dist/esm/groupview/panel/content.d.ts +1 -1
  172. package/dist/esm/groupview/panel/content.js +3 -3
  173. package/dist/esm/groupview/tab.d.ts +2 -12
  174. package/dist/esm/groupview/tab.js +15 -11
  175. package/dist/esm/groupview/titlebar/tabsContainer.d.ts +5 -8
  176. package/dist/esm/groupview/titlebar/tabsContainer.js +54 -61
  177. package/dist/esm/groupview/titlebar/voidContainer.d.ts +15 -0
  178. package/dist/esm/groupview/titlebar/voidContainer.js +47 -0
  179. package/dist/esm/groupview/types.d.ts +18 -2
  180. package/dist/esm/hostedContainer.js +3 -3
  181. package/dist/esm/index.d.ts +3 -3
  182. package/dist/esm/index.js +2 -2
  183. package/dist/esm/lifecycle.js +3 -3
  184. package/dist/esm/paneview/defaultPaneviewHeader.js +3 -3
  185. package/dist/esm/paneview/draggablePaneviewPanel.js +7 -6
  186. package/dist/esm/paneview/paneview.js +21 -21
  187. package/dist/esm/paneview/paneviewComponent.js +30 -30
  188. package/dist/esm/paneview/paneviewPanel.js +45 -44
  189. package/dist/esm/react/deserializer.d.ts +2 -1
  190. package/dist/esm/react/deserializer.js +2 -2
  191. package/dist/esm/react/dockview/defaultTab.d.ts +1 -1
  192. package/dist/esm/react/dockview/dockview.d.ts +5 -4
  193. package/dist/esm/react/dockview/dockview.js +1 -0
  194. package/dist/esm/react/dockview/groupControlsRenderer.d.ts +1 -1
  195. package/dist/esm/react/dockview/groupControlsRenderer.js +8 -8
  196. package/dist/esm/react/dockview/reactContentPart.js +3 -3
  197. package/dist/esm/react/dockview/reactHeaderPart.js +3 -3
  198. package/dist/esm/react/dockview/reactWatermarkPart.js +3 -3
  199. package/dist/esm/react/dockview/v2/reactContentRenderer.js +9 -9
  200. package/dist/esm/react/dockview/v2/webviewContentRenderer.js +3 -3
  201. package/dist/esm/react/gridview/view.js +2 -1
  202. package/dist/esm/react/paneview/view.js +3 -3
  203. package/dist/esm/react/react.d.ts +1 -1
  204. package/dist/esm/splitview/core/splitview.d.ts +4 -4
  205. package/dist/esm/splitview/core/splitview.js +59 -59
  206. package/dist/esm/splitview/core/viewItem.js +15 -15
  207. package/dist/esm/splitview/splitviewComponent.d.ts +1 -1
  208. package/dist/esm/splitview/splitviewComponent.js +23 -23
  209. package/dist/esm/splitview/splitviewPanel.js +31 -30
  210. package/dist/esm/types.d.ts +2 -1
  211. package/dist/esm/types.js +3 -1
  212. package/dist/styles/dockview.css +23 -26
  213. package/package.json +12 -16
  214. package/dist/cjs/api/groupPanelApi.js.map +0 -1
  215. package/dist/cjs/dockview/dockviewGroupPanel.js.map +0 -1
  216. package/dist/cjs/groupview/groupPanel.d.ts +0 -32
  217. package/dist/cjs/groupview/groupPanel.js +0 -3
  218. package/dist/cjs/groupview/groupPanel.js.map +0 -1
  219. package/dist/esm/groupview/groupPanel.d.ts +0 -32
  220. package/dist/esm/groupview/groupPanel.js +0 -1
@@ -1,18 +1,15 @@
1
1
  /**
2
2
  * dockview
3
- * @version 1.5.2
3
+ * @version 1.6.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- Object.defineProperty(exports, '__esModule', { value: true });
10
-
11
9
  var React = require('react');
12
10
  var ReactDOM = require('react-dom');
13
11
 
14
- function _interopNamespace(e) {
15
- if (e && e.__esModule) return e;
12
+ function _interopNamespaceDefault(e) {
16
13
  var n = Object.create(null);
17
14
  if (e) {
18
15
  Object.keys(e).forEach(function (k) {
@@ -25,12 +22,12 @@ function _interopNamespace(e) {
25
22
  }
26
23
  });
27
24
  }
28
- n["default"] = e;
25
+ n.default = e;
29
26
  return Object.freeze(n);
30
27
  }
31
28
 
32
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
- var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
29
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
30
+ var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM);
34
31
 
35
32
  function styleInject(css, ref) {
36
33
  if ( ref === void 0 ) ref = {};
@@ -59,7 +56,7 @@ function styleInject(css, ref) {
59
56
  }
60
57
  }
61
58
 
62
- 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.left {\n transform: translateX(-25%) scaleX(0.5);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.right {\n transform: translateX(25%) scaleX(0.5);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.top {\n transform: translateY(-25%) scaleY(0.5);\n}\n.drop-target > .drop-target-dropzone > .drop-target-selection.bottom {\n transform: translateY(25%) scaleY(0.5);\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.custom-dragging {\n height: 24px;\n line-height: 24px;\n font-size: 11px;\n width: 100px;\n background-color: dodgerblue;\n color: ghostwhite;\n border-radius: 11px;\n position: absolute;\n padding-left: 10px;\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.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 .void-container {\n display: flex;\n flex-grow: 1;\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.dragged {\n transform: translate3d(0px, 0px, 0px);\n /* 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.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}";
59
+ 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}";
63
60
  styleInject(css_248z);
64
61
 
65
62
  class TransferObject {
@@ -230,12 +227,12 @@ var Disposable;
230
227
  };
231
228
  })(Disposable || (Disposable = {}));
232
229
  class CompositeDisposable {
233
- constructor(...args) {
234
- this.disposables = args;
235
- }
236
230
  static from(...args) {
237
231
  return new CompositeDisposable(...args);
238
232
  }
233
+ constructor(...args) {
234
+ this.disposables = args;
235
+ }
239
236
  addDisposables(...args) {
240
237
  args.forEach((arg) => this.disposables.push(arg));
241
238
  }
@@ -453,21 +450,6 @@ function firstIndex(array, fn) {
453
450
  }
454
451
 
455
452
  class ViewItem {
456
- constructor(container, view, size, disposable) {
457
- this.container = container;
458
- this.view = view;
459
- this.disposable = disposable;
460
- this._cachedVisibleSize = undefined;
461
- if (typeof size === 'number') {
462
- this._size = size;
463
- this._cachedVisibleSize = undefined;
464
- container.classList.add('visible');
465
- }
466
- else {
467
- this._size = 0;
468
- this._cachedVisibleSize = size.cachedVisibleSize;
469
- }
470
- }
471
453
  set size(size) {
472
454
  this._size = size;
473
455
  }
@@ -520,6 +502,21 @@ class ViewItem {
520
502
  set enabled(enabled) {
521
503
  this.container.style.pointerEvents = enabled ? '' : 'none';
522
504
  }
505
+ constructor(container, view, size, disposable) {
506
+ this.container = container;
507
+ this.view = view;
508
+ this.disposable = disposable;
509
+ this._cachedVisibleSize = undefined;
510
+ if (typeof size === 'number') {
511
+ this._size = size;
512
+ this._cachedVisibleSize = undefined;
513
+ container.classList.add('visible');
514
+ }
515
+ else {
516
+ this._size = 0;
517
+ this._cachedVisibleSize = size.cachedVisibleSize;
518
+ }
519
+ }
523
520
  // layout(offset: number, layoutContext: TLayoutContext | undefined): void {
524
521
  // this.layoutContainer(offset);
525
522
  // this.view.layout(this.size, offset, layoutContext);
@@ -566,6 +563,65 @@ exports.Sizing = void 0;
566
563
  Sizing.Invisible = Invisible;
567
564
  })(exports.Sizing || (exports.Sizing = {}));
568
565
  class Splitview {
566
+ get size() {
567
+ return this._size;
568
+ }
569
+ set size(value) {
570
+ this._size = value;
571
+ }
572
+ get orthogonalSize() {
573
+ return this._orthogonalSize;
574
+ }
575
+ set orthogonalSize(value) {
576
+ this._orthogonalSize = value;
577
+ }
578
+ get length() {
579
+ return this.views.length;
580
+ }
581
+ get proportions() {
582
+ return this._proportions ? [...this._proportions] : undefined;
583
+ }
584
+ get orientation() {
585
+ return this._orientation;
586
+ }
587
+ set orientation(value) {
588
+ this._orientation = value;
589
+ const tmp = this.size;
590
+ this.size = this.orthogonalSize;
591
+ this.orthogonalSize = tmp;
592
+ removeClasses(this.element, 'horizontal', 'vertical');
593
+ this.element.classList.add(this.orientation == exports.Orientation.HORIZONTAL
594
+ ? 'horizontal'
595
+ : 'vertical');
596
+ }
597
+ get minimumSize() {
598
+ return this.views.reduce((r, item) => r + item.minimumSize, 0);
599
+ }
600
+ get maximumSize() {
601
+ return this.length === 0
602
+ ? Number.POSITIVE_INFINITY
603
+ : this.views.reduce((r, item) => r + item.maximumSize, 0);
604
+ }
605
+ get startSnappingEnabled() {
606
+ return this._startSnappingEnabled;
607
+ }
608
+ set startSnappingEnabled(startSnappingEnabled) {
609
+ if (this._startSnappingEnabled === startSnappingEnabled) {
610
+ return;
611
+ }
612
+ this._startSnappingEnabled = startSnappingEnabled;
613
+ this.updateSashEnablement();
614
+ }
615
+ get endSnappingEnabled() {
616
+ return this._endSnappingEnabled;
617
+ }
618
+ set endSnappingEnabled(endSnappingEnabled) {
619
+ if (this._endSnappingEnabled === endSnappingEnabled) {
620
+ return;
621
+ }
622
+ this._endSnappingEnabled = endSnappingEnabled;
623
+ this.updateSashEnablement();
624
+ }
569
625
  constructor(container, options) {
570
626
  this.container = container;
571
627
  this.views = [];
@@ -695,65 +751,6 @@ class Splitview {
695
751
  this.saveProportions();
696
752
  }
697
753
  }
698
- get size() {
699
- return this._size;
700
- }
701
- set size(value) {
702
- this._size = value;
703
- }
704
- get orthogonalSize() {
705
- return this._orthogonalSize;
706
- }
707
- set orthogonalSize(value) {
708
- this._orthogonalSize = value;
709
- }
710
- get length() {
711
- return this.views.length;
712
- }
713
- get proportions() {
714
- return this._proportions ? [...this._proportions] : undefined;
715
- }
716
- get orientation() {
717
- return this._orientation;
718
- }
719
- set orientation(value) {
720
- this._orientation = value;
721
- const tmp = this.size;
722
- this.size = this.orthogonalSize;
723
- this.orthogonalSize = tmp;
724
- removeClasses(this.element, 'horizontal', 'vertical');
725
- this.element.classList.add(this.orientation == exports.Orientation.HORIZONTAL
726
- ? 'horizontal'
727
- : 'vertical');
728
- }
729
- get minimumSize() {
730
- return this.views.reduce((r, item) => r + item.minimumSize, 0);
731
- }
732
- get maximumSize() {
733
- return this.length === 0
734
- ? Number.POSITIVE_INFINITY
735
- : this.views.reduce((r, item) => r + item.maximumSize, 0);
736
- }
737
- get startSnappingEnabled() {
738
- return this._startSnappingEnabled;
739
- }
740
- set startSnappingEnabled(startSnappingEnabled) {
741
- if (this._startSnappingEnabled === startSnappingEnabled) {
742
- return;
743
- }
744
- this._startSnappingEnabled = startSnappingEnabled;
745
- this.updateSashEnablement();
746
- }
747
- get endSnappingEnabled() {
748
- return this._endSnappingEnabled;
749
- }
750
- set endSnappingEnabled(endSnappingEnabled) {
751
- if (this._endSnappingEnabled === endSnappingEnabled) {
752
- return;
753
- }
754
- this._endSnappingEnabled = endSnappingEnabled;
755
- this.updateSashEnablement();
756
- }
757
754
  style(styles) {
758
755
  if ((styles === null || styles === void 0 ? void 0 : styles.separatorBorder) === 'transparent') {
759
756
  removeClasses(this.element, 'separator-border');
@@ -1217,6 +1214,27 @@ class Splitview {
1217
1214
  }
1218
1215
 
1219
1216
  class Paneview extends CompositeDisposable {
1217
+ get onDidAddView() {
1218
+ return this.splitview.onDidAddView;
1219
+ }
1220
+ get onDidRemoveView() {
1221
+ return this.splitview.onDidRemoveView;
1222
+ }
1223
+ get minimumSize() {
1224
+ return this.splitview.minimumSize;
1225
+ }
1226
+ get maximumSize() {
1227
+ return this.splitview.maximumSize;
1228
+ }
1229
+ get orientation() {
1230
+ return this.splitview.orientation;
1231
+ }
1232
+ get size() {
1233
+ return this.splitview.size;
1234
+ }
1235
+ get orthogonalSize() {
1236
+ return this.splitview.orthogonalSize;
1237
+ }
1220
1238
  constructor(container, options) {
1221
1239
  var _a;
1222
1240
  super();
@@ -1259,27 +1277,6 @@ class Paneview extends CompositeDisposable {
1259
1277
  this._onDidChange.fire();
1260
1278
  }));
1261
1279
  }
1262
- get onDidAddView() {
1263
- return this.splitview.onDidAddView;
1264
- }
1265
- get onDidRemoveView() {
1266
- return this.splitview.onDidRemoveView;
1267
- }
1268
- get minimumSize() {
1269
- return this.splitview.minimumSize;
1270
- }
1271
- get maximumSize() {
1272
- return this.splitview.maximumSize;
1273
- }
1274
- get orientation() {
1275
- return this.splitview.orientation;
1276
- }
1277
- get size() {
1278
- return this.splitview.size;
1279
- }
1280
- get orthogonalSize() {
1281
- return this.splitview.orthogonalSize;
1282
- }
1283
1280
  addPane(pane, size, index = this.splitview.length, skipLayout = false) {
1284
1281
  const disposable = pane.onDidChangeExpansionState(() => {
1285
1282
  this.setupAnimation();
@@ -1358,243 +1355,16 @@ class Paneview extends CompositeDisposable {
1358
1355
  }
1359
1356
  }
1360
1357
 
1361
- class DragAndDropObserver extends CompositeDisposable {
1362
- constructor(element, callbacks) {
1363
- super();
1364
- this.element = element;
1365
- this.callbacks = callbacks;
1366
- // A helper to fix issues with repeated DRAG_ENTER / DRAG_LEAVE
1367
- // calls see https://github.com/microsoft/vscode/issues/14470
1368
- // when the element has child elements where the events are fired
1369
- // repeadedly.
1370
- this.counter = 0;
1371
- this.registerListeners();
1358
+ /*---------------------------------------------------------------------------------------------
1359
+ * Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
1360
+ * https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
1361
+ *--------------------------------------------------------------------------------------------*/
1362
+ class LeafNode {
1363
+ get minimumWidth() {
1364
+ return this.view.minimumWidth;
1372
1365
  }
1373
- registerListeners() {
1374
- this.addDisposables(addDisposableListener(this.element, 'dragenter', (e) => {
1375
- this.counter++;
1376
- this.callbacks.onDragEnter(e);
1377
- }));
1378
- this.addDisposables(addDisposableListener(this.element, 'dragover', (e) => {
1379
- e.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome)
1380
- if (this.callbacks.onDragOver) {
1381
- this.callbacks.onDragOver(e);
1382
- }
1383
- }));
1384
- this.addDisposables(addDisposableListener(this.element, 'dragleave', (e) => {
1385
- this.counter--;
1386
- if (this.counter === 0) {
1387
- this.callbacks.onDragLeave(e);
1388
- }
1389
- }));
1390
- this.addDisposables(addDisposableListener(this.element, 'dragend', (e) => {
1391
- this.counter = 0;
1392
- this.callbacks.onDragEnd(e);
1393
- }));
1394
- this.addDisposables(addDisposableListener(this.element, 'drop', (e) => {
1395
- this.counter = 0;
1396
- this.callbacks.onDrop(e);
1397
- }));
1398
- }
1399
- }
1400
-
1401
- exports.Position = void 0;
1402
- (function (Position) {
1403
- Position["Top"] = "Top";
1404
- Position["Left"] = "Left";
1405
- Position["Bottom"] = "Bottom";
1406
- Position["Right"] = "Right";
1407
- Position["Center"] = "Center";
1408
- })(exports.Position || (exports.Position = {}));
1409
- function isBooleanValue(canDisplayOverlay) {
1410
- return typeof canDisplayOverlay === 'boolean';
1411
- }
1412
- class Droptarget extends CompositeDisposable {
1413
- constructor(element, options) {
1414
- super();
1415
- this.element = element;
1416
- this.options = options;
1417
- this._onDrop = new Emitter();
1418
- this.onDrop = this._onDrop.event;
1419
- this.addDisposables(this._onDrop, new DragAndDropObserver(this.element, {
1420
- onDragEnter: () => undefined,
1421
- onDragOver: (e) => {
1422
- const width = this.element.clientWidth;
1423
- const height = this.element.clientHeight;
1424
- if (width === 0 || height === 0) {
1425
- return; // avoid div!0
1426
- }
1427
- const x = e.offsetX;
1428
- const y = e.offsetY;
1429
- const xp = (100 * x) / width;
1430
- const yp = (100 * y) / height;
1431
- const quadrant = this.calculateQuadrant(this.options.validOverlays, xp, yp);
1432
- if (isBooleanValue(this.options.canDisplayOverlay)) {
1433
- if (!this.options.canDisplayOverlay) {
1434
- return;
1435
- }
1436
- }
1437
- else if (!this.options.canDisplayOverlay(e, quadrant)) {
1438
- return;
1439
- }
1440
- if (!this.target) {
1441
- this.target = document.createElement('div');
1442
- this.target.className = 'drop-target-dropzone';
1443
- this.overlay = document.createElement('div');
1444
- this.overlay.className = 'drop-target-selection';
1445
- this._state = exports.Position.Center;
1446
- this.target.appendChild(this.overlay);
1447
- this.element.classList.add('drop-target');
1448
- this.element.append(this.target);
1449
- }
1450
- if (this.options.validOverlays === 'none') {
1451
- return;
1452
- }
1453
- if (!this.target || !this.overlay) {
1454
- return;
1455
- }
1456
- const isSmallX = width < 100;
1457
- const isSmallY = height < 100;
1458
- this.toggleClasses(quadrant, isSmallX, isSmallY);
1459
- this.setState(quadrant);
1460
- },
1461
- onDragLeave: () => {
1462
- this.removeDropTarget();
1463
- },
1464
- onDragEnd: () => {
1465
- this.removeDropTarget();
1466
- },
1467
- onDrop: (e) => {
1468
- e.preventDefault();
1469
- e.stopPropagation();
1470
- const state = this._state;
1471
- this.removeDropTarget();
1472
- if (state) {
1473
- this._onDrop.fire({ position: state, nativeEvent: e });
1474
- }
1475
- },
1476
- }));
1477
- }
1478
- get state() {
1479
- return this._state;
1480
- }
1481
- set validOverlays(value) {
1482
- this.options.validOverlays = value;
1483
- }
1484
- set canDisplayOverlay(value) {
1485
- this.options.canDisplayOverlay = value;
1486
- }
1487
- dispose() {
1488
- this.removeDropTarget();
1489
- }
1490
- toggleClasses(quadrant, isSmallX, isSmallY) {
1491
- if (!this.overlay) {
1492
- return;
1493
- }
1494
- const isLeft = quadrant === 'left';
1495
- const isRight = quadrant === 'right';
1496
- const isTop = quadrant === 'top';
1497
- const isBottom = quadrant === 'bottom';
1498
- toggleClass(this.overlay, 'right', !isSmallX && isRight);
1499
- toggleClass(this.overlay, 'left', !isSmallX && isLeft);
1500
- toggleClass(this.overlay, 'top', !isSmallY && isTop);
1501
- toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
1502
- toggleClass(this.overlay, 'small-right', isSmallX && isRight);
1503
- toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
1504
- toggleClass(this.overlay, 'small-top', isSmallY && isTop);
1505
- toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
1506
- }
1507
- setState(quadrant) {
1508
- switch (quadrant) {
1509
- case 'top':
1510
- this._state = exports.Position.Top;
1511
- break;
1512
- case 'left':
1513
- this._state = exports.Position.Left;
1514
- break;
1515
- case 'bottom':
1516
- this._state = exports.Position.Bottom;
1517
- break;
1518
- case 'right':
1519
- this._state = exports.Position.Right;
1520
- break;
1521
- default:
1522
- this._state = exports.Position.Center;
1523
- break;
1524
- }
1525
- }
1526
- calculateQuadrant(overlayType, xp, yp) {
1527
- switch (overlayType) {
1528
- case 'all':
1529
- if (xp < 20) {
1530
- return 'left';
1531
- }
1532
- if (xp > 80) {
1533
- return 'right';
1534
- }
1535
- if (yp < 20) {
1536
- return 'top';
1537
- }
1538
- if (yp > 80) {
1539
- return 'bottom';
1540
- }
1541
- break;
1542
- case 'vertical':
1543
- if (yp < 50) {
1544
- return 'top';
1545
- }
1546
- return 'bottom';
1547
- case 'horizontal':
1548
- if (xp < 50) {
1549
- return 'left';
1550
- }
1551
- return 'right';
1552
- }
1553
- return null;
1554
- }
1555
- removeDropTarget() {
1556
- if (this.target) {
1557
- this._state = undefined;
1558
- this.element.removeChild(this.target);
1559
- this.target = undefined;
1560
- this.element.classList.remove('drop-target');
1561
- }
1562
- }
1563
- }
1564
-
1565
- /*---------------------------------------------------------------------------------------------
1566
- * Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
1567
- * https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
1568
- *--------------------------------------------------------------------------------------------*/
1569
- class LeafNode {
1570
- constructor(view, orientation, orthogonalSize, size = 0) {
1571
- this.view = view;
1572
- this.orientation = orientation;
1573
- this._onDidChange = new Emitter();
1574
- this.onDidChange = this._onDidChange.event;
1575
- this._orthogonalSize = orthogonalSize;
1576
- this._size = size;
1577
- this._disposable = this.view.onDidChange((event) => {
1578
- if (event) {
1579
- this._onDidChange.fire({
1580
- size: this.orientation === exports.Orientation.VERTICAL
1581
- ? event.width
1582
- : event.height,
1583
- orthogonalSize: this.orientation === exports.Orientation.VERTICAL
1584
- ? event.height
1585
- : event.width,
1586
- });
1587
- }
1588
- else {
1589
- this._onDidChange.fire({});
1590
- }
1591
- });
1592
- }
1593
- get minimumWidth() {
1594
- return this.view.minimumWidth;
1595
- }
1596
- get maximumWidth() {
1597
- return this.view.maximumWidth;
1366
+ get maximumWidth() {
1367
+ return this.view.maximumWidth;
1598
1368
  }
1599
1369
  get minimumHeight() {
1600
1370
  return this.view.minimumHeight;
@@ -1647,6 +1417,29 @@ class LeafNode {
1647
1417
  ? this.size
1648
1418
  : this.orthogonalSize;
1649
1419
  }
1420
+ constructor(view, orientation, orthogonalSize, size = 0) {
1421
+ this.view = view;
1422
+ this.orientation = orientation;
1423
+ this._onDidChange = new Emitter();
1424
+ this.onDidChange = this._onDidChange.event;
1425
+ this._orthogonalSize = orthogonalSize;
1426
+ this._size = size;
1427
+ this._disposable = this.view.onDidChange((event) => {
1428
+ if (event) {
1429
+ this._onDidChange.fire({
1430
+ size: this.orientation === exports.Orientation.VERTICAL
1431
+ ? event.width
1432
+ : event.height,
1433
+ orthogonalSize: this.orientation === exports.Orientation.VERTICAL
1434
+ ? event.height
1435
+ : event.width,
1436
+ });
1437
+ }
1438
+ else {
1439
+ this._onDidChange.fire({});
1440
+ }
1441
+ });
1442
+ }
1650
1443
  setVisible(visible) {
1651
1444
  if (this.view.setVisible) {
1652
1445
  this.view.setVisible(visible);
@@ -1669,53 +1462,6 @@ class LeafNode {
1669
1462
  * https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
1670
1463
  *--------------------------------------------------------------------------------------------*/
1671
1464
  class BranchNode extends CompositeDisposable {
1672
- constructor(orientation, proportionalLayout, styles, size, orthogonalSize, childDescriptors) {
1673
- super();
1674
- this.orientation = orientation;
1675
- this.proportionalLayout = proportionalLayout;
1676
- this.styles = styles;
1677
- this.children = [];
1678
- this._onDidChange = new Emitter();
1679
- this.onDidChange = this._onDidChange.event;
1680
- this._childrenDisposable = Disposable.NONE;
1681
- this._orthogonalSize = orthogonalSize;
1682
- this._size = size;
1683
- this.element = document.createElement('div');
1684
- this.element.className = 'branch-node';
1685
- if (!childDescriptors) {
1686
- this.splitview = new Splitview(this.element, {
1687
- orientation: this.orientation,
1688
- proportionalLayout,
1689
- styles,
1690
- });
1691
- this.splitview.layout(this.size, this.orthogonalSize);
1692
- }
1693
- else {
1694
- const descriptor = {
1695
- views: childDescriptors.map((childDescriptor) => {
1696
- return {
1697
- view: childDescriptor.node,
1698
- size: childDescriptor.node.size,
1699
- visible: childDescriptor.node instanceof LeafNode &&
1700
- childDescriptor.visible !== undefined
1701
- ? childDescriptor.visible
1702
- : true,
1703
- };
1704
- }),
1705
- size: this.size,
1706
- };
1707
- this.children = childDescriptors.map((c) => c.node);
1708
- this.splitview = new Splitview(this.element, {
1709
- orientation: this.orientation,
1710
- descriptor,
1711
- proportionalLayout,
1712
- });
1713
- }
1714
- this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
1715
- this._onDidChange.fire({});
1716
- }));
1717
- this.setupChildrenEvents();
1718
- }
1719
1465
  get width() {
1720
1466
  return this.orientation === exports.Orientation.HORIZONTAL
1721
1467
  ? this.size
@@ -1781,6 +1527,53 @@ class BranchNode extends CompositeDisposable {
1781
1527
  }
1782
1528
  return exports.LayoutPriority.Normal;
1783
1529
  }
1530
+ constructor(orientation, proportionalLayout, styles, size, orthogonalSize, childDescriptors) {
1531
+ super();
1532
+ this.orientation = orientation;
1533
+ this.proportionalLayout = proportionalLayout;
1534
+ this.styles = styles;
1535
+ this.children = [];
1536
+ this._onDidChange = new Emitter();
1537
+ this.onDidChange = this._onDidChange.event;
1538
+ this._childrenDisposable = Disposable.NONE;
1539
+ this._orthogonalSize = orthogonalSize;
1540
+ this._size = size;
1541
+ this.element = document.createElement('div');
1542
+ this.element.className = 'branch-node';
1543
+ if (!childDescriptors) {
1544
+ this.splitview = new Splitview(this.element, {
1545
+ orientation: this.orientation,
1546
+ proportionalLayout,
1547
+ styles,
1548
+ });
1549
+ this.splitview.layout(this.size, this.orthogonalSize);
1550
+ }
1551
+ else {
1552
+ const descriptor = {
1553
+ views: childDescriptors.map((childDescriptor) => {
1554
+ return {
1555
+ view: childDescriptor.node,
1556
+ size: childDescriptor.node.size,
1557
+ visible: childDescriptor.node instanceof LeafNode &&
1558
+ childDescriptor.visible !== undefined
1559
+ ? childDescriptor.visible
1560
+ : true,
1561
+ };
1562
+ }),
1563
+ size: this.size,
1564
+ };
1565
+ this.children = childDescriptors.map((c) => c.node);
1566
+ this.splitview = new Splitview(this.element, {
1567
+ orientation: this.orientation,
1568
+ descriptor,
1569
+ proportionalLayout,
1570
+ });
1571
+ }
1572
+ this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
1573
+ this._onDidChange.fire({});
1574
+ }));
1575
+ this.setupChildrenEvents();
1576
+ }
1784
1577
  setVisible(visible) {
1785
1578
  for (const child of this.children) {
1786
1579
  child.setVisible(visible);
@@ -1952,20 +1745,18 @@ function getRelativeLocation(rootOrientation, location, direction) {
1952
1745
  if (orientation === directionOrientation) {
1953
1746
  const [rest, _index] = tail(location);
1954
1747
  let index = _index;
1955
- if (direction === exports.Position.Right || direction === exports.Position.Bottom) {
1748
+ if (direction === 'right' || direction === 'bottom') {
1956
1749
  index += 1;
1957
1750
  }
1958
1751
  return [...rest, index];
1959
1752
  }
1960
1753
  else {
1961
- const index = direction === exports.Position.Right || direction === exports.Position.Bottom
1962
- ? 1
1963
- : 0;
1754
+ const index = direction === 'right' || direction === 'bottom' ? 1 : 0;
1964
1755
  return [...location, index];
1965
1756
  }
1966
1757
  }
1967
1758
  function getDirectionOrientation(direction) {
1968
- return direction === exports.Position.Top || direction === exports.Position.Bottom
1759
+ return direction === 'top' || direction === 'bottom'
1969
1760
  ? exports.Orientation.VERTICAL
1970
1761
  : exports.Orientation.HORIZONTAL;
1971
1762
  }
@@ -2000,15 +1791,8 @@ const serializeBranchNode = (node, orientation) => {
2000
1791
  };
2001
1792
  };
2002
1793
  class Gridview {
2003
- constructor(proportionalLayout, styles, orientation) {
2004
- this.proportionalLayout = proportionalLayout;
2005
- this.styles = styles;
2006
- this.disposable = new MutableDisposable();
2007
- this._onDidChange = new Emitter();
2008
- this.onDidChange = this._onDidChange.event;
2009
- this.element = document.createElement('div');
2010
- this.element.className = 'grid-view';
2011
- this.root = new BranchNode(orientation, proportionalLayout, styles, 0, 0);
1794
+ get length() {
1795
+ return this._root ? this._root.children.length : 0;
2012
1796
  }
2013
1797
  serialize() {
2014
1798
  const root = serializeBranchNode(this.getView(), this.orientation);
@@ -2082,6 +1866,32 @@ class Gridview {
2082
1866
  this._onDidChange.fire(e);
2083
1867
  });
2084
1868
  }
1869
+ /**
1870
+ * If the root is orientated as a VERTICAL node then nest the existing root within a new HORIZIONTAL root node
1871
+ * If the root is orientated as a HORIZONTAL node then nest the existing root within a new VERITCAL root node
1872
+ */
1873
+ insertOrthogonalSplitviewAtRoot() {
1874
+ if (!this._root) {
1875
+ return;
1876
+ }
1877
+ const oldRoot = this.root;
1878
+ oldRoot.element.remove();
1879
+ this._root = new BranchNode(orthogonal(oldRoot.orientation), this.proportionalLayout, this.styles, this.root.orthogonalSize, this.root.size);
1880
+ if (oldRoot.children.length === 1) {
1881
+ // can remove one level of redundant branching if there is only a single child
1882
+ const childReference = oldRoot.children[0];
1883
+ oldRoot.removeChild(0); // remove to prevent disposal when disposing of unwanted root
1884
+ oldRoot.dispose();
1885
+ this._root.addChild(childReference, exports.Sizing.Distribute, 0);
1886
+ }
1887
+ else {
1888
+ this._root.addChild(oldRoot, exports.Sizing.Distribute, 0);
1889
+ }
1890
+ this.element.appendChild(this._root.element);
1891
+ this.disposable.value = this._root.onDidChange((e) => {
1892
+ this._onDidChange.fire(e);
1893
+ });
1894
+ }
2085
1895
  next(location) {
2086
1896
  return this.progmaticSelect(location);
2087
1897
  }
@@ -2140,6 +1950,16 @@ class Gridview {
2140
1950
  get maximumHeight() {
2141
1951
  return this.root.maximumHeight;
2142
1952
  }
1953
+ constructor(proportionalLayout, styles, orientation) {
1954
+ this.proportionalLayout = proportionalLayout;
1955
+ this.styles = styles;
1956
+ this.disposable = new MutableDisposable();
1957
+ this._onDidChange = new Emitter();
1958
+ this.onDidChange = this._onDidChange.event;
1959
+ this.element = document.createElement('div');
1960
+ this.element.className = 'grid-view';
1961
+ this.root = new BranchNode(orientation, proportionalLayout, styles, 0, 0);
1962
+ }
2143
1963
  isViewVisible(location) {
2144
1964
  const [rest, index] = tail(location);
2145
1965
  const [, parent] = this.getNode(rest);
@@ -2271,9 +2091,6 @@ class Gridview {
2271
2091
  }
2272
2092
 
2273
2093
  class SplitviewApi {
2274
- constructor(component) {
2275
- this.component = component;
2276
- }
2277
2094
  get minimumSize() {
2278
2095
  return this.component.minimumSize;
2279
2096
  }
@@ -2307,6 +2124,9 @@ class SplitviewApi {
2307
2124
  get onDidRemoveView() {
2308
2125
  return this.component.onDidRemoveView;
2309
2126
  }
2127
+ constructor(component) {
2128
+ this.component = component;
2129
+ }
2310
2130
  updateOptions(options) {
2311
2131
  this.component.updateOptions(options);
2312
2132
  }
@@ -2339,9 +2159,6 @@ class SplitviewApi {
2339
2159
  }
2340
2160
  }
2341
2161
  class PaneviewApi {
2342
- constructor(component) {
2343
- this.component = component;
2344
- }
2345
2162
  get minimumSize() {
2346
2163
  return this.component.minimumSize;
2347
2164
  }
@@ -2380,6 +2197,9 @@ class PaneviewApi {
2380
2197
  };
2381
2198
  return emitter.event;
2382
2199
  }
2200
+ constructor(component) {
2201
+ this.component = component;
2202
+ }
2383
2203
  removePanel(panel) {
2384
2204
  this.component.removePanel(panel);
2385
2205
  }
@@ -2409,9 +2229,6 @@ class PaneviewApi {
2409
2229
  }
2410
2230
  }
2411
2231
  class GridviewApi {
2412
- constructor(component) {
2413
- this.component = component;
2414
- }
2415
2232
  get minimumHeight() {
2416
2233
  return this.component.minimumHeight;
2417
2234
  }
@@ -2454,6 +2271,9 @@ class GridviewApi {
2454
2271
  set orientation(value) {
2455
2272
  this.component.updateOptions({ orientation: value });
2456
2273
  }
2274
+ constructor(component) {
2275
+ this.component = component;
2276
+ }
2457
2277
  focus() {
2458
2278
  this.component.focus();
2459
2279
  }
@@ -2483,8 +2303,8 @@ class GridviewApi {
2483
2303
  }
2484
2304
  }
2485
2305
  class DockviewApi {
2486
- constructor(component) {
2487
- this.component = component;
2306
+ get id() {
2307
+ return this.component.id;
2488
2308
  }
2489
2309
  get width() {
2490
2310
  return this.component.width;
@@ -2549,6 +2369,9 @@ class DockviewApi {
2549
2369
  get activeGroup() {
2550
2370
  return this.component.activeGroup;
2551
2371
  }
2372
+ constructor(component) {
2373
+ this.component = component;
2374
+ }
2552
2375
  getTabHeight() {
2553
2376
  return this.component.tabHeight;
2554
2377
  }
@@ -2567,36 +2390,322 @@ class DockviewApi {
2567
2390
  addPanel(options) {
2568
2391
  return this.component.addPanel(options);
2569
2392
  }
2570
- addEmptyGroup(options) {
2571
- this.component.addEmptyGroup(options);
2393
+ addGroup(options) {
2394
+ return this.component.addGroup(options);
2572
2395
  }
2573
2396
  moveToNext(options) {
2574
2397
  this.component.moveToNext(options);
2575
2398
  }
2576
- moveToPrevious(options) {
2577
- this.component.moveToPrevious(options);
2399
+ moveToPrevious(options) {
2400
+ this.component.moveToPrevious(options);
2401
+ }
2402
+ closeAllGroups() {
2403
+ return this.component.closeAllGroups();
2404
+ }
2405
+ removeGroup(group) {
2406
+ this.component.removeGroup(group);
2407
+ }
2408
+ getGroup(id) {
2409
+ return this.component.getPanel(id);
2410
+ }
2411
+ fromJSON(data) {
2412
+ this.component.fromJSON(data);
2413
+ }
2414
+ toJSON() {
2415
+ return this.component.toJSON();
2416
+ }
2417
+ clear() {
2418
+ this.component.clear();
2419
+ }
2420
+ }
2421
+
2422
+ class DragAndDropObserver extends CompositeDisposable {
2423
+ constructor(element, callbacks) {
2424
+ super();
2425
+ this.element = element;
2426
+ this.callbacks = callbacks;
2427
+ this.target = null;
2428
+ this.registerListeners();
2429
+ }
2430
+ registerListeners() {
2431
+ this.addDisposables(addDisposableListener(this.element, 'dragenter', (e) => {
2432
+ this.target = e.target;
2433
+ this.callbacks.onDragEnter(e);
2434
+ }, true));
2435
+ this.addDisposables(addDisposableListener(this.element, 'dragover', (e) => {
2436
+ e.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome)
2437
+ if (this.callbacks.onDragOver) {
2438
+ this.callbacks.onDragOver(e);
2439
+ }
2440
+ }, true));
2441
+ this.addDisposables(addDisposableListener(this.element, 'dragleave', (e) => {
2442
+ if (this.target === e.target) {
2443
+ this.target = null;
2444
+ this.callbacks.onDragLeave(e);
2445
+ }
2446
+ }));
2447
+ this.addDisposables(addDisposableListener(this.element, 'dragend', (e) => {
2448
+ this.target = null;
2449
+ this.callbacks.onDragEnd(e);
2450
+ }));
2451
+ this.addDisposables(addDisposableListener(this.element, 'drop', (e) => {
2452
+ this.callbacks.onDrop(e);
2453
+ }));
2454
+ }
2455
+ }
2456
+
2457
+ function isBooleanValue(value) {
2458
+ return typeof value === 'boolean';
2459
+ }
2460
+
2461
+ function numberOrFallback(maybeNumber, fallback) {
2462
+ return typeof maybeNumber === 'number' ? maybeNumber : fallback;
2463
+ }
2464
+ function directionToPosition(direction) {
2465
+ switch (direction) {
2466
+ case 'above':
2467
+ return 'top';
2468
+ case 'below':
2469
+ return 'bottom';
2470
+ case 'left':
2471
+ return 'left';
2472
+ case 'right':
2473
+ return 'right';
2474
+ case 'within':
2475
+ return 'center';
2476
+ default:
2477
+ throw new Error(`invalid direction '${direction}'`);
2478
+ }
2479
+ }
2480
+ function positionToDirection(position) {
2481
+ switch (position) {
2482
+ case 'top':
2483
+ return 'above';
2484
+ case 'bottom':
2485
+ return 'below';
2486
+ case 'left':
2487
+ return 'left';
2488
+ case 'right':
2489
+ return 'right';
2490
+ case 'center':
2491
+ return 'within';
2492
+ default:
2493
+ throw new Error(`invalid position '${position}'`);
2494
+ }
2495
+ }
2496
+ class Droptarget extends CompositeDisposable {
2497
+ get state() {
2498
+ return this._state;
2499
+ }
2500
+ constructor(element, options) {
2501
+ super();
2502
+ this.element = element;
2503
+ this.options = options;
2504
+ this._onDrop = new Emitter();
2505
+ this.onDrop = this._onDrop.event;
2506
+ // use a set to take advantage of #<set>.has
2507
+ const acceptedTargetZonesSet = new Set(this.options.acceptedTargetZones);
2508
+ this.addDisposables(this._onDrop, new DragAndDropObserver(this.element, {
2509
+ onDragEnter: () => undefined,
2510
+ onDragOver: (e) => {
2511
+ const width = this.element.clientWidth;
2512
+ const height = this.element.clientHeight;
2513
+ if (width === 0 || height === 0) {
2514
+ return; // avoid div!0
2515
+ }
2516
+ const rect = e.currentTarget.getBoundingClientRect();
2517
+ const x = e.clientX - rect.left;
2518
+ const y = e.clientY - rect.top;
2519
+ const quadrant = this.calculateQuadrant(acceptedTargetZonesSet, x, y, width, height);
2520
+ if (quadrant === null) {
2521
+ // no drop target should be displayed
2522
+ this.removeDropTarget();
2523
+ return;
2524
+ }
2525
+ if (isBooleanValue(this.options.canDisplayOverlay)) {
2526
+ if (!this.options.canDisplayOverlay) {
2527
+ return;
2528
+ }
2529
+ }
2530
+ else if (!this.options.canDisplayOverlay(e, quadrant)) {
2531
+ return;
2532
+ }
2533
+ if (!this.target) {
2534
+ this.target = document.createElement('div');
2535
+ this.target.className = 'drop-target-dropzone';
2536
+ this.overlay = document.createElement('div');
2537
+ this.overlay.className = 'drop-target-selection';
2538
+ this._state = 'center';
2539
+ this.target.appendChild(this.overlay);
2540
+ this.element.classList.add('drop-target');
2541
+ this.element.append(this.target);
2542
+ }
2543
+ if (this.options.acceptedTargetZones.length === 0) {
2544
+ return;
2545
+ }
2546
+ if (!this.target || !this.overlay) {
2547
+ return;
2548
+ }
2549
+ this.toggleClasses(quadrant, width, height);
2550
+ this.setState(quadrant);
2551
+ },
2552
+ onDragLeave: () => {
2553
+ this.removeDropTarget();
2554
+ },
2555
+ onDragEnd: () => {
2556
+ this.removeDropTarget();
2557
+ },
2558
+ onDrop: (e) => {
2559
+ e.preventDefault();
2560
+ e.stopPropagation();
2561
+ const state = this._state;
2562
+ this.removeDropTarget();
2563
+ if (state) {
2564
+ this._onDrop.fire({ position: state, nativeEvent: e });
2565
+ }
2566
+ },
2567
+ }));
2568
+ }
2569
+ dispose() {
2570
+ this.removeDropTarget();
2571
+ }
2572
+ toggleClasses(quadrant, width, height) {
2573
+ var _a, _b, _c, _d;
2574
+ if (!this.overlay) {
2575
+ return;
2576
+ }
2577
+ const isSmallX = width < 100;
2578
+ const isSmallY = height < 100;
2579
+ const isLeft = quadrant === 'left';
2580
+ const isRight = quadrant === 'right';
2581
+ const isTop = quadrant === 'top';
2582
+ const isBottom = quadrant === 'bottom';
2583
+ const rightClass = !isSmallX && isRight;
2584
+ const leftClass = !isSmallX && isLeft;
2585
+ const topClass = !isSmallY && isTop;
2586
+ const bottomClass = !isSmallY && isBottom;
2587
+ let size = 0.5;
2588
+ if (((_b = (_a = this.options.overlayModel) === null || _a === void 0 ? void 0 : _a.size) === null || _b === void 0 ? void 0 : _b.type) === 'percentage') {
2589
+ size = clamp(this.options.overlayModel.size.value, 0, 100) / 100;
2590
+ }
2591
+ if (((_d = (_c = this.options.overlayModel) === null || _c === void 0 ? void 0 : _c.size) === null || _d === void 0 ? void 0 : _d.type) === 'pixels') {
2592
+ if (rightClass || leftClass) {
2593
+ size =
2594
+ clamp(0, this.options.overlayModel.size.value, width) /
2595
+ width;
2596
+ }
2597
+ if (topClass || bottomClass) {
2598
+ size =
2599
+ clamp(0, this.options.overlayModel.size.value, height) /
2600
+ height;
2601
+ }
2602
+ }
2603
+ const translate = (1 - size) / 2;
2604
+ const scale = size;
2605
+ let transform;
2606
+ if (rightClass) {
2607
+ transform = `translateX(${100 * translate}%) scaleX(${scale})`;
2608
+ }
2609
+ else if (leftClass) {
2610
+ transform = `translateX(-${100 * translate}%) scaleX(${scale})`;
2611
+ }
2612
+ else if (topClass) {
2613
+ transform = `translateY(-${100 * translate}%) scaleY(${scale})`;
2614
+ }
2615
+ else if (bottomClass) {
2616
+ transform = `translateY(${100 * translate}%) scaleY(${scale})`;
2617
+ }
2618
+ else {
2619
+ transform = '';
2620
+ }
2621
+ this.overlay.style.transform = transform;
2622
+ toggleClass(this.overlay, 'small-right', isSmallX && isRight);
2623
+ toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
2624
+ toggleClass(this.overlay, 'small-top', isSmallY && isTop);
2625
+ toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
2626
+ }
2627
+ setState(quadrant) {
2628
+ switch (quadrant) {
2629
+ case 'top':
2630
+ this._state = 'top';
2631
+ break;
2632
+ case 'left':
2633
+ this._state = 'left';
2634
+ break;
2635
+ case 'bottom':
2636
+ this._state = 'bottom';
2637
+ break;
2638
+ case 'right':
2639
+ this._state = 'right';
2640
+ break;
2641
+ case 'center':
2642
+ this._state = 'center';
2643
+ break;
2644
+ }
2645
+ }
2646
+ calculateQuadrant(overlayType, x, y, width, height) {
2647
+ var _a, _b, _c, _d, _e, _f;
2648
+ const isPercentage = ((_a = this.options.overlayModel) === null || _a === void 0 ? void 0 : _a.activationSize) === undefined ||
2649
+ ((_c = (_b = this.options.overlayModel) === null || _b === void 0 ? void 0 : _b.activationSize) === null || _c === void 0 ? void 0 : _c.type) === 'percentage';
2650
+ const value = numberOrFallback((_f = (_e = (_d = this.options) === null || _d === void 0 ? void 0 : _d.overlayModel) === null || _e === void 0 ? void 0 : _e.activationSize) === null || _f === void 0 ? void 0 : _f.value, 20);
2651
+ if (isPercentage) {
2652
+ return calculateQuadrantAsPercentage(overlayType, x, y, width, height, value);
2653
+ }
2654
+ return calculateQuadrantAsPixels(overlayType, x, y, width, height, value);
2655
+ }
2656
+ removeDropTarget() {
2657
+ if (this.target) {
2658
+ this._state = undefined;
2659
+ this.element.removeChild(this.target);
2660
+ this.target = undefined;
2661
+ this.overlay = undefined;
2662
+ this.element.classList.remove('drop-target');
2663
+ }
2664
+ }
2665
+ }
2666
+ function calculateQuadrantAsPercentage(overlayType, x, y, width, height, threshold) {
2667
+ const xp = (100 * x) / width;
2668
+ const yp = (100 * y) / height;
2669
+ if (overlayType.has('left') && xp < threshold) {
2670
+ return 'left';
2671
+ }
2672
+ if (overlayType.has('right') && xp > 100 - threshold) {
2673
+ return 'right';
2674
+ }
2675
+ if (overlayType.has('top') && yp < threshold) {
2676
+ return 'top';
2677
+ }
2678
+ if (overlayType.has('bottom') && yp > 100 - threshold) {
2679
+ return 'bottom';
2578
2680
  }
2579
- closeAllGroups() {
2580
- return this.component.closeAllGroups();
2681
+ if (!overlayType.has('center')) {
2682
+ return null;
2581
2683
  }
2582
- removeGroup(group) {
2583
- this.component.removeGroup(group);
2684
+ return 'center';
2685
+ }
2686
+ function calculateQuadrantAsPixels(overlayType, x, y, width, height, threshold) {
2687
+ if (overlayType.has('left') && x < threshold) {
2688
+ return 'left';
2584
2689
  }
2585
- getGroup(id) {
2586
- return this.component.getPanel(id);
2690
+ if (overlayType.has('right') && x > width - threshold) {
2691
+ return 'right';
2587
2692
  }
2588
- fromJSON(data) {
2589
- this.component.fromJSON(data);
2693
+ if (overlayType.has('top') && y < threshold) {
2694
+ return 'top';
2590
2695
  }
2591
- toJSON() {
2592
- return this.component.toJSON();
2696
+ if (overlayType.has('bottom') && y > height - threshold) {
2697
+ return 'bottom';
2593
2698
  }
2594
- clear() {
2595
- this.component.clear();
2699
+ if (!overlayType.has('center')) {
2700
+ return null;
2596
2701
  }
2702
+ return 'center';
2597
2703
  }
2598
2704
 
2599
2705
  class ContentContainer extends CompositeDisposable {
2706
+ get element() {
2707
+ return this._element;
2708
+ }
2600
2709
  constructor() {
2601
2710
  super();
2602
2711
  this.disposable = new MutableDisposable();
@@ -2614,9 +2723,6 @@ class ContentContainer extends CompositeDisposable {
2614
2723
  // 3) register dragEnd events
2615
2724
  // 4) register mouseMove events (if no buttons are present we take this as a dragEnd event)
2616
2725
  }
2617
- get element() {
2618
- return this._element;
2619
- }
2620
2726
  show() {
2621
2727
  this.element.style.display = '';
2622
2728
  }
@@ -2672,6 +2778,7 @@ exports.DockviewDropTargets = void 0;
2672
2778
  DockviewDropTargets[DockviewDropTargets["Tab"] = 0] = "Tab";
2673
2779
  DockviewDropTargets[DockviewDropTargets["Panel"] = 1] = "Panel";
2674
2780
  DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
2781
+ DockviewDropTargets[DockviewDropTargets["Edge"] = 3] = "Edge";
2675
2782
  })(exports.DockviewDropTargets || (exports.DockviewDropTargets = {}));
2676
2783
 
2677
2784
  class DragHandler extends CompositeDisposable {
@@ -2693,9 +2800,9 @@ class DragHandler extends CompositeDisposable {
2693
2800
  for (const iframe of this.iframes) {
2694
2801
  iframe.style.pointerEvents = 'none';
2695
2802
  }
2696
- this.el.classList.add('dragged');
2697
- setTimeout(() => this.el.classList.remove('dragged'), 0);
2698
- this.disposable.value = this.getData();
2803
+ this.el.classList.add('dv-dragged');
2804
+ setTimeout(() => this.el.classList.remove('dv-dragged'), 0);
2805
+ this.disposable.value = this.getData(event.dataTransfer);
2699
2806
  if (event.dataTransfer) {
2700
2807
  event.dataTransfer.effectAllowed = 'move';
2701
2808
  }
@@ -2709,11 +2816,10 @@ class DragHandler extends CompositeDisposable {
2709
2816
  }
2710
2817
  }
2711
2818
 
2712
- exports.MouseEventKind = void 0;
2713
- (function (MouseEventKind) {
2714
- MouseEventKind["CLICK"] = "CLICK";
2715
- })(exports.MouseEventKind || (exports.MouseEventKind = {}));
2716
2819
  class Tab extends CompositeDisposable {
2820
+ get element() {
2821
+ return this._element;
2822
+ }
2717
2823
  constructor(panelId, accessor, group) {
2718
2824
  super();
2719
2825
  this.panelId = panelId;
@@ -2757,25 +2863,30 @@ class Tab extends CompositeDisposable {
2757
2863
  * on the tabs-container. I cannot use event.preventDefault() since I need the on DragStart event to occur
2758
2864
  */
2759
2865
  event.stopPropagation();
2760
- this._onChanged.fire({ kind: exports.MouseEventKind.CLICK, event });
2866
+ this._onChanged.fire(event);
2761
2867
  }));
2762
2868
  this.droptarget = new Droptarget(this._element, {
2763
- validOverlays: 'none',
2764
- canDisplayOverlay: (event) => {
2869
+ acceptedTargetZones: ['center'],
2870
+ canDisplayOverlay: (event, position) => {
2871
+ if (this.group.locked) {
2872
+ return false;
2873
+ }
2765
2874
  const data = getPanelData();
2766
2875
  if (data && this.accessor.id === data.viewId) {
2876
+ if (data.panelId === null &&
2877
+ data.groupId === this.group.id) {
2878
+ // don't allow group move to drop on self
2879
+ return false;
2880
+ }
2767
2881
  return this.panelId !== data.panelId;
2768
2882
  }
2769
- return this.group.model.canDisplayOverlay(event, exports.DockviewDropTargets.Tab);
2883
+ return this.group.model.canDisplayOverlay(event, position, exports.DockviewDropTargets.Tab);
2770
2884
  },
2771
2885
  });
2772
2886
  this.addDisposables(this.droptarget.onDrop((event) => {
2773
2887
  this._onDropped.fire(event);
2774
2888
  }));
2775
2889
  }
2776
- get element() {
2777
- return this._element;
2778
- }
2779
2890
  setActive(isActive) {
2780
2891
  toggleClass(this.element, 'active-tab', isActive);
2781
2892
  toggleClass(this.element, 'inactive-tab', !isActive);
@@ -2793,56 +2904,94 @@ class Tab extends CompositeDisposable {
2793
2904
  }
2794
2905
  }
2795
2906
 
2796
- class TabsContainer extends CompositeDisposable {
2797
- constructor(accessor, group, options) {
2907
+ function addGhostImage(dataTransfer, ghostElement) {
2908
+ // class dockview provides to force ghost image to be drawn on a different layer and prevent weird rendering issues
2909
+ addClasses(ghostElement, 'dv-dragged');
2910
+ document.body.appendChild(ghostElement);
2911
+ dataTransfer.setDragImage(ghostElement, 0, 0);
2912
+ setTimeout(() => {
2913
+ ghostElement.remove();
2914
+ }, 0);
2915
+ }
2916
+
2917
+ class GroupDragHandler extends DragHandler {
2918
+ constructor(element, accessorId, group) {
2919
+ super(element);
2920
+ this.accessorId = accessorId;
2921
+ this.group = group;
2922
+ this.panelTransfer = LocalSelectionTransfer.getInstance();
2923
+ }
2924
+ getData(dataTransfer) {
2925
+ this.panelTransfer.setData([new PanelTransfer(this.accessorId, this.group.id, null)], PanelTransfer.prototype);
2926
+ const style = window.getComputedStyle(this.el);
2927
+ const bgColor = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-background-color');
2928
+ const color = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-color');
2929
+ if (dataTransfer) {
2930
+ const ghostElement = document.createElement('div');
2931
+ ghostElement.style.backgroundColor = bgColor;
2932
+ ghostElement.style.color = color;
2933
+ ghostElement.style.padding = '2px 8px';
2934
+ ghostElement.style.height = '24px';
2935
+ ghostElement.style.fontSize = '11px';
2936
+ ghostElement.style.lineHeight = '20px';
2937
+ ghostElement.style.borderRadius = '12px';
2938
+ ghostElement.style.position = 'absolute';
2939
+ ghostElement.textContent = `Multiple Panels (${this.group.size})`;
2940
+ addGhostImage(dataTransfer, ghostElement);
2941
+ }
2942
+ return {
2943
+ dispose: () => {
2944
+ this.panelTransfer.clearData(PanelTransfer.prototype);
2945
+ },
2946
+ };
2947
+ }
2948
+ dispose() {
2949
+ //
2950
+ }
2951
+ }
2952
+
2953
+ class VoidContainer extends CompositeDisposable {
2954
+ get element() {
2955
+ return this._element;
2956
+ }
2957
+ constructor(accessor, group) {
2798
2958
  super();
2799
2959
  this.accessor = accessor;
2800
2960
  this.group = group;
2801
- this.tabs = [];
2802
- this.selectedIndex = -1;
2803
- this._hidden = false;
2804
2961
  this._onDrop = new Emitter();
2805
2962
  this.onDrop = this._onDrop.event;
2806
- this.addDisposables(this._onDrop);
2807
2963
  this._element = document.createElement('div');
2808
- this._element.className = 'tabs-and-actions-container';
2809
- this.height = options.tabHeight;
2810
- this.actionContainer = document.createElement('div');
2811
- this.actionContainer.className = 'action-container';
2812
- this.tabContainer = document.createElement('div');
2813
- this.tabContainer.className = 'tabs-container';
2814
- this.voidContainer = document.createElement('div');
2815
- this.voidContainer.className = 'void-container';
2816
- this._element.appendChild(this.tabContainer);
2817
- this._element.appendChild(this.voidContainer);
2818
- this._element.appendChild(this.actionContainer);
2819
- this.voidDropTarget = new Droptarget(this.voidContainer, {
2820
- validOverlays: 'none',
2821
- canDisplayOverlay: (event) => {
2964
+ this._element.className = 'void-container';
2965
+ this._element.tabIndex = 0;
2966
+ this._element.draggable = true;
2967
+ this.addDisposables(this._onDrop, addDisposableListener(this._element, 'click', () => {
2968
+ this.accessor.doSetGroupActive(this.group);
2969
+ }));
2970
+ const handler = new GroupDragHandler(this._element, accessor.id, group);
2971
+ this.voidDropTarget = new Droptarget(this._element, {
2972
+ acceptedTargetZones: ['center'],
2973
+ canDisplayOverlay: (event, position) => {
2822
2974
  var _a;
2823
2975
  const data = getPanelData();
2824
2976
  if (data && this.accessor.id === data.viewId) {
2977
+ if (data.panelId === null &&
2978
+ data.groupId === this.group.id) {
2979
+ // don't allow group move to drop on self
2980
+ return false;
2981
+ }
2825
2982
  // don't show the overlay if the tab being dragged is the last panel of this group
2826
- return ((_a = last(this.tabs)) === null || _a === void 0 ? void 0 : _a.value.panelId) !== data.panelId;
2983
+ return ((_a = last(this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
2827
2984
  }
2828
- return group.model.canDisplayOverlay(event, exports.DockviewDropTargets.Panel);
2985
+ return group.model.canDisplayOverlay(event, position, exports.DockviewDropTargets.Panel);
2829
2986
  },
2830
2987
  });
2831
- this.addDisposables(this.voidDropTarget.onDrop((event) => {
2832
- this._onDrop.fire({
2833
- event: event.nativeEvent,
2834
- index: this.tabs.length,
2835
- });
2836
- }), this.voidDropTarget, addDisposableListener(this.tabContainer, 'mousedown', (event) => {
2837
- if (event.defaultPrevented) {
2838
- return;
2839
- }
2840
- const isLeftClick = event.button === 0;
2841
- if (isLeftClick) {
2842
- this.accessor.doSetGroupActive(this.group);
2843
- }
2844
- }));
2988
+ this.addDisposables(handler, this.voidDropTarget.onDrop((event) => {
2989
+ this._onDrop.fire(event);
2990
+ }), this.voidDropTarget);
2845
2991
  }
2992
+ }
2993
+
2994
+ class TabsContainer extends CompositeDisposable {
2846
2995
  get panels() {
2847
2996
  return this.tabs.map((_) => _.value.panelId);
2848
2997
  }
@@ -2903,6 +3052,52 @@ class TabsContainer extends CompositeDisposable {
2903
3052
  indexOf(id) {
2904
3053
  return this.tabs.findIndex((tab) => tab.value.panelId === id);
2905
3054
  }
3055
+ constructor(accessor, group) {
3056
+ super();
3057
+ this.accessor = accessor;
3058
+ this.group = group;
3059
+ this.tabs = [];
3060
+ this.selectedIndex = -1;
3061
+ this._hidden = false;
3062
+ this._onDrop = new Emitter();
3063
+ this.onDrop = this._onDrop.event;
3064
+ this.addDisposables(this._onDrop);
3065
+ this._element = document.createElement('div');
3066
+ this._element.className = 'tabs-and-actions-container';
3067
+ this.height = accessor.options.tabHeight;
3068
+ toggleClass(this._element, 'dv-full-width-single-tab', this.accessor.options.singleTabMode === 'fullwidth');
3069
+ this.addDisposables(this.accessor.onDidAddPanel((e) => {
3070
+ if (e.api.group === this.group) {
3071
+ toggleClass(this._element, 'dv-single-tab', this.size === 1);
3072
+ }
3073
+ }), this.accessor.onDidRemovePanel((e) => {
3074
+ if (e.api.group === this.group) {
3075
+ toggleClass(this._element, 'dv-single-tab', this.size === 1);
3076
+ }
3077
+ }));
3078
+ this.actionContainer = document.createElement('div');
3079
+ this.actionContainer.className = 'action-container';
3080
+ this.tabContainer = document.createElement('div');
3081
+ this.tabContainer.className = 'tabs-container';
3082
+ this.voidContainer = new VoidContainer(this.accessor, this.group);
3083
+ this._element.appendChild(this.tabContainer);
3084
+ this._element.appendChild(this.voidContainer.element);
3085
+ this._element.appendChild(this.actionContainer);
3086
+ this.addDisposables(this.voidContainer, this.voidContainer.onDrop((event) => {
3087
+ this._onDrop.fire({
3088
+ event: event.nativeEvent,
3089
+ index: this.tabs.length,
3090
+ });
3091
+ }), addDisposableListener(this.tabContainer, 'mousedown', (event) => {
3092
+ if (event.defaultPrevented) {
3093
+ return;
3094
+ }
3095
+ const isLeftClick = event.button === 0;
3096
+ if (isLeftClick) {
3097
+ this.accessor.doSetGroupActive(this.group);
3098
+ }
3099
+ }));
3100
+ }
2906
3101
  setActive(_isGroupActive) {
2907
3102
  // noop
2908
3103
  }
@@ -2947,15 +3142,13 @@ class TabsContainer extends CompositeDisposable {
2947
3142
  var _a;
2948
3143
  const alreadyFocused = panel.id === ((_a = this.group.model.activePanel) === null || _a === void 0 ? void 0 : _a.id) &&
2949
3144
  this.group.model.isContentFocused;
2950
- const isLeftClick = event.event.button === 0;
2951
- if (!isLeftClick || event.event.defaultPrevented) {
3145
+ const isLeftClick = event.button === 0;
3146
+ if (!isLeftClick || event.defaultPrevented) {
2952
3147
  return;
2953
3148
  }
2954
- if (event.kind === exports.MouseEventKind.CLICK) {
2955
- this.group.model.openPanel(panel, {
2956
- skipFocus: alreadyFocused,
2957
- });
2958
- }
3149
+ this.group.model.openPanel(panel, {
3150
+ skipFocus: alreadyFocused,
3151
+ });
2959
3152
  }), tabToAdd.onDrop((event) => {
2960
3153
  this._onDrop.fire({
2961
3154
  event: event.nativeEvent,
@@ -2978,63 +3171,6 @@ class TabsContainer extends CompositeDisposable {
2978
3171
  }
2979
3172
 
2980
3173
  class Groupview extends CompositeDisposable {
2981
- constructor(container, accessor, id, options, parent) {
2982
- super();
2983
- this.container = container;
2984
- this.accessor = accessor;
2985
- this.id = id;
2986
- this.options = options;
2987
- this.parent = parent;
2988
- this._isGroupActive = false;
2989
- this._locked = false;
2990
- this.mostRecentlyUsed = [];
2991
- this._onDidChange = new Emitter();
2992
- this.onDidChange = this._onDidChange.event;
2993
- this._width = 0;
2994
- this._height = 0;
2995
- this._panels = [];
2996
- this._onMove = new Emitter();
2997
- this.onMove = this._onMove.event;
2998
- this._onDidDrop = new Emitter();
2999
- this.onDidDrop = this._onDidDrop.event;
3000
- this._onDidAddPanel = new Emitter();
3001
- this.onDidAddPanel = this._onDidAddPanel.event;
3002
- this._onDidRemovePanel = new Emitter();
3003
- this.onDidRemovePanel = this._onDidRemovePanel.event;
3004
- this._onDidActivePanelChange = new Emitter();
3005
- this.onDidActivePanelChange = this._onDidActivePanelChange.event;
3006
- this.container.classList.add('groupview');
3007
- this.tabsContainer = new TabsContainer(this.accessor, this.parent, {
3008
- tabHeight: options.tabHeight,
3009
- });
3010
- this.contentContainer = new ContentContainer();
3011
- this.dropTarget = new Droptarget(this.contentContainer.element, {
3012
- validOverlays: 'all',
3013
- canDisplayOverlay: (event, quadrant) => {
3014
- if (this.locked && !quadrant) {
3015
- return false;
3016
- }
3017
- const data = getPanelData();
3018
- if (data && data.viewId === this.accessor.id) {
3019
- const groupHasOnePanelAndIsActiveDragElement = this._panels.length === 1 && data.groupId === this.id;
3020
- return !groupHasOnePanelAndIsActiveDragElement;
3021
- }
3022
- return this.canDisplayOverlay(event, exports.DockviewDropTargets.Panel);
3023
- },
3024
- });
3025
- container.append(this.tabsContainer.element, this.contentContainer.element);
3026
- this.header.hidden = !!options.hideHeader;
3027
- this.locked = !!options.locked;
3028
- this.addDisposables(this._onMove, this._onDidChange, this._onDidDrop, this._onDidAddPanel, this._onDidRemovePanel, this._onDidActivePanelChange, this.tabsContainer.onDrop((event) => {
3029
- this.handleDropEvent(event.event, exports.Position.Center, event.index);
3030
- }), this.contentContainer.onDidFocus(() => {
3031
- this.accessor.doSetGroupActive(this.parent, true);
3032
- }), this.contentContainer.onDidBlur(() => {
3033
- // noop
3034
- }), this.dropTarget.onDrop((event) => {
3035
- this.handleDropEvent(event.nativeEvent, event.position);
3036
- }));
3037
- }
3038
3174
  get element() {
3039
3175
  throw new Error('not supported');
3040
3176
  }
@@ -3046,6 +3182,7 @@ class Groupview extends CompositeDisposable {
3046
3182
  }
3047
3183
  set locked(value) {
3048
3184
  this._locked = value;
3185
+ toggleClass(this.container, 'locked-groupview', value);
3049
3186
  }
3050
3187
  get isActive() {
3051
3188
  return this._isGroupActive;
@@ -3083,6 +3220,71 @@ class Groupview extends CompositeDisposable {
3083
3220
  }
3084
3221
  return isAncestor(document.activeElement, this.contentContainer.element);
3085
3222
  }
3223
+ constructor(container, accessor, id, options, groupPanel) {
3224
+ super();
3225
+ this.container = container;
3226
+ this.accessor = accessor;
3227
+ this.id = id;
3228
+ this.options = options;
3229
+ this.groupPanel = groupPanel;
3230
+ this._isGroupActive = false;
3231
+ this._locked = false;
3232
+ this.mostRecentlyUsed = [];
3233
+ this._onDidChange = new Emitter();
3234
+ this.onDidChange = this._onDidChange.event;
3235
+ this._width = 0;
3236
+ this._height = 0;
3237
+ this._panels = [];
3238
+ this._onMove = new Emitter();
3239
+ this.onMove = this._onMove.event;
3240
+ this._onDidDrop = new Emitter();
3241
+ this.onDidDrop = this._onDidDrop.event;
3242
+ this._onDidAddPanel = new Emitter();
3243
+ this.onDidAddPanel = this._onDidAddPanel.event;
3244
+ this._onDidRemovePanel = new Emitter();
3245
+ this.onDidRemovePanel = this._onDidRemovePanel.event;
3246
+ this._onDidActivePanelChange = new Emitter();
3247
+ this.onDidActivePanelChange = this._onDidActivePanelChange.event;
3248
+ this.container.classList.add('groupview');
3249
+ this.tabsContainer = new TabsContainer(this.accessor, this.groupPanel);
3250
+ this.contentContainer = new ContentContainer();
3251
+ this.dropTarget = new Droptarget(this.contentContainer.element, {
3252
+ acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
3253
+ canDisplayOverlay: (event, position) => {
3254
+ if (this.locked && position === 'center') {
3255
+ return false;
3256
+ }
3257
+ const data = getPanelData();
3258
+ if (data && data.viewId === this.accessor.id) {
3259
+ if (data.groupId === this.id) {
3260
+ if (position === 'center') {
3261
+ // don't allow to drop on self for center position
3262
+ return false;
3263
+ }
3264
+ if (data.panelId === null) {
3265
+ // don't allow group move to drop anywhere on self
3266
+ return false;
3267
+ }
3268
+ }
3269
+ const groupHasOnePanelAndIsActiveDragElement = this._panels.length === 1 && data.groupId === this.id;
3270
+ return !groupHasOnePanelAndIsActiveDragElement;
3271
+ }
3272
+ return this.canDisplayOverlay(event, position, exports.DockviewDropTargets.Panel);
3273
+ },
3274
+ });
3275
+ container.append(this.tabsContainer.element, this.contentContainer.element);
3276
+ this.header.hidden = !!options.hideHeader;
3277
+ this.locked = !!options.locked;
3278
+ this.addDisposables(this._onMove, this._onDidChange, this._onDidDrop, this._onDidAddPanel, this._onDidRemovePanel, this._onDidActivePanelChange, this.tabsContainer.onDrop((event) => {
3279
+ this.handleDropEvent(event.event, 'center', event.index);
3280
+ }), this.contentContainer.onDidFocus(() => {
3281
+ this.accessor.doSetGroupActive(this.groupPanel, true);
3282
+ }), this.contentContainer.onDidBlur(() => {
3283
+ // noop
3284
+ }), this.dropTarget.onDrop((event) => {
3285
+ this.handleDropEvent(event.nativeEvent, event.position);
3286
+ }));
3287
+ }
3086
3288
  initialize() {
3087
3289
  var _a, _b;
3088
3290
  if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.panels) {
@@ -3098,11 +3300,11 @@ class Groupview extends CompositeDisposable {
3098
3300
  this.setActive(this.isActive, true, true);
3099
3301
  this.updateContainer();
3100
3302
  if (this.accessor.options.createGroupControlElement) {
3101
- this._control = this.accessor.options.createGroupControlElement(this.parent);
3303
+ this._control = this.accessor.options.createGroupControlElement(this.groupPanel);
3102
3304
  this.addDisposables(this._control);
3103
3305
  this._control.init({
3104
3306
  containerApi: new DockviewApi(this.accessor),
3105
- api: this.parent.api,
3307
+ api: this.groupPanel.api,
3106
3308
  });
3107
3309
  this.tabsContainer.setActionElement(this._control.element);
3108
3310
  }
@@ -3189,10 +3391,10 @@ class Groupview extends CompositeDisposable {
3189
3391
  const skipSetPanelActive = !!options.skipSetPanelActive;
3190
3392
  const skipSetGroupActive = !!options.skipSetGroupActive;
3191
3393
  // ensure the group is updated before we fire any events
3192
- panel.updateParentGroup(this.parent, true);
3394
+ panel.updateParentGroup(this.groupPanel, true);
3193
3395
  if (this._activePanel === panel) {
3194
3396
  if (!skipSetGroupActive) {
3195
- this.accessor.doSetGroupActive(this.parent);
3397
+ this.accessor.doSetGroupActive(this.groupPanel);
3196
3398
  }
3197
3399
  return;
3198
3400
  }
@@ -3201,7 +3403,7 @@ class Groupview extends CompositeDisposable {
3201
3403
  this.doSetActivePanel(panel);
3202
3404
  }
3203
3405
  if (!skipSetGroupActive) {
3204
- this.accessor.doSetGroupActive(this.parent, !!options.skipFocus);
3406
+ this.accessor.doSetGroupActive(this.groupPanel, !!options.skipFocus);
3205
3407
  }
3206
3408
  this.updateContainer();
3207
3409
  }
@@ -3224,7 +3426,7 @@ class Groupview extends CompositeDisposable {
3224
3426
  }
3225
3427
  }
3226
3428
  else {
3227
- this.accessor.removeGroup(this.parent);
3429
+ this.accessor.removeGroup(this.groupPanel);
3228
3430
  }
3229
3431
  }
3230
3432
  closePanel(panel) {
@@ -3329,7 +3531,7 @@ class Groupview extends CompositeDisposable {
3329
3531
  }
3330
3532
  updateContainer() {
3331
3533
  toggleClass(this.container, 'empty', this.isEmpty);
3332
- this.panels.forEach((panel) => panel.updateParentGroup(this.parent, this.isActive));
3534
+ this.panels.forEach((panel) => panel.updateParentGroup(this.groupPanel, this.isActive));
3333
3535
  if (this.isEmpty && !this.watermark) {
3334
3536
  const watermark = this.accessor.createWatermarkComponent();
3335
3537
  watermark.init({
@@ -3341,29 +3543,28 @@ class Groupview extends CompositeDisposable {
3341
3543
  this.watermark = watermark;
3342
3544
  addDisposableListener(this.watermark.element, 'click', () => {
3343
3545
  if (!this.isActive) {
3344
- this.accessor.doSetGroupActive(this.parent);
3546
+ this.accessor.doSetGroupActive(this.groupPanel);
3345
3547
  }
3346
3548
  });
3347
- this.contentContainer.hide();
3348
3549
  this.tabsContainer.hide();
3349
- this.container.appendChild(this.watermark.element);
3350
- this.watermark.updateParentGroup(this.parent, true);
3550
+ this.contentContainer.element.appendChild(this.watermark.element);
3551
+ this.watermark.updateParentGroup(this.groupPanel, true);
3351
3552
  }
3352
3553
  if (!this.isEmpty && this.watermark) {
3353
3554
  this.watermark.element.remove();
3354
3555
  this.watermark.dispose();
3355
3556
  this.watermark = undefined;
3356
- this.contentContainer.show();
3357
3557
  this.tabsContainer.show();
3358
3558
  }
3359
3559
  }
3360
- canDisplayOverlay(event, target) {
3560
+ canDisplayOverlay(event, position, target) {
3361
3561
  // custom overlay handler
3362
3562
  if (this.accessor.options.showDndOverlay) {
3363
3563
  return this.accessor.options.showDndOverlay({
3364
3564
  nativeEvent: event,
3365
3565
  target,
3366
3566
  group: this.accessor.getPanel(this.id),
3567
+ position,
3367
3568
  getData: getPanelData,
3368
3569
  });
3369
3570
  }
@@ -3371,7 +3572,17 @@ class Groupview extends CompositeDisposable {
3371
3572
  }
3372
3573
  handleDropEvent(event, position, index) {
3373
3574
  const data = getPanelData();
3374
- if (data) {
3575
+ if (data && data.viewId === this.accessor.id) {
3576
+ if (data.panelId === null) {
3577
+ // this is a group move dnd event
3578
+ const { groupId } = data;
3579
+ this._onMove.fire({
3580
+ target: position,
3581
+ groupId: groupId,
3582
+ index,
3583
+ });
3584
+ return;
3585
+ }
3375
3586
  const fromSameGroup = this.tabsContainer.indexOf(data.panelId) !== -1;
3376
3587
  if (fromSameGroup && this.tabsContainer.size === 1) {
3377
3588
  return;
@@ -3414,48 +3625,22 @@ class Groupview extends CompositeDisposable {
3414
3625
  }
3415
3626
 
3416
3627
  const nextLayoutId$1 = sequentialNumberGenerator();
3417
- function toTarget(direction) {
3418
- switch (direction) {
3419
- case 'left':
3420
- return exports.Position.Left;
3421
- case 'right':
3422
- return exports.Position.Right;
3423
- case 'above':
3424
- return exports.Position.Top;
3425
- case 'below':
3426
- return exports.Position.Bottom;
3427
- case 'within':
3428
- default:
3429
- return exports.Position.Center;
3430
- }
3431
- }
3432
- class BaseGrid extends CompositeDisposable {
3433
- constructor(_element, options) {
3434
- super();
3435
- this._element = _element;
3436
- this._id = nextLayoutId$1.next();
3437
- this._groups = new Map();
3438
- this._onDidLayoutChange = new Emitter();
3439
- this.onDidLayoutChange = this._onDidLayoutChange.event;
3440
- this._onDidRemoveGroup = new Emitter();
3441
- this.onDidRemoveGroup = this._onDidRemoveGroup.event;
3442
- this._onDidAddGroup = new Emitter();
3443
- this.onDidAddGroup = this._onDidAddGroup.event;
3444
- this._onDidActiveGroupChange = new Emitter();
3445
- this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
3446
- this._bufferOnDidLayoutChange = new TickDelayedEvent();
3447
- this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
3448
- this.element.appendChild(this.gridview.element);
3449
- this.layout(0, 0, true); // set some elements height/widths
3450
- this.addDisposables(this.gridview.onDidChange(() => {
3451
- this._bufferOnDidLayoutChange.fire();
3452
- }));
3453
- this.addDisposables(exports.Event.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
3454
- this._bufferOnDidLayoutChange.fire();
3455
- }), this._bufferOnDidLayoutChange.onEvent(() => {
3456
- this._onDidLayoutChange.fire();
3457
- }), this._bufferOnDidLayoutChange);
3628
+ function toTarget(direction) {
3629
+ switch (direction) {
3630
+ case 'left':
3631
+ return 'left';
3632
+ case 'right':
3633
+ return 'right';
3634
+ case 'above':
3635
+ return 'top';
3636
+ case 'below':
3637
+ return 'bottom';
3638
+ case 'within':
3639
+ default:
3640
+ return 'center';
3458
3641
  }
3642
+ }
3643
+ class BaseGrid extends CompositeDisposable {
3459
3644
  get id() {
3460
3645
  return this._id;
3461
3646
  }
@@ -3489,6 +3674,32 @@ class BaseGrid extends CompositeDisposable {
3489
3674
  get activeGroup() {
3490
3675
  return this._activeGroup;
3491
3676
  }
3677
+ constructor(_element, options) {
3678
+ super();
3679
+ this._element = _element;
3680
+ this._id = nextLayoutId$1.next();
3681
+ this._groups = new Map();
3682
+ this._onDidLayoutChange = new Emitter();
3683
+ this.onDidLayoutChange = this._onDidLayoutChange.event;
3684
+ this._onDidRemoveGroup = new Emitter();
3685
+ this.onDidRemoveGroup = this._onDidRemoveGroup.event;
3686
+ this._onDidAddGroup = new Emitter();
3687
+ this.onDidAddGroup = this._onDidAddGroup.event;
3688
+ this._onDidActiveGroupChange = new Emitter();
3689
+ this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
3690
+ this._bufferOnDidLayoutChange = new TickDelayedEvent();
3691
+ this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
3692
+ this.element.appendChild(this.gridview.element);
3693
+ this.layout(0, 0, true); // set some elements height/widths
3694
+ this.addDisposables(this.gridview.onDidChange(() => {
3695
+ this._bufferOnDidLayoutChange.fire();
3696
+ }));
3697
+ this.addDisposables(exports.Event.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
3698
+ this._bufferOnDidLayoutChange.fire();
3699
+ }), this._bufferOnDidLayoutChange.onEvent(() => {
3700
+ this._onDidLayoutChange.fire();
3701
+ }), this._bufferOnDidLayoutChange);
3702
+ }
3492
3703
  setVisible(panel, visible) {
3493
3704
  this.gridview.setViewVisible(getGridLocation(panel.element), visible);
3494
3705
  this._onDidLayoutChange.fire();
@@ -3597,10 +3808,51 @@ class BaseGrid extends CompositeDisposable {
3597
3808
  }
3598
3809
  }
3599
3810
 
3811
+ function isPanelOptionsWithPanel(data) {
3812
+ if (data.referencePanel) {
3813
+ return true;
3814
+ }
3815
+ return false;
3816
+ }
3817
+ function isPanelOptionsWithGroup(data) {
3818
+ if (data.referenceGroup) {
3819
+ return true;
3820
+ }
3821
+ return false;
3822
+ }
3823
+ function isGroupOptionsWithPanel(data) {
3824
+ if (data.referencePanel) {
3825
+ return true;
3826
+ }
3827
+ return false;
3828
+ }
3829
+ function isGroupOptionsWithGroup(data) {
3830
+ if (data.referenceGroup) {
3831
+ return true;
3832
+ }
3833
+ return false;
3834
+ }
3835
+
3600
3836
  /**
3601
3837
  * A core api implementation that should be used across all panel-like objects
3602
3838
  */
3603
3839
  class PanelApiImpl extends CompositeDisposable {
3840
+ //
3841
+ get isFocused() {
3842
+ return this._isFocused;
3843
+ }
3844
+ get isActive() {
3845
+ return this._isActive;
3846
+ }
3847
+ get isVisible() {
3848
+ return this._isVisible;
3849
+ }
3850
+ get width() {
3851
+ return this._width;
3852
+ }
3853
+ get height() {
3854
+ return this._height;
3855
+ }
3604
3856
  constructor(id) {
3605
3857
  super();
3606
3858
  this.id = id;
@@ -3609,6 +3861,7 @@ class PanelApiImpl extends CompositeDisposable {
3609
3861
  this._isVisible = true;
3610
3862
  this._width = 0;
3611
3863
  this._height = 0;
3864
+ this.panelUpdatesDisposable = new MutableDisposable();
3612
3865
  this._onDidDimensionChange = new Emitter({
3613
3866
  replay: true,
3614
3867
  });
@@ -3637,7 +3890,10 @@ class PanelApiImpl extends CompositeDisposable {
3637
3890
  //
3638
3891
  this._onActiveChange = new Emitter();
3639
3892
  this.onActiveChange = this._onActiveChange.event;
3640
- this.addDisposables(this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
3893
+ //
3894
+ this._onUpdateParameters = new Emitter();
3895
+ this.onUpdateParameters = this._onUpdateParameters.event;
3896
+ this.addDisposables(this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this._onUpdateParameters, this.onDidFocusChange((event) => {
3641
3897
  this._isFocused = event.isFocused;
3642
3898
  }), this.onDidActiveChange((event) => {
3643
3899
  this._isActive = event.isActive;
@@ -3648,21 +3904,14 @@ class PanelApiImpl extends CompositeDisposable {
3648
3904
  this._height = event.height;
3649
3905
  }));
3650
3906
  }
3651
- //
3652
- get isFocused() {
3653
- return this._isFocused;
3654
- }
3655
- get isActive() {
3656
- return this._isActive;
3657
- }
3658
- get isVisible() {
3659
- return this._isVisible;
3660
- }
3661
- get width() {
3662
- return this._width;
3663
- }
3664
- get height() {
3665
- return this._height;
3907
+ initialize(panel) {
3908
+ this.panelUpdatesDisposable.value = this._onUpdateParameters.event((parameters) => {
3909
+ panel.update({
3910
+ params: {
3911
+ params: parameters,
3912
+ },
3913
+ });
3914
+ });
3666
3915
  }
3667
3916
  setVisible(isVisible) {
3668
3917
  this._onVisibilityChange.fire({ isVisible });
@@ -3670,26 +3919,29 @@ class PanelApiImpl extends CompositeDisposable {
3670
3919
  setActive() {
3671
3920
  this._onActiveChange.fire();
3672
3921
  }
3922
+ updateParameters(parameters) {
3923
+ this._onUpdateParameters.fire(parameters);
3924
+ }
3673
3925
  dispose() {
3674
3926
  super.dispose();
3675
3927
  }
3676
3928
  }
3677
3929
 
3678
3930
  class GridviewPanelApiImpl extends PanelApiImpl {
3679
- //
3680
- constructor(id) {
3931
+ constructor(id, panel) {
3681
3932
  super(id);
3682
3933
  this._onDidConstraintsChangeInternal = new Emitter();
3683
3934
  this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
3684
- //
3685
3935
  this._onDidConstraintsChange = new Emitter({
3686
3936
  replay: true,
3687
3937
  });
3688
3938
  this.onDidConstraintsChange = this._onDidConstraintsChange.event;
3689
- //
3690
3939
  this._onDidSizeChange = new Emitter();
3691
3940
  this.onDidSizeChange = this._onDidSizeChange.event;
3692
3941
  this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
3942
+ if (panel) {
3943
+ this.initialize(panel);
3944
+ }
3693
3945
  }
3694
3946
  setConstraints(value) {
3695
3947
  this._onDidConstraintsChangeInternal.fire(value);
@@ -3700,19 +3952,6 @@ class GridviewPanelApiImpl extends PanelApiImpl {
3700
3952
  }
3701
3953
 
3702
3954
  class DockviewPanelApiImpl extends GridviewPanelApiImpl {
3703
- constructor(panel, group) {
3704
- super(panel.id);
3705
- this.panel = panel;
3706
- this._onDidTitleChange = new Emitter();
3707
- this.onDidTitleChange = this._onDidTitleChange.event;
3708
- this._onDidActiveGroupChange = new Emitter();
3709
- this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
3710
- this._onDidGroupChange = new Emitter();
3711
- this.onDidGroupChange = this._onDidGroupChange.event;
3712
- this.disposable = new MutableDisposable();
3713
- this._group = group;
3714
- this.addDisposables(this.disposable, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange);
3715
- }
3716
3955
  get title() {
3717
3956
  return this.panel.title;
3718
3957
  }
@@ -3736,30 +3975,29 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
3736
3975
  get group() {
3737
3976
  return this._group;
3738
3977
  }
3978
+ constructor(panel, group) {
3979
+ super(panel.id);
3980
+ this.panel = panel;
3981
+ this._onDidTitleChange = new Emitter();
3982
+ this.onDidTitleChange = this._onDidTitleChange.event;
3983
+ this._onDidActiveGroupChange = new Emitter();
3984
+ this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
3985
+ this._onDidGroupChange = new Emitter();
3986
+ this.onDidGroupChange = this._onDidGroupChange.event;
3987
+ this.disposable = new MutableDisposable();
3988
+ this.initialize(panel);
3989
+ this._group = group;
3990
+ this.addDisposables(this.disposable, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange);
3991
+ }
3739
3992
  setTitle(title) {
3740
- this._onDidTitleChange.fire({ title });
3993
+ this.panel.update({ params: { title } });
3741
3994
  }
3742
3995
  close() {
3743
- if (!this.group) {
3744
- throw new Error(`panel ${this.id} has no group`);
3745
- }
3746
- return this.group.model.closePanel(this.panel);
3996
+ this.group.model.closePanel(this.panel);
3747
3997
  }
3748
3998
  }
3749
3999
 
3750
- class DockviewGroupPanel extends CompositeDisposable {
3751
- constructor(id, accessor, containerApi, group) {
3752
- super();
3753
- this.id = id;
3754
- this.containerApi = containerApi;
3755
- this.mutableDisposable = new MutableDisposable();
3756
- this._title = '';
3757
- this._group = group;
3758
- this.api = new DockviewPanelApiImpl(this, this._group);
3759
- this.addDisposables(this.api.onActiveChange(() => {
3760
- accessor.setActivePanel(this);
3761
- }));
3762
- }
4000
+ class DockviewPanel extends CompositeDisposable {
3763
4001
  get params() {
3764
4002
  return this._params;
3765
4003
  }
@@ -3772,6 +4010,22 @@ class DockviewGroupPanel extends CompositeDisposable {
3772
4010
  get view() {
3773
4011
  return this._view;
3774
4012
  }
4013
+ constructor(id, accessor, containerApi, group) {
4014
+ super();
4015
+ this.id = id;
4016
+ this.containerApi = containerApi;
4017
+ this.mutableDisposable = new MutableDisposable();
4018
+ this._title = '';
4019
+ this._group = group;
4020
+ this.api = new DockviewPanelApiImpl(this, this._group);
4021
+ this.addDisposables(this.api.onActiveChange(() => {
4022
+ accessor.setActivePanel(this);
4023
+ }), this.api.onDidSizeChange((event) => {
4024
+ // forward the resize event to the group since if you want to resize a panel
4025
+ // you are actually just resizing the panels parent which is the group
4026
+ this.group.api.setSize(event);
4027
+ }));
4028
+ }
3775
4029
  init(params) {
3776
4030
  var _a;
3777
4031
  this._params = params.params;
@@ -3854,6 +4108,9 @@ class DockviewGroupPanel extends CompositeDisposable {
3854
4108
  }
3855
4109
 
3856
4110
  class ActionContainer {
4111
+ get element() {
4112
+ return this._element;
4113
+ }
3857
4114
  constructor() {
3858
4115
  this._element = document.createElement('div');
3859
4116
  this._element.className = 'actions-bar';
@@ -3861,9 +4118,6 @@ class ActionContainer {
3861
4118
  this._list.className = 'actions-container';
3862
4119
  this._element.appendChild(this._list);
3863
4120
  }
3864
- get element() {
3865
- return this._element;
3866
- }
3867
4121
  add(element) {
3868
4122
  const listItem = document.createElement('li');
3869
4123
  listItem.className = 'action-item';
@@ -3904,6 +4158,9 @@ const createChevronRightButton = () => createSvgElementFromPath({
3904
4158
  });
3905
4159
 
3906
4160
  class Watermark extends CompositeDisposable {
4161
+ get id() {
4162
+ return 'watermark';
4163
+ }
3907
4164
  constructor() {
3908
4165
  super();
3909
4166
  this._element = document.createElement('div');
@@ -3931,9 +4188,6 @@ class Watermark extends CompositeDisposable {
3931
4188
  }
3932
4189
  }));
3933
4190
  }
3934
- get id() {
3935
- return 'watermark';
3936
- }
3937
4191
  update(_event) {
3938
4192
  // noop
3939
4193
  }
@@ -3996,6 +4250,12 @@ function createComponent(id, componentName, components = {}, frameworkComponents
3996
4250
 
3997
4251
  const DEFAULT_TAB_IDENTIFIER = '__default__tab__';
3998
4252
  class DefaultTab extends CompositeDisposable {
4253
+ get element() {
4254
+ return this._element;
4255
+ }
4256
+ get id() {
4257
+ return DEFAULT_TAB_IDENTIFIER;
4258
+ }
3999
4259
  constructor() {
4000
4260
  super();
4001
4261
  this._isPanelVisible = false;
@@ -4028,12 +4288,6 @@ class DefaultTab extends CompositeDisposable {
4028
4288
  }));
4029
4289
  this.render();
4030
4290
  }
4031
- get element() {
4032
- return this._element;
4033
- }
4034
- get id() {
4035
- return DEFAULT_TAB_IDENTIFIER;
4036
- }
4037
4291
  update(event) {
4038
4292
  this.params = Object.assign(Object.assign({}, this.params), event.params);
4039
4293
  this.render();
@@ -4072,6 +4326,19 @@ class DefaultTab extends CompositeDisposable {
4072
4326
  }
4073
4327
 
4074
4328
  class BasePanelView extends CompositeDisposable {
4329
+ get element() {
4330
+ return this._element;
4331
+ }
4332
+ get width() {
4333
+ return this._width;
4334
+ }
4335
+ get height() {
4336
+ return this._height;
4337
+ }
4338
+ get params() {
4339
+ var _a;
4340
+ return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
4341
+ }
4075
4342
  constructor(id, component, api) {
4076
4343
  super();
4077
4344
  this.id = id;
@@ -4092,19 +4359,6 @@ class BasePanelView extends CompositeDisposable {
4092
4359
  this.api._onDidChangeFocus.fire({ isFocused: false });
4093
4360
  }));
4094
4361
  }
4095
- get element() {
4096
- return this._element;
4097
- }
4098
- get width() {
4099
- return this._width;
4100
- }
4101
- get height() {
4102
- return this._height;
4103
- }
4104
- get params() {
4105
- var _a;
4106
- return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
4107
- }
4108
4362
  focus() {
4109
4363
  this.api._onFocusEvent.fire();
4110
4364
  }
@@ -4145,50 +4399,6 @@ class BasePanelView extends CompositeDisposable {
4145
4399
  }
4146
4400
 
4147
4401
  class GridviewPanel extends BasePanelView {
4148
- constructor(id, component, api = new GridviewPanelApiImpl(id)) {
4149
- super(id, component, api);
4150
- this._evaluatedMinimumWidth = 0;
4151
- this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
4152
- this._evaluatedMinimumHeight = 0;
4153
- this._evaluatedMaximumHeight = Number.MAX_SAFE_INTEGER;
4154
- this._minimumWidth = 0;
4155
- this._minimumHeight = 0;
4156
- this._maximumWidth = Number.MAX_SAFE_INTEGER;
4157
- this._maximumHeight = Number.MAX_SAFE_INTEGER;
4158
- this._snap = false;
4159
- this._onDidChange = new Emitter();
4160
- this.onDidChange = this._onDidChange.event;
4161
- this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
4162
- const { isVisible } = event;
4163
- const { accessor } = this._params;
4164
- accessor.setVisible(this, isVisible);
4165
- }), this.api.onActiveChange(() => {
4166
- const { accessor } = this._params;
4167
- accessor.setActive(this);
4168
- }), this.api.onDidConstraintsChangeInternal((event) => {
4169
- if (typeof event.minimumWidth === 'number' ||
4170
- typeof event.minimumWidth === 'function') {
4171
- this._minimumWidth = event.minimumWidth;
4172
- }
4173
- if (typeof event.minimumHeight === 'number' ||
4174
- typeof event.minimumHeight === 'function') {
4175
- this._minimumHeight = event.minimumHeight;
4176
- }
4177
- if (typeof event.maximumWidth === 'number' ||
4178
- typeof event.maximumWidth === 'function') {
4179
- this._maximumWidth = event.maximumWidth;
4180
- }
4181
- if (typeof event.maximumHeight === 'number' ||
4182
- typeof event.maximumHeight === 'function') {
4183
- this._maximumHeight = event.maximumHeight;
4184
- }
4185
- }), this.api.onDidSizeChange((event) => {
4186
- this._onDidChange.fire({
4187
- height: event.height,
4188
- width: event.width,
4189
- });
4190
- }));
4191
- }
4192
4402
  get priority() {
4193
4403
  return this._priority;
4194
4404
  }
@@ -4238,6 +4448,51 @@ class GridviewPanel extends BasePanelView {
4238
4448
  get isActive() {
4239
4449
  return this.api.isActive;
4240
4450
  }
4451
+ constructor(id, component, api) {
4452
+ super(id, component, api);
4453
+ this._evaluatedMinimumWidth = 0;
4454
+ this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
4455
+ this._evaluatedMinimumHeight = 0;
4456
+ this._evaluatedMaximumHeight = Number.MAX_SAFE_INTEGER;
4457
+ this._minimumWidth = 0;
4458
+ this._minimumHeight = 0;
4459
+ this._maximumWidth = Number.MAX_SAFE_INTEGER;
4460
+ this._maximumHeight = Number.MAX_SAFE_INTEGER;
4461
+ this._snap = false;
4462
+ this._onDidChange = new Emitter();
4463
+ this.onDidChange = this._onDidChange.event;
4464
+ this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
4465
+ this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
4466
+ const { isVisible } = event;
4467
+ const { accessor } = this._params;
4468
+ accessor.setVisible(this, isVisible);
4469
+ }), this.api.onActiveChange(() => {
4470
+ const { accessor } = this._params;
4471
+ accessor.setActive(this);
4472
+ }), this.api.onDidConstraintsChangeInternal((event) => {
4473
+ if (typeof event.minimumWidth === 'number' ||
4474
+ typeof event.minimumWidth === 'function') {
4475
+ this._minimumWidth = event.minimumWidth;
4476
+ }
4477
+ if (typeof event.minimumHeight === 'number' ||
4478
+ typeof event.minimumHeight === 'function') {
4479
+ this._minimumHeight = event.minimumHeight;
4480
+ }
4481
+ if (typeof event.maximumWidth === 'number' ||
4482
+ typeof event.maximumWidth === 'function') {
4483
+ this._maximumWidth = event.maximumWidth;
4484
+ }
4485
+ if (typeof event.maximumHeight === 'number' ||
4486
+ typeof event.maximumHeight === 'function') {
4487
+ this._maximumHeight = event.maximumHeight;
4488
+ }
4489
+ }), this.api.onDidSizeChange((event) => {
4490
+ this._onDidChange.fire({
4491
+ height: event.height,
4492
+ width: event.width,
4493
+ });
4494
+ }));
4495
+ }
4241
4496
  setVisible(isVisible) {
4242
4497
  this.api._onDidVisibilityChange.fire({ isVisible });
4243
4498
  }
@@ -4283,10 +4538,6 @@ class GridviewPanel extends BasePanelView {
4283
4538
  class GroupviewApi extends GridviewPanelApiImpl {
4284
4539
  }
4285
4540
  class GroupPanel extends GridviewPanel {
4286
- constructor(accessor, id, options) {
4287
- super(id, 'groupview_default', new GroupviewApi(id));
4288
- this._model = new Groupview(this.element, accessor, id, options, this);
4289
- }
4290
4541
  get panels() {
4291
4542
  return this._model.panels;
4292
4543
  }
@@ -4320,6 +4571,10 @@ class GroupPanel extends GridviewPanel {
4320
4571
  get header() {
4321
4572
  return this._model.header;
4322
4573
  }
4574
+ constructor(accessor, id, options) {
4575
+ super(id, 'groupview_default', new GroupviewApi(id));
4576
+ this._model = new Groupview(this.element, accessor, id, options, this);
4577
+ }
4323
4578
  initialize() {
4324
4579
  this._model.initialize();
4325
4580
  }
@@ -4340,17 +4595,17 @@ class GroupPanel extends GridviewPanel {
4340
4595
  }
4341
4596
 
4342
4597
  class DefaultGroupPanelView {
4343
- constructor(renderers) {
4344
- var _a;
4345
- this._content = renderers.content;
4346
- this._tab = (_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab();
4347
- }
4348
4598
  get content() {
4349
4599
  return this._content;
4350
4600
  }
4351
4601
  get tab() {
4352
4602
  return this._tab;
4353
4603
  }
4604
+ constructor(renderers) {
4605
+ var _a;
4606
+ this._content = renderers.content;
4607
+ this._tab = (_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab();
4608
+ }
4354
4609
  init(params) {
4355
4610
  this.content.init(Object.assign(Object.assign({}, params), { tab: this.tab }));
4356
4611
  this.tab.init(params);
@@ -4383,14 +4638,49 @@ class DefaultGroupPanelView {
4383
4638
  }
4384
4639
  }
4385
4640
 
4386
- const nextGroupId = sequentialNumberGenerator();
4387
4641
  class DockviewComponent extends BaseGrid {
4642
+ get orientation() {
4643
+ return this.gridview.orientation;
4644
+ }
4645
+ get totalPanels() {
4646
+ return this.panels.length;
4647
+ }
4648
+ get panels() {
4649
+ return this.groups.flatMap((group) => group.panels);
4650
+ }
4651
+ get deserializer() {
4652
+ return this._deserializer;
4653
+ }
4654
+ set deserializer(value) {
4655
+ this._deserializer = value;
4656
+ }
4657
+ get options() {
4658
+ return this._options;
4659
+ }
4660
+ get activePanel() {
4661
+ const activeGroup = this.activeGroup;
4662
+ if (!activeGroup) {
4663
+ return undefined;
4664
+ }
4665
+ return activeGroup.activePanel;
4666
+ }
4667
+ set tabHeight(height) {
4668
+ this.options.tabHeight = height;
4669
+ this._groups.forEach((value) => {
4670
+ value.value.model.header.height = height;
4671
+ });
4672
+ }
4673
+ get tabHeight() {
4674
+ return this.options.tabHeight;
4675
+ }
4388
4676
  constructor(element, options) {
4389
4677
  super(element, {
4390
4678
  proportionalLayout: true,
4391
4679
  orientation: options.orientation || exports.Orientation.HORIZONTAL,
4392
4680
  styles: options.styles,
4393
4681
  });
4682
+ this.nextGroupId = sequentialNumberGenerator();
4683
+ this.watermark = null;
4394
4684
  this._onDidDrop = new Emitter();
4395
4685
  this.onDidDrop = this._onDidDrop.event;
4396
4686
  this._onDidRemovePanel = new Emitter();
@@ -4401,7 +4691,10 @@ class DockviewComponent extends BaseGrid {
4401
4691
  this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
4402
4692
  this._onDidActivePanelChange = new Emitter();
4403
4693
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
4404
- this.addDisposables(this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
4694
+ this.element.classList.add('dv-dockview');
4695
+ this.addDisposables(this._onDidDrop, exports.Event.any(this.onDidAddGroup, this.onDidRemoveGroup)(() => {
4696
+ this.updateWatermark();
4697
+ }), exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
4405
4698
  this._bufferOnDidLayoutChange.fire();
4406
4699
  }));
4407
4700
  this._options = options;
@@ -4421,38 +4714,72 @@ class DockviewComponent extends BaseGrid {
4421
4714
  !this.options.watermarkFrameworkComponent) {
4422
4715
  this.options.watermarkComponent = Watermark;
4423
4716
  }
4717
+ const dropTarget = new Droptarget(this.element, {
4718
+ canDisplayOverlay: (event, position) => {
4719
+ const data = getPanelData();
4720
+ if (data) {
4721
+ if (data.viewId !== this.id) {
4722
+ return false;
4723
+ }
4724
+ return true;
4725
+ }
4726
+ if (this.options.showDndOverlay) {
4727
+ return this.options.showDndOverlay({
4728
+ nativeEvent: event,
4729
+ position: position,
4730
+ target: exports.DockviewDropTargets.Edge,
4731
+ getData: getPanelData,
4732
+ });
4733
+ }
4734
+ return false;
4735
+ },
4736
+ acceptedTargetZones: ['top', 'bottom', 'left', 'right'],
4737
+ overlayModel: {
4738
+ activationSize: { type: 'pixels', value: 10 },
4739
+ size: { type: 'pixels', value: 20 },
4740
+ },
4741
+ });
4742
+ this.addDisposables(dropTarget, dropTarget.onDrop((event) => {
4743
+ const data = getPanelData();
4744
+ if (data) {
4745
+ this.moveGroupOrPanel(this.orthogonalize(event.position), data.groupId, data.panelId || undefined, 'center');
4746
+ }
4747
+ else {
4748
+ this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api, group: null, getData: getPanelData }));
4749
+ }
4750
+ }));
4424
4751
  this._api = new DockviewApi(this);
4752
+ this.updateWatermark();
4425
4753
  }
4426
- get totalPanels() {
4427
- return this.panels.length;
4428
- }
4429
- get panels() {
4430
- return this.groups.flatMap((group) => group.panels);
4431
- }
4432
- get deserializer() {
4433
- return this._deserializer;
4434
- }
4435
- set deserializer(value) {
4436
- this._deserializer = value;
4437
- }
4438
- get options() {
4439
- return this._options;
4440
- }
4441
- get activePanel() {
4442
- const activeGroup = this.activeGroup;
4443
- if (!activeGroup) {
4444
- return undefined;
4754
+ orthogonalize(position) {
4755
+ switch (position) {
4756
+ case 'top':
4757
+ case 'bottom':
4758
+ if (this.gridview.orientation === exports.Orientation.HORIZONTAL) {
4759
+ // we need to add to a vertical splitview but the current root is a horizontal splitview.
4760
+ // insert a vertical splitview at the root level and add the existing view as a child
4761
+ this.gridview.insertOrthogonalSplitviewAtRoot();
4762
+ }
4763
+ break;
4764
+ case 'left':
4765
+ case 'right':
4766
+ if (this.gridview.orientation === exports.Orientation.VERTICAL) {
4767
+ // we need to add to a horizontal splitview but the current root is a vertical splitview.
4768
+ // insert a horiziontal splitview at the root level and add the existing view as a child
4769
+ this.gridview.insertOrthogonalSplitviewAtRoot();
4770
+ }
4771
+ break;
4772
+ }
4773
+ switch (position) {
4774
+ case 'top':
4775
+ case 'left':
4776
+ return this.createGroupAtLocation([0]); // insert into first position
4777
+ case 'bottom':
4778
+ case 'right':
4779
+ return this.createGroupAtLocation([this.gridview.length]); // insert into last position
4780
+ default:
4781
+ throw new Error(`unsupported position ${position}`);
4445
4782
  }
4446
- return activeGroup.activePanel;
4447
- }
4448
- set tabHeight(height) {
4449
- this.options.tabHeight = height;
4450
- this._groups.forEach((value) => {
4451
- value.value.model.header.height = height;
4452
- });
4453
- }
4454
- get tabHeight() {
4455
- return this.options.tabHeight;
4456
4783
  }
4457
4784
  updateOptions(options) {
4458
4785
  const hasOrientationChanged = typeof options.orientation === 'string' &&
@@ -4502,8 +4829,7 @@ class DockviewComponent extends BaseGrid {
4502
4829
  options.group = this.activeGroup;
4503
4830
  }
4504
4831
  if (options.includePanel && options.group) {
4505
- if (options.group.activePanel !==
4506
- options.group.panels[0]) {
4832
+ if (options.group.activePanel !== options.group.panels[0]) {
4507
4833
  options.group.model.moveToPrevious({ suppressRoll: true });
4508
4834
  return;
4509
4835
  }
@@ -4536,14 +4862,14 @@ class DockviewComponent extends BaseGrid {
4536
4862
  fromJSON(data) {
4537
4863
  this.clear();
4538
4864
  if (!this.deserializer) {
4539
- throw new Error('invalid deserializer');
4865
+ throw new Error('no deserializer provided');
4540
4866
  }
4541
4867
  const { grid, panels, options, activeGroup } = data;
4542
4868
  if (typeof (options === null || options === void 0 ? void 0 : options.tabHeight) === 'number') {
4543
4869
  this.tabHeight = options.tabHeight;
4544
4870
  }
4545
- if (!this.deserializer) {
4546
- throw new Error('no deserializer provided');
4871
+ if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
4872
+ throw new Error('root must be of type branch');
4547
4873
  }
4548
4874
  this.gridview.deserialize(grid, {
4549
4875
  fromJSON: (node) => {
@@ -4556,19 +4882,20 @@ class DockviewComponent extends BaseGrid {
4556
4882
  this._onDidAddGroup.fire(group);
4557
4883
  for (const child of views) {
4558
4884
  const panel = this.deserializer.fromJSON(panels[child], group);
4559
- const isActive = typeof activeView === 'string' && activeView === panel.id;
4885
+ const isActive = typeof activeView === 'string' &&
4886
+ activeView === panel.id;
4560
4887
  group.model.openPanel(panel, {
4561
4888
  skipSetPanelActive: !isActive,
4562
- skipSetGroupActive: true
4889
+ skipSetGroupActive: true,
4563
4890
  });
4564
4891
  }
4565
4892
  if (!group.activePanel && group.panels.length > 0) {
4566
4893
  group.model.openPanel(group.panels[group.panels.length - 1], {
4567
- skipSetGroupActive: true
4894
+ skipSetGroupActive: true,
4568
4895
  });
4569
4896
  }
4570
4897
  return group;
4571
- }
4898
+ },
4572
4899
  });
4573
4900
  if (typeof activeGroup === 'string') {
4574
4901
  const panel = this.getPanel(activeGroup);
@@ -4607,12 +4934,31 @@ class DockviewComponent extends BaseGrid {
4607
4934
  throw new Error(`panel with id ${options.id} already exists`);
4608
4935
  }
4609
4936
  let referenceGroup;
4610
- if ((_a = options.position) === null || _a === void 0 ? void 0 : _a.referencePanel) {
4611
- const referencePanel = this.getGroupPanel(options.position.referencePanel);
4612
- if (!referencePanel) {
4613
- throw new Error(`referencePanel ${options.position.referencePanel} does not exist`);
4937
+ if (options.position) {
4938
+ if (isPanelOptionsWithPanel(options.position)) {
4939
+ const referencePanel = typeof options.position.referencePanel === 'string'
4940
+ ? this.getGroupPanel(options.position.referencePanel)
4941
+ : options.position.referencePanel;
4942
+ if (!referencePanel) {
4943
+ throw new Error(`referencePanel ${options.position.referencePanel} does not exist`);
4944
+ }
4945
+ referenceGroup = this.findGroup(referencePanel);
4946
+ }
4947
+ else if (isPanelOptionsWithGroup(options.position)) {
4948
+ referenceGroup =
4949
+ typeof options.position.referenceGroup === 'string'
4950
+ ? (_a = this._groups.get(options.position.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
4951
+ : options.position.referenceGroup;
4952
+ if (!referenceGroup) {
4953
+ throw new Error(`referencePanel ${options.position.referenceGroup} does not exist`);
4954
+ }
4955
+ }
4956
+ else {
4957
+ const group = this.orthogonalize(directionToPosition(options.position.direction));
4958
+ const panel = this.createPanel(options, group);
4959
+ group.model.openPanel(panel);
4960
+ return panel;
4614
4961
  }
4615
- referenceGroup = this.findGroup(referencePanel);
4616
4962
  }
4617
4963
  else {
4618
4964
  referenceGroup = this.activeGroup;
@@ -4620,7 +4966,7 @@ class DockviewComponent extends BaseGrid {
4620
4966
  let panel;
4621
4967
  if (referenceGroup) {
4622
4968
  const target = toTarget(((_b = options.position) === null || _b === void 0 ? void 0 : _b.direction) || 'within');
4623
- if (target === exports.Position.Center) {
4969
+ if (target === 'center') {
4624
4970
  panel = this.createPanel(options, referenceGroup);
4625
4971
  referenceGroup.model.openPanel(panel);
4626
4972
  }
@@ -4649,10 +4995,7 @@ class DockviewComponent extends BaseGrid {
4649
4995
  }
4650
4996
  group.model.removePanel(panel);
4651
4997
  panel.dispose();
4652
- const retainGroupForWatermark = this.size === 1;
4653
- if (!retainGroupForWatermark &&
4654
- group.size === 0 &&
4655
- options.removeEmptyGroup) {
4998
+ if (group.size === 0 && options.removeEmptyGroup) {
4656
4999
  this.removeGroup(group);
4657
5000
  }
4658
5001
  }
@@ -4664,24 +5007,67 @@ class DockviewComponent extends BaseGrid {
4664
5007
  ? { 'watermark-name': this.options.watermarkFrameworkComponent }
4665
5008
  : {}, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.watermark);
4666
5009
  }
4667
- addEmptyGroup(options) {
5010
+ updateWatermark() {
5011
+ if (this.groups.length === 0) {
5012
+ if (!this.watermark) {
5013
+ this.watermark = this.createWatermarkComponent();
5014
+ this.watermark.init({
5015
+ containerApi: new DockviewApi(this),
5016
+ params: {},
5017
+ title: '',
5018
+ api: null,
5019
+ });
5020
+ const watermarkContainer = document.createElement('div');
5021
+ watermarkContainer.className = 'dv-watermark-container';
5022
+ watermarkContainer.appendChild(this.watermark.element);
5023
+ this.element.appendChild(watermarkContainer);
5024
+ }
5025
+ }
5026
+ else if (this.watermark) {
5027
+ this.watermark.element.parentElement.remove();
5028
+ this.watermark.dispose();
5029
+ this.watermark = null;
5030
+ }
5031
+ }
5032
+ addGroup(options) {
5033
+ var _a;
4668
5034
  const group = this.createGroup();
4669
5035
  if (options) {
4670
- const referencePanel = this.panels.find((panel) => panel.id === options.referencePanel);
4671
- if (!referencePanel) {
4672
- throw new Error(`reference panel ${options.referencePanel} does not exist`);
5036
+ let referenceGroup;
5037
+ if (isGroupOptionsWithPanel(options)) {
5038
+ const referencePanel = typeof options.referencePanel === 'string'
5039
+ ? this.panels.find((panel) => panel.id === options.referencePanel)
5040
+ : options.referencePanel;
5041
+ if (!referencePanel) {
5042
+ throw new Error(`reference panel ${options.referencePanel} does not exist`);
5043
+ }
5044
+ referenceGroup = this.findGroup(referencePanel);
5045
+ if (!referenceGroup) {
5046
+ throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
5047
+ }
4673
5048
  }
4674
- const referenceGroup = this.findGroup(referencePanel);
4675
- if (!referenceGroup) {
4676
- throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
5049
+ else if (isGroupOptionsWithGroup(options)) {
5050
+ referenceGroup =
5051
+ typeof options.referenceGroup === 'string'
5052
+ ? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
5053
+ : options.referenceGroup;
5054
+ if (!referenceGroup) {
5055
+ throw new Error(`reference group ${options.referenceGroup} does not exist`);
5056
+ }
5057
+ }
5058
+ else {
5059
+ const group = this.orthogonalize(directionToPosition(options.direction));
5060
+ return group;
4677
5061
  }
4678
5062
  const target = toTarget(options.direction || 'within');
4679
5063
  const location = getGridLocation(referenceGroup.element);
4680
5064
  const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
4681
5065
  this.doAddGroup(group, relativeLocation);
5066
+ return group;
4682
5067
  }
4683
5068
  else {
4684
5069
  this.doAddGroup(group);
5070
+ return group;
4685
5071
  }
4686
5072
  }
4687
5073
  removeGroup(group, skipActive = false) {
@@ -4699,7 +5085,13 @@ class DockviewComponent extends BaseGrid {
4699
5085
  const sourceGroup = groupId
4700
5086
  ? (_a = this._groups.get(groupId)) === null || _a === void 0 ? void 0 : _a.value
4701
5087
  : undefined;
4702
- if (!target || target === exports.Position.Center) {
5088
+ if (itemId === undefined) {
5089
+ if (sourceGroup) {
5090
+ this.moveGroup(sourceGroup, referenceGroup, target);
5091
+ }
5092
+ return;
5093
+ }
5094
+ if (!target || target === 'center') {
4703
5095
  const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
4704
5096
  this.panels.find((panel) => panel.id === itemId);
4705
5097
  if (!groupItem) {
@@ -4747,6 +5139,28 @@ class DockviewComponent extends BaseGrid {
4747
5139
  }
4748
5140
  }
4749
5141
  }
5142
+ moveGroup(sourceGroup, referenceGroup, target) {
5143
+ if (sourceGroup) {
5144
+ if (!target || target === 'center') {
5145
+ const activePanel = sourceGroup.activePanel;
5146
+ const panels = [...sourceGroup.panels].map((p) => sourceGroup.model.removePanel(p.id));
5147
+ if ((sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.size) === 0) {
5148
+ this.doRemoveGroup(sourceGroup);
5149
+ }
5150
+ for (const panel of panels) {
5151
+ referenceGroup.model.openPanel(panel, {
5152
+ skipSetPanelActive: panel !== activePanel,
5153
+ });
5154
+ }
5155
+ }
5156
+ else {
5157
+ this.gridview.removeView(getGridLocation(sourceGroup.element));
5158
+ const referenceLocation = getGridLocation(referenceGroup.element);
5159
+ const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
5160
+ this.gridview.addView(sourceGroup, exports.Sizing.Distribute, dropLocation);
5161
+ }
5162
+ }
5163
+ }
4750
5164
  doSetGroupActive(group, skipFocus) {
4751
5165
  var _a, _b;
4752
5166
  const isGroupAlreadyFocused = this._activeGroup === group;
@@ -4768,9 +5182,9 @@ class DockviewComponent extends BaseGrid {
4768
5182
  id = undefined;
4769
5183
  }
4770
5184
  if (!id) {
4771
- id = nextGroupId.next();
5185
+ id = this.nextGroupId.next();
4772
5186
  while (this._groups.has(id)) {
4773
- id = nextGroupId.next();
5187
+ id = this.nextGroupId.next();
4774
5188
  }
4775
5189
  }
4776
5190
  const view = new GroupPanel(this, id, options);
@@ -4803,7 +5217,7 @@ class DockviewComponent extends BaseGrid {
4803
5217
  content: this.createContentComponent(options.id, options.component),
4804
5218
  tab: this.createTabComponent(options.id, options.tabComponent || this.options.defaultTabComponent),
4805
5219
  });
4806
- const panel = new DockviewGroupPanel(options.id, this, this._api, group);
5220
+ const panel = new DockviewPanel(options.id, this, this._api, group);
4807
5221
  panel.init({
4808
5222
  view,
4809
5223
  title: options.title || options.id,
@@ -4838,6 +5252,21 @@ class DockviewComponent extends BaseGrid {
4838
5252
  }
4839
5253
 
4840
5254
  class GridviewComponent extends BaseGrid {
5255
+ get orientation() {
5256
+ return this.gridview.orientation;
5257
+ }
5258
+ set orientation(value) {
5259
+ this.gridview.orientation = value;
5260
+ }
5261
+ get options() {
5262
+ return this._options;
5263
+ }
5264
+ get deserializer() {
5265
+ return this._deserializer;
5266
+ }
5267
+ set deserializer(value) {
5268
+ this._deserializer = value;
5269
+ }
4841
5270
  constructor(element, options) {
4842
5271
  super(element, {
4843
5272
  proportionalLayout: options.proportionalLayout,
@@ -4854,21 +5283,6 @@ class GridviewComponent extends BaseGrid {
4854
5283
  this.options.frameworkComponents = {};
4855
5284
  }
4856
5285
  }
4857
- get orientation() {
4858
- return this.gridview.orientation;
4859
- }
4860
- set orientation(value) {
4861
- this.gridview.orientation = value;
4862
- }
4863
- get options() {
4864
- return this._options;
4865
- }
4866
- get deserializer() {
4867
- return this._deserializer;
4868
- }
4869
- set deserializer(value) {
4870
- this._deserializer = value;
4871
- }
4872
5286
  updateOptions(options) {
4873
5287
  const hasOrientationChanged = typeof options.orientation === 'string' &&
4874
5288
  this.gridview.orientation !== options.orientation;
@@ -4966,7 +5380,7 @@ class GridviewComponent extends BaseGrid {
4966
5380
  throw new Error(`reference group ${options.reference} does not exist`);
4967
5381
  }
4968
5382
  const target = toTarget(options.direction);
4969
- if (target === exports.Position.Center) {
5383
+ if (target === 'center') {
4970
5384
  throw new Error(`${target} not supported as an option`);
4971
5385
  }
4972
5386
  else {
@@ -4984,7 +5398,7 @@ class GridviewComponent extends BaseGrid {
4984
5398
  throw new Error(`reference group ${options.position.referencePanel} does not exist`);
4985
5399
  }
4986
5400
  const target = toTarget(options.position.direction);
4987
- if (target === exports.Position.Center) {
5401
+ if (target === 'center') {
4988
5402
  throw new Error(`${target} not supported as an option`);
4989
5403
  }
4990
5404
  else {
@@ -5073,29 +5487,6 @@ class GridviewComponent extends BaseGrid {
5073
5487
  * A high-level implementation of splitview that works using 'panels'
5074
5488
  */
5075
5489
  class SplitviewComponent extends CompositeDisposable {
5076
- constructor(element, options) {
5077
- super();
5078
- this.element = element;
5079
- this._disposable = new MutableDisposable();
5080
- this._panels = new Map();
5081
- this._onDidLayoutfromJSON = new Emitter();
5082
- this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
5083
- this._onDidAddView = new Emitter();
5084
- this.onDidAddView = this._onDidAddView.event;
5085
- this._onDidRemoveView = new Emitter();
5086
- this.onDidRemoveView = this._onDidRemoveView.event;
5087
- this._onDidLayoutChange = new Emitter();
5088
- this.onDidLayoutChange = this._onDidLayoutChange.event;
5089
- this._options = options;
5090
- if (!options.components) {
5091
- options.components = {};
5092
- }
5093
- if (!options.frameworkComponents) {
5094
- options.frameworkComponents = {};
5095
- }
5096
- this.splitview = new Splitview(this.element, options);
5097
- this.addDisposables(this._disposable, this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
5098
- }
5099
5490
  get panels() {
5100
5491
  return this.splitview.getViews();
5101
5492
  }
@@ -5133,6 +5524,29 @@ class SplitviewComponent extends CompositeDisposable {
5133
5524
  ? this.splitview.size
5134
5525
  : this.splitview.orthogonalSize;
5135
5526
  }
5527
+ constructor(element, options) {
5528
+ super();
5529
+ this.element = element;
5530
+ this._disposable = new MutableDisposable();
5531
+ this._panels = new Map();
5532
+ this._onDidLayoutfromJSON = new Emitter();
5533
+ this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
5534
+ this._onDidAddView = new Emitter();
5535
+ this.onDidAddView = this._onDidAddView.event;
5536
+ this._onDidRemoveView = new Emitter();
5537
+ this.onDidRemoveView = this._onDidRemoveView.event;
5538
+ this._onDidLayoutChange = new Emitter();
5539
+ this.onDidLayoutChange = this._onDidLayoutChange.event;
5540
+ this._options = options;
5541
+ if (!options.components) {
5542
+ options.components = {};
5543
+ }
5544
+ if (!options.frameworkComponents) {
5545
+ options.frameworkComponents = {};
5546
+ }
5547
+ this.splitview = new Splitview(this.element, options);
5548
+ this.addDisposables(this._disposable, this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
5549
+ }
5136
5550
  updateOptions(options) {
5137
5551
  const hasOrientationChanged = typeof options.orientation === 'string' &&
5138
5552
  this.options.orientation !== options.orientation;
@@ -5340,6 +5754,9 @@ class SplitviewPanelApiImpl extends PanelApiImpl {
5340
5754
  }
5341
5755
 
5342
5756
  class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
5757
+ set pane(pane) {
5758
+ this._pane = pane;
5759
+ }
5343
5760
  constructor(id) {
5344
5761
  super(id);
5345
5762
  this._onDidExpansionChange = new Emitter({
@@ -5352,9 +5769,6 @@ class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
5352
5769
  this.onMouseLeave = this._onMouseLeave.event;
5353
5770
  this.addDisposables(this._onDidExpansionChange, this._onMouseEnter, this._onMouseLeave);
5354
5771
  }
5355
- set pane(pane) {
5356
- this._pane = pane;
5357
- }
5358
5772
  setExpanded(isExpanded) {
5359
5773
  var _a;
5360
5774
  (_a = this._pane) === null || _a === void 0 ? void 0 : _a.setExpanded(isExpanded);
@@ -5366,50 +5780,6 @@ class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
5366
5780
  }
5367
5781
 
5368
5782
  class PaneviewPanel extends BasePanelView {
5369
- constructor(id, component, headerComponent, orientation, isExpanded, isHeaderVisible) {
5370
- super(id, component, new PaneviewPanelApiImpl(id));
5371
- this.headerComponent = headerComponent;
5372
- this._onDidChangeExpansionState = new Emitter({ replay: true });
5373
- this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
5374
- this._onDidChange = new Emitter();
5375
- this.onDidChange = this._onDidChange.event;
5376
- this.headerSize = 22;
5377
- this._orthogonalSize = 0;
5378
- this._size = 0;
5379
- this._minimumBodySize = 100;
5380
- this._maximumBodySize = Number.POSITIVE_INFINITY;
5381
- this._isExpanded = false;
5382
- this.expandedSize = 0;
5383
- this.api.pane = this; // TODO cannot use 'this' before 'super'
5384
- this._isExpanded = isExpanded;
5385
- this._headerVisible = isHeaderVisible;
5386
- this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
5387
- this._orientation = orientation;
5388
- this.element.classList.add('pane');
5389
- this.addDisposables(this.api.onDidSizeChange((event) => {
5390
- this._onDidChange.fire({ size: event.size });
5391
- }), addDisposableListener(this.element, 'mouseenter', (ev) => {
5392
- this.api._onMouseEnter.fire(ev);
5393
- }), addDisposableListener(this.element, 'mouseleave', (ev) => {
5394
- this.api._onMouseLeave.fire(ev);
5395
- }));
5396
- this.addDisposables(this._onDidChangeExpansionState, this.onDidChangeExpansionState((isPanelExpanded) => {
5397
- this.api._onDidExpansionChange.fire({
5398
- isExpanded: isPanelExpanded,
5399
- });
5400
- }), this.api.onDidFocusChange((e) => {
5401
- if (!this.header) {
5402
- return;
5403
- }
5404
- if (e.isFocused) {
5405
- addClasses(this.header, 'focused');
5406
- }
5407
- else {
5408
- removeClasses(this.header, 'focused');
5409
- }
5410
- }));
5411
- this.renderOnce();
5412
- }
5413
5783
  set orientation(value) {
5414
5784
  this._orientation = value;
5415
5785
  }
@@ -5457,6 +5827,51 @@ class PaneviewPanel extends BasePanelView {
5457
5827
  this._headerVisible = value;
5458
5828
  this.header.style.display = value ? '' : 'none';
5459
5829
  }
5830
+ constructor(id, component, headerComponent, orientation, isExpanded, isHeaderVisible) {
5831
+ super(id, component, new PaneviewPanelApiImpl(id));
5832
+ this.headerComponent = headerComponent;
5833
+ this._onDidChangeExpansionState = new Emitter({ replay: true });
5834
+ this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
5835
+ this._onDidChange = new Emitter();
5836
+ this.onDidChange = this._onDidChange.event;
5837
+ this.headerSize = 22;
5838
+ this._orthogonalSize = 0;
5839
+ this._size = 0;
5840
+ this._minimumBodySize = 100;
5841
+ this._maximumBodySize = Number.POSITIVE_INFINITY;
5842
+ this._isExpanded = false;
5843
+ this.expandedSize = 0;
5844
+ this.api.pane = this; // TODO cannot use 'this' before 'super'
5845
+ this.api.initialize(this);
5846
+ this._isExpanded = isExpanded;
5847
+ this._headerVisible = isHeaderVisible;
5848
+ this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
5849
+ this._orientation = orientation;
5850
+ this.element.classList.add('pane');
5851
+ this.addDisposables(this.api.onDidSizeChange((event) => {
5852
+ this._onDidChange.fire({ size: event.size });
5853
+ }), addDisposableListener(this.element, 'mouseenter', (ev) => {
5854
+ this.api._onMouseEnter.fire(ev);
5855
+ }), addDisposableListener(this.element, 'mouseleave', (ev) => {
5856
+ this.api._onMouseLeave.fire(ev);
5857
+ }));
5858
+ this.addDisposables(this._onDidChangeExpansionState, this.onDidChangeExpansionState((isPanelExpanded) => {
5859
+ this.api._onDidExpansionChange.fire({
5860
+ isExpanded: isPanelExpanded,
5861
+ });
5862
+ }), this.api.onDidFocusChange((e) => {
5863
+ if (!this.header) {
5864
+ return;
5865
+ }
5866
+ if (e.isFocused) {
5867
+ addClasses(this.header, 'focused');
5868
+ }
5869
+ else {
5870
+ removeClasses(this.header, 'focused');
5871
+ }
5872
+ }));
5873
+ this.renderOnce();
5874
+ }
5460
5875
  setVisible(isVisible) {
5461
5876
  this.api._onDidVisibilityChange.fire({ isVisible });
5462
5877
  }
@@ -5580,7 +5995,10 @@ class DraggablePaneviewPanel extends PaneviewPanel {
5580
5995
  }
5581
5996
  })(this.header);
5582
5997
  this.target = new Droptarget(this.element, {
5583
- validOverlays: 'vertical',
5998
+ acceptedTargetZones: ['top', 'bottom'],
5999
+ overlayModel: {
6000
+ activationSize: { type: 'percentage', value: 50 },
6001
+ },
5584
6002
  canDisplayOverlay: (event) => {
5585
6003
  const data = getPaneData();
5586
6004
  if (data) {
@@ -5623,12 +6041,10 @@ class DraggablePaneviewPanel extends PaneviewPanel {
5623
6041
  const allPanels = containerApi.panels;
5624
6042
  const fromIndex = allPanels.indexOf(existingPanel);
5625
6043
  let toIndex = containerApi.panels.indexOf(this);
5626
- if (event.position === exports.Position.Left ||
5627
- event.position === exports.Position.Top) {
6044
+ if (event.position === 'left' || event.position === 'top') {
5628
6045
  toIndex = Math.max(0, toIndex - 1);
5629
6046
  }
5630
- if (event.position === exports.Position.Right ||
5631
- event.position === exports.Position.Bottom) {
6047
+ if (event.position === 'right' || event.position === 'bottom') {
5632
6048
  if (fromIndex > toIndex) {
5633
6049
  toIndex++;
5634
6050
  }
@@ -5639,6 +6055,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
5639
6055
  }
5640
6056
 
5641
6057
  class DefaultHeader extends CompositeDisposable {
6058
+ get element() {
6059
+ return this._element;
6060
+ }
5642
6061
  constructor() {
5643
6062
  super();
5644
6063
  this._expandedIcon = createExpandMoreButton();
@@ -5657,9 +6076,6 @@ class DefaultHeader extends CompositeDisposable {
5657
6076
  (_a = this.apiRef.api) === null || _a === void 0 ? void 0 : _a.setExpanded(!this.apiRef.api.isExpanded);
5658
6077
  }));
5659
6078
  }
5660
- get element() {
5661
- return this._element;
5662
- }
5663
6079
  init(params) {
5664
6080
  this.apiRef.api = params.api;
5665
6081
  this._content.textContent = params.title;
@@ -5712,36 +6128,6 @@ class PaneFramework extends DraggablePaneviewPanel {
5712
6128
  }
5713
6129
  }
5714
6130
  class PaneviewComponent extends CompositeDisposable {
5715
- constructor(element, options) {
5716
- super();
5717
- this.element = element;
5718
- this._id = nextLayoutId.next();
5719
- this._disposable = new MutableDisposable();
5720
- this._viewDisposables = new Map();
5721
- this._onDidLayoutfromJSON = new Emitter();
5722
- this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
5723
- this._onDidLayoutChange = new Emitter();
5724
- this.onDidLayoutChange = this._onDidLayoutChange.event;
5725
- this._onDidDrop = new Emitter();
5726
- this.onDidDrop = this._onDidDrop.event;
5727
- this._onDidAddView = new Emitter();
5728
- this.onDidAddView = this._onDidAddView.event;
5729
- this._onDidRemoveView = new Emitter();
5730
- this.onDidRemoveView = this._onDidRemoveView.event;
5731
- this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
5732
- this._options = options;
5733
- if (!options.components) {
5734
- options.components = {};
5735
- }
5736
- if (!options.frameworkComponents) {
5737
- options.frameworkComponents = {};
5738
- }
5739
- this.paneview = new Paneview(this.element, {
5740
- // only allow paneview in the vertical orientation for now
5741
- orientation: exports.Orientation.VERTICAL,
5742
- });
5743
- this.addDisposables(this._disposable);
5744
- }
5745
6131
  get id() {
5746
6132
  return this._id;
5747
6133
  }
@@ -5776,6 +6162,36 @@ class PaneviewComponent extends CompositeDisposable {
5776
6162
  get options() {
5777
6163
  return this._options;
5778
6164
  }
6165
+ constructor(element, options) {
6166
+ super();
6167
+ this.element = element;
6168
+ this._id = nextLayoutId.next();
6169
+ this._disposable = new MutableDisposable();
6170
+ this._viewDisposables = new Map();
6171
+ this._onDidLayoutfromJSON = new Emitter();
6172
+ this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
6173
+ this._onDidLayoutChange = new Emitter();
6174
+ this.onDidLayoutChange = this._onDidLayoutChange.event;
6175
+ this._onDidDrop = new Emitter();
6176
+ this.onDidDrop = this._onDidDrop.event;
6177
+ this._onDidAddView = new Emitter();
6178
+ this.onDidAddView = this._onDidAddView.event;
6179
+ this._onDidRemoveView = new Emitter();
6180
+ this.onDidRemoveView = this._onDidRemoveView.event;
6181
+ this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
6182
+ this._options = options;
6183
+ if (!options.components) {
6184
+ options.components = {};
6185
+ }
6186
+ if (!options.frameworkComponents) {
6187
+ options.frameworkComponents = {};
6188
+ }
6189
+ this.paneview = new Paneview(this.element, {
6190
+ // only allow paneview in the vertical orientation for now
6191
+ orientation: exports.Orientation.VERTICAL,
6192
+ });
6193
+ this.addDisposables(this._disposable);
6194
+ }
5779
6195
  focus() {
5780
6196
  //
5781
6197
  }
@@ -5961,36 +6377,6 @@ class PaneviewComponent extends CompositeDisposable {
5961
6377
  }
5962
6378
 
5963
6379
  class SplitviewPanel extends BasePanelView {
5964
- constructor(id, componentName) {
5965
- super(id, componentName, new SplitviewPanelApiImpl(id));
5966
- this._evaluatedMinimumSize = 0;
5967
- this._evaluatedMaximumSize = Number.POSITIVE_INFINITY;
5968
- this._minimumSize = 0;
5969
- this._maximumSize = Number.POSITIVE_INFINITY;
5970
- this._snap = false;
5971
- this._onDidChange = new Emitter();
5972
- this.onDidChange = this._onDidChange.event;
5973
- this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
5974
- const { isVisible } = event;
5975
- const { accessor } = this._params;
5976
- accessor.setVisible(this, isVisible);
5977
- }), this.api.onActiveChange(() => {
5978
- const { accessor } = this._params;
5979
- accessor.setActive(this);
5980
- }), this.api.onDidConstraintsChangeInternal((event) => {
5981
- if (typeof event.minimumSize === 'number' ||
5982
- typeof event.minimumSize === 'function') {
5983
- this._minimumSize = event.minimumSize;
5984
- }
5985
- if (typeof event.maximumSize === 'number' ||
5986
- typeof event.maximumSize === 'function') {
5987
- this._maximumSize = event.maximumSize;
5988
- }
5989
- this.updateConstraints();
5990
- }), this.api.onDidSizeChange((event) => {
5991
- this._onDidChange.fire({ size: event.size });
5992
- }));
5993
- }
5994
6380
  get priority() {
5995
6381
  return this._priority;
5996
6382
  }
@@ -6023,6 +6409,37 @@ class SplitviewPanel extends BasePanelView {
6023
6409
  get snap() {
6024
6410
  return this._snap;
6025
6411
  }
6412
+ constructor(id, componentName) {
6413
+ super(id, componentName, new SplitviewPanelApiImpl(id));
6414
+ this._evaluatedMinimumSize = 0;
6415
+ this._evaluatedMaximumSize = Number.POSITIVE_INFINITY;
6416
+ this._minimumSize = 0;
6417
+ this._maximumSize = Number.POSITIVE_INFINITY;
6418
+ this._snap = false;
6419
+ this._onDidChange = new Emitter();
6420
+ this.onDidChange = this._onDidChange.event;
6421
+ this.api.initialize(this);
6422
+ this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
6423
+ const { isVisible } = event;
6424
+ const { accessor } = this._params;
6425
+ accessor.setVisible(this, isVisible);
6426
+ }), this.api.onActiveChange(() => {
6427
+ const { accessor } = this._params;
6428
+ accessor.setActive(this);
6429
+ }), this.api.onDidConstraintsChangeInternal((event) => {
6430
+ if (typeof event.minimumSize === 'number' ||
6431
+ typeof event.minimumSize === 'function') {
6432
+ this._minimumSize = event.minimumSize;
6433
+ }
6434
+ if (typeof event.maximumSize === 'number' ||
6435
+ typeof event.maximumSize === 'function') {
6436
+ this._maximumSize = event.maximumSize;
6437
+ }
6438
+ this.updateConstraints();
6439
+ }), this.api.onDidSizeChange((event) => {
6440
+ this._onDidChange.fire({ size: event.size });
6441
+ }));
6442
+ }
6026
6443
  setVisible(isVisible) {
6027
6444
  this.api._onDidVisibilityChange.fire({ isVisible });
6028
6445
  }
@@ -6188,6 +6605,9 @@ function isReactElement(element) {
6188
6605
  }
6189
6606
 
6190
6607
  class ReactPanelContentPart {
6608
+ get element() {
6609
+ return this._element;
6610
+ }
6191
6611
  constructor(id, component, reactPortalStore) {
6192
6612
  this.id = id;
6193
6613
  this.component = component;
@@ -6199,9 +6619,6 @@ class ReactPanelContentPart {
6199
6619
  this._element = document.createElement('div');
6200
6620
  this._element.className = 'dockview-react-part';
6201
6621
  }
6202
- get element() {
6203
- return this._element;
6204
- }
6205
6622
  focus() {
6206
6623
  // TODO
6207
6624
  }
@@ -6236,6 +6653,9 @@ class ReactPanelContentPart {
6236
6653
  }
6237
6654
 
6238
6655
  class ReactPanelHeaderPart {
6656
+ get element() {
6657
+ return this._element;
6658
+ }
6239
6659
  constructor(id, component, reactPortalStore) {
6240
6660
  this.id = id;
6241
6661
  this.component = component;
@@ -6243,9 +6663,6 @@ class ReactPanelHeaderPart {
6243
6663
  this._element = document.createElement('div');
6244
6664
  this._element.className = 'dockview-react-part';
6245
6665
  }
6246
- get element() {
6247
- return this._element;
6248
- }
6249
6666
  focus() {
6250
6667
  //noop
6251
6668
  }
@@ -6304,7 +6721,7 @@ class ReactPanelDeserialzier {
6304
6721
  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),
6305
6722
  tab,
6306
6723
  });
6307
- const panel = new DockviewGroupPanel(panelId, this.layout, new DockviewApi(this.layout), group);
6724
+ const panel = new DockviewPanel(panelId, this.layout, new DockviewApi(this.layout), group);
6308
6725
  panel.init({
6309
6726
  view,
6310
6727
  title,
@@ -6315,6 +6732,9 @@ class ReactPanelDeserialzier {
6315
6732
  }
6316
6733
 
6317
6734
  class ReactWatermarkPart {
6735
+ get element() {
6736
+ return this._element;
6737
+ }
6318
6738
  constructor(id, component, reactPortalStore) {
6319
6739
  this.id = id;
6320
6740
  this.component = component;
@@ -6325,9 +6745,6 @@ class ReactWatermarkPart {
6325
6745
  this._element = document.createElement('div');
6326
6746
  this._element.className = 'dockview-react-part';
6327
6747
  }
6328
- get element() {
6329
- return this._element;
6330
- }
6331
6748
  init(parameters) {
6332
6749
  this.parameters = parameters;
6333
6750
  this.part = new ReactPart(this.element, this.reactPortalStore, this.component, {
@@ -6370,14 +6787,6 @@ class ReactWatermarkPart {
6370
6787
  }
6371
6788
 
6372
6789
  class ReactGroupControlsRendererPart {
6373
- constructor(component, reactPortalStore, _group) {
6374
- this.component = component;
6375
- this.reactPortalStore = reactPortalStore;
6376
- this._group = _group;
6377
- this.mutableDisposable = new MutableDisposable();
6378
- this._element = document.createElement('div');
6379
- this._element.className = 'dockview-react-part';
6380
- }
6381
6790
  get element() {
6382
6791
  return this._element;
6383
6792
  }
@@ -6387,6 +6796,14 @@ class ReactGroupControlsRendererPart {
6387
6796
  get group() {
6388
6797
  return this._group;
6389
6798
  }
6799
+ constructor(component, reactPortalStore, _group) {
6800
+ this.component = component;
6801
+ this.reactPortalStore = reactPortalStore;
6802
+ this._group = _group;
6803
+ this.mutableDisposable = new MutableDisposable();
6804
+ this._element = document.createElement('div');
6805
+ this._element.className = 'dockview-react-part';
6806
+ }
6390
6807
  focus() {
6391
6808
  // TODO
6392
6809
  }
@@ -6501,6 +6918,7 @@ const DockviewReact = React__namespace.forwardRef((props, ref) => {
6501
6918
  : undefined,
6502
6919
  showDndOverlay: props.showDndOverlay,
6503
6920
  createGroupControlElement: createGroupControlElement(props.groupControlComponent, { addPortal }),
6921
+ singleTabMode: props.singleTabMode,
6504
6922
  });
6505
6923
  (_a = domRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(dockview.element);
6506
6924
  dockview.deserializer = new ReactPanelDeserialzier(dockview);
@@ -6713,7 +7131,7 @@ SplitviewReact.displayName = 'SplitviewComponent';
6713
7131
 
6714
7132
  class ReactGridPanelView extends GridviewPanel {
6715
7133
  constructor(id, component, reactComponent, reactPortalStore) {
6716
- super(id, component);
7134
+ super(id, component, new GridviewPanelApiImpl(id));
6717
7135
  this.reactComponent = reactComponent;
6718
7136
  this.reactPortalStore = reactPortalStore;
6719
7137
  }
@@ -6792,6 +7210,9 @@ const GridviewReact = React__namespace.forwardRef((props, ref) => {
6792
7210
  GridviewReact.displayName = 'GridviewComponent';
6793
7211
 
6794
7212
  class PanePanelSection {
7213
+ get element() {
7214
+ return this._element;
7215
+ }
6795
7216
  constructor(id, component, reactPortalStore) {
6796
7217
  this.id = id;
6797
7218
  this.component = component;
@@ -6800,9 +7221,6 @@ class PanePanelSection {
6800
7221
  this._element.style.height = '100%';
6801
7222
  this._element.style.width = '100%';
6802
7223
  }
6803
- get element() {
6804
- return this._element;
6805
- }
6806
7224
  init(parameters) {
6807
7225
  this.part = new ReactPart(this.element, this.reactPortalStore, this.component, {
6808
7226
  params: parameters.params,
@@ -6950,6 +7368,7 @@ exports.SplitviewComponent = SplitviewComponent;
6950
7368
  exports.SplitviewPanel = SplitviewPanel;
6951
7369
  exports.SplitviewReact = SplitviewReact;
6952
7370
  exports.Tab = Tab;
7371
+ exports.directionToPosition = directionToPosition;
6953
7372
  exports.getDirectionOrientation = getDirectionOrientation;
6954
7373
  exports.getGridLocation = getGridLocation;
6955
7374
  exports.getLocationOrientation = getLocationOrientation;
@@ -6958,7 +7377,12 @@ exports.getPanelData = getPanelData;
6958
7377
  exports.getRelativeLocation = getRelativeLocation;
6959
7378
  exports.indexInParent = indexInParent;
6960
7379
  exports.isGridBranchNode = isGridBranchNode;
7380
+ exports.isGroupOptionsWithGroup = isGroupOptionsWithGroup;
7381
+ exports.isGroupOptionsWithPanel = isGroupOptionsWithPanel;
7382
+ exports.isPanelOptionsWithGroup = isPanelOptionsWithGroup;
7383
+ exports.isPanelOptionsWithPanel = isPanelOptionsWithPanel;
6961
7384
  exports.isReactElement = isReactElement;
6962
7385
  exports.orthogonal = orthogonal;
7386
+ exports.positionToDirection = positionToDirection;
6963
7387
  exports.toTarget = toTarget;
6964
7388
  exports.usePortalsLifecycle = usePortalsLifecycle;