dockview-core 1.13.1 → 1.14.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/README.md +1 -21
- package/dist/cjs/api/dockviewGroupPanelApi.js +4 -5
- package/dist/cjs/api/dockviewPanelApi.js +4 -6
- package/dist/cjs/dockview/dockviewComponent.js +13 -76
- package/dist/cjs/dockview/dockviewPanel.js +1 -10
- package/dist/cjs/dockview/options.d.ts +1 -1
- package/dist/cjs/dockview/types.d.ts +5 -10
- package/dist/cjs/dockview/validate.d.ts +0 -0
- package/dist/cjs/dockview/validate.js +76 -0
- package/dist/cjs/events.js +3 -3
- package/dist/cjs/index.d.ts +4 -3
- package/dist/cjs/index.js +5 -3
- package/dist/dockview-core.amd.js +38 -53
- 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 +37 -52
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +38 -53
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +26 -41
- 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 +38 -53
- 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 +37 -52
- 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 -76
- package/dist/esm/dockview/dockviewPanel.js +1 -10
- package/dist/esm/dockview/options.d.ts +1 -1
- package/dist/esm/dockview/types.d.ts +5 -10
- package/dist/esm/dockview/validate.d.ts +0 -0
- package/dist/esm/dockview/validate.js +76 -0
- package/dist/esm/events.js +3 -3
- package/dist/esm/index.d.ts +4 -3
- package/dist/esm/index.js +4 -3
- package/dist/styles/dockview.css +4 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 1.
|
|
3
|
+
* @version 1.14.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
this.value = value;
|
|
130
130
|
}
|
|
131
131
|
print() {
|
|
132
|
-
console.warn(this.value);
|
|
132
|
+
console.warn('dockview: stacktrace', this.value);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
class Listener {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
var _a;
|
|
195
195
|
// don't check until stack of execution is completed to allow for out-of-order disposals within the same execution block
|
|
196
196
|
for (const listener of this._listeners) {
|
|
197
|
-
console.warn((_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
|
|
197
|
+
console.warn('dockview: stacktrace', (_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
}
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
|
|
277
|
+
exports.DockviewDisposable = void 0;
|
|
278
278
|
(function (Disposable) {
|
|
279
279
|
Disposable.NONE = {
|
|
280
280
|
dispose: () => {
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
291
|
Disposable.from = from;
|
|
292
|
-
})(
|
|
292
|
+
})(exports.DockviewDisposable || (exports.DockviewDisposable = {}));
|
|
293
293
|
class CompositeDisposable {
|
|
294
294
|
get isDisposed() {
|
|
295
295
|
return this._isDisposed;
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
}
|
|
313
313
|
class MutableDisposable {
|
|
314
314
|
constructor() {
|
|
315
|
-
this._disposable =
|
|
315
|
+
this._disposable = exports.DockviewDisposable.NONE;
|
|
316
316
|
}
|
|
317
317
|
set value(disposable) {
|
|
318
318
|
if (this._disposable) {
|
|
@@ -323,7 +323,7 @@
|
|
|
323
323
|
dispose() {
|
|
324
324
|
if (this._disposable) {
|
|
325
325
|
this._disposable.dispose();
|
|
326
|
-
this._disposable =
|
|
326
|
+
this._disposable = exports.DockviewDisposable.NONE;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
}
|
|
@@ -1750,7 +1750,7 @@
|
|
|
1750
1750
|
this.orientation = orientation;
|
|
1751
1751
|
this.proportionalLayout = proportionalLayout;
|
|
1752
1752
|
this.styles = styles;
|
|
1753
|
-
this._childrenDisposable =
|
|
1753
|
+
this._childrenDisposable = exports.DockviewDisposable.NONE;
|
|
1754
1754
|
this.children = [];
|
|
1755
1755
|
this._onDidChange = new Emitter();
|
|
1756
1756
|
this.onDidChange = this._onDidChange.event;
|
|
@@ -1898,7 +1898,7 @@
|
|
|
1898
1898
|
this.setChildVisible(i, visible);
|
|
1899
1899
|
});
|
|
1900
1900
|
}
|
|
1901
|
-
return
|
|
1901
|
+
return exports.DockviewDisposable.NONE;
|
|
1902
1902
|
}));
|
|
1903
1903
|
}
|
|
1904
1904
|
dispose() {
|
|
@@ -2599,7 +2599,7 @@
|
|
|
2599
2599
|
this.gridview.locked = !!options.locked;
|
|
2600
2600
|
this.element.appendChild(this.gridview.element);
|
|
2601
2601
|
this.layout(0, 0, true); // set some elements height/widths
|
|
2602
|
-
this.addDisposables(
|
|
2602
|
+
this.addDisposables(exports.DockviewDisposable.from(() => {
|
|
2603
2603
|
var _a;
|
|
2604
2604
|
(_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.element);
|
|
2605
2605
|
}), this.gridview.onDidChange(() => {
|
|
@@ -5744,8 +5744,7 @@
|
|
|
5744
5744
|
}
|
|
5745
5745
|
}
|
|
5746
5746
|
|
|
5747
|
-
|
|
5748
|
-
const NOT_INITIALIZED_MESSAGE = 'DockviewGroupPanelApiImpl not initialized';
|
|
5747
|
+
const NOT_INITIALIZED_MESSAGE = 'dockview: DockviewGroupPanelApiImpl not initialized';
|
|
5749
5748
|
class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
5750
5749
|
get location() {
|
|
5751
5750
|
if (!this._group) {
|
|
@@ -5818,14 +5817,14 @@
|
|
|
5818
5817
|
}
|
|
5819
5818
|
}
|
|
5820
5819
|
initialize(group) {
|
|
5821
|
-
this._group = group;
|
|
5822
5820
|
/**
|
|
5823
|
-
* TODO: Annoying initialization order caveat
|
|
5821
|
+
* TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
|
|
5824
5822
|
*
|
|
5825
5823
|
* Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
|
|
5826
5824
|
* By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
|
|
5827
5825
|
* finished ensuring the `model` is defined.
|
|
5828
5826
|
*/
|
|
5827
|
+
this._group = group;
|
|
5829
5828
|
queueMicrotask(() => {
|
|
5830
5829
|
this._mutableDisposable.value =
|
|
5831
5830
|
this._group.model.onDidActivePanelChange((event) => {
|
|
@@ -5979,12 +5978,10 @@
|
|
|
5979
5978
|
var _a;
|
|
5980
5979
|
let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
|
|
5981
5980
|
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
!this.isVisible &&
|
|
5987
|
-
this.group.model.isPanelActive(this.panel)) {
|
|
5981
|
+
const hasBecomeHidden = !event.isVisible && this.isVisible;
|
|
5982
|
+
const hasBecomeVisible = event.isVisible && !this.isVisible;
|
|
5983
|
+
const isActivePanel = this.group.model.isPanelActive(this.panel);
|
|
5984
|
+
if (hasBecomeHidden || (hasBecomeVisible && isActivePanel)) {
|
|
5988
5985
|
this._onDidVisibilityChange.fire(event);
|
|
5989
5986
|
}
|
|
5990
5987
|
}), this.group.api.onDidLocationChange((event) => {
|
|
@@ -6070,12 +6067,6 @@
|
|
|
6070
6067
|
const didTitleChange = title !== this.title;
|
|
6071
6068
|
if (didTitleChange) {
|
|
6072
6069
|
this._title = title;
|
|
6073
|
-
this.view.update({
|
|
6074
|
-
params: {
|
|
6075
|
-
params: this._params,
|
|
6076
|
-
title: this.title,
|
|
6077
|
-
},
|
|
6078
|
-
});
|
|
6079
6070
|
this.api._onDidTitleChange.fire({ title });
|
|
6080
6071
|
}
|
|
6081
6072
|
}
|
|
@@ -6103,10 +6094,7 @@
|
|
|
6103
6094
|
}
|
|
6104
6095
|
// update the view with the updated props
|
|
6105
6096
|
this.view.update({
|
|
6106
|
-
params:
|
|
6107
|
-
params: this._params,
|
|
6108
|
-
title: this.title,
|
|
6109
|
-
},
|
|
6097
|
+
params: this._params,
|
|
6110
6098
|
});
|
|
6111
6099
|
}
|
|
6112
6100
|
updateParentGroup(group, options) {
|
|
@@ -6719,7 +6707,7 @@
|
|
|
6719
6707
|
this.element = element;
|
|
6720
6708
|
this.map = {};
|
|
6721
6709
|
this._disposed = false;
|
|
6722
|
-
this.addDisposables(
|
|
6710
|
+
this.addDisposables(exports.DockviewDisposable.from(() => {
|
|
6723
6711
|
for (const value of Object.values(this.map)) {
|
|
6724
6712
|
value.disposable.dispose();
|
|
6725
6713
|
value.destroy.dispose();
|
|
@@ -6744,8 +6732,8 @@
|
|
|
6744
6732
|
element.className = 'dv-render-overlay';
|
|
6745
6733
|
this.map[panel.api.id] = {
|
|
6746
6734
|
panel,
|
|
6747
|
-
disposable:
|
|
6748
|
-
destroy:
|
|
6735
|
+
disposable: exports.DockviewDisposable.NONE,
|
|
6736
|
+
destroy: exports.DockviewDisposable.NONE,
|
|
6749
6737
|
element,
|
|
6750
6738
|
};
|
|
6751
6739
|
}
|
|
@@ -6809,7 +6797,7 @@
|
|
|
6809
6797
|
}
|
|
6810
6798
|
resize();
|
|
6811
6799
|
}));
|
|
6812
|
-
this.map[panel.api.id].destroy =
|
|
6800
|
+
this.map[panel.api.id].destroy = exports.DockviewDisposable.from(() => {
|
|
6813
6801
|
var _a;
|
|
6814
6802
|
if (panel.view.content.element.parentElement === focusContainer) {
|
|
6815
6803
|
focusContainer.removeChild(panel.view.content.element);
|
|
@@ -7129,7 +7117,7 @@
|
|
|
7129
7117
|
this.updateWatermark();
|
|
7130
7118
|
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
7131
7119
|
this._bufferOnDidLayoutChange.fire();
|
|
7132
|
-
}),
|
|
7120
|
+
}), exports.DockviewDisposable.from(() => {
|
|
7133
7121
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
7134
7122
|
for (const group of [...this._floatingGroups]) {
|
|
7135
7123
|
group.dispose();
|
|
@@ -7244,7 +7232,7 @@
|
|
|
7244
7232
|
return element.getBoundingClientRect();
|
|
7245
7233
|
}
|
|
7246
7234
|
const box = getBox();
|
|
7247
|
-
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();
|
|
7235
|
+
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();
|
|
7248
7236
|
if (itemToPopout.api.location.type === 'grid') {
|
|
7249
7237
|
itemToPopout.api.setVisible(false);
|
|
7250
7238
|
}
|
|
@@ -7345,7 +7333,7 @@
|
|
|
7345
7333
|
*/
|
|
7346
7334
|
addDisposableWindowListener(_window.window, 'resize', () => {
|
|
7347
7335
|
group.layout(window.innerWidth, window.innerHeight);
|
|
7348
|
-
}), overlayRenderContainer,
|
|
7336
|
+
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
7349
7337
|
if (this.getPanel(referenceGroup.id)) {
|
|
7350
7338
|
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7351
7339
|
from: group,
|
|
@@ -7360,24 +7348,22 @@
|
|
|
7360
7348
|
});
|
|
7361
7349
|
}
|
|
7362
7350
|
}
|
|
7363
|
-
else {
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
returnedGroup = removedGroup;
|
|
7373
|
-
}
|
|
7351
|
+
else if (this.getPanel(group.id)) {
|
|
7352
|
+
const removedGroup = this.doRemoveGroup(group, {
|
|
7353
|
+
skipDispose: true,
|
|
7354
|
+
skipActive: true,
|
|
7355
|
+
});
|
|
7356
|
+
removedGroup.model.renderContainer =
|
|
7357
|
+
this.overlayRenderContainer;
|
|
7358
|
+
removedGroup.model.location = { type: 'grid' };
|
|
7359
|
+
returnedGroup = removedGroup;
|
|
7374
7360
|
}
|
|
7375
7361
|
}));
|
|
7376
7362
|
this._popoutGroups.push(value);
|
|
7377
7363
|
this.updateWatermark();
|
|
7378
7364
|
})
|
|
7379
7365
|
.catch((err) => {
|
|
7380
|
-
console.error(err);
|
|
7366
|
+
console.error('dockview: failed to create popout window', err);
|
|
7381
7367
|
});
|
|
7382
7368
|
}
|
|
7383
7369
|
addFloatingGroup(item, coord, options) {
|
|
@@ -7420,7 +7406,7 @@
|
|
|
7420
7406
|
this.doRemoveGroup(item, {
|
|
7421
7407
|
skipDispose: true,
|
|
7422
7408
|
skipPopoutReturn: true,
|
|
7423
|
-
skipPopoutAssociated:
|
|
7409
|
+
skipPopoutAssociated: false,
|
|
7424
7410
|
});
|
|
7425
7411
|
}
|
|
7426
7412
|
}
|
|
@@ -7780,7 +7766,6 @@
|
|
|
7780
7766
|
clear() {
|
|
7781
7767
|
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
7782
7768
|
const hasActiveGroup = !!this.activeGroup;
|
|
7783
|
-
!!this.activePanel;
|
|
7784
7769
|
for (const group of groups) {
|
|
7785
7770
|
// remove the group will automatically remove the panels
|
|
7786
7771
|
this.removeGroup(group, { skipActive: true });
|
|
@@ -8286,7 +8271,7 @@
|
|
|
8286
8271
|
}
|
|
8287
8272
|
let id = options === null || options === void 0 ? void 0 : options.id;
|
|
8288
8273
|
if (id && this._groups.has(options.id)) {
|
|
8289
|
-
console.warn(`Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
|
|
8274
|
+
console.warn(`dockview: Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
|
|
8290
8275
|
id = undefined;
|
|
8291
8276
|
}
|
|
8292
8277
|
if (!id) {
|