dockview-core 1.14.2 → 1.15.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 (76) hide show
  1. package/dist/cjs/api/component.api.d.ts +4 -5
  2. package/dist/cjs/api/component.api.js +12 -2
  3. package/dist/cjs/constants.d.ts +2 -0
  4. package/dist/cjs/constants.js +1 -1
  5. package/dist/cjs/dnd/overlay.d.ts +6 -4
  6. package/dist/cjs/dnd/overlay.js +119 -28
  7. package/dist/cjs/dockview/components/titlebar/tabsContainer.js +4 -2
  8. package/dist/cjs/dockview/dockviewComponent.d.ts +20 -17
  9. package/dist/cjs/dockview/dockviewComponent.js +92 -45
  10. package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +3 -12
  11. package/dist/cjs/dockview/options.d.ts +10 -6
  12. package/dist/cjs/dockview/options.js +1 -0
  13. package/dist/cjs/dom.d.ts +1 -0
  14. package/dist/cjs/dom.js +5 -1
  15. package/dist/cjs/gridview/baseComponentGridview.d.ts +3 -0
  16. package/dist/cjs/gridview/baseComponentGridview.js +8 -2
  17. package/dist/cjs/gridview/branchNode.d.ts +7 -3
  18. package/dist/cjs/gridview/branchNode.js +24 -29
  19. package/dist/cjs/gridview/gridview.d.ts +7 -1
  20. package/dist/cjs/gridview/gridview.js +31 -8
  21. package/dist/cjs/gridview/gridviewPanel.d.ts +1 -0
  22. package/dist/cjs/gridview/gridviewPanel.js +7 -0
  23. package/dist/cjs/math.js +5 -1
  24. package/dist/cjs/splitview/splitview.d.ts +13 -0
  25. package/dist/cjs/splitview/splitview.js +42 -12
  26. package/dist/cjs/types.d.ts +23 -0
  27. package/dist/dockview-core.amd.js +317 -110
  28. package/dist/dockview-core.amd.js.map +1 -1
  29. package/dist/dockview-core.amd.min.js +2 -2
  30. package/dist/dockview-core.amd.min.js.map +1 -1
  31. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  32. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  33. package/dist/dockview-core.amd.noStyle.js +316 -109
  34. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  35. package/dist/dockview-core.cjs.js +317 -110
  36. package/dist/dockview-core.cjs.js.map +1 -1
  37. package/dist/dockview-core.esm.js +317 -110
  38. package/dist/dockview-core.esm.js.map +1 -1
  39. package/dist/dockview-core.esm.min.js +2 -2
  40. package/dist/dockview-core.esm.min.js.map +1 -1
  41. package/dist/dockview-core.js +317 -110
  42. package/dist/dockview-core.js.map +1 -1
  43. package/dist/dockview-core.min.js +2 -2
  44. package/dist/dockview-core.min.js.map +1 -1
  45. package/dist/dockview-core.min.noStyle.js +2 -2
  46. package/dist/dockview-core.min.noStyle.js.map +1 -1
  47. package/dist/dockview-core.noStyle.js +316 -109
  48. package/dist/dockview-core.noStyle.js.map +1 -1
  49. package/dist/esm/api/component.api.d.ts +4 -5
  50. package/dist/esm/api/component.api.js +8 -2
  51. package/dist/esm/constants.d.ts +2 -0
  52. package/dist/esm/constants.js +1 -1
  53. package/dist/esm/dnd/overlay.d.ts +6 -4
  54. package/dist/esm/dnd/overlay.js +108 -28
  55. package/dist/esm/dockview/components/titlebar/tabsContainer.js +4 -2
  56. package/dist/esm/dockview/dockviewComponent.d.ts +20 -17
  57. package/dist/esm/dockview/dockviewComponent.js +93 -46
  58. package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +3 -12
  59. package/dist/esm/dockview/options.d.ts +10 -6
  60. package/dist/esm/dockview/options.js +1 -0
  61. package/dist/esm/dom.d.ts +1 -0
  62. package/dist/esm/dom.js +3 -0
  63. package/dist/esm/gridview/baseComponentGridview.d.ts +3 -0
  64. package/dist/esm/gridview/baseComponentGridview.js +6 -2
  65. package/dist/esm/gridview/branchNode.d.ts +7 -3
  66. package/dist/esm/gridview/branchNode.js +19 -7
  67. package/dist/esm/gridview/gridview.d.ts +7 -1
  68. package/dist/esm/gridview/gridview.js +27 -8
  69. package/dist/esm/gridview/gridviewPanel.d.ts +1 -0
  70. package/dist/esm/gridview/gridviewPanel.js +3 -0
  71. package/dist/esm/math.js +5 -1
  72. package/dist/esm/splitview/splitview.d.ts +13 -0
  73. package/dist/esm/splitview/splitview.js +38 -12
  74. package/dist/esm/types.d.ts +23 -0
  75. package/dist/styles/dockview.css +0 -13
  76. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { IDockviewComponent, SerializedDockview } from '../dockview/dockviewComponent';
1
+ import { FloatingGroupOptions, IDockviewComponent, MovePanelEvent, SerializedDockview } from '../dockview/dockviewComponent';
2
2
  import { AddGroupOptions, AddPanelOptions, DockviewDndOverlayEvent, MovementOptions } from '../dockview/options';
3
3
  import { Parameters } from '../panel/types';
4
4
  import { Direction } from '../gridview/baseComponentGridview';
@@ -354,6 +354,7 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
354
354
  * Invoked when a panel is removed. May be called multiple times when moving panels.
355
355
  */
356
356
  get onDidRemovePanel(): Event<IDockviewPanel>;
357
+ get onDidMovePanel(): Event<MovePanelEvent>;
357
358
  /**
358
359
  * Invoked after a layout is deserialzied using the `fromJSON` method.
359
360
  */
@@ -450,10 +451,7 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
450
451
  /**
451
452
  * Add a floating group
452
453
  */
453
- addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel, coord?: {
454
- x: number;
455
- y: number;
456
- }): void;
454
+ addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel, options?: FloatingGroupOptions): void;
457
455
  /**
458
456
  * Create a component from a serialized object.
459
457
  */
@@ -493,4 +491,5 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
493
491
  window: Window;
494
492
  }) => void;
495
493
  }): Promise<void>;
494
+ setGap(gap: number | undefined): void;
496
495
  }
@@ -709,6 +709,13 @@ var DockviewApi = /** @class */ (function () {
709
709
  enumerable: false,
710
710
  configurable: true
711
711
  });
712
+ Object.defineProperty(DockviewApi.prototype, "onDidMovePanel", {
713
+ get: function () {
714
+ return this.component.onDidMovePanel;
715
+ },
716
+ enumerable: false,
717
+ configurable: true
718
+ });
712
719
  Object.defineProperty(DockviewApi.prototype, "onDidLayoutFromJSON", {
713
720
  /**
714
721
  * Invoked after a layout is deserialzied using the `fromJSON` method.
@@ -895,8 +902,8 @@ var DockviewApi = /** @class */ (function () {
895
902
  /**
896
903
  * Add a floating group
897
904
  */
898
- DockviewApi.prototype.addFloatingGroup = function (item, coord) {
899
- return this.component.addFloatingGroup(item, coord);
905
+ DockviewApi.prototype.addFloatingGroup = function (item, options) {
906
+ return this.component.addFloatingGroup(item, options);
900
907
  };
901
908
  /**
902
909
  * Create a component from a serialized object.
@@ -950,6 +957,9 @@ var DockviewApi = /** @class */ (function () {
950
957
  DockviewApi.prototype.addPopoutGroup = function (item, options) {
951
958
  return this.component.addPopoutGroup(item, options);
952
959
  };
960
+ DockviewApi.prototype.setGap = function (gap) {
961
+ this.component.updateOptions({ gap: gap });
962
+ };
953
963
  return DockviewApi;
954
964
  }());
955
965
  exports.DockviewApi = DockviewApi;
@@ -2,4 +2,6 @@ export declare const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
2
2
  export declare const DEFAULT_FLOATING_GROUP_POSITION: {
3
3
  left: number;
4
4
  top: number;
5
+ width: number;
6
+ height: number;
5
7
  };
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_FLOATING_GROUP_POSITION = exports.DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = void 0;
4
4
  exports.DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
5
- exports.DEFAULT_FLOATING_GROUP_POSITION = { left: 100, top: 100 };
5
+ exports.DEFAULT_FLOATING_GROUP_POSITION = { left: 100, top: 100, width: 300, height: 300 };
@@ -1,6 +1,6 @@
1
1
  import { Event } from '../events';
2
2
  import { CompositeDisposable } from '../lifecycle';
3
- import { Box } from '../types';
3
+ import { AnchoredBox } from '../types';
4
4
  export declare class Overlay extends CompositeDisposable {
5
5
  private readonly options;
6
6
  private _element;
@@ -10,16 +10,18 @@ export declare class Overlay extends CompositeDisposable {
10
10
  readonly onDidChangeEnd: Event<void>;
11
11
  private static MINIMUM_HEIGHT;
12
12
  private static MINIMUM_WIDTH;
13
+ private verticalAlignment;
14
+ private horiziontalAlignment;
13
15
  set minimumInViewportWidth(value: number | undefined);
14
16
  set minimumInViewportHeight(value: number | undefined);
15
- constructor(options: Box & {
17
+ constructor(options: AnchoredBox & {
16
18
  container: HTMLElement;
17
19
  content: HTMLElement;
18
20
  minimumInViewportWidth?: number;
19
21
  minimumInViewportHeight?: number;
20
22
  });
21
- setBounds(bounds?: Partial<Box>): void;
22
- toJSON(): Box;
23
+ setBounds(bounds?: Partial<AnchoredBox>): void;
24
+ toJSON(): AnchoredBox;
23
25
  setupDrag(dragTarget: HTMLElement, options?: {
24
26
  inDragMode: boolean;
25
27
  }): void;
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
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
+ };
17
28
  var __read = (this && this.__read) || function (o, n) {
18
29
  var m = typeof Symbol === "function" && o[Symbol.iterator];
19
30
  if (!m) return o;
@@ -90,12 +101,7 @@ var Overlay = /** @class */ (function (_super) {
90
101
  _this._element.appendChild(_this.options.content);
91
102
  _this.options.container.appendChild(_this._element);
92
103
  // if input bad resize within acceptable boundaries
93
- _this.setBounds({
94
- height: _this.options.height,
95
- width: _this.options.width,
96
- top: _this.options.top,
97
- left: _this.options.left,
98
- });
104
+ _this.setBounds(__assign(__assign(__assign(__assign({ height: _this.options.height, width: _this.options.width }, ('top' in _this.options && { top: _this.options.top })), ('bottom' in _this.options && { bottom: _this.options.bottom })), ('left' in _this.options && { left: _this.options.left })), ('right' in _this.options && { right: _this.options.right })));
99
105
  return _this;
100
106
  }
101
107
  Object.defineProperty(Overlay.prototype, "minimumInViewportWidth", {
@@ -120,11 +126,25 @@ var Overlay = /** @class */ (function (_super) {
120
126
  if (typeof bounds.width === 'number') {
121
127
  this._element.style.width = "".concat(bounds.width, "px");
122
128
  }
123
- if (typeof bounds.top === 'number') {
129
+ if ('top' in bounds && typeof bounds.top === 'number') {
124
130
  this._element.style.top = "".concat(bounds.top, "px");
131
+ this._element.style.bottom = 'auto';
132
+ this.verticalAlignment = 'top';
133
+ }
134
+ if ('bottom' in bounds && typeof bounds.bottom === 'number') {
135
+ this._element.style.bottom = "".concat(bounds.bottom, "px");
136
+ this._element.style.top = 'auto';
137
+ this.verticalAlignment = 'bottom';
125
138
  }
126
- if (typeof bounds.left === 'number') {
139
+ if ('left' in bounds && typeof bounds.left === 'number') {
127
140
  this._element.style.left = "".concat(bounds.left, "px");
141
+ this._element.style.right = 'auto';
142
+ this.horiziontalAlignment = 'left';
143
+ }
144
+ if ('right' in bounds && typeof bounds.right === 'number') {
145
+ this._element.style.right = "".concat(bounds.right, "px");
146
+ this._element.style.left = 'auto';
147
+ this.horiziontalAlignment = 'right';
128
148
  }
129
149
  var containerRect = this.options.container.getBoundingClientRect();
130
150
  var overlayRect = this._element.getBoundingClientRect();
@@ -132,24 +152,54 @@ var Overlay = /** @class */ (function (_super) {
132
152
  // a minimum width of minimumViewportWidth must be inside the viewport
133
153
  var xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
134
154
  // a minimum height of minimumViewportHeight must be inside the viewport
135
- var yOffset = typeof this.options.minimumInViewportHeight === 'number'
136
- ? Math.max(0, this.getMinimumHeight(overlayRect.height))
137
- : 0;
138
- var left = (0, math_1.clamp)(overlayRect.left - containerRect.left, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
139
- var top = (0, math_1.clamp)(overlayRect.top - containerRect.top, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
140
- this._element.style.left = "".concat(left, "px");
141
- this._element.style.top = "".concat(top, "px");
155
+ var yOffset = Math.max(0, this.getMinimumHeight(overlayRect.height));
156
+ if (this.verticalAlignment === 'top') {
157
+ var top_1 = (0, math_1.clamp)(overlayRect.top - containerRect.top, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
158
+ this._element.style.top = "".concat(top_1, "px");
159
+ this._element.style.bottom = 'auto';
160
+ }
161
+ if (this.verticalAlignment === 'bottom') {
162
+ var bottom = (0, math_1.clamp)(containerRect.bottom - overlayRect.bottom, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
163
+ this._element.style.bottom = "".concat(bottom, "px");
164
+ this._element.style.top = 'auto';
165
+ }
166
+ if (this.horiziontalAlignment === 'left') {
167
+ var left = (0, math_1.clamp)(overlayRect.left - containerRect.left, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
168
+ this._element.style.left = "".concat(left, "px");
169
+ this._element.style.right = 'auto';
170
+ }
171
+ if (this.horiziontalAlignment === 'right') {
172
+ var right = (0, math_1.clamp)(containerRect.right - overlayRect.right, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
173
+ this._element.style.right = "".concat(right, "px");
174
+ this._element.style.left = 'auto';
175
+ }
142
176
  this._onDidChange.fire();
143
177
  };
144
178
  Overlay.prototype.toJSON = function () {
145
179
  var container = this.options.container.getBoundingClientRect();
146
180
  var element = this._element.getBoundingClientRect();
147
- return {
148
- top: element.top - container.top,
149
- left: element.left - container.left,
150
- width: element.width,
151
- height: element.height,
152
- };
181
+ var result = {};
182
+ if (this.verticalAlignment === 'top') {
183
+ result.top = parseFloat(this._element.style.top);
184
+ }
185
+ else if (this.verticalAlignment === 'bottom') {
186
+ result.bottom = parseFloat(this._element.style.bottom);
187
+ }
188
+ else {
189
+ result.top = element.top - container.top;
190
+ }
191
+ if (this.horiziontalAlignment === 'left') {
192
+ result.left = parseFloat(this._element.style.left);
193
+ }
194
+ else if (this.horiziontalAlignment === 'right') {
195
+ result.right = parseFloat(this._element.style.right);
196
+ }
197
+ else {
198
+ result.left = element.left - container.left;
199
+ }
200
+ result.width = element.width;
201
+ result.height = element.height;
202
+ return result;
153
203
  };
154
204
  Overlay.prototype.setupDrag = function (dragTarget, options) {
155
205
  var _this = this;
@@ -202,12 +252,30 @@ var Overlay = /** @class */ (function (_super) {
202
252
  };
203
253
  }
204
254
  var xOffset = Math.max(0, _this.getMinimumWidth(overlayRect.width));
205
- var yOffset = Math.max(0, _this.options.minimumInViewportHeight
206
- ? _this.getMinimumHeight(overlayRect.height)
207
- : 0);
208
- var left = (0, math_1.clamp)(x - offset.x, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
255
+ var yOffset = Math.max(0, _this.getMinimumHeight(overlayRect.height));
209
256
  var top = (0, math_1.clamp)(y - offset.y, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
210
- _this.setBounds({ top: top, left: left });
257
+ var bottom = (0, math_1.clamp)(offset.y -
258
+ y +
259
+ containerRect.height -
260
+ overlayRect.height, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
261
+ var left = (0, math_1.clamp)(x - offset.x, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
262
+ var right = (0, math_1.clamp)(offset.x - x + containerRect.width - overlayRect.width, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
263
+ var bounds = {};
264
+ // Anchor to top or to bottom depending on which one is closer
265
+ if (top <= bottom) {
266
+ bounds.top = top;
267
+ }
268
+ else {
269
+ bounds.bottom = bottom;
270
+ }
271
+ // Anchor to left or to right depending on which one is closer
272
+ if (left <= right) {
273
+ bounds.left = left;
274
+ }
275
+ else {
276
+ bounds.right = right;
277
+ }
278
+ _this.setBounds(bounds);
211
279
  }), (0, events_1.addDisposableWindowListener)(window, 'mouseup', function () {
212
280
  (0, dom_1.toggleClass)(_this._element, 'dv-resize-container-dragging', false);
213
281
  move.dispose();
@@ -284,8 +352,10 @@ var Overlay = /** @class */ (function (_super) {
284
352
  };
285
353
  }
286
354
  var top = undefined;
355
+ var bottom = undefined;
287
356
  var height = undefined;
288
357
  var left = undefined;
358
+ var right = undefined;
289
359
  var width = undefined;
290
360
  var moveTop = function () {
291
361
  top = (0, math_1.clamp)(y, -Number.MAX_VALUE, startPosition.originalY +
@@ -299,6 +369,7 @@ var Overlay = /** @class */ (function (_super) {
299
369
  startPosition.originalY +
300
370
  startPosition.originalHeight -
301
371
  top;
372
+ bottom = containerRect.height - top - height;
302
373
  };
303
374
  var moveBottom = function () {
304
375
  top =
@@ -310,6 +381,7 @@ var Overlay = /** @class */ (function (_super) {
310
381
  ? -top +
311
382
  _this.options.minimumInViewportHeight
312
383
  : Overlay.MINIMUM_HEIGHT, Number.MAX_VALUE);
384
+ bottom = containerRect.height - top - height;
313
385
  };
314
386
  var moveLeft = function () {
315
387
  left = (0, math_1.clamp)(x, -Number.MAX_VALUE, startPosition.originalX +
@@ -323,6 +395,7 @@ var Overlay = /** @class */ (function (_super) {
323
395
  startPosition.originalX +
324
396
  startPosition.originalWidth -
325
397
  left;
398
+ right = containerRect.width - left - width;
326
399
  };
327
400
  var moveRight = function () {
328
401
  left =
@@ -334,6 +407,7 @@ var Overlay = /** @class */ (function (_super) {
334
407
  ? -left +
335
408
  _this.options.minimumInViewportWidth
336
409
  : Overlay.MINIMUM_WIDTH, Number.MAX_VALUE);
410
+ right = containerRect.width - left - width;
337
411
  };
338
412
  switch (direction) {
339
413
  case 'top':
@@ -365,7 +439,24 @@ var Overlay = /** @class */ (function (_super) {
365
439
  moveRight();
366
440
  break;
367
441
  }
368
- _this.setBounds({ height: height, width: width, top: top, left: left });
442
+ var bounds = {};
443
+ // Anchor to top or to bottom depending on which one is closer
444
+ if (top <= bottom) {
445
+ bounds.top = top;
446
+ }
447
+ else {
448
+ bounds.bottom = bottom;
449
+ }
450
+ // Anchor to left or to right depending on which one is closer
451
+ if (left <= right) {
452
+ bounds.left = left;
453
+ }
454
+ else {
455
+ bounds.right = right;
456
+ }
457
+ bounds.height = height;
458
+ bounds.width = width;
459
+ _this.setBounds(bounds);
369
460
  }), {
370
461
  dispose: function () {
371
462
  var e_4, _a;
@@ -399,7 +490,7 @@ var Overlay = /** @class */ (function (_super) {
399
490
  if (typeof this.options.minimumInViewportHeight === 'number') {
400
491
  return height - this.options.minimumInViewportHeight;
401
492
  }
402
- return height;
493
+ return 0;
403
494
  };
404
495
  Overlay.prototype.dispose = function () {
405
496
  this._element.remove();
@@ -130,7 +130,8 @@ var TabsContainer = /** @class */ (function (_super) {
130
130
  _this.accessor.addFloatingGroup(_this.group, {
131
131
  x: left - rootLeft + 20,
132
132
  y: top_1 - rootTop + 20,
133
- }, { inDragMode: true });
133
+ inDragMode: true,
134
+ });
134
135
  }
135
136
  }), (0, events_1.addDisposableListener)(_this.tabContainer, 'mousedown', function (event) {
136
137
  if (event.defaultPrevented) {
@@ -287,7 +288,8 @@ var TabsContainer = /** @class */ (function (_super) {
287
288
  _this.accessor.addFloatingGroup(panel_1, {
288
289
  x: left - rootLeft,
289
290
  y: top_2 - rootTop,
290
- }, { inDragMode: true });
291
+ inDragMode: true,
292
+ });
291
293
  return;
292
294
  }
293
295
  var isLeftClick = event.button === 0;
@@ -11,7 +11,7 @@ import { GroupOptions, GroupPanelViewState, DockviewDidDropEvent, DockviewWillDr
11
11
  import { DockviewGroupPanel } from './dockviewGroupPanel';
12
12
  import { Parameters } from '../panel/types';
13
13
  import { GroupDragEvent, TabDragEvent } from './components/titlebar/tabsContainer';
14
- import { Box } from '../types';
14
+ import { AnchoredBox, Box } from '../types';
15
15
  import { DockviewPanelRenderer, OverlayRenderContainer } from '../overlayRenderContainer';
16
16
  export interface PanelReference {
17
17
  update: (event: {
@@ -23,7 +23,7 @@ export interface PanelReference {
23
23
  }
24
24
  export interface SerializedFloatingGroup {
25
25
  data: GroupPanelViewState;
26
- position: Box;
26
+ position: AnchoredBox;
27
27
  }
28
28
  export interface SerializedPopoutGroup {
29
29
  data: GroupPanelViewState;
@@ -42,6 +42,10 @@ export interface SerializedDockview {
42
42
  floatingGroups?: SerializedFloatingGroup[];
43
43
  popoutGroups?: SerializedPopoutGroup[];
44
44
  }
45
+ export interface MovePanelEvent {
46
+ panel: IDockviewPanel;
47
+ from: DockviewGroupPanel;
48
+ }
45
49
  type MoveGroupOptions = {
46
50
  from: {
47
51
  group: DockviewGroupPanel;
@@ -62,6 +66,16 @@ type MoveGroupOrPanelOptions = {
62
66
  index?: number;
63
67
  };
64
68
  };
69
+ export interface FloatingGroupOptions {
70
+ x?: number;
71
+ y?: number;
72
+ height?: number;
73
+ width?: number;
74
+ position?: AnchoredBox;
75
+ skipRemoveGroup?: boolean;
76
+ inDragMode?: boolean;
77
+ skipActiveGroup?: boolean;
78
+ }
65
79
  export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
66
80
  readonly activePanel: IDockviewPanel | undefined;
67
81
  readonly totalPanels: number;
@@ -80,6 +94,7 @@ export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
80
94
  readonly onDidAddGroup: Event<DockviewGroupPanel>;
81
95
  readonly onDidActiveGroupChange: Event<DockviewGroupPanel | undefined>;
82
96
  readonly onUnhandledDragOverEvent: Event<DockviewDndOverlayEvent>;
97
+ readonly onDidMovePanel: Event<MovePanelEvent>;
83
98
  readonly options: DockviewComponentOptions;
84
99
  updateOptions(options: DockviewOptions): void;
85
100
  moveGroupOrPanel(options: MoveGroupOrPanelOptions): void;
@@ -98,10 +113,7 @@ export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
98
113
  focus(): void;
99
114
  toJSON(): SerializedDockview;
100
115
  fromJSON(data: SerializedDockview): void;
101
- addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel, coord?: {
102
- x: number;
103
- y: number;
104
- }): void;
116
+ addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel, options?: FloatingGroupOptions): void;
105
117
  addPopoutGroup(item: IDockviewPanel | DockviewGroupPanel, options?: {
106
118
  position?: Box;
107
119
  popoutUrl?: string;
@@ -143,10 +155,10 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
143
155
  private readonly _onDidActivePanelChange;
144
156
  readonly onDidActivePanelChange: Event<IDockviewPanel | undefined>;
145
157
  private readonly _onDidMovePanel;
158
+ readonly onDidMovePanel: Event<MovePanelEvent>;
146
159
  private readonly _floatingGroups;
147
160
  private readonly _popoutGroups;
148
161
  private readonly _rootDropTarget;
149
- private _ignoreEvents;
150
162
  private readonly _onDidRemoveGroup;
151
163
  readonly onDidRemoveGroup: Event<DockviewGroupPanel>;
152
164
  protected readonly _onDidAddGroup: Emitter<DockviewGroupPanel>;
@@ -175,16 +187,7 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
175
187
  }) => void;
176
188
  overridePopoutGroup?: DockviewGroupPanel;
177
189
  }): Promise<void>;
178
- addFloatingGroup(item: DockviewPanel | DockviewGroupPanel, coord?: {
179
- x?: number;
180
- y?: number;
181
- height?: number;
182
- width?: number;
183
- }, options?: {
184
- skipRemoveGroup?: boolean;
185
- inDragMode: boolean;
186
- skipActiveGroup?: boolean;
187
- }): void;
190
+ addFloatingGroup(item: DockviewPanel | DockviewGroupPanel, options?: FloatingGroupOptions): void;
188
191
  private orthogonalize;
189
192
  updateOptions(options: Partial<DockviewComponentOptions>): void;
190
193
  layout(width: number, height: number, forceResize?: boolean | undefined): void;