dockview-core 1.15.3 → 1.16.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.
- package/dist/cjs/api/component.api.d.ts +30 -6
- package/dist/cjs/api/component.api.js +42 -6
- package/dist/cjs/api/dockviewPanelApi.d.ts +1 -1
- package/dist/cjs/api/entryPoints.d.ts +9 -0
- package/dist/cjs/api/entryPoints.js +28 -0
- package/dist/cjs/dnd/abstractDragHandler.js +2 -65
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +4 -2
- package/dist/cjs/dockview/dockviewComponent.js +59 -17
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +1 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +1 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +1 -1
- package/dist/cjs/dockview/dockviewPanel.d.ts +1 -1
- package/dist/cjs/dockview/dockviewPanel.js +1 -1
- package/dist/cjs/dockview/options.d.ts +2 -2
- package/dist/cjs/dockview/options.js +1 -0
- package/dist/cjs/dockview/types.d.ts +1 -1
- package/dist/cjs/dom.d.ts +3 -0
- package/dist/cjs/dom.js +66 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +3 -2
- package/dist/cjs/gridview/baseComponentGridview.js +3 -0
- package/dist/cjs/gridview/gridviewComponent.d.ts +1 -1
- package/dist/cjs/gridview/gridviewComponent.js +3 -2
- package/dist/cjs/gridview/options.d.ts +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/{dnd → overlay}/overlay.d.ts +3 -0
- package/dist/cjs/{dnd → overlay}/overlay.js +41 -82
- package/dist/cjs/{overlayRenderContainer.d.ts → overlay/overlayRenderContainer.d.ts} +7 -5
- package/dist/cjs/{overlayRenderContainer.js → overlay/overlayRenderContainer.js} +41 -6
- package/dist/cjs/paneview/options.d.ts +1 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +1 -1
- package/dist/cjs/paneview/paneviewComponent.js +5 -2
- package/dist/cjs/splitview/options.d.ts +1 -1
- package/dist/cjs/splitview/splitview.js +64 -71
- package/dist/cjs/splitview/splitviewComponent.d.ts +1 -1
- package/dist/cjs/splitview/splitviewComponent.js +5 -2
- package/dist/dockview-core.amd.js +258 -98
- 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 +257 -97
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +258 -98
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +255 -99
- 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 +258 -98
- 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 +257 -97
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +30 -6
- package/dist/esm/api/component.api.js +42 -6
- package/dist/esm/api/dockviewPanelApi.d.ts +1 -1
- package/dist/esm/api/entryPoints.d.ts +9 -0
- package/dist/esm/api/entryPoints.js +21 -0
- package/dist/esm/dnd/abstractDragHandler.js +3 -11
- package/dist/esm/dockview/components/panel/content.js +1 -1
- package/dist/esm/dockview/components/titlebar/voidContainer.js +1 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +4 -2
- package/dist/esm/dockview/dockviewComponent.js +47 -13
- package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +1 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +1 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.js +1 -1
- package/dist/esm/dockview/dockviewPanel.d.ts +1 -1
- package/dist/esm/dockview/dockviewPanel.js +1 -1
- package/dist/esm/dockview/options.d.ts +2 -2
- package/dist/esm/dockview/options.js +1 -0
- package/dist/esm/dockview/types.d.ts +1 -1
- package/dist/esm/dom.d.ts +3 -0
- package/dist/esm/dom.js +20 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +3 -2
- package/dist/esm/gridview/baseComponentGridview.js +3 -0
- package/dist/esm/gridview/gridviewComponent.d.ts +1 -1
- package/dist/esm/gridview/gridviewComponent.js +3 -2
- package/dist/esm/gridview/options.d.ts +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/{dnd → overlay}/overlay.d.ts +3 -0
- package/dist/esm/{dnd → overlay}/overlay.js +36 -32
- package/dist/esm/{overlayRenderContainer.d.ts → overlay/overlayRenderContainer.d.ts} +7 -5
- package/dist/esm/{overlayRenderContainer.js → overlay/overlayRenderContainer.js} +39 -6
- package/dist/esm/paneview/options.d.ts +1 -1
- package/dist/esm/paneview/paneviewComponent.d.ts +1 -1
- package/dist/esm/paneview/paneviewComponent.js +5 -2
- package/dist/esm/splitview/options.d.ts +1 -1
- package/dist/esm/splitview/splitview.js +37 -27
- package/dist/esm/splitview/splitviewComponent.d.ts +1 -1
- package/dist/esm/splitview/splitviewComponent.js +5 -2
- package/dist/styles/dockview.css +78 -82
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Event } from '../events';
|
|
2
2
|
import { CompositeDisposable } from '../lifecycle';
|
|
3
3
|
import { AnchoredBox } from '../types';
|
|
4
|
+
export declare const DEFAULT_OVERLAY_Z_INDEX = 999;
|
|
4
5
|
export declare class Overlay extends CompositeDisposable {
|
|
5
6
|
private readonly options;
|
|
6
7
|
private _element;
|
|
@@ -14,12 +15,14 @@ export declare class Overlay extends CompositeDisposable {
|
|
|
14
15
|
private horiziontalAlignment;
|
|
15
16
|
set minimumInViewportWidth(value: number | undefined);
|
|
16
17
|
set minimumInViewportHeight(value: number | undefined);
|
|
18
|
+
get element(): HTMLElement;
|
|
17
19
|
constructor(options: AnchoredBox & {
|
|
18
20
|
container: HTMLElement;
|
|
19
21
|
content: HTMLElement;
|
|
20
22
|
minimumInViewportWidth?: number;
|
|
21
23
|
minimumInViewportHeight?: number;
|
|
22
24
|
});
|
|
25
|
+
bringToFront(): void;
|
|
23
26
|
setBounds(bounds?: Partial<AnchoredBox>): void;
|
|
24
27
|
toJSON(): AnchoredBox;
|
|
25
28
|
setupDrag(dragTarget: HTMLElement, options?: {
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { disableIframePointEvents, quasiDefaultPrevented, toggleClass, } from '../dom';
|
|
2
2
|
import { Emitter, addDisposableListener, addDisposableWindowListener, } from '../events';
|
|
3
3
|
import { CompositeDisposable, MutableDisposable } from '../lifecycle';
|
|
4
4
|
import { clamp } from '../math';
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export const DEFAULT_OVERLAY_Z_INDEX = 999;
|
|
6
|
+
class AriaLevelTracker {
|
|
7
|
+
constructor() {
|
|
8
|
+
this._orderedList = [];
|
|
9
|
+
}
|
|
10
|
+
push(element) {
|
|
11
|
+
this._orderedList = [
|
|
12
|
+
...this._orderedList.filter((item) => item !== element),
|
|
13
|
+
element,
|
|
14
|
+
];
|
|
15
|
+
this.update();
|
|
16
|
+
}
|
|
17
|
+
destroy(element) {
|
|
18
|
+
this._orderedList = this._orderedList.filter((item) => item !== element);
|
|
19
|
+
this.update();
|
|
20
|
+
}
|
|
21
|
+
update() {
|
|
22
|
+
for (let i = 0; i < this._orderedList.length; i++) {
|
|
23
|
+
this._orderedList[i].setAttribute('aria-level', `${i}`);
|
|
24
|
+
this._orderedList[i].style.zIndex = `${DEFAULT_OVERLAY_Z_INDEX + i * 2}`;
|
|
10
25
|
}
|
|
11
|
-
toggleClass(element, 'dv-bring-to-front', true);
|
|
12
|
-
previous = element;
|
|
13
26
|
}
|
|
14
|
-
|
|
15
|
-
|
|
27
|
+
}
|
|
28
|
+
const arialLevelTracker = new AriaLevelTracker();
|
|
16
29
|
export class Overlay extends CompositeDisposable {
|
|
17
30
|
set minimumInViewportWidth(value) {
|
|
18
31
|
this.options.minimumInViewportWidth = value;
|
|
@@ -20,6 +33,9 @@ export class Overlay extends CompositeDisposable {
|
|
|
20
33
|
set minimumInViewportHeight(value) {
|
|
21
34
|
this.options.minimumInViewportHeight = value;
|
|
22
35
|
}
|
|
36
|
+
get element() {
|
|
37
|
+
return this._element;
|
|
38
|
+
}
|
|
23
39
|
constructor(options) {
|
|
24
40
|
super();
|
|
25
41
|
this.options = options;
|
|
@@ -42,6 +58,10 @@ export class Overlay extends CompositeDisposable {
|
|
|
42
58
|
this.options.container.appendChild(this._element);
|
|
43
59
|
// if input bad resize within acceptable boundaries
|
|
44
60
|
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 })));
|
|
61
|
+
arialLevelTracker.push(this._element);
|
|
62
|
+
}
|
|
63
|
+
bringToFront() {
|
|
64
|
+
arialLevelTracker.push(this._element);
|
|
45
65
|
}
|
|
46
66
|
setBounds(bounds = {}) {
|
|
47
67
|
if (typeof bounds.height === 'number') {
|
|
@@ -129,18 +149,10 @@ export class Overlay extends CompositeDisposable {
|
|
|
129
149
|
const move = new MutableDisposable();
|
|
130
150
|
const track = () => {
|
|
131
151
|
let offset = null;
|
|
132
|
-
const iframes =
|
|
133
|
-
...getElementsByTagName('iframe'),
|
|
134
|
-
...getElementsByTagName('webview'),
|
|
135
|
-
];
|
|
136
|
-
for (const iframe of iframes) {
|
|
137
|
-
iframe.style.pointerEvents = 'none';
|
|
138
|
-
}
|
|
152
|
+
const iframes = disableIframePointEvents();
|
|
139
153
|
move.value = new CompositeDisposable({
|
|
140
154
|
dispose: () => {
|
|
141
|
-
|
|
142
|
-
iframe.style.pointerEvents = 'auto';
|
|
143
|
-
}
|
|
155
|
+
iframes.release();
|
|
144
156
|
},
|
|
145
157
|
}, addDisposableWindowListener(window, 'mousemove', (e) => {
|
|
146
158
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
@@ -209,9 +221,8 @@ export class Overlay extends CompositeDisposable {
|
|
|
209
221
|
track();
|
|
210
222
|
}
|
|
211
223
|
}), addDisposableListener(this.options.content, 'mousedown', () => {
|
|
212
|
-
|
|
224
|
+
arialLevelTracker.push(this._element);
|
|
213
225
|
}, true));
|
|
214
|
-
bringElementToFront(this._element);
|
|
215
226
|
if (options.inDragMode) {
|
|
216
227
|
track();
|
|
217
228
|
}
|
|
@@ -224,13 +235,7 @@ export class Overlay extends CompositeDisposable {
|
|
|
224
235
|
this.addDisposables(move, addDisposableListener(resizeHandleElement, 'mousedown', (e) => {
|
|
225
236
|
e.preventDefault();
|
|
226
237
|
let startPosition = null;
|
|
227
|
-
const iframes =
|
|
228
|
-
...getElementsByTagName('iframe'),
|
|
229
|
-
...getElementsByTagName('webview'),
|
|
230
|
-
];
|
|
231
|
-
for (const iframe of iframes) {
|
|
232
|
-
iframe.style.pointerEvents = 'none';
|
|
233
|
-
}
|
|
238
|
+
const iframes = disableIframePointEvents();
|
|
234
239
|
move.value = new CompositeDisposable(addDisposableWindowListener(window, 'mousemove', (e) => {
|
|
235
240
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
236
241
|
const overlayRect = this._element.getBoundingClientRect();
|
|
@@ -353,9 +358,7 @@ export class Overlay extends CompositeDisposable {
|
|
|
353
358
|
this.setBounds(bounds);
|
|
354
359
|
}), {
|
|
355
360
|
dispose: () => {
|
|
356
|
-
|
|
357
|
-
iframe.style.pointerEvents = 'auto';
|
|
358
|
-
}
|
|
361
|
+
iframes.release();
|
|
359
362
|
},
|
|
360
363
|
}, addDisposableWindowListener(window, 'mouseup', () => {
|
|
361
364
|
move.dispose();
|
|
@@ -376,6 +379,7 @@ export class Overlay extends CompositeDisposable {
|
|
|
376
379
|
return 0;
|
|
377
380
|
}
|
|
378
381
|
dispose() {
|
|
382
|
+
arialLevelTracker.destroy(this._element);
|
|
379
383
|
this._element.remove();
|
|
380
384
|
super.dispose();
|
|
381
385
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { Droptarget } from '
|
|
2
|
-
import { CompositeDisposable } from '
|
|
3
|
-
import { IDockviewPanel } from '
|
|
1
|
+
import { Droptarget } from '../dnd/droptarget';
|
|
2
|
+
import { CompositeDisposable } from '../lifecycle';
|
|
3
|
+
import { IDockviewPanel } from '../dockview/dockviewPanel';
|
|
4
|
+
import { DockviewComponent } from '../dockview/dockviewComponent';
|
|
4
5
|
export type DockviewPanelRenderer = 'onlyWhenVisible' | 'always';
|
|
5
6
|
export interface IRenderable {
|
|
6
7
|
readonly element: HTMLElement;
|
|
7
8
|
readonly dropTarget: Droptarget;
|
|
8
9
|
}
|
|
9
10
|
export declare class OverlayRenderContainer extends CompositeDisposable {
|
|
10
|
-
|
|
11
|
+
readonly element: HTMLElement;
|
|
12
|
+
readonly accessor: DockviewComponent;
|
|
11
13
|
private readonly map;
|
|
12
14
|
private _disposed;
|
|
13
|
-
constructor(element: HTMLElement);
|
|
15
|
+
constructor(element: HTMLElement, accessor: DockviewComponent);
|
|
14
16
|
detatch(panel: IDockviewPanel): boolean;
|
|
15
17
|
attach(options: {
|
|
16
18
|
panel: IDockviewPanel;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { DragAndDropObserver } from '
|
|
2
|
-
import { getDomNodePagePosition, toggleClass } from '
|
|
3
|
-
import { CompositeDisposable, Disposable } from '
|
|
1
|
+
import { DragAndDropObserver } from '../dnd/dnd';
|
|
2
|
+
import { getDomNodePagePosition, toggleClass } from '../dom';
|
|
3
|
+
import { CompositeDisposable, Disposable, MutableDisposable, } from '../lifecycle';
|
|
4
|
+
import { DEFAULT_OVERLAY_Z_INDEX } from './overlay';
|
|
4
5
|
function createFocusableElement() {
|
|
5
6
|
const element = document.createElement('div');
|
|
6
7
|
element.tabIndex = -1;
|
|
7
8
|
return element;
|
|
8
9
|
}
|
|
9
10
|
export class OverlayRenderContainer extends CompositeDisposable {
|
|
10
|
-
constructor(element) {
|
|
11
|
+
constructor(element, accessor) {
|
|
11
12
|
super();
|
|
12
13
|
this.element = element;
|
|
14
|
+
this.accessor = accessor;
|
|
13
15
|
this.map = {};
|
|
14
16
|
this._disposed = false;
|
|
15
17
|
this.addDisposables(Disposable.from(() => {
|
|
@@ -65,7 +67,35 @@ export class OverlayRenderContainer extends CompositeDisposable {
|
|
|
65
67
|
}
|
|
66
68
|
focusContainer.style.display = panel.api.isVisible ? '' : 'none';
|
|
67
69
|
};
|
|
68
|
-
const
|
|
70
|
+
const observerDisposable = new MutableDisposable();
|
|
71
|
+
const correctLayerPosition = () => {
|
|
72
|
+
if (panel.api.location.type === 'floating') {
|
|
73
|
+
queueMicrotask(() => {
|
|
74
|
+
const floatingGroup = this.accessor.floatingGroups.find((group) => group.group === panel.api.group);
|
|
75
|
+
if (!floatingGroup) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const element = floatingGroup.overlay.element;
|
|
79
|
+
const update = () => {
|
|
80
|
+
const level = Number(element.getAttribute('aria-level'));
|
|
81
|
+
focusContainer.style.zIndex = `${DEFAULT_OVERLAY_Z_INDEX + level * 2 + 1}`;
|
|
82
|
+
};
|
|
83
|
+
const observer = new MutationObserver(() => {
|
|
84
|
+
update();
|
|
85
|
+
});
|
|
86
|
+
observerDisposable.value = Disposable.from(() => observer.disconnect());
|
|
87
|
+
observer.observe(element, {
|
|
88
|
+
attributeFilter: ['aria-level'],
|
|
89
|
+
attributes: true,
|
|
90
|
+
});
|
|
91
|
+
update();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
focusContainer.style.zIndex = ''; // reset the z-index, perhaps CSS will take over here
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const disposable = new CompositeDisposable(observerDisposable,
|
|
69
99
|
/**
|
|
70
100
|
* since container is positioned absoutely we must explicitly forward
|
|
71
101
|
* the dnd events for the expect behaviours to continue to occur in terms of dnd
|
|
@@ -89,7 +119,7 @@ export class OverlayRenderContainer extends CompositeDisposable {
|
|
|
89
119
|
onDragOver: (e) => {
|
|
90
120
|
referenceContainer.dropTarget.dnd.onDragOver(e);
|
|
91
121
|
},
|
|
92
|
-
}), panel.api.onDidVisibilityChange((
|
|
122
|
+
}), panel.api.onDidVisibilityChange(() => {
|
|
93
123
|
/**
|
|
94
124
|
* Control the visibility of the content, however even when not visible (display: none)
|
|
95
125
|
* the content is still maintained within the DOM hence DOM specific attributes
|
|
@@ -101,6 +131,8 @@ export class OverlayRenderContainer extends CompositeDisposable {
|
|
|
101
131
|
return;
|
|
102
132
|
}
|
|
103
133
|
resize();
|
|
134
|
+
}), panel.api.onDidLocationChange(() => {
|
|
135
|
+
correctLayerPosition();
|
|
104
136
|
}));
|
|
105
137
|
this.map[panel.api.id].destroy = Disposable.from(() => {
|
|
106
138
|
var _a;
|
|
@@ -109,6 +141,7 @@ export class OverlayRenderContainer extends CompositeDisposable {
|
|
|
109
141
|
}
|
|
110
142
|
(_a = focusContainer.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(focusContainer);
|
|
111
143
|
});
|
|
144
|
+
correctLayerPosition();
|
|
112
145
|
queueMicrotask(() => {
|
|
113
146
|
if (this.isDisposed) {
|
|
114
147
|
return;
|
|
@@ -112,7 +112,7 @@ export declare class PaneviewComponent extends Resizable implements IPaneviewCom
|
|
|
112
112
|
get height(): number;
|
|
113
113
|
get width(): number;
|
|
114
114
|
get options(): PaneviewComponentOptions;
|
|
115
|
-
constructor(options: PaneviewComponentOptions);
|
|
115
|
+
constructor(parentElement: HTMLElement, options: PaneviewComponentOptions);
|
|
116
116
|
setVisible(panel: PaneviewPanel, visible: boolean): void;
|
|
117
117
|
focus(): void;
|
|
118
118
|
updateOptions(options: Partial<PaneviewComponentOptions>): void;
|
|
@@ -56,8 +56,8 @@ export class PaneviewComponent extends Resizable {
|
|
|
56
56
|
get options() {
|
|
57
57
|
return this._options;
|
|
58
58
|
}
|
|
59
|
-
constructor(options) {
|
|
60
|
-
super(
|
|
59
|
+
constructor(parentElement, options) {
|
|
60
|
+
super(parentElement, options.disableAutoResizing);
|
|
61
61
|
this._id = nextLayoutId.next();
|
|
62
62
|
this._disposable = new MutableDisposable();
|
|
63
63
|
this._viewDisposables = new Map();
|
|
@@ -71,6 +71,9 @@ export class PaneviewComponent extends Resizable {
|
|
|
71
71
|
this.onDidAddView = this._onDidAddView.event;
|
|
72
72
|
this._onDidRemoveView = new Emitter();
|
|
73
73
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
74
|
+
if (typeof options.className === 'string') {
|
|
75
|
+
this.element.classList.add(options.className);
|
|
76
|
+
}
|
|
74
77
|
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
|
|
75
78
|
this._options = options;
|
|
76
79
|
if (!options.components) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
|
|
3
3
|
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/splitview
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { removeClasses, addClasses, toggleClass,
|
|
5
|
+
import { removeClasses, addClasses, toggleClass, disableIframePointEvents, } from '../dom';
|
|
6
6
|
import { Emitter } from '../events';
|
|
7
7
|
import { pushToStart, pushToEnd, firstIndex } from '../array';
|
|
8
8
|
import { range, clamp } from '../math';
|
|
@@ -359,13 +359,7 @@ export class Splitview {
|
|
|
359
359
|
for (const item of this.viewItems) {
|
|
360
360
|
item.enabled = false;
|
|
361
361
|
}
|
|
362
|
-
const iframes =
|
|
363
|
-
...getElementsByTagName('iframe'),
|
|
364
|
-
...getElementsByTagName('webview'),
|
|
365
|
-
];
|
|
366
|
-
for (const iframe of iframes) {
|
|
367
|
-
iframe.style.pointerEvents = 'none';
|
|
368
|
-
}
|
|
362
|
+
const iframes = disableIframePointEvents();
|
|
369
363
|
const start = this._orientation === Orientation.HORIZONTAL
|
|
370
364
|
? event.clientX
|
|
371
365
|
: event.clientY;
|
|
@@ -427,9 +421,7 @@ export class Splitview {
|
|
|
427
421
|
for (const item of this.viewItems) {
|
|
428
422
|
item.enabled = true;
|
|
429
423
|
}
|
|
430
|
-
|
|
431
|
-
iframe.style.pointerEvents = 'auto';
|
|
432
|
-
}
|
|
424
|
+
iframes.release();
|
|
433
425
|
this.saveProportions();
|
|
434
426
|
document.removeEventListener('pointermove', onPointerMove);
|
|
435
427
|
document.removeEventListener('pointerup', end);
|
|
@@ -596,29 +588,47 @@ export class Splitview {
|
|
|
596
588
|
if (this.viewItems.length === 0) {
|
|
597
589
|
return;
|
|
598
590
|
}
|
|
599
|
-
const
|
|
600
|
-
const
|
|
591
|
+
const visibleViewItems = this.viewItems.filter((i) => i.visible);
|
|
592
|
+
const sashCount = Math.max(0, visibleViewItems.length - 1);
|
|
593
|
+
const marginReducedSize = (this.margin * sashCount) / Math.max(1, visibleViewItems.length);
|
|
601
594
|
let totalLeftOffset = 0;
|
|
602
595
|
const viewLeftOffsets = [];
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
this.sashes[i].container.style.left = `${offset}px`;
|
|
609
|
-
this.sashes[i].container.style.top = `0px`;
|
|
596
|
+
const sashWidth = 4; // hardcoded in css
|
|
597
|
+
const runningVisiblePanelCount = this.viewItems.reduce((arr, viewItem, i) => {
|
|
598
|
+
const flag = viewItem.visible ? 1 : 0;
|
|
599
|
+
if (i === 0) {
|
|
600
|
+
arr.push(flag);
|
|
610
601
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
this.sashes[i].container.style.top = `${offset}px`;
|
|
602
|
+
else {
|
|
603
|
+
arr.push(arr[i - 1] + flag);
|
|
614
604
|
}
|
|
615
|
-
|
|
605
|
+
return arr;
|
|
606
|
+
}, []);
|
|
607
|
+
// calculate both view and cash positions
|
|
616
608
|
this.viewItems.forEach((view, i) => {
|
|
617
|
-
|
|
618
|
-
|
|
609
|
+
totalLeftOffset += this.viewItems[i].size;
|
|
610
|
+
viewLeftOffsets.push(totalLeftOffset);
|
|
611
|
+
const size = view.visible ? view.size - marginReducedSize : 0;
|
|
612
|
+
const visiblePanelsBeforeThisView = Math.max(0, runningVisiblePanelCount[i] - 1);
|
|
613
|
+
const offset = i === 0 || visiblePanelsBeforeThisView === 0
|
|
619
614
|
? 0
|
|
620
615
|
: viewLeftOffsets[i - 1] +
|
|
621
|
-
(
|
|
616
|
+
(visiblePanelsBeforeThisView / sashCount) * marginReducedSize;
|
|
617
|
+
if (i < this.viewItems.length - 1) {
|
|
618
|
+
// calculate sash position
|
|
619
|
+
const newSize = view.visible
|
|
620
|
+
? offset + size - sashWidth / 2 + this.margin / 2
|
|
621
|
+
: offset;
|
|
622
|
+
if (this._orientation === Orientation.HORIZONTAL) {
|
|
623
|
+
this.sashes[i].container.style.left = `${newSize}px`;
|
|
624
|
+
this.sashes[i].container.style.top = `0px`;
|
|
625
|
+
}
|
|
626
|
+
if (this._orientation === Orientation.VERTICAL) {
|
|
627
|
+
this.sashes[i].container.style.left = `0px`;
|
|
628
|
+
this.sashes[i].container.style.top = `${newSize}px`;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
// calculate view position
|
|
622
632
|
if (this._orientation === Orientation.HORIZONTAL) {
|
|
623
633
|
view.container.style.width = `${size}px`;
|
|
624
634
|
view.container.style.left = `${offset}px`;
|
|
@@ -83,7 +83,7 @@ export declare class SplitviewComponent extends Resizable implements ISplitviewC
|
|
|
83
83
|
get maximumSize(): number;
|
|
84
84
|
get height(): number;
|
|
85
85
|
get width(): number;
|
|
86
|
-
constructor(options: SplitviewComponentOptions);
|
|
86
|
+
constructor(parentElement: HTMLElement, options: SplitviewComponentOptions);
|
|
87
87
|
updateOptions(options: Partial<SplitviewComponentUpdateOptions>): void;
|
|
88
88
|
focus(): void;
|
|
89
89
|
movePanel(from: number, to: number): void;
|
|
@@ -44,8 +44,8 @@ export class SplitviewComponent extends Resizable {
|
|
|
44
44
|
? this.splitview.size
|
|
45
45
|
: this.splitview.orthogonalSize;
|
|
46
46
|
}
|
|
47
|
-
constructor(options) {
|
|
48
|
-
super(
|
|
47
|
+
constructor(parentElement, options) {
|
|
48
|
+
super(parentElement, options.disableAutoResizing);
|
|
49
49
|
this._splitviewChangeDisposable = new MutableDisposable();
|
|
50
50
|
this._panels = new Map();
|
|
51
51
|
this._onDidLayoutfromJSON = new Emitter();
|
|
@@ -56,6 +56,9 @@ export class SplitviewComponent extends Resizable {
|
|
|
56
56
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
57
57
|
this._onDidLayoutChange = new Emitter();
|
|
58
58
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
59
|
+
if (typeof options.className === 'string') {
|
|
60
|
+
this.element.classList.add(options.className);
|
|
61
|
+
}
|
|
59
62
|
this._options = options;
|
|
60
63
|
if (!options.components) {
|
|
61
64
|
options.components = {};
|
package/dist/styles/dockview.css
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
.dv-render-overlay {
|
|
2
|
-
position: absolute;
|
|
3
|
-
z-index: 1;
|
|
4
|
-
height: 100%;
|
|
5
|
-
}
|
|
6
|
-
.dv-render-overlay.dv-render-overlay-float {
|
|
7
|
-
z-index: 999;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.dv-debug .dv-render-overlay {
|
|
11
|
-
outline: 1px solid red;
|
|
12
|
-
outline-offset: -1;
|
|
13
|
-
}
|
|
14
1
|
.dockview-svg {
|
|
15
2
|
display: inline-block;
|
|
16
3
|
fill: currentcolor;
|
|
@@ -257,7 +244,7 @@
|
|
|
257
244
|
.dockview-theme-replit .groupview.inactive-group {
|
|
258
245
|
border: 1px solid transparent;
|
|
259
246
|
}
|
|
260
|
-
.dockview-theme-replit .vertical > .sash-container > .sash::after {
|
|
247
|
+
.dockview-theme-replit .vertical > .sash-container > .sash:not(.disabled)::after {
|
|
261
248
|
content: "";
|
|
262
249
|
height: 4px;
|
|
263
250
|
width: 40px;
|
|
@@ -268,10 +255,10 @@
|
|
|
268
255
|
background-color: var(--dv-separator-handle-background-color);
|
|
269
256
|
position: absolute;
|
|
270
257
|
}
|
|
271
|
-
.dockview-theme-replit .vertical > .sash-container > .sash:hover::after {
|
|
258
|
+
.dockview-theme-replit .vertical > .sash-container > .sash:not(.disabled):hover::after {
|
|
272
259
|
background-color: var(--dv-separator-handle-hover-background-color);
|
|
273
260
|
}
|
|
274
|
-
.dockview-theme-replit .horizontal > .sash-container > .sash::after {
|
|
261
|
+
.dockview-theme-replit .horizontal > .sash-container > .sash:not(.disabled)::after {
|
|
275
262
|
content: "";
|
|
276
263
|
height: 40px;
|
|
277
264
|
width: 4px;
|
|
@@ -282,7 +269,7 @@
|
|
|
282
269
|
background-color: var(--dv-separator-handle-background-color);
|
|
283
270
|
position: absolute;
|
|
284
271
|
}
|
|
285
|
-
.dockview-theme-replit .horizontal > .sash-container > .sash:hover::after {
|
|
272
|
+
.dockview-theme-replit .horizontal > .sash-container > .sash:not(.disabled):hover::after {
|
|
286
273
|
background-color: var(--dv-separator-handle-hover-background-color);
|
|
287
274
|
}
|
|
288
275
|
.drop-target {
|
|
@@ -319,6 +306,74 @@
|
|
|
319
306
|
.drop-target > .drop-target-dropzone > .drop-target-selection.dv-drop-target-right.dv-drop-target-small-horizontal {
|
|
320
307
|
border-right: 1px solid var(--dv-drag-over-border-color);
|
|
321
308
|
}
|
|
309
|
+
.dv-dockview {
|
|
310
|
+
position: relative;
|
|
311
|
+
background-color: var(--dv-group-view-background-color);
|
|
312
|
+
}
|
|
313
|
+
.dv-dockview .dv-watermark-container {
|
|
314
|
+
position: absolute;
|
|
315
|
+
top: 0px;
|
|
316
|
+
left: 0px;
|
|
317
|
+
height: 100%;
|
|
318
|
+
width: 100%;
|
|
319
|
+
z-index: 1;
|
|
320
|
+
}
|
|
321
|
+
.dv-dockview .dv-overlay-render-container {
|
|
322
|
+
position: relative;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {
|
|
326
|
+
background-color: var(--dv-activegroup-visiblepanel-tab-background-color);
|
|
327
|
+
color: var(--dv-activegroup-visiblepanel-tab-color);
|
|
328
|
+
}
|
|
329
|
+
.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {
|
|
330
|
+
background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);
|
|
331
|
+
color: var(--dv-activegroup-hiddenpanel-tab-color);
|
|
332
|
+
}
|
|
333
|
+
.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {
|
|
334
|
+
background-color: var(--dv-inactivegroup-visiblepanel-tab-background-color);
|
|
335
|
+
color: var(--dv-inactivegroup-visiblepanel-tab-color);
|
|
336
|
+
}
|
|
337
|
+
.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {
|
|
338
|
+
background-color: var(--dv-inactivegroup-hiddenpanel-tab-background-color);
|
|
339
|
+
color: var(--dv-inactivegroup-hiddenpanel-tab-color);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* when a tab is dragged we lose the above stylings because they are conditional on parent elements
|
|
344
|
+
* therefore we also set some stylings for the dragging event
|
|
345
|
+
**/
|
|
346
|
+
.tab.dv-tab-dragging {
|
|
347
|
+
background-color: var(--dv-activegroup-visiblepanel-tab-background-color);
|
|
348
|
+
color: var(--dv-activegroup-visiblepanel-tab-color);
|
|
349
|
+
}
|
|
350
|
+
.groupview {
|
|
351
|
+
display: flex;
|
|
352
|
+
flex-direction: column;
|
|
353
|
+
height: 100%;
|
|
354
|
+
background-color: var(--dv-group-view-background-color);
|
|
355
|
+
overflow: hidden;
|
|
356
|
+
}
|
|
357
|
+
.groupview:focus {
|
|
358
|
+
outline: none;
|
|
359
|
+
}
|
|
360
|
+
.groupview.empty > .tabs-and-actions-container {
|
|
361
|
+
display: none;
|
|
362
|
+
}
|
|
363
|
+
.groupview > .content-container {
|
|
364
|
+
flex-grow: 1;
|
|
365
|
+
min-height: 0;
|
|
366
|
+
outline: none;
|
|
367
|
+
}
|
|
368
|
+
.dv-root-wrapper {
|
|
369
|
+
height: 100%;
|
|
370
|
+
width: 100%;
|
|
371
|
+
}
|
|
372
|
+
.grid-view,
|
|
373
|
+
.branch-node {
|
|
374
|
+
height: 100%;
|
|
375
|
+
width: 100%;
|
|
376
|
+
}
|
|
322
377
|
.dv-debug .dv-resize-container .dv-resize-handle-top {
|
|
323
378
|
background-color: red;
|
|
324
379
|
}
|
|
@@ -344,9 +399,6 @@
|
|
|
344
399
|
border: 1px solid var(--dv-tab-divider-color);
|
|
345
400
|
box-shadow: var(--dv-floating-box-shadow);
|
|
346
401
|
}
|
|
347
|
-
.dv-resize-container.dv-bring-to-front {
|
|
348
|
-
z-index: 998;
|
|
349
|
-
}
|
|
350
402
|
.dv-resize-container.dv-resize-container-dragging {
|
|
351
403
|
opacity: 0.5;
|
|
352
404
|
}
|
|
@@ -422,73 +474,17 @@
|
|
|
422
474
|
position: absolute;
|
|
423
475
|
cursor: se-resize;
|
|
424
476
|
}
|
|
425
|
-
.dv-
|
|
426
|
-
position: relative;
|
|
427
|
-
background-color: var(--dv-group-view-background-color);
|
|
428
|
-
}
|
|
429
|
-
.dv-dockview .dv-watermark-container {
|
|
477
|
+
.dv-render-overlay {
|
|
430
478
|
position: absolute;
|
|
431
|
-
top: 0px;
|
|
432
|
-
left: 0px;
|
|
433
|
-
height: 100%;
|
|
434
|
-
width: 100%;
|
|
435
479
|
z-index: 1;
|
|
436
|
-
}
|
|
437
|
-
.dv-dockview .dv-overlay-render-container {
|
|
438
|
-
position: relative;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {
|
|
442
|
-
background-color: var(--dv-activegroup-visiblepanel-tab-background-color);
|
|
443
|
-
color: var(--dv-activegroup-visiblepanel-tab-color);
|
|
444
|
-
}
|
|
445
|
-
.groupview.active-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {
|
|
446
|
-
background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);
|
|
447
|
-
color: var(--dv-activegroup-hiddenpanel-tab-color);
|
|
448
|
-
}
|
|
449
|
-
.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.active-tab {
|
|
450
|
-
background-color: var(--dv-inactivegroup-visiblepanel-tab-background-color);
|
|
451
|
-
color: var(--dv-inactivegroup-visiblepanel-tab-color);
|
|
452
|
-
}
|
|
453
|
-
.groupview.inactive-group > .tabs-and-actions-container > .tabs-container > .tab.inactive-tab {
|
|
454
|
-
background-color: var(--dv-inactivegroup-hiddenpanel-tab-background-color);
|
|
455
|
-
color: var(--dv-inactivegroup-hiddenpanel-tab-color);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* when a tab is dragged we lose the above stylings because they are conditional on parent elements
|
|
460
|
-
* therefore we also set some stylings for the dragging event
|
|
461
|
-
**/
|
|
462
|
-
.tab.dv-tab-dragging {
|
|
463
|
-
background-color: var(--dv-activegroup-visiblepanel-tab-background-color);
|
|
464
|
-
color: var(--dv-activegroup-visiblepanel-tab-color);
|
|
465
|
-
}
|
|
466
|
-
.groupview {
|
|
467
|
-
display: flex;
|
|
468
|
-
flex-direction: column;
|
|
469
480
|
height: 100%;
|
|
470
|
-
background-color: var(--dv-group-view-background-color);
|
|
471
|
-
overflow: hidden;
|
|
472
481
|
}
|
|
473
|
-
.
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
.groupview.empty > .tabs-and-actions-container {
|
|
477
|
-
display: none;
|
|
478
|
-
}
|
|
479
|
-
.groupview > .content-container {
|
|
480
|
-
flex-grow: 1;
|
|
481
|
-
min-height: 0;
|
|
482
|
-
outline: none;
|
|
483
|
-
}
|
|
484
|
-
.dv-root-wrapper {
|
|
485
|
-
height: 100%;
|
|
486
|
-
width: 100%;
|
|
482
|
+
.dv-render-overlay.dv-render-overlay-float {
|
|
483
|
+
z-index: 998;
|
|
487
484
|
}
|
|
488
|
-
.
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
width: 100%;
|
|
485
|
+
.dv-debug .dv-render-overlay {
|
|
486
|
+
outline: 1px solid red;
|
|
487
|
+
outline-offset: -1;
|
|
492
488
|
}
|
|
493
489
|
.pane-container {
|
|
494
490
|
height: 100%;
|