dockview-core 1.14.2 → 1.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/component.api.d.ts +5 -5
- package/dist/cjs/api/component.api.js +19 -2
- package/dist/cjs/constants.d.ts +2 -0
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/dnd/overlay.d.ts +6 -4
- package/dist/cjs/dnd/overlay.js +119 -28
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +4 -2
- package/dist/cjs/dockview/dockviewComponent.d.ts +24 -17
- package/dist/cjs/dockview/dockviewComponent.js +104 -47
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +3 -12
- package/dist/cjs/dockview/options.d.ts +10 -6
- package/dist/cjs/dockview/options.js +1 -0
- package/dist/cjs/dom.d.ts +1 -0
- package/dist/cjs/dom.js +5 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +3 -0
- package/dist/cjs/gridview/baseComponentGridview.js +8 -2
- package/dist/cjs/gridview/branchNode.d.ts +7 -3
- package/dist/cjs/gridview/branchNode.js +24 -29
- package/dist/cjs/gridview/gridview.d.ts +7 -1
- package/dist/cjs/gridview/gridview.js +31 -8
- package/dist/cjs/gridview/gridviewPanel.d.ts +1 -0
- package/dist/cjs/gridview/gridviewPanel.js +7 -0
- package/dist/cjs/math.js +5 -1
- package/dist/cjs/splitview/splitview.d.ts +13 -0
- package/dist/cjs/splitview/splitview.js +42 -12
- package/dist/cjs/types.d.ts +23 -0
- package/dist/dockview-core.amd.js +328 -112
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +327 -111
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +328 -112
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +328 -112
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +328 -112
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +327 -111
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +5 -5
- package/dist/esm/api/component.api.js +11 -2
- package/dist/esm/constants.d.ts +2 -0
- package/dist/esm/constants.js +1 -1
- package/dist/esm/dnd/overlay.d.ts +6 -4
- package/dist/esm/dnd/overlay.js +108 -28
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +4 -2
- package/dist/esm/dockview/dockviewComponent.d.ts +24 -17
- package/dist/esm/dockview/dockviewComponent.js +101 -48
- package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +3 -12
- package/dist/esm/dockview/options.d.ts +10 -6
- package/dist/esm/dockview/options.js +1 -0
- package/dist/esm/dom.d.ts +1 -0
- package/dist/esm/dom.js +3 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +3 -0
- package/dist/esm/gridview/baseComponentGridview.js +6 -2
- package/dist/esm/gridview/branchNode.d.ts +7 -3
- package/dist/esm/gridview/branchNode.js +19 -7
- package/dist/esm/gridview/gridview.d.ts +7 -1
- package/dist/esm/gridview/gridview.js +27 -8
- package/dist/esm/gridview/gridviewPanel.d.ts +1 -0
- package/dist/esm/gridview/gridviewPanel.js +3 -0
- package/dist/esm/math.js +5 -1
- package/dist/esm/splitview/splitview.d.ts +13 -0
- package/dist/esm/splitview/splitview.js +38 -12
- package/dist/esm/types.d.ts +23 -0
- package/dist/styles/dockview.css +0 -13
- 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';
|
|
@@ -330,6 +330,7 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
330
330
|
* Total number of panels.
|
|
331
331
|
*/
|
|
332
332
|
get totalPanels(): number;
|
|
333
|
+
get gap(): number;
|
|
333
334
|
/**
|
|
334
335
|
* Invoked when the active group changes. May be undefined if no group is active.
|
|
335
336
|
*/
|
|
@@ -354,6 +355,7 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
354
355
|
* Invoked when a panel is removed. May be called multiple times when moving panels.
|
|
355
356
|
*/
|
|
356
357
|
get onDidRemovePanel(): Event<IDockviewPanel>;
|
|
358
|
+
get onDidMovePanel(): Event<MovePanelEvent>;
|
|
357
359
|
/**
|
|
358
360
|
* Invoked after a layout is deserialzied using the `fromJSON` method.
|
|
359
361
|
*/
|
|
@@ -450,10 +452,7 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
450
452
|
/**
|
|
451
453
|
* Add a floating group
|
|
452
454
|
*/
|
|
453
|
-
addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel,
|
|
454
|
-
x: number;
|
|
455
|
-
y: number;
|
|
456
|
-
}): void;
|
|
455
|
+
addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel, options?: FloatingGroupOptions): void;
|
|
457
456
|
/**
|
|
458
457
|
* Create a component from a serialized object.
|
|
459
458
|
*/
|
|
@@ -493,4 +492,5 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
493
492
|
window: Window;
|
|
494
493
|
}) => void;
|
|
495
494
|
}): Promise<void>;
|
|
495
|
+
setGap(gap: number | undefined): void;
|
|
496
496
|
}
|
|
@@ -452,6 +452,9 @@ export class DockviewApi {
|
|
|
452
452
|
get totalPanels() {
|
|
453
453
|
return this.component.totalPanels;
|
|
454
454
|
}
|
|
455
|
+
get gap() {
|
|
456
|
+
return this.component.gap;
|
|
457
|
+
}
|
|
455
458
|
/**
|
|
456
459
|
* Invoked when the active group changes. May be undefined if no group is active.
|
|
457
460
|
*/
|
|
@@ -488,6 +491,9 @@ export class DockviewApi {
|
|
|
488
491
|
get onDidRemovePanel() {
|
|
489
492
|
return this.component.onDidRemovePanel;
|
|
490
493
|
}
|
|
494
|
+
get onDidMovePanel() {
|
|
495
|
+
return this.component.onDidMovePanel;
|
|
496
|
+
}
|
|
491
497
|
/**
|
|
492
498
|
* Invoked after a layout is deserialzied using the `fromJSON` method.
|
|
493
499
|
*/
|
|
@@ -628,8 +634,8 @@ export class DockviewApi {
|
|
|
628
634
|
/**
|
|
629
635
|
* Add a floating group
|
|
630
636
|
*/
|
|
631
|
-
addFloatingGroup(item,
|
|
632
|
-
return this.component.addFloatingGroup(item,
|
|
637
|
+
addFloatingGroup(item, options) {
|
|
638
|
+
return this.component.addFloatingGroup(item, options);
|
|
633
639
|
}
|
|
634
640
|
/**
|
|
635
641
|
* Create a component from a serialized object.
|
|
@@ -679,4 +685,7 @@ export class DockviewApi {
|
|
|
679
685
|
addPopoutGroup(item, options) {
|
|
680
686
|
return this.component.addPopoutGroup(item, options);
|
|
681
687
|
}
|
|
688
|
+
setGap(gap) {
|
|
689
|
+
this.component.updateOptions({ gap });
|
|
690
|
+
}
|
|
682
691
|
}
|
package/dist/esm/constants.d.ts
CHANGED
package/dist/esm/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
|
|
2
|
-
export const DEFAULT_FLOATING_GROUP_POSITION = { left: 100, top: 100 };
|
|
2
|
+
export const 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 {
|
|
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:
|
|
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<
|
|
22
|
-
toJSON():
|
|
23
|
+
setBounds(bounds?: Partial<AnchoredBox>): void;
|
|
24
|
+
toJSON(): AnchoredBox;
|
|
23
25
|
setupDrag(dragTarget: HTMLElement, options?: {
|
|
24
26
|
inDragMode: boolean;
|
|
25
27
|
}): void;
|
package/dist/esm/dnd/overlay.js
CHANGED
|
@@ -41,12 +41,7 @@ export class Overlay extends CompositeDisposable {
|
|
|
41
41
|
this._element.appendChild(this.options.content);
|
|
42
42
|
this.options.container.appendChild(this._element);
|
|
43
43
|
// if input bad resize within acceptable boundaries
|
|
44
|
-
this.setBounds({
|
|
45
|
-
height: this.options.height,
|
|
46
|
-
width: this.options.width,
|
|
47
|
-
top: this.options.top,
|
|
48
|
-
left: this.options.left,
|
|
49
|
-
});
|
|
44
|
+
this.setBounds(Object.assign(Object.assign(Object.assign(Object.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 })));
|
|
50
45
|
}
|
|
51
46
|
setBounds(bounds = {}) {
|
|
52
47
|
if (typeof bounds.height === 'number') {
|
|
@@ -55,11 +50,25 @@ export class Overlay extends CompositeDisposable {
|
|
|
55
50
|
if (typeof bounds.width === 'number') {
|
|
56
51
|
this._element.style.width = `${bounds.width}px`;
|
|
57
52
|
}
|
|
58
|
-
if (typeof bounds.top === 'number') {
|
|
53
|
+
if ('top' in bounds && typeof bounds.top === 'number') {
|
|
59
54
|
this._element.style.top = `${bounds.top}px`;
|
|
55
|
+
this._element.style.bottom = 'auto';
|
|
56
|
+
this.verticalAlignment = 'top';
|
|
60
57
|
}
|
|
61
|
-
if (typeof bounds.
|
|
58
|
+
if ('bottom' in bounds && typeof bounds.bottom === 'number') {
|
|
59
|
+
this._element.style.bottom = `${bounds.bottom}px`;
|
|
60
|
+
this._element.style.top = 'auto';
|
|
61
|
+
this.verticalAlignment = 'bottom';
|
|
62
|
+
}
|
|
63
|
+
if ('left' in bounds && typeof bounds.left === 'number') {
|
|
62
64
|
this._element.style.left = `${bounds.left}px`;
|
|
65
|
+
this._element.style.right = 'auto';
|
|
66
|
+
this.horiziontalAlignment = 'left';
|
|
67
|
+
}
|
|
68
|
+
if ('right' in bounds && typeof bounds.right === 'number') {
|
|
69
|
+
this._element.style.right = `${bounds.right}px`;
|
|
70
|
+
this._element.style.left = 'auto';
|
|
71
|
+
this.horiziontalAlignment = 'right';
|
|
63
72
|
}
|
|
64
73
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
65
74
|
const overlayRect = this._element.getBoundingClientRect();
|
|
@@ -67,24 +76,54 @@ export class Overlay extends CompositeDisposable {
|
|
|
67
76
|
// a minimum width of minimumViewportWidth must be inside the viewport
|
|
68
77
|
const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
|
|
69
78
|
// a minimum height of minimumViewportHeight must be inside the viewport
|
|
70
|
-
const yOffset =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
this.
|
|
79
|
+
const yOffset = Math.max(0, this.getMinimumHeight(overlayRect.height));
|
|
80
|
+
if (this.verticalAlignment === 'top') {
|
|
81
|
+
const top = clamp(overlayRect.top - containerRect.top, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
82
|
+
this._element.style.top = `${top}px`;
|
|
83
|
+
this._element.style.bottom = 'auto';
|
|
84
|
+
}
|
|
85
|
+
if (this.verticalAlignment === 'bottom') {
|
|
86
|
+
const bottom = clamp(containerRect.bottom - overlayRect.bottom, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
87
|
+
this._element.style.bottom = `${bottom}px`;
|
|
88
|
+
this._element.style.top = 'auto';
|
|
89
|
+
}
|
|
90
|
+
if (this.horiziontalAlignment === 'left') {
|
|
91
|
+
const left = clamp(overlayRect.left - containerRect.left, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
92
|
+
this._element.style.left = `${left}px`;
|
|
93
|
+
this._element.style.right = 'auto';
|
|
94
|
+
}
|
|
95
|
+
if (this.horiziontalAlignment === 'right') {
|
|
96
|
+
const right = clamp(containerRect.right - overlayRect.right, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
97
|
+
this._element.style.right = `${right}px`;
|
|
98
|
+
this._element.style.left = 'auto';
|
|
99
|
+
}
|
|
77
100
|
this._onDidChange.fire();
|
|
78
101
|
}
|
|
79
102
|
toJSON() {
|
|
80
103
|
const container = this.options.container.getBoundingClientRect();
|
|
81
104
|
const element = this._element.getBoundingClientRect();
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
105
|
+
const result = {};
|
|
106
|
+
if (this.verticalAlignment === 'top') {
|
|
107
|
+
result.top = parseFloat(this._element.style.top);
|
|
108
|
+
}
|
|
109
|
+
else if (this.verticalAlignment === 'bottom') {
|
|
110
|
+
result.bottom = parseFloat(this._element.style.bottom);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
result.top = element.top - container.top;
|
|
114
|
+
}
|
|
115
|
+
if (this.horiziontalAlignment === 'left') {
|
|
116
|
+
result.left = parseFloat(this._element.style.left);
|
|
117
|
+
}
|
|
118
|
+
else if (this.horiziontalAlignment === 'right') {
|
|
119
|
+
result.right = parseFloat(this._element.style.right);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
result.left = element.left - container.left;
|
|
123
|
+
}
|
|
124
|
+
result.width = element.width;
|
|
125
|
+
result.height = element.height;
|
|
126
|
+
return result;
|
|
88
127
|
}
|
|
89
128
|
setupDrag(dragTarget, options = { inDragMode: false }) {
|
|
90
129
|
const move = new MutableDisposable();
|
|
@@ -116,12 +155,30 @@ export class Overlay extends CompositeDisposable {
|
|
|
116
155
|
};
|
|
117
156
|
}
|
|
118
157
|
const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
|
|
119
|
-
const yOffset = Math.max(0, this.
|
|
120
|
-
? this.getMinimumHeight(overlayRect.height)
|
|
121
|
-
: 0);
|
|
122
|
-
const left = clamp(x - offset.x, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
158
|
+
const yOffset = Math.max(0, this.getMinimumHeight(overlayRect.height));
|
|
123
159
|
const top = clamp(y - offset.y, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
124
|
-
|
|
160
|
+
const bottom = clamp(offset.y -
|
|
161
|
+
y +
|
|
162
|
+
containerRect.height -
|
|
163
|
+
overlayRect.height, -yOffset, Math.max(0, containerRect.height - overlayRect.height + yOffset));
|
|
164
|
+
const left = clamp(x - offset.x, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
165
|
+
const right = clamp(offset.x - x + containerRect.width - overlayRect.width, -xOffset, Math.max(0, containerRect.width - overlayRect.width + xOffset));
|
|
166
|
+
const bounds = {};
|
|
167
|
+
// Anchor to top or to bottom depending on which one is closer
|
|
168
|
+
if (top <= bottom) {
|
|
169
|
+
bounds.top = top;
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
bounds.bottom = bottom;
|
|
173
|
+
}
|
|
174
|
+
// Anchor to left or to right depending on which one is closer
|
|
175
|
+
if (left <= right) {
|
|
176
|
+
bounds.left = left;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
bounds.right = right;
|
|
180
|
+
}
|
|
181
|
+
this.setBounds(bounds);
|
|
125
182
|
}), addDisposableWindowListener(window, 'mouseup', () => {
|
|
126
183
|
toggleClass(this._element, 'dv-resize-container-dragging', false);
|
|
127
184
|
move.dispose();
|
|
@@ -189,8 +246,10 @@ export class Overlay extends CompositeDisposable {
|
|
|
189
246
|
};
|
|
190
247
|
}
|
|
191
248
|
let top = undefined;
|
|
249
|
+
let bottom = undefined;
|
|
192
250
|
let height = undefined;
|
|
193
251
|
let left = undefined;
|
|
252
|
+
let right = undefined;
|
|
194
253
|
let width = undefined;
|
|
195
254
|
const moveTop = () => {
|
|
196
255
|
top = clamp(y, -Number.MAX_VALUE, startPosition.originalY +
|
|
@@ -204,6 +263,7 @@ export class Overlay extends CompositeDisposable {
|
|
|
204
263
|
startPosition.originalY +
|
|
205
264
|
startPosition.originalHeight -
|
|
206
265
|
top;
|
|
266
|
+
bottom = containerRect.height - top - height;
|
|
207
267
|
};
|
|
208
268
|
const moveBottom = () => {
|
|
209
269
|
top =
|
|
@@ -215,6 +275,7 @@ export class Overlay extends CompositeDisposable {
|
|
|
215
275
|
? -top +
|
|
216
276
|
this.options.minimumInViewportHeight
|
|
217
277
|
: Overlay.MINIMUM_HEIGHT, Number.MAX_VALUE);
|
|
278
|
+
bottom = containerRect.height - top - height;
|
|
218
279
|
};
|
|
219
280
|
const moveLeft = () => {
|
|
220
281
|
left = clamp(x, -Number.MAX_VALUE, startPosition.originalX +
|
|
@@ -228,6 +289,7 @@ export class Overlay extends CompositeDisposable {
|
|
|
228
289
|
startPosition.originalX +
|
|
229
290
|
startPosition.originalWidth -
|
|
230
291
|
left;
|
|
292
|
+
right = containerRect.width - left - width;
|
|
231
293
|
};
|
|
232
294
|
const moveRight = () => {
|
|
233
295
|
left =
|
|
@@ -239,6 +301,7 @@ export class Overlay extends CompositeDisposable {
|
|
|
239
301
|
? -left +
|
|
240
302
|
this.options.minimumInViewportWidth
|
|
241
303
|
: Overlay.MINIMUM_WIDTH, Number.MAX_VALUE);
|
|
304
|
+
right = containerRect.width - left - width;
|
|
242
305
|
};
|
|
243
306
|
switch (direction) {
|
|
244
307
|
case 'top':
|
|
@@ -270,7 +333,24 @@ export class Overlay extends CompositeDisposable {
|
|
|
270
333
|
moveRight();
|
|
271
334
|
break;
|
|
272
335
|
}
|
|
273
|
-
|
|
336
|
+
const bounds = {};
|
|
337
|
+
// Anchor to top or to bottom depending on which one is closer
|
|
338
|
+
if (top <= bottom) {
|
|
339
|
+
bounds.top = top;
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
bounds.bottom = bottom;
|
|
343
|
+
}
|
|
344
|
+
// Anchor to left or to right depending on which one is closer
|
|
345
|
+
if (left <= right) {
|
|
346
|
+
bounds.left = left;
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
bounds.right = right;
|
|
350
|
+
}
|
|
351
|
+
bounds.height = height;
|
|
352
|
+
bounds.width = width;
|
|
353
|
+
this.setBounds(bounds);
|
|
274
354
|
}), {
|
|
275
355
|
dispose: () => {
|
|
276
356
|
for (const iframe of iframes) {
|
|
@@ -293,7 +373,7 @@ export class Overlay extends CompositeDisposable {
|
|
|
293
373
|
if (typeof this.options.minimumInViewportHeight === 'number') {
|
|
294
374
|
return height - this.options.minimumInViewportHeight;
|
|
295
375
|
}
|
|
296
|
-
return
|
|
376
|
+
return 0;
|
|
297
377
|
}
|
|
298
378
|
dispose() {
|
|
299
379
|
this._element.remove();
|
|
@@ -145,7 +145,8 @@ export class TabsContainer extends CompositeDisposable {
|
|
|
145
145
|
this.accessor.addFloatingGroup(this.group, {
|
|
146
146
|
x: left - rootLeft + 20,
|
|
147
147
|
y: top - rootTop + 20,
|
|
148
|
-
|
|
148
|
+
inDragMode: true,
|
|
149
|
+
});
|
|
149
150
|
}
|
|
150
151
|
}), addDisposableListener(this.tabContainer, 'mousedown', (event) => {
|
|
151
152
|
if (event.defaultPrevented) {
|
|
@@ -214,7 +215,8 @@ export class TabsContainer extends CompositeDisposable {
|
|
|
214
215
|
this.accessor.addFloatingGroup(panel, {
|
|
215
216
|
x: left - rootLeft,
|
|
216
217
|
y: top - rootTop,
|
|
217
|
-
|
|
218
|
+
inDragMode: true,
|
|
219
|
+
});
|
|
218
220
|
return;
|
|
219
221
|
}
|
|
220
222
|
const 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, AnchorPosition, 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:
|
|
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,11 +66,24 @@ 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?: AnchorPosition;
|
|
75
|
+
}
|
|
76
|
+
export interface FloatingGroupOptionsInternal extends FloatingGroupOptions {
|
|
77
|
+
skipRemoveGroup?: boolean;
|
|
78
|
+
inDragMode?: boolean;
|
|
79
|
+
skipActiveGroup?: boolean;
|
|
80
|
+
}
|
|
65
81
|
export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
|
|
66
82
|
readonly activePanel: IDockviewPanel | undefined;
|
|
67
83
|
readonly totalPanels: number;
|
|
68
84
|
readonly panels: IDockviewPanel[];
|
|
69
85
|
readonly orientation: Orientation;
|
|
86
|
+
readonly gap: number;
|
|
70
87
|
readonly onDidDrop: Event<DockviewDidDropEvent>;
|
|
71
88
|
readonly onWillDrop: Event<DockviewWillDropEvent>;
|
|
72
89
|
readonly onWillShowOverlay: Event<WillShowOverlayLocationEvent>;
|
|
@@ -80,6 +97,7 @@ export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
|
|
|
80
97
|
readonly onDidAddGroup: Event<DockviewGroupPanel>;
|
|
81
98
|
readonly onDidActiveGroupChange: Event<DockviewGroupPanel | undefined>;
|
|
82
99
|
readonly onUnhandledDragOverEvent: Event<DockviewDndOverlayEvent>;
|
|
100
|
+
readonly onDidMovePanel: Event<MovePanelEvent>;
|
|
83
101
|
readonly options: DockviewComponentOptions;
|
|
84
102
|
updateOptions(options: DockviewOptions): void;
|
|
85
103
|
moveGroupOrPanel(options: MoveGroupOrPanelOptions): void;
|
|
@@ -98,10 +116,7 @@ export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
|
|
|
98
116
|
focus(): void;
|
|
99
117
|
toJSON(): SerializedDockview;
|
|
100
118
|
fromJSON(data: SerializedDockview): void;
|
|
101
|
-
addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel,
|
|
102
|
-
x: number;
|
|
103
|
-
y: number;
|
|
104
|
-
}): void;
|
|
119
|
+
addFloatingGroup(item: IDockviewPanel | DockviewGroupPanel, options?: FloatingGroupOptions): void;
|
|
105
120
|
addPopoutGroup(item: IDockviewPanel | DockviewGroupPanel, options?: {
|
|
106
121
|
position?: Box;
|
|
107
122
|
popoutUrl?: string;
|
|
@@ -143,10 +158,10 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
143
158
|
private readonly _onDidActivePanelChange;
|
|
144
159
|
readonly onDidActivePanelChange: Event<IDockviewPanel | undefined>;
|
|
145
160
|
private readonly _onDidMovePanel;
|
|
161
|
+
readonly onDidMovePanel: Event<MovePanelEvent>;
|
|
146
162
|
private readonly _floatingGroups;
|
|
147
163
|
private readonly _popoutGroups;
|
|
148
164
|
private readonly _rootDropTarget;
|
|
149
|
-
private _ignoreEvents;
|
|
150
165
|
private readonly _onDidRemoveGroup;
|
|
151
166
|
readonly onDidRemoveGroup: Event<DockviewGroupPanel>;
|
|
152
167
|
protected readonly _onDidAddGroup: Emitter<DockviewGroupPanel>;
|
|
@@ -160,6 +175,7 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
160
175
|
get activePanel(): IDockviewPanel | undefined;
|
|
161
176
|
get renderer(): DockviewPanelRenderer;
|
|
162
177
|
get api(): DockviewApi;
|
|
178
|
+
get gap(): number;
|
|
163
179
|
constructor(options: DockviewComponentOptions);
|
|
164
180
|
addPopoutGroup(itemToPopout: DockviewPanel | DockviewGroupPanel, options?: {
|
|
165
181
|
skipRemoveGroup?: boolean;
|
|
@@ -175,16 +191,7 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
175
191
|
}) => void;
|
|
176
192
|
overridePopoutGroup?: DockviewGroupPanel;
|
|
177
193
|
}): Promise<void>;
|
|
178
|
-
addFloatingGroup(item: DockviewPanel | DockviewGroupPanel,
|
|
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;
|
|
194
|
+
addFloatingGroup(item: DockviewPanel | DockviewGroupPanel, options?: FloatingGroupOptionsInternal): void;
|
|
188
195
|
private orthogonalize;
|
|
189
196
|
updateOptions(options: Partial<DockviewComponentOptions>): void;
|
|
190
197
|
layout(width: number, height: number, forceResize?: boolean | undefined): void;
|