dockview-core 1.13.1 → 1.14.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/dockviewGroupPanelApi.js +4 -5
- package/dist/cjs/api/dockviewPanelApi.js +4 -6
- package/dist/cjs/dockview/dockviewComponent.js +13 -16
- package/dist/cjs/dockview/dockviewPanel.js +1 -10
- package/dist/cjs/events.js +3 -3
- package/dist/dockview-core.amd.js +24 -39
- 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 +24 -39
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +24 -39
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +24 -39
- 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 +24 -39
- 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 +24 -39
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/dockviewGroupPanelApi.js +3 -4
- package/dist/esm/api/dockviewPanelApi.js +4 -6
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +1 -1
- package/dist/esm/dockview/dockviewComponent.js +13 -16
- package/dist/esm/dockview/dockviewPanel.js +1 -10
- package/dist/esm/events.js +3 -3
- package/package.json +1 -1
|
@@ -2,8 +2,7 @@ import { positionToDirection } from '../dnd/droptarget';
|
|
|
2
2
|
import { Emitter } from '../events';
|
|
3
3
|
import { MutableDisposable } from '../lifecycle';
|
|
4
4
|
import { GridviewPanelApiImpl } from './gridviewPanelApi';
|
|
5
|
-
|
|
6
|
-
const NOT_INITIALIZED_MESSAGE = 'DockviewGroupPanelApiImpl not initialized';
|
|
5
|
+
const NOT_INITIALIZED_MESSAGE = 'dockview: DockviewGroupPanelApiImpl not initialized';
|
|
7
6
|
export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
8
7
|
get location() {
|
|
9
8
|
if (!this._group) {
|
|
@@ -76,14 +75,14 @@ export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
initialize(group) {
|
|
79
|
-
this._group = group;
|
|
80
78
|
/**
|
|
81
|
-
* TODO: Annoying initialization order caveat
|
|
79
|
+
* TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
|
|
82
80
|
*
|
|
83
81
|
* Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
|
|
84
82
|
* By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
|
|
85
83
|
* finished ensuring the `model` is defined.
|
|
86
84
|
*/
|
|
85
|
+
this._group = group;
|
|
87
86
|
queueMicrotask(() => {
|
|
88
87
|
this._mutableDisposable.value =
|
|
89
88
|
this._group.model.onDidActivePanelChange((event) => {
|
|
@@ -88,12 +88,10 @@ export class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
88
88
|
var _a;
|
|
89
89
|
let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
|
|
90
90
|
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
!this.isVisible &&
|
|
96
|
-
this.group.model.isPanelActive(this.panel)) {
|
|
91
|
+
const hasBecomeHidden = !event.isVisible && this.isVisible;
|
|
92
|
+
const hasBecomeVisible = event.isVisible && !this.isVisible;
|
|
93
|
+
const isActivePanel = this.group.model.isPanelActive(this.panel);
|
|
94
|
+
if (hasBecomeHidden || (hasBecomeVisible && isActivePanel)) {
|
|
97
95
|
this._onDidVisibilityChange.fire(event);
|
|
98
96
|
}
|
|
99
97
|
}), this.group.api.onDidLocationChange((event) => {
|
|
@@ -3,7 +3,7 @@ import { addDisposableListener, Emitter } from '../../../events';
|
|
|
3
3
|
import { Tab } from '../tab/tab';
|
|
4
4
|
import { VoidContainer } from './voidContainer';
|
|
5
5
|
import { toggleClass } from '../../../dom';
|
|
6
|
-
import { WillShowOverlayLocationEvent
|
|
6
|
+
import { WillShowOverlayLocationEvent } from '../../dockviewGroupPanelModel';
|
|
7
7
|
import { getPanelData } from '../../../dnd/dataTransfer';
|
|
8
8
|
export class TabsContainer extends CompositeDisposable {
|
|
9
9
|
get panels() {
|
|
@@ -328,7 +328,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
328
328
|
return element.getBoundingClientRect();
|
|
329
329
|
}
|
|
330
330
|
const box = getBox();
|
|
331
|
-
const groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId();
|
|
331
|
+
const groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId();
|
|
332
332
|
if (itemToPopout.api.location.type === 'grid') {
|
|
333
333
|
itemToPopout.api.setVisible(false);
|
|
334
334
|
}
|
|
@@ -444,24 +444,22 @@ export class DockviewComponent extends BaseGrid {
|
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
else {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
returnedGroup = removedGroup;
|
|
457
|
-
}
|
|
447
|
+
else if (this.getPanel(group.id)) {
|
|
448
|
+
const removedGroup = this.doRemoveGroup(group, {
|
|
449
|
+
skipDispose: true,
|
|
450
|
+
skipActive: true,
|
|
451
|
+
});
|
|
452
|
+
removedGroup.model.renderContainer =
|
|
453
|
+
this.overlayRenderContainer;
|
|
454
|
+
removedGroup.model.location = { type: 'grid' };
|
|
455
|
+
returnedGroup = removedGroup;
|
|
458
456
|
}
|
|
459
457
|
}));
|
|
460
458
|
this._popoutGroups.push(value);
|
|
461
459
|
this.updateWatermark();
|
|
462
460
|
})
|
|
463
461
|
.catch((err) => {
|
|
464
|
-
console.error(err);
|
|
462
|
+
console.error('dockview: failed to create popout window', err);
|
|
465
463
|
});
|
|
466
464
|
}
|
|
467
465
|
addFloatingGroup(item, coord, options) {
|
|
@@ -504,7 +502,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
504
502
|
this.doRemoveGroup(item, {
|
|
505
503
|
skipDispose: true,
|
|
506
504
|
skipPopoutReturn: true,
|
|
507
|
-
skipPopoutAssociated:
|
|
505
|
+
skipPopoutAssociated: false,
|
|
508
506
|
});
|
|
509
507
|
}
|
|
510
508
|
}
|
|
@@ -866,7 +864,6 @@ export class DockviewComponent extends BaseGrid {
|
|
|
866
864
|
clear() {
|
|
867
865
|
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
868
866
|
const hasActiveGroup = !!this.activeGroup;
|
|
869
|
-
const hasActivePanel = !!this.activePanel;
|
|
870
867
|
for (const group of groups) {
|
|
871
868
|
// remove the group will automatically remove the panels
|
|
872
869
|
this.removeGroup(group, { skipActive: true });
|
|
@@ -1372,7 +1369,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1372
1369
|
}
|
|
1373
1370
|
let id = options === null || options === void 0 ? void 0 : options.id;
|
|
1374
1371
|
if (id && this._groups.has(options.id)) {
|
|
1375
|
-
console.warn(`Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
|
|
1372
|
+
console.warn(`dockview: Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
|
|
1376
1373
|
id = undefined;
|
|
1377
1374
|
}
|
|
1378
1375
|
if (!id) {
|
|
@@ -65,12 +65,6 @@ export class DockviewPanel extends CompositeDisposable {
|
|
|
65
65
|
const didTitleChange = title !== this.title;
|
|
66
66
|
if (didTitleChange) {
|
|
67
67
|
this._title = title;
|
|
68
|
-
this.view.update({
|
|
69
|
-
params: {
|
|
70
|
-
params: this._params,
|
|
71
|
-
title: this.title,
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
68
|
this.api._onDidTitleChange.fire({ title });
|
|
75
69
|
}
|
|
76
70
|
}
|
|
@@ -98,10 +92,7 @@ export class DockviewPanel extends CompositeDisposable {
|
|
|
98
92
|
}
|
|
99
93
|
// update the view with the updated props
|
|
100
94
|
this.view.update({
|
|
101
|
-
params:
|
|
102
|
-
params: this._params,
|
|
103
|
-
title: this.title,
|
|
104
|
-
},
|
|
95
|
+
params: this._params,
|
|
105
96
|
});
|
|
106
97
|
}
|
|
107
98
|
updateParentGroup(group, options) {
|
package/dist/esm/events.js
CHANGED
|
@@ -50,7 +50,7 @@ class Stacktrace {
|
|
|
50
50
|
this.value = value;
|
|
51
51
|
}
|
|
52
52
|
print() {
|
|
53
|
-
console.warn(this.value);
|
|
53
|
+
console.warn('dockview: stacktrace', this.value);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
class Listener {
|
|
@@ -92,7 +92,7 @@ export class Emitter {
|
|
|
92
92
|
}
|
|
93
93
|
else if (Emitter.ENABLE_TRACKING) {
|
|
94
94
|
// console.warn(
|
|
95
|
-
// `
|
|
95
|
+
// `dockview: listener already disposed`,
|
|
96
96
|
// Stacktrace.create().print()
|
|
97
97
|
// );
|
|
98
98
|
}
|
|
@@ -120,7 +120,7 @@ export class Emitter {
|
|
|
120
120
|
var _a;
|
|
121
121
|
// don't check until stack of execution is completed to allow for out-of-order disposals within the same execution block
|
|
122
122
|
for (const listener of this._listeners) {
|
|
123
|
-
console.warn((_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
|
|
123
|
+
console.warn('dockview: stacktrace', (_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
}
|