dockview-core 6.6.1 → 7.0.3

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 (203) hide show
  1. package/README.md +8 -1
  2. package/dist/cjs/api/component.api.d.ts +42 -21
  3. package/dist/cjs/api/component.api.js +111 -20
  4. package/dist/cjs/api/dockviewGroupPanelApi.d.ts +23 -8
  5. package/dist/cjs/api/dockviewGroupPanelApi.js +24 -1
  6. package/dist/cjs/api/dockviewPanelApi.d.ts +4 -3
  7. package/dist/cjs/api/dockviewPanelApi.js +8 -0
  8. package/dist/cjs/dnd/dropTargetAnchorContainer.js +1 -2
  9. package/dist/cjs/dnd/droptarget.d.ts +8 -0
  10. package/dist/cjs/dnd/droptarget.js +28 -0
  11. package/dist/cjs/dnd/pointer/longPress.js +1 -1
  12. package/dist/cjs/dnd/pointer/pointerDragController.js +9 -7
  13. package/dist/cjs/dnd/pointer/pointerDragSource.js +4 -2
  14. package/dist/cjs/dockview/accessibilityMessages.d.ts +32 -0
  15. package/dist/cjs/dockview/accessibilityMessages.js +51 -0
  16. package/dist/cjs/dockview/allModules.d.ts +8 -0
  17. package/dist/cjs/dockview/allModules.js +25 -0
  18. package/dist/cjs/dockview/components/panel/content.d.ts +2 -0
  19. package/dist/cjs/dockview/components/panel/content.js +41 -10
  20. package/dist/cjs/dockview/components/popupService.js +1 -1
  21. package/dist/cjs/dockview/components/tab/tab.js +35 -7
  22. package/dist/cjs/dockview/components/titlebar/floatingTitleBar.d.ts +34 -0
  23. package/dist/cjs/dockview/components/titlebar/floatingTitleBar.js +95 -0
  24. package/dist/cjs/dockview/components/titlebar/groupDragSource.d.ts +51 -0
  25. package/dist/cjs/dockview/components/titlebar/groupDragSource.js +218 -0
  26. package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.d.ts +2 -1
  27. package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.js +36 -30
  28. package/dist/cjs/dockview/components/titlebar/tabGroups.d.ts +27 -5
  29. package/dist/cjs/dockview/components/titlebar/tabGroups.js +104 -53
  30. package/dist/cjs/dockview/components/titlebar/tabs.d.ts +12 -0
  31. package/dist/cjs/dockview/components/titlebar/tabs.js +121 -25
  32. package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +4 -0
  33. package/dist/cjs/dockview/components/titlebar/tabsContainer.js +13 -3
  34. package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +1 -4
  35. package/dist/cjs/dockview/components/titlebar/voidContainer.js +32 -156
  36. package/dist/cjs/dockview/dndCapabilities.js +3 -3
  37. package/dist/cjs/dockview/dockviewComponent.d.ts +304 -49
  38. package/dist/cjs/dockview/dockviewComponent.js +1839 -1075
  39. package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +33 -2
  40. package/dist/cjs/dockview/dockviewFloatingGroupPanel.js +39 -3
  41. package/dist/cjs/dockview/dockviewGroupPanel.d.ts +1 -2
  42. package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +36 -14
  43. package/dist/cjs/dockview/dockviewGroupPanelModel.js +151 -125
  44. package/dist/cjs/dockview/dockviewPanel.d.ts +2 -2
  45. package/dist/cjs/dockview/dockviewPanel.js +4 -5
  46. package/dist/cjs/dockview/dockviewShell.d.ts +29 -7
  47. package/dist/cjs/dockview/dockviewShell.js +94 -36
  48. package/dist/cjs/dockview/edgeGroupService.d.ts +38 -0
  49. package/dist/cjs/dockview/edgeGroupService.js +128 -0
  50. package/dist/cjs/dockview/floatingGroupService.d.ts +37 -0
  51. package/dist/cjs/dockview/floatingGroupService.js +231 -0
  52. package/dist/cjs/dockview/headerActionsService.d.ts +32 -0
  53. package/dist/cjs/dockview/headerActionsService.js +149 -0
  54. package/dist/cjs/dockview/liveRegionService.d.ts +53 -0
  55. package/dist/cjs/dockview/liveRegionService.js +185 -0
  56. package/dist/cjs/dockview/moduleContracts.d.ts +119 -0
  57. package/dist/cjs/dockview/moduleContracts.js +2 -0
  58. package/dist/cjs/dockview/modules.d.ts +110 -0
  59. package/dist/cjs/dockview/modules.js +304 -0
  60. package/dist/cjs/dockview/options.d.ts +159 -6
  61. package/dist/cjs/dockview/options.js +8 -1
  62. package/dist/cjs/dockview/popoutWindowService.d.ts +95 -0
  63. package/dist/cjs/dockview/popoutWindowService.js +261 -0
  64. package/dist/cjs/dockview/rootDropTargetService.d.ts +35 -0
  65. package/dist/cjs/dockview/rootDropTargetService.js +87 -0
  66. package/dist/cjs/dockview/strictEventsSequencing.js +6 -6
  67. package/dist/cjs/dockview/tabGroup.js +3 -3
  68. package/dist/cjs/dockview/tabGroupAccent.js +1 -3
  69. package/dist/cjs/dockview/watermarkService.d.ts +30 -0
  70. package/dist/cjs/dockview/watermarkService.js +61 -0
  71. package/dist/cjs/dom.js +1 -1
  72. package/dist/cjs/events.js +1 -1
  73. package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -1
  74. package/dist/cjs/gridview/baseComponentGridview.js +6 -10
  75. package/dist/cjs/gridview/branchNode.js +13 -17
  76. package/dist/cjs/gridview/gridview.js +8 -8
  77. package/dist/cjs/gridview/gridviewComponent.d.ts +3 -3
  78. package/dist/cjs/gridview/gridviewComponent.js +1 -6
  79. package/dist/cjs/gridview/gridviewPanel.d.ts +1 -1
  80. package/dist/cjs/index.d.ts +11 -4
  81. package/dist/cjs/index.js +14 -1
  82. package/dist/cjs/overlay/overlay.d.ts +43 -1
  83. package/dist/cjs/overlay/overlay.js +82 -36
  84. package/dist/cjs/overlay/overlayRenderContainer.js +3 -4
  85. package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +2 -2
  86. package/dist/cjs/paneview/draggablePaneviewPanel.js +5 -5
  87. package/dist/cjs/paneview/paneviewComponent.d.ts +3 -3
  88. package/dist/cjs/paneview/paneviewComponent.js +7 -11
  89. package/dist/cjs/popoutWindow.js +4 -4
  90. package/dist/cjs/scrollbar.d.ts +1 -1
  91. package/dist/cjs/scrollbar.js +7 -6
  92. package/dist/cjs/splitview/splitview.d.ts +1 -1
  93. package/dist/cjs/splitview/splitview.js +21 -20
  94. package/dist/cjs/splitview/viewItem.js +1 -1
  95. package/dist/dockview-core.js +3548 -1544
  96. package/dist/dockview-core.min.js +2 -2
  97. package/dist/dockview-core.min.js.map +1 -1
  98. package/dist/dockview-core.min.noStyle.js +2 -2
  99. package/dist/dockview-core.min.noStyle.js.map +1 -1
  100. package/dist/dockview-core.noStyle.js +3547 -1543
  101. package/dist/esm/api/component.api.d.ts +42 -21
  102. package/dist/esm/api/component.api.js +63 -18
  103. package/dist/esm/api/dockviewGroupPanelApi.d.ts +23 -8
  104. package/dist/esm/api/dockviewGroupPanelApi.js +20 -1
  105. package/dist/esm/api/dockviewPanelApi.d.ts +4 -3
  106. package/dist/esm/api/dockviewPanelApi.js +7 -0
  107. package/dist/esm/dnd/dropTargetAnchorContainer.js +1 -2
  108. package/dist/esm/dnd/droptarget.d.ts +8 -0
  109. package/dist/esm/dnd/droptarget.js +28 -0
  110. package/dist/esm/dnd/pointer/longPress.js +1 -1
  111. package/dist/esm/dnd/pointer/pointerDragController.js +9 -7
  112. package/dist/esm/dnd/pointer/pointerDragSource.js +4 -2
  113. package/dist/esm/dockview/accessibilityMessages.d.ts +32 -0
  114. package/dist/esm/dockview/accessibilityMessages.js +30 -0
  115. package/dist/esm/dockview/allModules.d.ts +8 -0
  116. package/dist/esm/dockview/allModules.js +22 -0
  117. package/dist/esm/dockview/components/panel/content.d.ts +2 -0
  118. package/dist/esm/dockview/components/panel/content.js +42 -11
  119. package/dist/esm/dockview/components/popupService.js +1 -1
  120. package/dist/esm/dockview/components/tab/tab.js +35 -7
  121. package/dist/esm/dockview/components/titlebar/floatingTitleBar.d.ts +34 -0
  122. package/dist/esm/dockview/components/titlebar/floatingTitleBar.js +65 -0
  123. package/dist/esm/dockview/components/titlebar/groupDragSource.d.ts +51 -0
  124. package/dist/esm/dockview/components/titlebar/groupDragSource.js +178 -0
  125. package/dist/esm/dockview/components/titlebar/tabGroupIndicator.d.ts +2 -1
  126. package/dist/esm/dockview/components/titlebar/tabGroupIndicator.js +36 -30
  127. package/dist/esm/dockview/components/titlebar/tabGroups.d.ts +27 -5
  128. package/dist/esm/dockview/components/titlebar/tabGroups.js +91 -41
  129. package/dist/esm/dockview/components/titlebar/tabs.d.ts +12 -0
  130. package/dist/esm/dockview/components/titlebar/tabs.js +119 -26
  131. package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +4 -0
  132. package/dist/esm/dockview/components/titlebar/tabsContainer.js +8 -2
  133. package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +1 -4
  134. package/dist/esm/dockview/components/titlebar/voidContainer.js +34 -146
  135. package/dist/esm/dockview/dndCapabilities.js +3 -3
  136. package/dist/esm/dockview/dockviewComponent.d.ts +304 -49
  137. package/dist/esm/dockview/dockviewComponent.js +1459 -772
  138. package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +33 -2
  139. package/dist/esm/dockview/dockviewFloatingGroupPanel.js +35 -3
  140. package/dist/esm/dockview/dockviewGroupPanel.d.ts +1 -2
  141. package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +36 -14
  142. package/dist/esm/dockview/dockviewGroupPanelModel.js +127 -117
  143. package/dist/esm/dockview/dockviewPanel.d.ts +2 -2
  144. package/dist/esm/dockview/dockviewPanel.js +1 -2
  145. package/dist/esm/dockview/dockviewShell.d.ts +29 -7
  146. package/dist/esm/dockview/dockviewShell.js +89 -37
  147. package/dist/esm/dockview/edgeGroupService.d.ts +38 -0
  148. package/dist/esm/dockview/edgeGroupService.js +63 -0
  149. package/dist/esm/dockview/floatingGroupService.d.ts +37 -0
  150. package/dist/esm/dockview/floatingGroupService.js +150 -0
  151. package/dist/esm/dockview/headerActionsService.d.ts +32 -0
  152. package/dist/esm/dockview/headerActionsService.js +86 -0
  153. package/dist/esm/dockview/liveRegionService.d.ts +53 -0
  154. package/dist/esm/dockview/liveRegionService.js +159 -0
  155. package/dist/esm/dockview/moduleContracts.d.ts +119 -0
  156. package/dist/esm/dockview/moduleContracts.js +1 -0
  157. package/dist/esm/dockview/modules.d.ts +110 -0
  158. package/dist/esm/dockview/modules.js +170 -0
  159. package/dist/esm/dockview/options.d.ts +159 -6
  160. package/dist/esm/dockview/options.js +8 -1
  161. package/dist/esm/dockview/popoutWindowService.d.ts +95 -0
  162. package/dist/esm/dockview/popoutWindowService.js +175 -0
  163. package/dist/esm/dockview/rootDropTargetService.d.ts +35 -0
  164. package/dist/esm/dockview/rootDropTargetService.js +82 -0
  165. package/dist/esm/dockview/strictEventsSequencing.js +6 -6
  166. package/dist/esm/dockview/tabGroup.js +3 -3
  167. package/dist/esm/dockview/tabGroupAccent.js +1 -3
  168. package/dist/esm/dockview/watermarkService.d.ts +30 -0
  169. package/dist/esm/dockview/watermarkService.js +56 -0
  170. package/dist/esm/dom.js +1 -1
  171. package/dist/esm/events.js +1 -1
  172. package/dist/esm/gridview/baseComponentGridview.d.ts +1 -1
  173. package/dist/esm/gridview/baseComponentGridview.js +5 -10
  174. package/dist/esm/gridview/branchNode.js +13 -15
  175. package/dist/esm/gridview/gridview.js +8 -8
  176. package/dist/esm/gridview/gridviewComponent.d.ts +3 -3
  177. package/dist/esm/gridview/gridviewComponent.js +1 -6
  178. package/dist/esm/gridview/gridviewPanel.d.ts +1 -1
  179. package/dist/esm/index.d.ts +11 -4
  180. package/dist/esm/index.js +4 -0
  181. package/dist/esm/overlay/overlay.d.ts +43 -1
  182. package/dist/esm/overlay/overlay.js +78 -36
  183. package/dist/esm/overlay/overlayRenderContainer.js +3 -4
  184. package/dist/esm/paneview/draggablePaneviewPanel.d.ts +2 -2
  185. package/dist/esm/paneview/draggablePaneviewPanel.js +5 -5
  186. package/dist/esm/paneview/paneviewComponent.d.ts +3 -3
  187. package/dist/esm/paneview/paneviewComponent.js +7 -11
  188. package/dist/esm/popoutWindow.js +4 -4
  189. package/dist/esm/scrollbar.d.ts +1 -1
  190. package/dist/esm/scrollbar.js +7 -6
  191. package/dist/esm/splitview/splitview.d.ts +1 -1
  192. package/dist/esm/splitview/splitview.js +21 -20
  193. package/dist/esm/splitview/viewItem.js +1 -1
  194. package/dist/package/main.cjs.js +3550 -1546
  195. package/dist/package/main.cjs.min.js +2 -2
  196. package/dist/package/main.esm.min.mjs +2 -2
  197. package/dist/package/main.esm.mjs +3538 -1545
  198. package/dist/styles/dockview.css +283 -21
  199. package/package.json +10 -1
  200. package/dist/cjs/dockview/contextMenu.d.ts +0 -10
  201. package/dist/cjs/dockview/contextMenu.js +0 -313
  202. package/dist/esm/dockview/contextMenu.d.ts +0 -10
  203. package/dist/esm/dockview/contextMenu.js +0 -228
@@ -17,39 +17,55 @@ var lifecycle_1 = require("../lifecycle");
17
17
  var splitview_1 = require("../splitview/splitview");
18
18
  var dom_1 = require("../dom");
19
19
  var EdgeGroupView = /** @class */ (function () {
20
- function EdgeGroupView(options, group, orientation) {
20
+ function EdgeGroupView(options, group, orientation, gapAdd) {
21
+ if (gapAdd === void 0) { gapAdd = 0; }
21
22
  var _a, _b, _c;
22
23
  this._onDidChange = new events_1.Emitter();
23
24
  this.onDidChange = this._onDidChange.event;
24
25
  this.snap = false;
25
26
  this.priority = splitview_1.LayoutPriority.Low;
26
27
  this._isCollapsed = false;
28
+ this._tabSizeDisposables = new lifecycle_1.CompositeDisposable();
27
29
  this._group = group;
28
30
  this._orientation = orientation;
29
31
  group.element.classList.add('dv-edge-group');
30
32
  group.element.dataset.testid = "dv-edge-group-".concat(options.id);
31
- this._collapsedSize = (_a = options.collapsedSize) !== null && _a !== void 0 ? _a : 35;
33
+ this._baseCollapsedSize = (_a = options.collapsedSize) !== null && _a !== void 0 ? _a : 35;
34
+ this._baseMinimumSize = options.minimumSize;
35
+ this._gapAdd = gapAdd;
32
36
  this._expandedMaximumSize =
33
37
  (_b = options.maximumSize) !== null && _b !== void 0 ? _b : Number.POSITIVE_INFINITY;
34
- // If the caller explicitly provides a minimumSize, respect it.
35
- // Otherwise fall back to collapsedSize + 50 so the expanded state is
36
- // visually distinguishable from the collapsed state.
37
- this._expandedMinimumSize =
38
- options.minimumSize !== undefined
39
- ? options.minimumSize
40
- : this._collapsedSize + 50;
41
38
  this._lastExpandedSize = (_c = options.initialSize) !== null && _c !== void 0 ? _c : 200;
42
39
  if (options.collapsed) {
43
40
  this._isCollapsed = true;
44
41
  group.element.classList.add('dv-edge-collapsed');
45
42
  }
43
+ this._observeTabStrip();
46
44
  }
45
+ Object.defineProperty(EdgeGroupView.prototype, "_effectiveBaseCollapsed", {
46
+ /**
47
+ * The effective (pre-gap) collapsed size: the measured tab-strip size when
48
+ * available, otherwise the configured/theme base.
49
+ */
50
+ get: function () {
51
+ var _a;
52
+ return (_a = this._measuredTabSize) !== null && _a !== void 0 ? _a : this._baseCollapsedSize;
53
+ },
54
+ enumerable: false,
55
+ configurable: true
56
+ });
47
57
  Object.defineProperty(EdgeGroupView.prototype, "minimumSize", {
48
58
  get: function () {
49
59
  // When collapsed, lock size to collapsedSize so sash can't drag it open
50
- return this._isCollapsed
51
- ? this._collapsedSize
52
- : this._expandedMinimumSize;
60
+ if (this._isCollapsed) {
61
+ return this.collapsedSize;
62
+ }
63
+ // If the caller explicitly provides a minimumSize, respect it.
64
+ // Otherwise fall back to collapsedSize + 50 so the expanded state is
65
+ // visually distinguishable from the collapsed state.
66
+ return this._baseMinimumSize !== undefined
67
+ ? this._baseMinimumSize + this._gapAdd
68
+ : this._effectiveBaseCollapsed + 50 + this._gapAdd;
53
69
  },
54
70
  enumerable: false,
55
71
  configurable: true
@@ -58,7 +74,7 @@ var EdgeGroupView = /** @class */ (function () {
58
74
  get: function () {
59
75
  // When collapsed, lock size to collapsedSize so sash can't drag it open
60
76
  return this._isCollapsed
61
- ? this._collapsedSize
77
+ ? this.collapsedSize
62
78
  : this._expandedMaximumSize;
63
79
  },
64
80
  enumerable: false,
@@ -87,11 +103,43 @@ var EdgeGroupView = /** @class */ (function () {
87
103
  });
88
104
  Object.defineProperty(EdgeGroupView.prototype, "collapsedSize", {
89
105
  get: function () {
90
- return this._collapsedSize;
106
+ return this._effectiveBaseCollapsed + this._gapAdd;
91
107
  },
92
108
  enumerable: false,
93
109
  configurable: true
94
110
  });
111
+ /**
112
+ * Watch the group's tab strip so the collapsed size follows the live tab
113
+ * height. The strip's cross-axis size (height for top/bottom, width for
114
+ * left/right) is exactly what a collapsed edge group should occupy; a
115
+ * ResizeObserver keeps them in sync when the tab height changes at runtime.
116
+ */
117
+ EdgeGroupView.prototype._observeTabStrip = function () {
118
+ var _this = this;
119
+ var strip = this._group.element.querySelector('.dv-tabs-and-actions-container');
120
+ if (!strip) {
121
+ return;
122
+ }
123
+ this._tabSizeDisposables.addDisposables((0, dom_1.watchElementResize)(strip, function () {
124
+ _this._applyMeasuredTabSize(_this._orientation === 'vertical'
125
+ ? strip.offsetHeight
126
+ : strip.offsetWidth);
127
+ }));
128
+ };
129
+ /**
130
+ * Apply a freshly-measured tab-strip cross size. When the group is
131
+ * collapsed this resizes it in the parent splitview so the collapsed strip
132
+ * always shows the full tab height.
133
+ */
134
+ EdgeGroupView.prototype._applyMeasuredTabSize = function (size) {
135
+ if (size <= 0 || size === this._measuredTabSize) {
136
+ return;
137
+ }
138
+ this._measuredTabSize = size;
139
+ if (this._isCollapsed) {
140
+ this._onDidChange.fire({ size: this.collapsedSize });
141
+ }
142
+ };
95
143
  EdgeGroupView.prototype.layout = function (size, orthogonalSize) {
96
144
  // Track the last expanded size so we can restore it after collapsing
97
145
  if (!this._isCollapsed) {
@@ -126,15 +174,18 @@ var EdgeGroupView = /** @class */ (function () {
126
174
  this._lastExpandedSize = size;
127
175
  };
128
176
  /**
129
- * Apply new effective collapsed and expanded-minimum sizes after a theme
130
- * or gap change. The caller (ShellManager) is responsible for computing
131
- * the correct values from the original config and the new gap.
177
+ * Apply a new base (pre-gap) collapsed size, base minimum size and gap
178
+ * contribution after a theme or gap change. Base values come from the
179
+ * original config; the ShellManager owns the gap arithmetic. A live
180
+ * measured tab size (if any) continues to win over the base collapsed size.
132
181
  */
133
- EdgeGroupView.prototype.updateCollapsedSize = function (newCollapsedSize, newExpandedMinimumSize) {
134
- this._collapsedSize = newCollapsedSize;
135
- this._expandedMinimumSize = newExpandedMinimumSize;
182
+ EdgeGroupView.prototype.updateSizing = function (baseCollapsedSize, baseMinimumSize, gapAdd) {
183
+ this._baseCollapsedSize = baseCollapsedSize;
184
+ this._baseMinimumSize = baseMinimumSize;
185
+ this._gapAdd = gapAdd;
136
186
  };
137
187
  EdgeGroupView.prototype.dispose = function () {
188
+ this._tabSizeDisposables.dispose();
138
189
  this._onDidChange.dispose();
139
190
  };
140
191
  return EdgeGroupView;
@@ -279,15 +330,6 @@ var MiddleColumnView = /** @class */ (function () {
279
330
  };
280
331
  return MiddleColumnView;
281
332
  }());
282
- function adjustedOpts(base, defaultCollapsed, gapAdd) {
283
- var _a;
284
- var effectiveCollapsed = ((_a = base.collapsedSize) !== null && _a !== void 0 ? _a : defaultCollapsed) + gapAdd;
285
- var result = __assign(__assign({}, base), { collapsedSize: effectiveCollapsed });
286
- if (base.minimumSize !== undefined) {
287
- result.minimumSize = base.minimumSize + gapAdd;
288
- }
289
- return result;
290
- }
291
333
  var ShellManager = /** @class */ (function () {
292
334
  function ShellManager(container, dockviewElement, layoutGrid, gap, defaultCollapsedSize) {
293
335
  if (gap === void 0) { gap = 0; }
@@ -316,6 +358,26 @@ var ShellManager = /** @class */ (function () {
316
358
  this._middleIndex = 0;
317
359
  this._outerSplitview.addView(this._middleColumn, { type: 'distribute' }, 0);
318
360
  this._disposables.addDisposables((0, dom_1.watchElementResize)(this._shellElement, function (entry) {
361
+ /**
362
+ * When the shell (or an ancestor) becomes hidden — e.g. a
363
+ * nested dockview whose `onlyWhenVisible` host panel is
364
+ * deactivated — the element collapses to (0, 0) or is detached
365
+ * from the DOM. Propagating that zero size would relayout the
366
+ * edge-group splitview at 0, clamping the low-priority edge
367
+ * groups down to their minimum size and destroying the user's
368
+ * sizing. Skip these cases so sizes are preserved while hidden;
369
+ * mirrors the guard in the `Resizable` base class. See #1495.
370
+ *
371
+ * offsetParent === null is equivalent to display: none on the
372
+ * element or one of its ancestors.
373
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
374
+ */
375
+ if (!_this._shellElement.offsetParent) {
376
+ return;
377
+ }
378
+ if (!(0, dom_1.isInDocument)(_this._shellElement)) {
379
+ return;
380
+ }
319
381
  var width = Math.round(entry.contentRect.width);
320
382
  var height = Math.round(entry.contentRect.height);
321
383
  if (width === _this._currentWidth &&
@@ -356,7 +418,7 @@ var ShellManager = /** @class */ (function () {
356
418
  var isHorizontal = position === 'left' || position === 'right';
357
419
  var gapAdd = isHorizontal ? outerGapAdd : innerGapAdd;
358
420
  var orientation = isHorizontal ? 'horizontal' : 'vertical';
359
- var view = new EdgeGroupView(adjustedOpts(__assign({ collapsedSize: this._defaultCollapsedSize }, options), this._defaultCollapsedSize, gapAdd), group, orientation);
421
+ var view = new EdgeGroupView(__assign({ collapsedSize: this._defaultCollapsedSize }, options), group, orientation, gapAdd);
360
422
  var initialSize = view.isCollapsed
361
423
  ? view.collapsedSize
362
424
  : view.lastExpandedSize;
@@ -423,10 +485,7 @@ var ShellManager = /** @class */ (function () {
423
485
  var updateView = function (view, baseCfg, gapAdd) {
424
486
  var _a;
425
487
  var baseCS = (_a = baseCfg.collapsedSize) !== null && _a !== void 0 ? _a : defaultCollapsedSize;
426
- var newCS = baseCS + gapAdd;
427
- var baseMS = baseCfg.minimumSize;
428
- var newMS = baseMS !== undefined ? baseMS + gapAdd : newCS + 50;
429
- view.updateCollapsedSize(newCS, newMS);
488
+ view.updateSizing(baseCS, baseCfg.minimumSize, gapAdd);
430
489
  };
431
490
  var topCfg = this._viewConfigs.get('top');
432
491
  if (this._topView && topCfg) {
@@ -677,9 +736,8 @@ var ShellManager = /** @class */ (function () {
677
736
  }
678
737
  };
679
738
  ShellManager.prototype.dispose = function () {
680
- var _a;
681
739
  this._disposables.dispose();
682
- (_a = this._shellElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this._shellElement);
740
+ this._shellElement.remove();
683
741
  };
684
742
  return ShellManager;
685
743
  }());
@@ -0,0 +1,38 @@
1
+ import { IDisposable } from '../lifecycle';
2
+ import { DockviewGroupPanel } from './dockviewGroupPanel';
3
+ import { EdgeGroupPosition } from './dockviewShell';
4
+ /**
5
+ * EdgeGroupService is a pure registry: it tracks which positions are
6
+ * occupied and owns each edge group's per-instance cleanup disposable.
7
+ *
8
+ * The ShellManager (layout infrastructure) and the addEdgeGroup
9
+ * orchestration remain on DockviewComponent.
10
+ */
11
+ export interface IEdgeGroupServiceHost {
12
+ }
13
+ export interface IEdgeGroupService extends IDisposable {
14
+ add(position: EdgeGroupPosition, group: DockviewGroupPanel, autoCollapseDisposable: IDisposable): void;
15
+ remove(position: EdgeGroupPosition): void;
16
+ get(position: EdgeGroupPosition): DockviewGroupPanel | undefined;
17
+ has(position: EdgeGroupPosition): boolean;
18
+ hasAny(): boolean;
19
+ entries(): IterableIterator<[EdgeGroupPosition, DockviewGroupPanel]>;
20
+ includes(group: DockviewGroupPanel): boolean;
21
+ findPositionOf(group: DockviewGroupPanel): EdgeGroupPosition | undefined;
22
+ disposeAll(): void;
23
+ }
24
+ export declare class EdgeGroupService implements IEdgeGroupService {
25
+ private readonly _edgeGroups;
26
+ private readonly _edgeGroupDisposables;
27
+ add(position: EdgeGroupPosition, group: DockviewGroupPanel, autoCollapseDisposable: IDisposable): void;
28
+ remove(position: EdgeGroupPosition): void;
29
+ get(position: EdgeGroupPosition): DockviewGroupPanel | undefined;
30
+ has(position: EdgeGroupPosition): boolean;
31
+ hasAny(): boolean;
32
+ entries(): IterableIterator<[EdgeGroupPosition, DockviewGroupPanel]>;
33
+ includes(group: DockviewGroupPanel): boolean;
34
+ findPositionOf(group: DockviewGroupPanel): EdgeGroupPosition | undefined;
35
+ disposeAll(): void;
36
+ dispose(): void;
37
+ }
38
+ export declare const EdgeGroupModule: import("./modules").DockviewModule<IEdgeGroupServiceHost>;
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __values = (this && this.__values) || function(o) {
3
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
+ if (m) return m.call(o);
5
+ if (o && typeof o.length === "number") return {
6
+ next: function () {
7
+ if (o && i >= o.length) o = void 0;
8
+ return { value: o && o[i++], done: !o };
9
+ }
10
+ };
11
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
+ };
13
+ var __read = (this && this.__read) || function (o, n) {
14
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
15
+ if (!m) return o;
16
+ var i = m.call(o), r, ar = [], e;
17
+ try {
18
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
19
+ }
20
+ catch (error) { e = { error: error }; }
21
+ finally {
22
+ try {
23
+ if (r && !r.done && (m = i["return"])) m.call(i);
24
+ }
25
+ finally { if (e) throw e.error; }
26
+ }
27
+ return ar;
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.EdgeGroupModule = exports.EdgeGroupService = void 0;
31
+ var modules_1 = require("./modules");
32
+ var EdgeGroupService = /** @class */ (function () {
33
+ function EdgeGroupService() {
34
+ this._edgeGroups = new Map();
35
+ this._edgeGroupDisposables = new Map();
36
+ }
37
+ // No constructor needed — the host is currently unused. The
38
+ // IEdgeGroupServiceHost slot stays for symmetry with the other modules
39
+ // and to leave room for future host callbacks.
40
+ EdgeGroupService.prototype.add = function (position, group, autoCollapseDisposable) {
41
+ this._edgeGroups.set(position, group);
42
+ this._edgeGroupDisposables.set(position, autoCollapseDisposable);
43
+ };
44
+ EdgeGroupService.prototype.remove = function (position) {
45
+ var _a;
46
+ (_a = this._edgeGroupDisposables.get(position)) === null || _a === void 0 ? void 0 : _a.dispose();
47
+ this._edgeGroupDisposables.delete(position);
48
+ this._edgeGroups.delete(position);
49
+ };
50
+ EdgeGroupService.prototype.get = function (position) {
51
+ return this._edgeGroups.get(position);
52
+ };
53
+ EdgeGroupService.prototype.has = function (position) {
54
+ return this._edgeGroups.has(position);
55
+ };
56
+ EdgeGroupService.prototype.hasAny = function () {
57
+ return this._edgeGroups.size > 0;
58
+ };
59
+ EdgeGroupService.prototype.entries = function () {
60
+ return this._edgeGroups.entries();
61
+ };
62
+ EdgeGroupService.prototype.includes = function (group) {
63
+ var e_1, _a;
64
+ try {
65
+ for (var _b = __values(this._edgeGroups.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
66
+ var edgeGroup = _c.value;
67
+ if (edgeGroup === group) {
68
+ return true;
69
+ }
70
+ }
71
+ }
72
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
73
+ finally {
74
+ try {
75
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
76
+ }
77
+ finally { if (e_1) throw e_1.error; }
78
+ }
79
+ return false;
80
+ };
81
+ EdgeGroupService.prototype.findPositionOf = function (group) {
82
+ var e_2, _a;
83
+ try {
84
+ for (var _b = __values(this._edgeGroups), _c = _b.next(); !_c.done; _c = _b.next()) {
85
+ var _d = __read(_c.value, 2), position = _d[0], edgeGroup = _d[1];
86
+ if (edgeGroup === group) {
87
+ return position;
88
+ }
89
+ }
90
+ }
91
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
92
+ finally {
93
+ try {
94
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
95
+ }
96
+ finally { if (e_2) throw e_2.error; }
97
+ }
98
+ return undefined;
99
+ };
100
+ EdgeGroupService.prototype.disposeAll = function () {
101
+ var e_3, _a;
102
+ try {
103
+ for (var _b = __values(this._edgeGroupDisposables.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
104
+ var disposable = _c.value;
105
+ disposable.dispose();
106
+ }
107
+ }
108
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
109
+ finally {
110
+ try {
111
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
112
+ }
113
+ finally { if (e_3) throw e_3.error; }
114
+ }
115
+ this._edgeGroupDisposables.clear();
116
+ this._edgeGroups.clear();
117
+ };
118
+ EdgeGroupService.prototype.dispose = function () {
119
+ this.disposeAll();
120
+ };
121
+ return EdgeGroupService;
122
+ }());
123
+ exports.EdgeGroupService = EdgeGroupService;
124
+ exports.EdgeGroupModule = (0, modules_1.defineModule)({
125
+ name: 'EdgeGroup',
126
+ serviceKey: 'edgeGroupService',
127
+ create: function () { return new EdgeGroupService(); },
128
+ });
@@ -0,0 +1,37 @@
1
+ import { IDisposable } from '../lifecycle';
2
+ import { Gridview } from '../gridview/gridview';
3
+ import { Overlay } from '../overlay/overlay';
4
+ import { DockviewFloatingGroupPanel } from './dockviewFloatingGroupPanel';
5
+ import { DockviewGroupPanel } from './dockviewGroupPanel';
6
+ import { DockviewOptions } from './options';
7
+ import { SerializedFloatingGroup } from './dockviewComponent';
8
+ /**
9
+ * Narrow callback surface the FloatingGroupService needs from its host
10
+ * component. Keeps the service decoupled from DockviewComponent.
11
+ */
12
+ export interface IFloatingGroupHost {
13
+ fireLayoutChange(): void;
14
+ }
15
+ export interface IFloatingGroupService extends IDisposable {
16
+ readonly floatingGroups: readonly DockviewFloatingGroupPanel[];
17
+ add(group: DockviewGroupPanel, overlay: Overlay, gridview: Gridview): DockviewFloatingGroupPanel;
18
+ findByGroup(group: DockviewGroupPanel): DockviewFloatingGroupPanel | undefined;
19
+ serialize(): SerializedFloatingGroup[];
20
+ constrainBounds(): void;
21
+ updateBounds(options: Partial<DockviewOptions>): void;
22
+ disposeAll(): void;
23
+ }
24
+ export declare class FloatingGroupService implements IFloatingGroupService {
25
+ private readonly _host;
26
+ private readonly _floatingGroups;
27
+ get floatingGroups(): readonly DockviewFloatingGroupPanel[];
28
+ constructor(host: IFloatingGroupHost);
29
+ add(group: DockviewGroupPanel, overlay: Overlay, gridview: Gridview): DockviewFloatingGroupPanel;
30
+ findByGroup(group: DockviewGroupPanel): DockviewFloatingGroupPanel | undefined;
31
+ serialize(): SerializedFloatingGroup[];
32
+ constrainBounds(): void;
33
+ updateBounds(options: Partial<DockviewOptions>): void;
34
+ disposeAll(): void;
35
+ dispose(): void;
36
+ }
37
+ export declare const FloatingGroupModule: import("./modules").DockviewModule<IFloatingGroupHost>;
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ var __values = (this && this.__values) || function(o) {
3
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
+ if (m) return m.call(o);
5
+ if (o && typeof o.length === "number") return {
6
+ next: function () {
7
+ if (o && i >= o.length) o = void 0;
8
+ return { value: o && o[i++], done: !o };
9
+ }
10
+ };
11
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
+ };
13
+ var __read = (this && this.__read) || function (o, n) {
14
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
15
+ if (!m) return o;
16
+ var i = m.call(o), r, ar = [], e;
17
+ try {
18
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
19
+ }
20
+ catch (error) { e = { error: error }; }
21
+ finally {
22
+ try {
23
+ if (r && !r.done && (m = i["return"])) m.call(i);
24
+ }
25
+ finally { if (e) throw e.error; }
26
+ }
27
+ return ar;
28
+ };
29
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
30
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
31
+ if (ar || !(i in from)) {
32
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
33
+ ar[i] = from[i];
34
+ }
35
+ }
36
+ return to.concat(ar || Array.prototype.slice.call(from));
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.FloatingGroupModule = exports.FloatingGroupService = void 0;
40
+ var lifecycle_1 = require("../lifecycle");
41
+ var array_1 = require("../array");
42
+ var dom_1 = require("../dom");
43
+ var constants_1 = require("../constants");
44
+ var dockviewFloatingGroupPanel_1 = require("./dockviewFloatingGroupPanel");
45
+ var modules_1 = require("./modules");
46
+ var FloatingGroupService = /** @class */ (function () {
47
+ function FloatingGroupService(host) {
48
+ this._floatingGroups = [];
49
+ this._host = host;
50
+ }
51
+ Object.defineProperty(FloatingGroupService.prototype, "floatingGroups", {
52
+ get: function () {
53
+ return this._floatingGroups;
54
+ },
55
+ enumerable: false,
56
+ configurable: true
57
+ });
58
+ FloatingGroupService.prototype.add = function (group, overlay, gridview) {
59
+ var _this = this;
60
+ var floatingGroupPanel = new dockviewFloatingGroupPanel_1.DockviewFloatingGroupPanel(group, overlay, gridview);
61
+ var disposable = new lifecycle_1.CompositeDisposable(group.api.onDidActiveChange(function (event) {
62
+ if (event.isActive) {
63
+ overlay.bringToFront();
64
+ }
65
+ }), (function () {
66
+ // The floating window's nested gridview fills the overlay
67
+ // beneath the (optional) title bar; size it from its own
68
+ // measured box so it follows the overlay as the user drags
69
+ // / resizes the window.
70
+ var lastWidth = -1;
71
+ var lastHeight = -1;
72
+ return (0, dom_1.watchElementResize)(gridview.element, function (entry) {
73
+ var width = Math.round(entry.contentRect.width);
74
+ var height = Math.round(entry.contentRect.height);
75
+ if (width === lastWidth && height === lastHeight) {
76
+ return;
77
+ }
78
+ lastWidth = width;
79
+ lastHeight = height;
80
+ gridview.layout(width, height);
81
+ });
82
+ })());
83
+ // Floating windows are non-modal dialogs (role set in Overlay). Give
84
+ // the dialog an accessible name from the representative group's active
85
+ // panel, refreshed as the active panel changes. An untitled panel
86
+ // leaves the dialog unnamed rather than hard-coding a label string.
87
+ var updateDialogLabel = function () {
88
+ var _a;
89
+ var title = (_a = group.activePanel) === null || _a === void 0 ? void 0 : _a.title;
90
+ if (title) {
91
+ overlay.element.setAttribute('aria-label', title);
92
+ }
93
+ else {
94
+ overlay.element.removeAttribute('aria-label');
95
+ }
96
+ };
97
+ updateDialogLabel();
98
+ floatingGroupPanel.addDisposables(group.api.onDidActivePanelChange(function () { return updateDialogLabel(); }), overlay.onDidChange(function () {
99
+ gridview.layout(gridview.width, gridview.height);
100
+ }), overlay.onDidChangeEnd(function () {
101
+ _this._host.fireLayoutChange();
102
+ }), group.onDidChange(function (event) {
103
+ // `event.height` is the group's requested *content* height.
104
+ // When a dedicated title bar is present the overlay's outer
105
+ // box is taller by the header, so add it back to preserve the
106
+ // requested content size.
107
+ overlay.setBounds({
108
+ height: typeof (event === null || event === void 0 ? void 0 : event.height) === 'number'
109
+ ? event.height + overlay.headerHeight
110
+ : event === null || event === void 0 ? void 0 : event.height,
111
+ width: event === null || event === void 0 ? void 0 : event.width,
112
+ });
113
+ }), {
114
+ dispose: function () {
115
+ disposable.dispose();
116
+ (0, array_1.remove)(_this._floatingGroups, floatingGroupPanel);
117
+ group.model.location = { type: 'grid' };
118
+ },
119
+ });
120
+ this._floatingGroups.push(floatingGroupPanel);
121
+ return floatingGroupPanel;
122
+ };
123
+ FloatingGroupService.prototype.findByGroup = function (group) {
124
+ // A floating window may host several groups in a nested gridview, so
125
+ // match by membership (DOM containment) rather than only the anchor
126
+ // group. `floating.group === group` covers the brief window before the
127
+ // anchor's element is attached to the gridview.
128
+ return this._floatingGroups.find(function (floating) {
129
+ return floating.group === group ||
130
+ floating.gridview.element.contains(group.element);
131
+ });
132
+ };
133
+ FloatingGroupService.prototype.serialize = function () {
134
+ return this._floatingGroups.map(function (floating) {
135
+ var grid = floating.gridview.serialize();
136
+ var position = floating.overlay.toJSON();
137
+ var root = grid.root;
138
+ // A single-group window keeps the legacy `data` shape so layouts
139
+ // round-trip byte-stably and older readers keep working; only
140
+ // genuine multi-group windows emit the nested `grid` form.
141
+ if (root.type === 'branch' &&
142
+ root.data.length === 1 &&
143
+ root.data[0].type === 'leaf') {
144
+ return {
145
+ data: root.data[0].data,
146
+ position: position,
147
+ };
148
+ }
149
+ return { grid: grid, position: position };
150
+ });
151
+ };
152
+ FloatingGroupService.prototype.constrainBounds = function () {
153
+ var e_1, _a;
154
+ try {
155
+ for (var _b = __values(this._floatingGroups), _c = _b.next(); !_c.done; _c = _b.next()) {
156
+ var floating = _c.value;
157
+ floating.overlay.setBounds();
158
+ }
159
+ }
160
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
161
+ finally {
162
+ try {
163
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
164
+ }
165
+ finally { if (e_1) throw e_1.error; }
166
+ }
167
+ };
168
+ FloatingGroupService.prototype.updateBounds = function (options) {
169
+ var e_2, _a;
170
+ var _b, _c;
171
+ if (!('floatingGroupBounds' in options)) {
172
+ return;
173
+ }
174
+ try {
175
+ for (var _d = __values(this._floatingGroups), _e = _d.next(); !_e.done; _e = _d.next()) {
176
+ var group = _e.value;
177
+ switch (options.floatingGroupBounds) {
178
+ case 'boundedWithinViewport':
179
+ group.overlay.minimumInViewportHeight = undefined;
180
+ group.overlay.minimumInViewportWidth = undefined;
181
+ break;
182
+ case undefined:
183
+ group.overlay.minimumInViewportHeight =
184
+ constants_1.DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE;
185
+ group.overlay.minimumInViewportWidth =
186
+ constants_1.DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE;
187
+ break;
188
+ default:
189
+ group.overlay.minimumInViewportHeight =
190
+ (_b = options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumHeightWithinViewport;
191
+ group.overlay.minimumInViewportWidth =
192
+ (_c = options.floatingGroupBounds) === null || _c === void 0 ? void 0 : _c.minimumWidthWithinViewport;
193
+ }
194
+ group.overlay.setBounds();
195
+ }
196
+ }
197
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
198
+ finally {
199
+ try {
200
+ if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
201
+ }
202
+ finally { if (e_2) throw e_2.error; }
203
+ }
204
+ };
205
+ FloatingGroupService.prototype.disposeAll = function () {
206
+ var e_3, _a;
207
+ try {
208
+ for (var _b = __values(__spreadArray([], __read(this._floatingGroups), false)), _c = _b.next(); !_c.done; _c = _b.next()) {
209
+ var floating = _c.value;
210
+ floating.dispose();
211
+ }
212
+ }
213
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
214
+ finally {
215
+ try {
216
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
217
+ }
218
+ finally { if (e_3) throw e_3.error; }
219
+ }
220
+ };
221
+ FloatingGroupService.prototype.dispose = function () {
222
+ this.disposeAll();
223
+ };
224
+ return FloatingGroupService;
225
+ }());
226
+ exports.FloatingGroupService = FloatingGroupService;
227
+ exports.FloatingGroupModule = (0, modules_1.defineModule)({
228
+ name: 'FloatingGroup',
229
+ serviceKey: 'floatingGroupService',
230
+ create: function (host) { return new FloatingGroupService(host); },
231
+ });