dockview 1.13.0 → 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/dockview/reactContentPart.js +1 -1
- package/dist/cjs/dockview/reactHeaderPart.js +1 -1
- package/dist/dockview.amd.js +68 -55
- package/dist/dockview.amd.js.map +1 -1
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.js.map +1 -1
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.min.noStyle.js.map +1 -1
- package/dist/dockview.amd.noStyle.js +68 -55
- package/dist/dockview.amd.noStyle.js.map +1 -1
- package/dist/dockview.cjs.js +68 -55
- package/dist/dockview.cjs.js.map +1 -1
- package/dist/dockview.esm.js +68 -55
- package/dist/dockview.esm.js.map +1 -1
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.esm.min.js.map +1 -1
- package/dist/dockview.js +68 -55
- package/dist/dockview.js.map +1 -1
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.js.map +1 -1
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.min.noStyle.js.map +1 -1
- package/dist/dockview.noStyle.js +68 -55
- package/dist/dockview.noStyle.js.map +1 -1
- package/dist/esm/dockview/reactContentPart.js +1 -1
- package/dist/esm/dockview/reactHeaderPart.js +1 -1
- package/package.json +2 -2
|
@@ -36,7 +36,7 @@ var ReactPanelContentPart = /** @class */ (function () {
|
|
|
36
36
|
};
|
|
37
37
|
ReactPanelContentPart.prototype.update = function (event) {
|
|
38
38
|
var _a;
|
|
39
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
39
|
+
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update({ params: event.params });
|
|
40
40
|
};
|
|
41
41
|
ReactPanelContentPart.prototype.layout = function (_width, _height) {
|
|
42
42
|
// noop
|
|
@@ -31,7 +31,7 @@ var ReactPanelHeaderPart = /** @class */ (function () {
|
|
|
31
31
|
};
|
|
32
32
|
ReactPanelHeaderPart.prototype.update = function (event) {
|
|
33
33
|
var _a;
|
|
34
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
34
|
+
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update({ params: event.params });
|
|
35
35
|
};
|
|
36
36
|
ReactPanelHeaderPart.prototype.layout = function (_width, _height) {
|
|
37
37
|
// noop - retrieval from api
|
package/dist/dockview.amd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 1.
|
|
3
|
+
* @version 1.14.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -155,7 +155,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
155
155
|
this.value = value;
|
|
156
156
|
}
|
|
157
157
|
print() {
|
|
158
|
-
console.warn(this.value);
|
|
158
|
+
console.warn('dockview: stacktrace', this.value);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
class Listener {
|
|
@@ -220,7 +220,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
220
220
|
var _a;
|
|
221
221
|
// don't check until stack of execution is completed to allow for out-of-order disposals within the same execution block
|
|
222
222
|
for (const listener of this._listeners) {
|
|
223
|
-
console.warn((_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
|
|
223
|
+
console.warn('dockview: stacktrace', (_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
226
|
}
|
|
@@ -250,18 +250,49 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
250
250
|
},
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
|
|
253
|
+
/**
|
|
254
|
+
*
|
|
255
|
+
* Event Emitter that fires events from a Microtask callback, only one event will fire per event-loop cycle.
|
|
256
|
+
*
|
|
257
|
+
* It's kind of like using an `asapScheduler` in RxJs with additional logic to only fire once per event-loop cycle.
|
|
258
|
+
* This implementation exists to avoid external dependencies.
|
|
259
|
+
*
|
|
260
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/queueMicrotask
|
|
261
|
+
* @see https://rxjs.dev/api/index/const/asapScheduler
|
|
262
|
+
*/
|
|
263
|
+
class AsapEvent {
|
|
254
264
|
constructor() {
|
|
255
265
|
this._onFired = new Emitter();
|
|
256
|
-
this.
|
|
266
|
+
this._currentFireCount = 0;
|
|
267
|
+
this._queued = false;
|
|
268
|
+
this.onEvent = (e) => {
|
|
269
|
+
/**
|
|
270
|
+
* when the event is first subscribed to take note of the current fire count
|
|
271
|
+
*/
|
|
272
|
+
const fireCountAtTimeOfEventSubscription = this._currentFireCount;
|
|
273
|
+
return this._onFired.event(() => {
|
|
274
|
+
/**
|
|
275
|
+
* if the current fire count is greater than the fire count at event subscription
|
|
276
|
+
* then the event has been fired since we subscribed and it's ok to "on_next" the event.
|
|
277
|
+
*
|
|
278
|
+
* if the count is not greater then what we are recieving is an event from the microtask
|
|
279
|
+
* queue that was triggered before we actually subscribed and therfore we should ignore it.
|
|
280
|
+
*/
|
|
281
|
+
if (this._currentFireCount > fireCountAtTimeOfEventSubscription) {
|
|
282
|
+
e();
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
};
|
|
257
286
|
}
|
|
258
287
|
fire() {
|
|
259
|
-
|
|
260
|
-
|
|
288
|
+
this._currentFireCount++;
|
|
289
|
+
if (this._queued) {
|
|
290
|
+
return;
|
|
261
291
|
}
|
|
262
|
-
this.
|
|
292
|
+
this._queued = true;
|
|
293
|
+
queueMicrotask(() => {
|
|
294
|
+
this._queued = false;
|
|
263
295
|
this._onFired.fire();
|
|
264
|
-
clearTimeout(this.timer);
|
|
265
296
|
});
|
|
266
297
|
}
|
|
267
298
|
dispose() {
|
|
@@ -2579,15 +2610,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2579
2610
|
super(document.createElement('div'), options.disableAutoResizing);
|
|
2580
2611
|
this._id = nextLayoutId$1.next();
|
|
2581
2612
|
this._groups = new Map();
|
|
2582
|
-
this._onDidLayoutChange = new Emitter();
|
|
2583
|
-
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
2584
2613
|
this._onDidRemove = new Emitter();
|
|
2585
2614
|
this.onDidRemove = this._onDidRemove.event;
|
|
2586
2615
|
this._onDidAdd = new Emitter();
|
|
2587
2616
|
this.onDidAdd = this._onDidAdd.event;
|
|
2588
2617
|
this._onDidActiveChange = new Emitter();
|
|
2589
2618
|
this.onDidActiveChange = this._onDidActiveChange.event;
|
|
2590
|
-
this._bufferOnDidLayoutChange = new
|
|
2619
|
+
this._bufferOnDidLayoutChange = new AsapEvent();
|
|
2620
|
+
this.onDidLayoutChange = this._bufferOnDidLayoutChange.onEvent;
|
|
2591
2621
|
this.element.style.height = '100%';
|
|
2592
2622
|
this.element.style.width = '100%';
|
|
2593
2623
|
options.parentElement.appendChild(this.element);
|
|
@@ -2602,13 +2632,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2602
2632
|
this._bufferOnDidLayoutChange.fire();
|
|
2603
2633
|
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove, this.onDidActiveChange)(() => {
|
|
2604
2634
|
this._bufferOnDidLayoutChange.fire();
|
|
2605
|
-
}), this._bufferOnDidLayoutChange.onEvent(() => {
|
|
2606
|
-
this._onDidLayoutChange.fire();
|
|
2607
2635
|
}), this._bufferOnDidLayoutChange);
|
|
2608
2636
|
}
|
|
2609
2637
|
setVisible(panel, visible) {
|
|
2610
2638
|
this.gridview.setViewVisible(getGridLocation(panel.element), visible);
|
|
2611
|
-
this.
|
|
2639
|
+
this._bufferOnDidLayoutChange.fire();
|
|
2612
2640
|
}
|
|
2613
2641
|
isVisible(panel) {
|
|
2614
2642
|
return this.gridview.isViewVisible(getGridLocation(panel.element));
|
|
@@ -2714,7 +2742,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2714
2742
|
this._onDidActiveChange.dispose();
|
|
2715
2743
|
this._onDidAdd.dispose();
|
|
2716
2744
|
this._onDidRemove.dispose();
|
|
2717
|
-
this._onDidLayoutChange.dispose();
|
|
2718
2745
|
for (const group of this.groups) {
|
|
2719
2746
|
group.dispose();
|
|
2720
2747
|
}
|
|
@@ -5743,8 +5770,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5743
5770
|
}
|
|
5744
5771
|
}
|
|
5745
5772
|
|
|
5746
|
-
|
|
5747
|
-
const NOT_INITIALIZED_MESSAGE = 'DockviewGroupPanelApiImpl not initialized';
|
|
5773
|
+
const NOT_INITIALIZED_MESSAGE = 'dockview: DockviewGroupPanelApiImpl not initialized';
|
|
5748
5774
|
class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
5749
5775
|
get location() {
|
|
5750
5776
|
if (!this._group) {
|
|
@@ -5817,14 +5843,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5817
5843
|
}
|
|
5818
5844
|
}
|
|
5819
5845
|
initialize(group) {
|
|
5820
|
-
this._group = group;
|
|
5821
5846
|
/**
|
|
5822
|
-
* TODO: Annoying initialization order caveat
|
|
5847
|
+
* TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
|
|
5823
5848
|
*
|
|
5824
5849
|
* Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
|
|
5825
5850
|
* By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
|
|
5826
5851
|
* finished ensuring the `model` is defined.
|
|
5827
5852
|
*/
|
|
5853
|
+
this._group = group;
|
|
5828
5854
|
queueMicrotask(() => {
|
|
5829
5855
|
this._mutableDisposable.value =
|
|
5830
5856
|
this._group.model.onDidActivePanelChange((event) => {
|
|
@@ -5978,12 +6004,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5978
6004
|
var _a;
|
|
5979
6005
|
let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
|
|
5980
6006
|
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
!this.isVisible &&
|
|
5986
|
-
this.group.model.isPanelActive(this.panel)) {
|
|
6007
|
+
const hasBecomeHidden = !event.isVisible && this.isVisible;
|
|
6008
|
+
const hasBecomeVisible = event.isVisible && !this.isVisible;
|
|
6009
|
+
const isActivePanel = this.group.model.isPanelActive(this.panel);
|
|
6010
|
+
if (hasBecomeHidden || (hasBecomeVisible && isActivePanel)) {
|
|
5987
6011
|
this._onDidVisibilityChange.fire(event);
|
|
5988
6012
|
}
|
|
5989
6013
|
}), this.group.api.onDidLocationChange((event) => {
|
|
@@ -6069,12 +6093,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6069
6093
|
const didTitleChange = title !== this.title;
|
|
6070
6094
|
if (didTitleChange) {
|
|
6071
6095
|
this._title = title;
|
|
6072
|
-
this.view.update({
|
|
6073
|
-
params: {
|
|
6074
|
-
params: this._params,
|
|
6075
|
-
title: this.title,
|
|
6076
|
-
},
|
|
6077
|
-
});
|
|
6078
6096
|
this.api._onDidTitleChange.fire({ title });
|
|
6079
6097
|
}
|
|
6080
6098
|
}
|
|
@@ -6102,10 +6120,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6102
6120
|
}
|
|
6103
6121
|
// update the view with the updated props
|
|
6104
6122
|
this.view.update({
|
|
6105
|
-
params:
|
|
6106
|
-
params: this._params,
|
|
6107
|
-
title: this.title,
|
|
6108
|
-
},
|
|
6123
|
+
params: this._params,
|
|
6109
6124
|
});
|
|
6110
6125
|
}
|
|
6111
6126
|
updateParentGroup(group, options) {
|
|
@@ -7220,7 +7235,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7220
7235
|
return element.getBoundingClientRect();
|
|
7221
7236
|
}
|
|
7222
7237
|
const box = getBox();
|
|
7223
|
-
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();
|
|
7238
|
+
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();
|
|
7224
7239
|
if (itemToPopout.api.location.type === 'grid') {
|
|
7225
7240
|
itemToPopout.api.setVisible(false);
|
|
7226
7241
|
}
|
|
@@ -7336,24 +7351,22 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7336
7351
|
});
|
|
7337
7352
|
}
|
|
7338
7353
|
}
|
|
7339
|
-
else {
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
returnedGroup = removedGroup;
|
|
7349
|
-
}
|
|
7354
|
+
else if (this.getPanel(group.id)) {
|
|
7355
|
+
const removedGroup = this.doRemoveGroup(group, {
|
|
7356
|
+
skipDispose: true,
|
|
7357
|
+
skipActive: true,
|
|
7358
|
+
});
|
|
7359
|
+
removedGroup.model.renderContainer =
|
|
7360
|
+
this.overlayRenderContainer;
|
|
7361
|
+
removedGroup.model.location = { type: 'grid' };
|
|
7362
|
+
returnedGroup = removedGroup;
|
|
7350
7363
|
}
|
|
7351
7364
|
}));
|
|
7352
7365
|
this._popoutGroups.push(value);
|
|
7353
7366
|
this.updateWatermark();
|
|
7354
7367
|
})
|
|
7355
7368
|
.catch((err) => {
|
|
7356
|
-
console.error(err);
|
|
7369
|
+
console.error('dockview: failed to create popout window', err);
|
|
7357
7370
|
});
|
|
7358
7371
|
}
|
|
7359
7372
|
addFloatingGroup(item, coord, options) {
|
|
@@ -7396,7 +7409,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7396
7409
|
this.doRemoveGroup(item, {
|
|
7397
7410
|
skipDispose: true,
|
|
7398
7411
|
skipPopoutReturn: true,
|
|
7399
|
-
skipPopoutAssociated:
|
|
7412
|
+
skipPopoutAssociated: false,
|
|
7400
7413
|
});
|
|
7401
7414
|
}
|
|
7402
7415
|
}
|
|
@@ -7756,7 +7769,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7756
7769
|
clear() {
|
|
7757
7770
|
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
7758
7771
|
const hasActiveGroup = !!this.activeGroup;
|
|
7759
|
-
!!this.activePanel;
|
|
7760
7772
|
for (const group of groups) {
|
|
7761
7773
|
// remove the group will automatically remove the panels
|
|
7762
7774
|
this.removeGroup(group, { skipActive: true });
|
|
@@ -7940,7 +7952,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7940
7952
|
}
|
|
7941
7953
|
addGroup(options) {
|
|
7942
7954
|
var _a;
|
|
7943
|
-
const group = this.createGroup(options);
|
|
7944
7955
|
if (options) {
|
|
7945
7956
|
let referenceGroup;
|
|
7946
7957
|
if (isGroupOptionsWithPanel(options)) {
|
|
@@ -7974,6 +7985,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7974
7985
|
const target = toTarget(options.direction || 'within');
|
|
7975
7986
|
const location = getGridLocation(referenceGroup.element);
|
|
7976
7987
|
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
7988
|
+
const group = this.createGroup(options);
|
|
7977
7989
|
this.doAddGroup(group, relativeLocation);
|
|
7978
7990
|
if (!options.skipSetActive) {
|
|
7979
7991
|
this.doSetGroupAndPanelActive(group);
|
|
@@ -7981,6 +7993,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7981
7993
|
return group;
|
|
7982
7994
|
}
|
|
7983
7995
|
else {
|
|
7996
|
+
const group = this.createGroup(options);
|
|
7984
7997
|
this.doAddGroup(group);
|
|
7985
7998
|
this.doSetGroupAndPanelActive(group);
|
|
7986
7999
|
return group;
|
|
@@ -8261,7 +8274,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8261
8274
|
}
|
|
8262
8275
|
let id = options === null || options === void 0 ? void 0 : options.id;
|
|
8263
8276
|
if (id && this._groups.has(options.id)) {
|
|
8264
|
-
console.warn(`Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
|
|
8277
|
+
console.warn(`dockview: Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
|
|
8265
8278
|
id = undefined;
|
|
8266
8279
|
}
|
|
8267
8280
|
if (!id) {
|
|
@@ -9478,7 +9491,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9478
9491
|
}
|
|
9479
9492
|
update(event) {
|
|
9480
9493
|
var _a;
|
|
9481
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
9494
|
+
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update({ params: event.params });
|
|
9482
9495
|
}
|
|
9483
9496
|
layout(_width, _height) {
|
|
9484
9497
|
// noop
|
|
@@ -9516,7 +9529,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9516
9529
|
}
|
|
9517
9530
|
update(event) {
|
|
9518
9531
|
var _a;
|
|
9519
|
-
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
9532
|
+
(_a = this.part) === null || _a === void 0 ? void 0 : _a.update({ params: event.params });
|
|
9520
9533
|
}
|
|
9521
9534
|
layout(_width, _height) {
|
|
9522
9535
|
// noop - retrieval from api
|