dockview-react 4.11.0 → 4.13.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/dockview-react.amd.js +172 -54
- package/dist/dockview-react.amd.js.map +1 -1
- package/dist/dockview-react.amd.min.js +2 -2
- package/dist/dockview-react.amd.min.js.map +1 -1
- package/dist/dockview-react.amd.min.noStyle.js +2 -2
- package/dist/dockview-react.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-react.amd.noStyle.js +172 -54
- package/dist/dockview-react.amd.noStyle.js.map +1 -1
- package/dist/dockview-react.cjs.js +172 -54
- package/dist/dockview-react.cjs.js.map +1 -1
- package/dist/dockview-react.esm.js +172 -55
- package/dist/dockview-react.esm.js.map +1 -1
- package/dist/dockview-react.esm.min.js +2 -2
- package/dist/dockview-react.esm.min.js.map +1 -1
- package/dist/dockview-react.js +172 -54
- package/dist/dockview-react.js.map +1 -1
- package/dist/dockview-react.min.js +2 -2
- package/dist/dockview-react.min.js.map +1 -1
- package/dist/dockview-react.min.noStyle.js +2 -2
- package/dist/dockview-react.min.noStyle.js.map +1 -1
- package/dist/dockview-react.noStyle.js +172 -54
- package/dist/dockview-react.noStyle.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.13.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -1297,11 +1297,13 @@ class Splitview {
|
|
|
1297
1297
|
document.removeEventListener('pointermove', onPointerMove);
|
|
1298
1298
|
document.removeEventListener('pointerup', end);
|
|
1299
1299
|
document.removeEventListener('pointercancel', end);
|
|
1300
|
+
document.removeEventListener('contextmenu', end);
|
|
1300
1301
|
this._onDidSashEnd.fire(undefined);
|
|
1301
1302
|
};
|
|
1302
1303
|
document.addEventListener('pointermove', onPointerMove);
|
|
1303
1304
|
document.addEventListener('pointerup', end);
|
|
1304
1305
|
document.addEventListener('pointercancel', end);
|
|
1306
|
+
document.addEventListener('contextmenu', end);
|
|
1305
1307
|
};
|
|
1306
1308
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
1307
1309
|
const sashItem = {
|
|
@@ -3784,8 +3786,8 @@ class DockviewApi {
|
|
|
3784
3786
|
/**
|
|
3785
3787
|
* Create a component from a serialized object.
|
|
3786
3788
|
*/
|
|
3787
|
-
fromJSON(data) {
|
|
3788
|
-
this.component.fromJSON(data);
|
|
3789
|
+
fromJSON(data, options) {
|
|
3790
|
+
this.component.fromJSON(data, options);
|
|
3789
3791
|
}
|
|
3790
3792
|
/**
|
|
3791
3793
|
* Create a serialized object of the current component.
|
|
@@ -5016,6 +5018,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
5016
5018
|
}
|
|
5017
5019
|
if (doRender) {
|
|
5018
5020
|
const focusTracker = trackFocus(container);
|
|
5021
|
+
this.focusTracker = focusTracker;
|
|
5019
5022
|
const disposable = new CompositeDisposable();
|
|
5020
5023
|
disposable.addDisposables(focusTracker, focusTracker.onDidFocus(() => this._onDidFocus.fire()), focusTracker.onDidBlur(() => this._onDidBlur.fire()));
|
|
5021
5024
|
this.disposable.value = disposable;
|
|
@@ -5043,6 +5046,16 @@ class ContentContainer extends CompositeDisposable {
|
|
|
5043
5046
|
this.disposable.dispose();
|
|
5044
5047
|
super.dispose();
|
|
5045
5048
|
}
|
|
5049
|
+
/**
|
|
5050
|
+
* Refresh the focus tracker state to handle cases where focus state
|
|
5051
|
+
* gets out of sync due to programmatic panel activation
|
|
5052
|
+
*/
|
|
5053
|
+
refreshFocusState() {
|
|
5054
|
+
var _a;
|
|
5055
|
+
if ((_a = this.focusTracker) === null || _a === void 0 ? void 0 : _a.refreshState) {
|
|
5056
|
+
this.focusTracker.refreshState();
|
|
5057
|
+
}
|
|
5058
|
+
}
|
|
5046
5059
|
}
|
|
5047
5060
|
|
|
5048
5061
|
function addGhostImage(dataTransfer, ghostElement, options) {
|
|
@@ -5152,7 +5165,7 @@ class Tab extends CompositeDisposable {
|
|
|
5152
5165
|
}
|
|
5153
5166
|
}
|
|
5154
5167
|
|
|
5155
|
-
class
|
|
5168
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5156
5169
|
get kind() {
|
|
5157
5170
|
return this.options.kind;
|
|
5158
5171
|
}
|
|
@@ -5500,7 +5513,7 @@ class Tabs extends CompositeDisposable {
|
|
|
5500
5513
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5501
5514
|
});
|
|
5502
5515
|
}), tab.onWillShowOverlay((event) => {
|
|
5503
|
-
this._onWillShowOverlay.fire(new
|
|
5516
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5504
5517
|
kind: 'tab',
|
|
5505
5518
|
panel: this.group.activePanel,
|
|
5506
5519
|
api: this.accessor.api,
|
|
@@ -5664,7 +5677,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5664
5677
|
index: this.tabs.size,
|
|
5665
5678
|
});
|
|
5666
5679
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5667
|
-
this._onWillShowOverlay.fire(new
|
|
5680
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5668
5681
|
kind: 'header_space',
|
|
5669
5682
|
panel: this.group.activePanel,
|
|
5670
5683
|
api: this.accessor.api,
|
|
@@ -6058,7 +6071,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
6058
6071
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6059
6072
|
this._onWillShowOverlay.fire(event);
|
|
6060
6073
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6061
|
-
this._onWillShowOverlay.fire(new
|
|
6074
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
6062
6075
|
kind: 'content',
|
|
6063
6076
|
panel: this.activePanel,
|
|
6064
6077
|
api: this._api,
|
|
@@ -6369,8 +6382,11 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
6369
6382
|
this._activePanel = panel;
|
|
6370
6383
|
if (panel) {
|
|
6371
6384
|
this.tabsContainer.setActivePanel(panel);
|
|
6385
|
+
this.contentContainer.openPanel(panel);
|
|
6372
6386
|
panel.layout(this._width, this._height);
|
|
6373
6387
|
this.updateMru(panel);
|
|
6388
|
+
// Refresh focus state to handle programmatic activation without DOM focus change
|
|
6389
|
+
this.contentContainer.refreshFocusState();
|
|
6374
6390
|
this._onDidActivePanelChange.fire({
|
|
6375
6391
|
panel,
|
|
6376
6392
|
});
|
|
@@ -6731,7 +6747,19 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
6731
6747
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6732
6748
|
this._onDidActivePanelChange = new Emitter();
|
|
6733
6749
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6734
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange)
|
|
6750
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
|
|
6751
|
+
// When becoming visible, apply any pending size change
|
|
6752
|
+
if (event.isVisible && this._pendingSize) {
|
|
6753
|
+
super.setSize(this._pendingSize);
|
|
6754
|
+
this._pendingSize = undefined;
|
|
6755
|
+
}
|
|
6756
|
+
}));
|
|
6757
|
+
}
|
|
6758
|
+
setSize(event) {
|
|
6759
|
+
// Always store the requested size
|
|
6760
|
+
this._pendingSize = Object.assign({}, event);
|
|
6761
|
+
// Apply the size change immediately
|
|
6762
|
+
super.setSize(event);
|
|
6735
6763
|
}
|
|
6736
6764
|
close() {
|
|
6737
6765
|
if (!this._group) {
|
|
@@ -7200,6 +7228,18 @@ class DockviewPanel extends CompositeDisposable {
|
|
|
7200
7228
|
params: this._params,
|
|
7201
7229
|
});
|
|
7202
7230
|
}
|
|
7231
|
+
updateFromStateModel(state) {
|
|
7232
|
+
var _a, _b, _c;
|
|
7233
|
+
this._maximumHeight = state.maximumHeight;
|
|
7234
|
+
this._minimumHeight = state.minimumHeight;
|
|
7235
|
+
this._maximumWidth = state.maximumWidth;
|
|
7236
|
+
this._minimumWidth = state.minimumWidth;
|
|
7237
|
+
this.update({ params: (_a = state.params) !== null && _a !== void 0 ? _a : {} });
|
|
7238
|
+
this.setTitle((_b = state.title) !== null && _b !== void 0 ? _b : this.id);
|
|
7239
|
+
this.setRenderer((_c = state.renderer) !== null && _c !== void 0 ? _c : this.accessor.renderer);
|
|
7240
|
+
// state.contentComponent;
|
|
7241
|
+
// state.tabComponent;
|
|
7242
|
+
}
|
|
7203
7243
|
updateParentGroup(group, options) {
|
|
7204
7244
|
this._group = group;
|
|
7205
7245
|
this.api.group = this._group;
|
|
@@ -7671,13 +7711,16 @@ class Overlay extends CompositeDisposable {
|
|
|
7671
7711
|
let right = undefined;
|
|
7672
7712
|
let width = undefined;
|
|
7673
7713
|
const moveTop = () => {
|
|
7674
|
-
|
|
7714
|
+
// When dragging top handle, constrain top position to prevent oversizing
|
|
7715
|
+
const maxTop = startPosition.originalY +
|
|
7675
7716
|
startPosition.originalHeight >
|
|
7676
7717
|
containerRect.height
|
|
7677
|
-
?
|
|
7718
|
+
? Math.max(0, containerRect.height -
|
|
7719
|
+
Overlay.MINIMUM_HEIGHT)
|
|
7678
7720
|
: Math.max(0, startPosition.originalY +
|
|
7679
7721
|
startPosition.originalHeight -
|
|
7680
|
-
Overlay.MINIMUM_HEIGHT)
|
|
7722
|
+
Overlay.MINIMUM_HEIGHT);
|
|
7723
|
+
top = clamp(y, 0, maxTop);
|
|
7681
7724
|
height =
|
|
7682
7725
|
startPosition.originalY +
|
|
7683
7726
|
startPosition.originalHeight -
|
|
@@ -7688,22 +7731,27 @@ class Overlay extends CompositeDisposable {
|
|
|
7688
7731
|
top =
|
|
7689
7732
|
startPosition.originalY -
|
|
7690
7733
|
startPosition.originalHeight;
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7734
|
+
// When dragging bottom handle, constrain height to container height
|
|
7735
|
+
const minHeight = top < 0 &&
|
|
7736
|
+
typeof this.options.minimumInViewportHeight ===
|
|
7737
|
+
'number'
|
|
7694
7738
|
? -top +
|
|
7695
7739
|
this.options.minimumInViewportHeight
|
|
7696
|
-
: Overlay.MINIMUM_HEIGHT
|
|
7740
|
+
: Overlay.MINIMUM_HEIGHT;
|
|
7741
|
+
const maxHeight = containerRect.height - Math.max(0, top);
|
|
7742
|
+
height = clamp(y - top, minHeight, maxHeight);
|
|
7697
7743
|
bottom = containerRect.height - top - height;
|
|
7698
7744
|
};
|
|
7699
7745
|
const moveLeft = () => {
|
|
7700
|
-
|
|
7746
|
+
const maxLeft = startPosition.originalX +
|
|
7701
7747
|
startPosition.originalWidth >
|
|
7702
7748
|
containerRect.width
|
|
7703
|
-
?
|
|
7749
|
+
? Math.max(0, containerRect.width -
|
|
7750
|
+
Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
|
|
7704
7751
|
: Math.max(0, startPosition.originalX +
|
|
7705
7752
|
startPosition.originalWidth -
|
|
7706
|
-
Overlay.MINIMUM_WIDTH)
|
|
7753
|
+
Overlay.MINIMUM_WIDTH);
|
|
7754
|
+
left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
|
|
7707
7755
|
width =
|
|
7708
7756
|
startPosition.originalX +
|
|
7709
7757
|
startPosition.originalWidth -
|
|
@@ -7714,12 +7762,15 @@ class Overlay extends CompositeDisposable {
|
|
|
7714
7762
|
left =
|
|
7715
7763
|
startPosition.originalX -
|
|
7716
7764
|
startPosition.originalWidth;
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7765
|
+
// When dragging right handle, constrain width to container width
|
|
7766
|
+
const minWidth = left < 0 &&
|
|
7767
|
+
typeof this.options.minimumInViewportWidth ===
|
|
7768
|
+
'number'
|
|
7720
7769
|
? -left +
|
|
7721
7770
|
this.options.minimumInViewportWidth
|
|
7722
|
-
: Overlay.MINIMUM_WIDTH
|
|
7771
|
+
: Overlay.MINIMUM_WIDTH;
|
|
7772
|
+
const maxWidth = containerRect.width - Math.max(0, left);
|
|
7773
|
+
width = clamp(x - left, minWidth, maxWidth);
|
|
7723
7774
|
right = containerRect.width - left - width;
|
|
7724
7775
|
};
|
|
7725
7776
|
switch (direction) {
|
|
@@ -8549,7 +8600,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8549
8600
|
// option only available when no panels in primary grid
|
|
8550
8601
|
return;
|
|
8551
8602
|
}
|
|
8552
|
-
this._onWillShowOverlay.fire(new
|
|
8603
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8553
8604
|
kind: 'edge',
|
|
8554
8605
|
panel: undefined,
|
|
8555
8606
|
api: this._api,
|
|
@@ -8963,7 +9014,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8963
9014
|
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
|
|
8964
9015
|
const el = group.element.querySelector('.dv-void-container');
|
|
8965
9016
|
if (!el) {
|
|
8966
|
-
throw new Error('failed to find drag handle');
|
|
9017
|
+
throw new Error('dockview: failed to find drag handle');
|
|
8967
9018
|
}
|
|
8968
9019
|
overlay.setupDrag(el, {
|
|
8969
9020
|
inDragMode: typeof (options === null || options === void 0 ? void 0 : options.inDragMode) === 'boolean'
|
|
@@ -9035,7 +9086,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9035
9086
|
case 'right':
|
|
9036
9087
|
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
9037
9088
|
default:
|
|
9038
|
-
throw new Error(`unsupported position ${position}`);
|
|
9089
|
+
throw new Error(`dockview: unsupported position ${position}`);
|
|
9039
9090
|
}
|
|
9040
9091
|
}
|
|
9041
9092
|
updateOptions(options) {
|
|
@@ -9181,15 +9232,48 @@ class DockviewComponent extends BaseGrid {
|
|
|
9181
9232
|
}
|
|
9182
9233
|
return result;
|
|
9183
9234
|
}
|
|
9184
|
-
fromJSON(data) {
|
|
9235
|
+
fromJSON(data, options) {
|
|
9185
9236
|
var _a, _b;
|
|
9237
|
+
const existingPanels = new Map();
|
|
9238
|
+
let tempGroup;
|
|
9239
|
+
if (options === null || options === void 0 ? void 0 : options.reuseExistingPanels) {
|
|
9240
|
+
/**
|
|
9241
|
+
* What are we doing here?
|
|
9242
|
+
*
|
|
9243
|
+
* 1. Create a temporary group to hold any panels that currently exist and that also exist in the new layout
|
|
9244
|
+
* 2. Remove that temporary group from the group mapping so that it doesn't get cleared when we clear the layout
|
|
9245
|
+
*/
|
|
9246
|
+
tempGroup = this.createGroup();
|
|
9247
|
+
this._groups.delete(tempGroup.api.id);
|
|
9248
|
+
const newPanels = Object.keys(data.panels);
|
|
9249
|
+
for (const panel of this.panels) {
|
|
9250
|
+
if (newPanels.includes(panel.api.id)) {
|
|
9251
|
+
existingPanels.set(panel.api.id, panel);
|
|
9252
|
+
}
|
|
9253
|
+
}
|
|
9254
|
+
this.movingLock(() => {
|
|
9255
|
+
Array.from(existingPanels.values()).forEach((panel) => {
|
|
9256
|
+
this.moveGroupOrPanel({
|
|
9257
|
+
from: {
|
|
9258
|
+
groupId: panel.api.group.api.id,
|
|
9259
|
+
panelId: panel.api.id,
|
|
9260
|
+
},
|
|
9261
|
+
to: {
|
|
9262
|
+
group: tempGroup,
|
|
9263
|
+
position: 'center',
|
|
9264
|
+
},
|
|
9265
|
+
keepEmptyGroups: true,
|
|
9266
|
+
});
|
|
9267
|
+
});
|
|
9268
|
+
});
|
|
9269
|
+
}
|
|
9186
9270
|
this.clear();
|
|
9187
9271
|
if (typeof data !== 'object' || data === null) {
|
|
9188
|
-
throw new Error('serialized layout must be a non-null object');
|
|
9272
|
+
throw new Error('dockview: serialized layout must be a non-null object');
|
|
9189
9273
|
}
|
|
9190
9274
|
const { grid, panels, activeGroup } = data;
|
|
9191
9275
|
if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
|
|
9192
|
-
throw new Error('root must be of type branch');
|
|
9276
|
+
throw new Error('dockview: root must be of type branch');
|
|
9193
9277
|
}
|
|
9194
9278
|
try {
|
|
9195
9279
|
// take note of the existing dimensions
|
|
@@ -9198,7 +9282,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9198
9282
|
const createGroupFromSerializedState = (data) => {
|
|
9199
9283
|
const { id, locked, hideHeader, views, activeView } = data;
|
|
9200
9284
|
if (typeof id !== 'string') {
|
|
9201
|
-
throw new Error('group id must be of type string');
|
|
9285
|
+
throw new Error('dockview: group id must be of type string');
|
|
9202
9286
|
}
|
|
9203
9287
|
const group = this.createGroup({
|
|
9204
9288
|
id,
|
|
@@ -9213,17 +9297,38 @@ class DockviewComponent extends BaseGrid {
|
|
|
9213
9297
|
* In running this section first we avoid firing lots of 'add' events in the event of a failure
|
|
9214
9298
|
* due to a corruption of input data.
|
|
9215
9299
|
*/
|
|
9216
|
-
const
|
|
9217
|
-
|
|
9300
|
+
const existingPanel = existingPanels.get(child);
|
|
9301
|
+
if (tempGroup && existingPanel) {
|
|
9302
|
+
this.movingLock(() => {
|
|
9303
|
+
tempGroup.model.removePanel(existingPanel);
|
|
9304
|
+
});
|
|
9305
|
+
createdPanels.push(existingPanel);
|
|
9306
|
+
existingPanel.updateFromStateModel(panels[child]);
|
|
9307
|
+
}
|
|
9308
|
+
else {
|
|
9309
|
+
const panel = this._deserializer.fromJSON(panels[child], group);
|
|
9310
|
+
createdPanels.push(panel);
|
|
9311
|
+
}
|
|
9218
9312
|
}
|
|
9219
9313
|
for (let i = 0; i < views.length; i++) {
|
|
9220
9314
|
const panel = createdPanels[i];
|
|
9221
9315
|
const isActive = typeof activeView === 'string' &&
|
|
9222
9316
|
activeView === panel.id;
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9317
|
+
const hasExisting = existingPanels.has(panel.api.id);
|
|
9318
|
+
if (hasExisting) {
|
|
9319
|
+
this.movingLock(() => {
|
|
9320
|
+
group.model.openPanel(panel, {
|
|
9321
|
+
skipSetActive: !isActive,
|
|
9322
|
+
skipSetGroupActive: true,
|
|
9323
|
+
});
|
|
9324
|
+
});
|
|
9325
|
+
}
|
|
9326
|
+
else {
|
|
9327
|
+
group.model.openPanel(panel, {
|
|
9328
|
+
skipSetActive: !isActive,
|
|
9329
|
+
skipSetGroupActive: true,
|
|
9330
|
+
});
|
|
9331
|
+
}
|
|
9227
9332
|
}
|
|
9228
9333
|
if (!group.activePanel && group.panels.length > 0) {
|
|
9229
9334
|
group.model.openPanel(group.panels[group.panels.length - 1], {
|
|
@@ -9262,7 +9367,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
9262
9367
|
setTimeout(() => {
|
|
9263
9368
|
this.addPopoutGroup(group, {
|
|
9264
9369
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
9265
|
-
overridePopoutGroup: gridReferenceGroup
|
|
9370
|
+
overridePopoutGroup: gridReferenceGroup
|
|
9371
|
+
? group
|
|
9372
|
+
: undefined,
|
|
9266
9373
|
referenceGroup: gridReferenceGroup
|
|
9267
9374
|
? this.getPanel(gridReferenceGroup)
|
|
9268
9375
|
: undefined,
|
|
@@ -9348,11 +9455,11 @@ class DockviewComponent extends BaseGrid {
|
|
|
9348
9455
|
addPanel(options) {
|
|
9349
9456
|
var _a, _b;
|
|
9350
9457
|
if (this.panels.find((_) => _.id === options.id)) {
|
|
9351
|
-
throw new Error(`panel with id ${options.id} already exists`);
|
|
9458
|
+
throw new Error(`dockview: panel with id ${options.id} already exists`);
|
|
9352
9459
|
}
|
|
9353
9460
|
let referenceGroup;
|
|
9354
9461
|
if (options.position && options.floating) {
|
|
9355
|
-
throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9462
|
+
throw new Error('dockview: you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9356
9463
|
}
|
|
9357
9464
|
const initial = {
|
|
9358
9465
|
width: options.initialWidth,
|
|
@@ -9366,7 +9473,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9366
9473
|
: options.position.referencePanel;
|
|
9367
9474
|
index = options.position.index;
|
|
9368
9475
|
if (!referencePanel) {
|
|
9369
|
-
throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9476
|
+
throw new Error(`dockview: referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9370
9477
|
}
|
|
9371
9478
|
referenceGroup = this.findGroup(referencePanel);
|
|
9372
9479
|
}
|
|
@@ -9377,7 +9484,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9377
9484
|
: options.position.referenceGroup;
|
|
9378
9485
|
index = options.position.index;
|
|
9379
9486
|
if (!referenceGroup) {
|
|
9380
|
-
throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9487
|
+
throw new Error(`dockview: referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9381
9488
|
}
|
|
9382
9489
|
}
|
|
9383
9490
|
else {
|
|
@@ -9489,7 +9596,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9489
9596
|
}) {
|
|
9490
9597
|
const group = panel.group;
|
|
9491
9598
|
if (!group) {
|
|
9492
|
-
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9599
|
+
throw new Error(`dockview: cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9493
9600
|
}
|
|
9494
9601
|
group.model.removePanel(panel, {
|
|
9495
9602
|
skipSetActiveGroup: options.skipSetActiveGroup,
|
|
@@ -9538,11 +9645,11 @@ class DockviewComponent extends BaseGrid {
|
|
|
9538
9645
|
? this.panels.find((panel) => panel.id === options.referencePanel)
|
|
9539
9646
|
: options.referencePanel;
|
|
9540
9647
|
if (!referencePanel) {
|
|
9541
|
-
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
9648
|
+
throw new Error(`dockview: reference panel ${options.referencePanel} does not exist`);
|
|
9542
9649
|
}
|
|
9543
9650
|
referenceGroup = this.findGroup(referencePanel);
|
|
9544
9651
|
if (!referenceGroup) {
|
|
9545
|
-
throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9652
|
+
throw new Error(`dockview: reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9546
9653
|
}
|
|
9547
9654
|
}
|
|
9548
9655
|
else if (isGroupOptionsWithGroup(options)) {
|
|
@@ -9551,7 +9658,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9551
9658
|
? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
9552
9659
|
: options.referenceGroup;
|
|
9553
9660
|
if (!referenceGroup) {
|
|
9554
|
-
throw new Error(`reference group ${options.referenceGroup} does not exist`);
|
|
9661
|
+
throw new Error(`dockview: reference group ${options.referenceGroup} does not exist`);
|
|
9555
9662
|
}
|
|
9556
9663
|
}
|
|
9557
9664
|
else {
|
|
@@ -9619,7 +9726,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9619
9726
|
}
|
|
9620
9727
|
return floatingGroup.group;
|
|
9621
9728
|
}
|
|
9622
|
-
throw new Error('failed to find floating group');
|
|
9729
|
+
throw new Error('dockview: failed to find floating group');
|
|
9623
9730
|
}
|
|
9624
9731
|
if (group.api.location.type === 'popout') {
|
|
9625
9732
|
const selectedGroup = this._popoutGroups.find((_) => _.popoutGroup === group);
|
|
@@ -9650,7 +9757,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9650
9757
|
this.updateWatermark();
|
|
9651
9758
|
return selectedGroup.popoutGroup;
|
|
9652
9759
|
}
|
|
9653
|
-
throw new Error('failed to find popout group');
|
|
9760
|
+
throw new Error('dockview: failed to find popout group');
|
|
9654
9761
|
}
|
|
9655
9762
|
const re = super.doRemoveGroup(group, options);
|
|
9656
9763
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive)) {
|
|
@@ -9681,7 +9788,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9681
9788
|
? (_a = this._groups.get(sourceGroupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
9682
9789
|
: undefined;
|
|
9683
9790
|
if (!sourceGroup) {
|
|
9684
|
-
throw new Error(`Failed to find group id ${sourceGroupId}`);
|
|
9791
|
+
throw new Error(`dockview: Failed to find group id ${sourceGroupId}`);
|
|
9685
9792
|
}
|
|
9686
9793
|
if (sourceItemId === undefined) {
|
|
9687
9794
|
/**
|
|
@@ -9706,9 +9813,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
9706
9813
|
skipSetActiveGroup: true,
|
|
9707
9814
|
}));
|
|
9708
9815
|
if (!removedPanel) {
|
|
9709
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9816
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9710
9817
|
}
|
|
9711
|
-
if (sourceGroup.model.size === 0) {
|
|
9818
|
+
if (!options.keepEmptyGroups && sourceGroup.model.size === 0) {
|
|
9712
9819
|
// remove the group and do not set a new group as active
|
|
9713
9820
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9714
9821
|
}
|
|
@@ -9718,7 +9825,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
9718
9825
|
var _a;
|
|
9719
9826
|
return destinationGroup.model.openPanel(removedPanel, {
|
|
9720
9827
|
index: destinationIndex,
|
|
9721
|
-
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9828
|
+
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9829
|
+
!isDestinationGroupEmpty,
|
|
9722
9830
|
skipSetGroupActive: true,
|
|
9723
9831
|
});
|
|
9724
9832
|
});
|
|
@@ -9729,6 +9837,13 @@ class DockviewComponent extends BaseGrid {
|
|
|
9729
9837
|
panel: removedPanel,
|
|
9730
9838
|
from: sourceGroup,
|
|
9731
9839
|
});
|
|
9840
|
+
/**
|
|
9841
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
9842
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
9843
|
+
*/
|
|
9844
|
+
requestAnimationFrame(() => {
|
|
9845
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9846
|
+
});
|
|
9732
9847
|
}
|
|
9733
9848
|
else {
|
|
9734
9849
|
/**
|
|
@@ -9773,7 +9888,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
9773
9888
|
}));
|
|
9774
9889
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9775
9890
|
const newGroup = this.createGroupAtLocation(targetLocation);
|
|
9776
|
-
this.movingLock(() => newGroup.model.openPanel(removedPanel
|
|
9891
|
+
this.movingLock(() => newGroup.model.openPanel(removedPanel, {
|
|
9892
|
+
skipSetActive: true,
|
|
9893
|
+
}));
|
|
9777
9894
|
this.doSetGroupAndPanelActive(newGroup);
|
|
9778
9895
|
this._onDidMovePanel.fire({
|
|
9779
9896
|
panel: this.getGroupPanel(sourceItemId),
|
|
@@ -9806,7 +9923,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9806
9923
|
skipSetActiveGroup: true,
|
|
9807
9924
|
}));
|
|
9808
9925
|
if (!removedPanel) {
|
|
9809
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9926
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9810
9927
|
}
|
|
9811
9928
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
9812
9929
|
const group = this.createGroupAtLocation(dropLocation);
|
|
@@ -9861,7 +9978,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9861
9978
|
case 'floating': {
|
|
9862
9979
|
const selectedFloatingGroup = this._floatingGroups.find((x) => x.group === from);
|
|
9863
9980
|
if (!selectedFloatingGroup) {
|
|
9864
|
-
throw new Error('failed to find floating group');
|
|
9981
|
+
throw new Error('dockview: failed to find floating group');
|
|
9865
9982
|
}
|
|
9866
9983
|
selectedFloatingGroup.dispose();
|
|
9867
9984
|
break;
|
|
@@ -9869,7 +9986,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9869
9986
|
case 'popout': {
|
|
9870
9987
|
const selectedPopoutGroup = this._popoutGroups.find((x) => x.popoutGroup === from);
|
|
9871
9988
|
if (!selectedPopoutGroup) {
|
|
9872
|
-
throw new Error('failed to find popout group');
|
|
9989
|
+
throw new Error('dockview: failed to find popout group');
|
|
9873
9990
|
}
|
|
9874
9991
|
// Remove from popout groups list to prevent automatic restoration
|
|
9875
9992
|
const index = this._popoutGroups.indexOf(selectedPopoutGroup);
|
|
@@ -12038,6 +12155,7 @@ exports.DockviewPanel = DockviewPanel;
|
|
|
12038
12155
|
exports.DockviewReact = DockviewReact;
|
|
12039
12156
|
exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
|
|
12040
12157
|
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
12158
|
+
exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
|
|
12041
12159
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
12042
12160
|
exports.Gridview = Gridview;
|
|
12043
12161
|
exports.GridviewApi = GridviewApi;
|