dockview-core 3.0.2 → 3.1.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/dockviewGroupPanelApi.d.ts +1 -2
- package/dist/cjs/api/dockviewGroupPanelApi.js +1 -17
- package/dist/cjs/dockview/components/tab/defaultTab.js +0 -3
- package/dist/cjs/dockview/components/tab/tab.d.ts +2 -2
- package/dist/cjs/dockview/components/tab/tab.js +4 -7
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +13 -7
- package/dist/cjs/dockview/dockviewComponent.js +3 -0
- package/dist/cjs/dockview/dockviewGroupPanel.js +3 -0
- package/dist/dockview-core.amd.js +26 -34
- 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 +25 -33
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +26 -34
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +26 -34
- 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 +26 -34
- 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 +25 -33
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +1 -2
- package/dist/esm/api/dockviewGroupPanelApi.js +1 -16
- package/dist/esm/dockview/components/tab/defaultTab.js +0 -3
- package/dist/esm/dockview/components/tab/tab.d.ts +2 -2
- package/dist/esm/dockview/components/tab/tab.js +4 -7
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +13 -7
- package/dist/esm/dockview/dockviewComponent.js +3 -0
- package/dist/esm/dockview/dockviewGroupPanel.js +3 -0
- package/dist/styles/dockview.css +2 -2
- package/package.json +1 -1
|
@@ -31,11 +31,10 @@ export interface DockviewGroupPanelFloatingChangeEvent {
|
|
|
31
31
|
}
|
|
32
32
|
export declare class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
33
33
|
private readonly accessor;
|
|
34
|
-
private readonly _mutableDisposable;
|
|
35
34
|
private _group;
|
|
36
35
|
readonly _onDidLocationChange: Emitter<DockviewGroupPanelFloatingChangeEvent>;
|
|
37
36
|
readonly onDidLocationChange: Event<DockviewGroupPanelFloatingChangeEvent>;
|
|
38
|
-
|
|
37
|
+
readonly _onDidActivePanelChange: Emitter<DockviewGroupChangeEvent>;
|
|
39
38
|
readonly onDidActivePanelChange: Event<DockviewGroupChangeEvent>;
|
|
40
39
|
get location(): DockviewGroupLocation;
|
|
41
40
|
constructor(id: string, accessor: DockviewComponent);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { positionToDirection } from '../dnd/droptarget';
|
|
2
2
|
import { Emitter } from '../events';
|
|
3
|
-
import { MutableDisposable } from '../lifecycle';
|
|
4
3
|
import { GridviewPanelApiImpl } from './gridviewPanelApi';
|
|
5
4
|
const NOT_INITIALIZED_MESSAGE = 'dockview: DockviewGroupPanelApiImpl not initialized';
|
|
6
5
|
export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
@@ -13,12 +12,11 @@ export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
13
12
|
constructor(id, accessor) {
|
|
14
13
|
super(id, '__dockviewgroup__');
|
|
15
14
|
this.accessor = accessor;
|
|
16
|
-
this._mutableDisposable = new MutableDisposable();
|
|
17
15
|
this._onDidLocationChange = new Emitter();
|
|
18
16
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
19
17
|
this._onDidActivePanelChange = new Emitter();
|
|
20
18
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
21
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange
|
|
19
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange);
|
|
22
20
|
}
|
|
23
21
|
close() {
|
|
24
22
|
if (!this._group) {
|
|
@@ -76,19 +74,6 @@ export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
76
74
|
}
|
|
77
75
|
}
|
|
78
76
|
initialize(group) {
|
|
79
|
-
/**
|
|
80
|
-
* TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
|
|
81
|
-
*
|
|
82
|
-
* Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
|
|
83
|
-
* By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
|
|
84
|
-
* finished ensuring the `model` is defined.
|
|
85
|
-
*/
|
|
86
77
|
this._group = group;
|
|
87
|
-
queueMicrotask(() => {
|
|
88
|
-
this._mutableDisposable.value =
|
|
89
|
-
this._group.model.onDidActivePanelChange((event) => {
|
|
90
|
-
this._onDidActivePanelChange.fire(event);
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
78
|
}
|
|
94
79
|
}
|
|
@@ -16,9 +16,6 @@ export class DefaultTab extends CompositeDisposable {
|
|
|
16
16
|
this.action.appendChild(createCloseButton());
|
|
17
17
|
this._element.appendChild(this._content);
|
|
18
18
|
this._element.appendChild(this.action);
|
|
19
|
-
this.addDisposables(addDisposableListener(this.action, 'pointerdown', (ev) => {
|
|
20
|
-
ev.preventDefault();
|
|
21
|
-
}));
|
|
22
19
|
this.render();
|
|
23
20
|
}
|
|
24
21
|
init(params) {
|
|
@@ -12,8 +12,8 @@ export declare class Tab extends CompositeDisposable {
|
|
|
12
12
|
private readonly _element;
|
|
13
13
|
private readonly dropTarget;
|
|
14
14
|
private content;
|
|
15
|
-
private readonly
|
|
16
|
-
readonly
|
|
15
|
+
private readonly _onPointDown;
|
|
16
|
+
readonly onPointerDown: Event<MouseEvent>;
|
|
17
17
|
private readonly _onDropped;
|
|
18
18
|
readonly onDrop: Event<DroptargetEvent>;
|
|
19
19
|
private readonly _onDragStart;
|
|
@@ -31,8 +31,8 @@ export class Tab extends CompositeDisposable {
|
|
|
31
31
|
this.accessor = accessor;
|
|
32
32
|
this.group = group;
|
|
33
33
|
this.content = undefined;
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
34
|
+
this._onPointDown = new Emitter();
|
|
35
|
+
this.onPointerDown = this._onPointDown.event;
|
|
36
36
|
this._onDropped = new Emitter();
|
|
37
37
|
this.onDrop = this._onDropped.event;
|
|
38
38
|
this._onDragStart = new Emitter();
|
|
@@ -62,13 +62,10 @@ export class Tab extends CompositeDisposable {
|
|
|
62
62
|
},
|
|
63
63
|
});
|
|
64
64
|
this.onWillShowOverlay = this.dropTarget.onWillShowOverlay;
|
|
65
|
-
this.addDisposables(this.
|
|
65
|
+
this.addDisposables(this._onPointDown, this._onDropped, this._onDragStart, dragHandler.onDragStart((event) => {
|
|
66
66
|
this._onDragStart.fire(event);
|
|
67
67
|
}), dragHandler, addDisposableListener(this._element, 'pointerdown', (event) => {
|
|
68
|
-
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
this._onChanged.fire(event);
|
|
68
|
+
this._onPointDown.fire(event);
|
|
72
69
|
}), this.dropTarget.onDrop((event) => {
|
|
73
70
|
this._onDropped.fire(event);
|
|
74
71
|
}), this.dropTarget);
|
|
@@ -156,6 +156,9 @@ export class TabsContainer extends CompositeDisposable {
|
|
|
156
156
|
delete(id) {
|
|
157
157
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
158
158
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
159
|
+
if (!tabToRemove) {
|
|
160
|
+
throw new Error(`dockview: Tab not found`);
|
|
161
|
+
}
|
|
159
162
|
const { value, disposable } = tabToRemove;
|
|
160
163
|
disposable.dispose();
|
|
161
164
|
value.dispose();
|
|
@@ -176,7 +179,10 @@ export class TabsContainer extends CompositeDisposable {
|
|
|
176
179
|
tab.setContent(panel.view.tab);
|
|
177
180
|
const disposable = new CompositeDisposable(tab.onDragStart((event) => {
|
|
178
181
|
this._onTabDragStart.fire({ nativeEvent: event, panel });
|
|
179
|
-
}), tab.
|
|
182
|
+
}), tab.onPointerDown((event) => {
|
|
183
|
+
if (event.defaultPrevented) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
180
186
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
181
187
|
const isFloatingWithOnePanel = this.group.api.location.type === 'floating' &&
|
|
182
188
|
this.size === 1;
|
|
@@ -194,12 +200,12 @@ export class TabsContainer extends CompositeDisposable {
|
|
|
194
200
|
});
|
|
195
201
|
return;
|
|
196
202
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
+
switch (event.button) {
|
|
204
|
+
case 0: // left click or touch
|
|
205
|
+
if (this.group.activePanel !== panel) {
|
|
206
|
+
this.group.model.openPanel(panel);
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
203
209
|
}
|
|
204
210
|
}), tab.onDrop((event) => {
|
|
205
211
|
this._onDrop.fire({
|
|
@@ -412,6 +412,9 @@ export class DockviewComponent extends BaseGrid {
|
|
|
412
412
|
addDisposableWindowListener(_window.window, 'resize', () => {
|
|
413
413
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
414
414
|
}), overlayRenderContainer, Disposable.from(() => {
|
|
415
|
+
if (this.isDisposed) {
|
|
416
|
+
return; // cleanup may run after instance is disposed
|
|
417
|
+
}
|
|
415
418
|
if (isGroupAddedToDom &&
|
|
416
419
|
this.getPanel(referenceGroup.id)) {
|
|
417
420
|
this.movingLock(() => moveGroupWithoutDestroying({
|
|
@@ -67,6 +67,9 @@ export class DockviewGroupPanel extends GridviewPanel {
|
|
|
67
67
|
}, new DockviewGroupPanelApiImpl(id, accessor));
|
|
68
68
|
this.api.initialize(this); // cannot use 'this' after after 'super' call
|
|
69
69
|
this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
|
|
70
|
+
this.addDisposables(this.model.onDidActivePanelChange((event) => {
|
|
71
|
+
this.api._onDidActivePanelChange.fire(event);
|
|
72
|
+
}));
|
|
70
73
|
}
|
|
71
74
|
focus() {
|
|
72
75
|
if (!this.api.isActive) {
|
package/dist/styles/dockview.css
CHANGED
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
.dockview-theme-replit .dv-groupview.dv-inactive-group {
|
|
244
244
|
border: 1px solid transparent;
|
|
245
245
|
}
|
|
246
|
-
.dockview-theme-replit .vertical > .sash-container > .sash:not(.disabled)::after {
|
|
246
|
+
.dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled)::after {
|
|
247
247
|
content: "";
|
|
248
248
|
height: 4px;
|
|
249
249
|
width: 40px;
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
background-color: var(--dv-separator-handle-background-color);
|
|
255
255
|
position: absolute;
|
|
256
256
|
}
|
|
257
|
-
.dockview-theme-replit .vertical > .sash-container > .sash:not(.disabled):hover::after {
|
|
257
|
+
.dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled):hover::after {
|
|
258
258
|
background-color: var(--dv-separator-handle-hover-background-color);
|
|
259
259
|
}
|
|
260
260
|
.dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled)::after {
|