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
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.FLOATING_REDOCK_INITIATION_DELAY_MS = exports.GroupDragSource = void 0;
30
+ var dataTransfer_1 = require("../../../dnd/dataTransfer");
31
+ var backend_1 = require("../../../dnd/backend");
32
+ var events_1 = require("../../../events");
33
+ var lifecycle_1 = require("../../../lifecycle");
34
+ var dom_1 = require("../../../dom");
35
+ var dndCapabilities_1 = require("../../dndCapabilities");
36
+ // Floating-group redock via touch: require a deliberate long press so the
37
+ // "move the float around" gesture doesn't double-trigger the redock ghost.
38
+ // Infinity pressTolerance disables the pre-arm flick override; any motion
39
+ // during the wait is treated as drag-the-float, not redock intent.
40
+ var FLOATING_REDOCK_INITIATION_DELAY_MS = 500;
41
+ exports.FLOATING_REDOCK_INITIATION_DELAY_MS = FLOATING_REDOCK_INITIATION_DELAY_MS;
42
+ /**
43
+ * The drag-source half of a group drag handle: html5 + pointer drag sources
44
+ * that publish a group-level `PanelTransfer`, the "Multiple Panels (N)" ghost,
45
+ * and the floating-group disambiguation that keeps the redock gesture from
46
+ * firing alongside the overlay's move-the-float gesture.
47
+ *
48
+ * Shared by the tab-bar void container and the dedicated floating title bar so
49
+ * both grab handles redock identically.
50
+ */
51
+ var GroupDragSource = /** @class */ (function (_super) {
52
+ __extends(GroupDragSource, _super);
53
+ function GroupDragSource(options) {
54
+ var _a, _b, _c;
55
+ var _this = _super.call(this) || this;
56
+ _this.panelTransfer = dataTransfer_1.LocalSelectionTransfer.getInstance();
57
+ _this._onDragStart = new events_1.Emitter();
58
+ _this.onDragStart = _this._onDragStart.event;
59
+ _this._element = options.element;
60
+ _this.accessor = options.accessor;
61
+ var group = options.group;
62
+ _this.groupAccessor = typeof group === 'function' ? group : function () { return group; };
63
+ _this.isFloatingMoveHandle =
64
+ (_a = options.isFloatingMoveHandle) !== null && _a !== void 0 ? _a : (function () { return true; });
65
+ var caps = (0, dndCapabilities_1.resolveDndCapabilities)(_this.accessor.options);
66
+ _this._element.draggable = caps.html5;
67
+ (0, dom_1.toggleClass)(_this._element, 'dv-draggable', caps.html5 || caps.pointer);
68
+ _this.addDisposables(_this._onDragStart);
69
+ var buildMultiPanelsGhost = function () {
70
+ var ghostEl = document.createElement('div');
71
+ var style = globalThis.getComputedStyle(_this._element);
72
+ var bgColor = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-background-color');
73
+ var color = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-color');
74
+ ghostEl.style.backgroundColor = bgColor;
75
+ ghostEl.style.color = color;
76
+ ghostEl.style.padding = '2px 8px';
77
+ ghostEl.style.height = '24px';
78
+ ghostEl.style.fontSize = '11px';
79
+ ghostEl.style.lineHeight = '20px';
80
+ ghostEl.style.borderRadius = '12px';
81
+ ghostEl.style.whiteSpace = 'nowrap';
82
+ ghostEl.style.boxSizing = 'border-box';
83
+ // HTML5 setDragImage snapshots the element as appended to the
84
+ // document; a default block-level div would stretch to the
85
+ // body's width and render as a viewport-wide bar.
86
+ ghostEl.style.display = 'inline-block';
87
+ ghostEl.textContent = "Multiple Panels (".concat(_this.group.size, ")");
88
+ return ghostEl;
89
+ };
90
+ var buildGhostSpec = function () {
91
+ var _a, _b;
92
+ // The custom-ghost resolution (createGroupDragGhostComponent) is
93
+ // owned by the AdvancedDnD module; core keeps the default chip and
94
+ // falls back to it when no custom ghost is produced (incl. when
95
+ // the module is absent).
96
+ var customGhost = (_b = (_a = _this.accessor).buildGroupDragGhost) === null || _b === void 0 ? void 0 : _b.call(_a, _this.group);
97
+ if (customGhost) {
98
+ return customGhost;
99
+ }
100
+ return {
101
+ element: buildMultiPanelsGhost(),
102
+ offsetX: 30,
103
+ offsetY: -10,
104
+ };
105
+ };
106
+ var sharedDragOptions = {
107
+ getData: function () {
108
+ _this.panelTransfer.setData([new dataTransfer_1.PanelTransfer(_this.accessor.id, _this.group.id, null)], dataTransfer_1.PanelTransfer.prototype);
109
+ return {
110
+ dispose: function () {
111
+ _this.panelTransfer.clearData(dataTransfer_1.PanelTransfer.prototype);
112
+ },
113
+ };
114
+ },
115
+ createGhost: buildGhostSpec,
116
+ onDragStart: function (event) {
117
+ _this._onDragStart.fire(event);
118
+ },
119
+ };
120
+ _this.html5DragSource = backend_1.html5Backend.createDragSource(_this._element, __assign(__assign({}, sharedDragOptions), { disabled: !caps.html5, isCancelled: function (event) {
121
+ // HTML5: when this element is the floating window's move
122
+ // handle, redock needs shift+drag (otherwise click-and-drag
123
+ // conflicts with moving the float). A non-move-handle (e.g. the
124
+ // void container when a title bar moves the float) redocks with
125
+ // a plain drag, like a group in the main grid.
126
+ if (_this.group.api.location.type === 'floating' &&
127
+ _this.isFloatingMoveHandle() &&
128
+ !event.shiftKey) {
129
+ return true;
130
+ }
131
+ if (_this.group.api.location.type === 'edge' &&
132
+ _this.group.size === 0) {
133
+ return true;
134
+ }
135
+ return false;
136
+ } }));
137
+ // Only the move handle needs the touch disambiguation; other handles
138
+ // redock with the normal grid press behaviour.
139
+ var isFloating = function () {
140
+ var _a, _b, _c;
141
+ return ((_c = (_b = (_a = _this.group) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.location) === null || _c === void 0 ? void 0 : _c.type) === 'floating' &&
142
+ _this.isFloatingMoveHandle();
143
+ };
144
+ _this.pointerDragSource = backend_1.pointerBackend.createDragSource(_this._element, __assign(__assign({}, sharedDragOptions), { disabled: !caps.pointer, touchOnly: !caps.pointerHandlesMouse,
145
+ // Floating groups share this element with the overlay's
146
+ // move-the-float drag. Without a longer hold + tolerance
147
+ // override, both gestures commit simultaneously and the
148
+ // user sees the float follow their finger *and* a ghost.
149
+ touchInitiationDelay: function () {
150
+ return isFloating() ? FLOATING_REDOCK_INITIATION_DELAY_MS : 250;
151
+ }, pressTolerance: function () { return (isFloating() ? Infinity : 8); }, isCancelled: function () {
152
+ if (!(0, dndCapabilities_1.resolveDndCapabilities)(_this.accessor.options).pointer) {
153
+ return true;
154
+ }
155
+ // Pointer: long-press IS the deliberate gesture, so
156
+ // floating groups don't need the shift gate.
157
+ if (_this.group.api.location.type === 'edge' &&
158
+ _this.group.size === 0) {
159
+ return true;
160
+ }
161
+ return false;
162
+ }, onDragStart: function (event) {
163
+ var _a;
164
+ // Redock just committed — abort any in-flight overlay
165
+ // move so the float stops following the finger while
166
+ // the ghost takes over.
167
+ (_a = _this.getFloatingOverlay()) === null || _a === void 0 ? void 0 : _a.cancelPendingDrag();
168
+ _this._onDragStart.fire(event);
169
+ } }));
170
+ // Mirror direction: once the overlay's move-the-float gesture has
171
+ // actually moved something, cancel the pending redock arm so the
172
+ // ghost doesn't appear mid-drag if the user holds past 500ms.
173
+ var overlayMoveSub = new lifecycle_1.MutableDisposable();
174
+ var refreshOverlayMoveSub = function () {
175
+ var overlay = _this.getFloatingOverlay();
176
+ overlayMoveSub.value = overlay
177
+ ? overlay.onDidStartMoving(function () {
178
+ _this.pointerDragSource.cancelPending();
179
+ })
180
+ : lifecycle_1.Disposable.NONE;
181
+ };
182
+ refreshOverlayMoveSub();
183
+ _this.addDisposables(overlayMoveSub);
184
+ var locationChange = (_c = (_b = _this.group) === null || _b === void 0 ? void 0 : _b.api) === null || _c === void 0 ? void 0 : _c.onDidLocationChange;
185
+ if (locationChange) {
186
+ _this.addDisposables(locationChange(refreshOverlayMoveSub));
187
+ }
188
+ _this.addDisposables(_this.html5DragSource, _this.pointerDragSource);
189
+ return _this;
190
+ }
191
+ Object.defineProperty(GroupDragSource.prototype, "group", {
192
+ // Resolved lazily so a retargetable handle (the floating title bar) always
193
+ // drags the window's *current* anchor group, not the one captured here.
194
+ get: function () {
195
+ return this.groupAccessor();
196
+ },
197
+ enumerable: false,
198
+ configurable: true
199
+ });
200
+ GroupDragSource.prototype.updateDragAndDropState = function () {
201
+ var caps = (0, dndCapabilities_1.resolveDndCapabilities)(this.accessor.options);
202
+ this._element.draggable = caps.html5;
203
+ (0, dom_1.toggleClass)(this._element, 'dv-draggable', caps.html5 || caps.pointer);
204
+ this.html5DragSource.setDisabled(!caps.html5);
205
+ this.pointerDragSource.setDisabled(!caps.pointer);
206
+ this.pointerDragSource.setTouchOnly(!caps.pointerHandlesMouse);
207
+ };
208
+ GroupDragSource.prototype.getFloatingOverlay = function () {
209
+ var _this = this;
210
+ var _a, _b;
211
+ if (!this.group) {
212
+ return undefined;
213
+ }
214
+ return (_b = (_a = this.accessor.floatingGroups) === null || _a === void 0 ? void 0 : _a.find(function (fg) { return fg.group === _this.group; })) === null || _b === void 0 ? void 0 : _b.overlay;
215
+ };
216
+ return GroupDragSource;
217
+ }(lifecycle_1.CompositeDisposable));
218
+ exports.GroupDragSource = GroupDragSource;
@@ -1,5 +1,5 @@
1
1
  import { IValueDisposable } from '../../../lifecycle';
2
- import { DockviewHeaderDirection } from '../../options';
2
+ import { DockviewHeaderDirection, DockviewHeaderPosition } from '../../options';
3
3
  import { Tab } from '../tab/tab';
4
4
  import { ITabGroup } from '../../tabGroup';
5
5
  import { TabGroupColorPalette } from '../../tabGroupAccent';
@@ -10,6 +10,7 @@ export interface TabGroupIndicatorContext {
10
10
  getTabMap(): Map<string, IValueDisposable<Tab>>;
11
11
  getChipElement(groupId: string): HTMLElement | undefined;
12
12
  getDirection(): DockviewHeaderDirection;
13
+ getHeaderPosition(): DockviewHeaderPosition;
13
14
  getColorPalette(): TabGroupColorPalette | undefined;
14
15
  }
15
16
  export interface ITabGroupIndicator {
@@ -228,8 +228,7 @@ var BaseTabGroupIndicator = /** @class */ (function () {
228
228
  var isAnimating = tg.collapsed ||
229
229
  tg.panelIds.some(function (pid) {
230
230
  var te = tabMap.get(pid);
231
- return (te &&
232
- te.value.element.classList.contains('dv-tab--group-expanding'));
231
+ return te === null || te === void 0 ? void 0 : te.value.element.classList.contains('dv-tab--group-expanding');
233
232
  });
234
233
  if (isAnimating && chipEl) {
235
234
  var chipRect = chipEl.getBoundingClientRect();
@@ -349,7 +348,10 @@ var WrapTabGroupIndicator = /** @class */ (function (_super) {
349
348
  // Ensure SVG + path child exists (created once, reused)
350
349
  var svg = underline.firstElementChild;
351
350
  var path;
352
- if (!svg || svg.tagName !== 'svg') {
351
+ if ((svg === null || svg === void 0 ? void 0 : svg.tagName) === 'svg') {
352
+ path = svg.firstElementChild;
353
+ }
354
+ else {
353
355
  underline.replaceChildren();
354
356
  svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
355
357
  svg.style.display = 'block';
@@ -358,9 +360,6 @@ var WrapTabGroupIndicator = /** @class */ (function (_super) {
358
360
  svg.appendChild(path);
359
361
  underline.appendChild(svg);
360
362
  }
361
- else {
362
- path = svg.firstElementChild;
363
- }
364
363
  path.setAttribute('stroke', color);
365
364
  path.setAttribute('stroke-width', String(t));
366
365
  if (!activeTabEntry) {
@@ -385,6 +384,7 @@ var WrapTabGroupIndicator = /** @class */ (function (_super) {
385
384
  }
386
385
  var r = 6; // corner radius
387
386
  var half = t / 2;
387
+ var headerPosition = this._ctx.getHeaderPosition();
388
388
  if (isVertical) {
389
389
  var svgW = crossSize;
390
390
  var svgH = mainSize;
@@ -392,19 +392,22 @@ var WrapTabGroupIndicator = /** @class */ (function (_super) {
392
392
  svg.setAttribute('height', String(svgH));
393
393
  underline.style.width = "".concat(svgW, "px");
394
394
  underline.style.height = "".concat(svgH, "px");
395
- var xLeft = half;
396
- var xRight = svgW - half;
395
+ // right header: indicator on the left edge (invert x sides)
396
+ var isRightHeader = headerPosition === 'right';
397
+ var xNear = isRightHeader ? svgW - half : half;
398
+ var xFar = isRightHeader ? half : svgW - half;
399
+ var cd = isRightHeader ? -1 : 1; // curve direction
397
400
  var d = [
398
- "M ".concat(xLeft, ",0"),
399
- "L ".concat(xLeft, ",").concat(aStart - r),
400
- "Q ".concat(xLeft, ",").concat(aStart, " ").concat(xLeft + r, ",").concat(aStart),
401
- "L ".concat(xRight - r, ",").concat(aStart),
402
- "Q ".concat(xRight, ",").concat(aStart, " ").concat(xRight, ",").concat(aStart + r),
403
- "L ".concat(xRight, ",").concat(aEnd - r),
404
- "Q ".concat(xRight, ",").concat(aEnd, " ").concat(xRight - r, ",").concat(aEnd),
405
- "L ".concat(xLeft + r, ",").concat(aEnd),
406
- "Q ".concat(xLeft, ",").concat(aEnd, " ").concat(xLeft, ",").concat(aEnd + r),
407
- "L ".concat(xLeft, ",").concat(svgH),
401
+ "M ".concat(xNear, ",0"),
402
+ "L ".concat(xNear, ",").concat(aStart - r),
403
+ "Q ".concat(xNear, ",").concat(aStart, " ").concat(xNear + cd * r, ",").concat(aStart),
404
+ "L ".concat(xFar - cd * r, ",").concat(aStart),
405
+ "Q ".concat(xFar, ",").concat(aStart, " ").concat(xFar, ",").concat(aStart + r),
406
+ "L ".concat(xFar, ",").concat(aEnd - r),
407
+ "Q ".concat(xFar, ",").concat(aEnd, " ").concat(xFar - cd * r, ",").concat(aEnd),
408
+ "L ".concat(xNear + cd * r, ",").concat(aEnd),
409
+ "Q ".concat(xNear, ",").concat(aEnd, " ").concat(xNear, ",").concat(aEnd + r),
410
+ "L ".concat(xNear, ",").concat(svgH),
408
411
  ].join(' ');
409
412
  path.setAttribute('d', d);
410
413
  }
@@ -415,19 +418,22 @@ var WrapTabGroupIndicator = /** @class */ (function (_super) {
415
418
  svg.setAttribute('height', String(svgH));
416
419
  underline.style.width = "".concat(svgW, "px");
417
420
  underline.style.height = "".concat(svgH, "px");
418
- var yBot = svgH - half;
419
- var yTop = half;
421
+ // bottom header: indicator on the top edge (invert y sides)
422
+ var isBottomHeader = headerPosition === 'bottom';
423
+ var yNear = isBottomHeader ? half : svgH - half;
424
+ var yFar = isBottomHeader ? svgH - half : half;
425
+ var cd = isBottomHeader ? 1 : -1; // curve direction
420
426
  var d = [
421
- "M 0,".concat(yBot),
422
- "L ".concat(aStart - r, ",").concat(yBot),
423
- "Q ".concat(aStart, ",").concat(yBot, " ").concat(aStart, ",").concat(yBot - r),
424
- "L ".concat(aStart, ",").concat(yTop + r),
425
- "Q ".concat(aStart, ",").concat(yTop, " ").concat(aStart + r, ",").concat(yTop),
426
- "L ".concat(aEnd - r, ",").concat(yTop),
427
- "Q ".concat(aEnd, ",").concat(yTop, " ").concat(aEnd, ",").concat(yTop + r),
428
- "L ".concat(aEnd, ",").concat(yBot - r),
429
- "Q ".concat(aEnd, ",").concat(yBot, " ").concat(aEnd + r, ",").concat(yBot),
430
- "L ".concat(svgW, ",").concat(yBot),
427
+ "M 0,".concat(yNear),
428
+ "L ".concat(aStart - r, ",").concat(yNear),
429
+ "Q ".concat(aStart, ",").concat(yNear, " ").concat(aStart, ",").concat(yNear + cd * r),
430
+ "L ".concat(aStart, ",").concat(yFar - cd * r),
431
+ "Q ".concat(aStart, ",").concat(yFar, " ").concat(aStart + r, ",").concat(yFar),
432
+ "L ".concat(aEnd - r, ",").concat(yFar),
433
+ "Q ".concat(aEnd, ",").concat(yFar, " ").concat(aEnd, ",").concat(yFar - cd * r),
434
+ "L ".concat(aEnd, ",").concat(yNear + cd * r),
435
+ "Q ".concat(aEnd, ",").concat(yNear, " ").concat(aEnd + r, ",").concat(yNear),
436
+ "L ".concat(svgW, ",").concat(yNear),
431
437
  ].join(' ');
432
438
  path.setAttribute('d', d);
433
439
  }
@@ -27,9 +27,17 @@ export interface TabGroupManagerCallbacks {
27
27
  }
28
28
  interface ChipRendererEntry {
29
29
  chip: ITabGroupChipRenderer;
30
- /** Created by the manager so it can be toggled live on strategy changes. */
31
- html5DragSource: IDragSource;
32
- pointerDragSource: IDragSource;
30
+ /**
31
+ * Created by the manager so it can be toggled live on strategy changes.
32
+ * Undefined between an in-flight drag being torn down by
33
+ * `disposeChipDrag` and the following `update()` re-arming it — the chip
34
+ * element outlives a within-group move even though its drag sources do
35
+ * not. (#1410)
36
+ */
37
+ html5DragSource: IDragSource | undefined;
38
+ pointerDragSource: IDragSource | undefined;
39
+ /** Disposes the two drag sources + their shared dragend listener. */
40
+ dragSourcesDisposable: IDisposable | undefined;
33
41
  disposable: IDisposable;
34
42
  dropTarget: Droptarget;
35
43
  }
@@ -70,14 +78,28 @@ export declare class TabGroupManager {
70
78
  * iframe shield are released BEFORE the cross-group move detaches
71
79
  * the chip (chip dispose is scheduled on a microtask via
72
80
  * `_scheduleTabGroupUpdate`, which is too late for callers that read
73
- * `getPanelData()` synchronously after the move). Idempotent — the
74
- * subsequent `update()` will also dispose the sources.
81
+ * `getPanelData()` synchronously after the move).
82
+ *
83
+ * A cross-group move dissolves the source chip entirely, but a
84
+ * within-group reorder keeps the same chip element — so the sources are
85
+ * cleared to `undefined` here and the subsequent `update()` re-arms them
86
+ * via `_ensureChipForGroup`. Without that re-arm the chip would fire a
87
+ * native `dragstart` (the element keeps `draggable=true`) but never set
88
+ * a transfer payload, leaving the group permanently undraggable after
89
+ * its first move. (#1410)
75
90
  */
76
91
  disposeChipDrag(tabGroupId: string): void;
77
92
  /** Cloned chip rect used as the pointer follow-finger ghost. */
78
93
  private _buildChipGhostElement;
79
94
  disposeAll(): void;
80
95
  private _ensureIndicator;
96
+ /**
97
+ * Create the HTML5 + pointer drag sources for a chip (and the direct
98
+ * dragend listener that clears the transfer synchronously). Extracted so
99
+ * both the initial chip build and the post-move re-arm in
100
+ * `_ensureChipForGroup` share one wiring path. (#1410)
101
+ */
102
+ private _createChipDragSources;
81
103
  private _ensureChipForGroup;
82
104
  private _positionChipForGroup;
83
105
  private _updateTabGroupClasses;