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
|
*/
|
|
@@ -1295,11 +1295,13 @@ class Splitview {
|
|
|
1295
1295
|
document.removeEventListener('pointermove', onPointerMove);
|
|
1296
1296
|
document.removeEventListener('pointerup', end);
|
|
1297
1297
|
document.removeEventListener('pointercancel', end);
|
|
1298
|
+
document.removeEventListener('contextmenu', end);
|
|
1298
1299
|
this._onDidSashEnd.fire(undefined);
|
|
1299
1300
|
};
|
|
1300
1301
|
document.addEventListener('pointermove', onPointerMove);
|
|
1301
1302
|
document.addEventListener('pointerup', end);
|
|
1302
1303
|
document.addEventListener('pointercancel', end);
|
|
1304
|
+
document.addEventListener('contextmenu', end);
|
|
1303
1305
|
};
|
|
1304
1306
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
1305
1307
|
const sashItem = {
|
|
@@ -3782,8 +3784,8 @@ class DockviewApi {
|
|
|
3782
3784
|
/**
|
|
3783
3785
|
* Create a component from a serialized object.
|
|
3784
3786
|
*/
|
|
3785
|
-
fromJSON(data) {
|
|
3786
|
-
this.component.fromJSON(data);
|
|
3787
|
+
fromJSON(data, options) {
|
|
3788
|
+
this.component.fromJSON(data, options);
|
|
3787
3789
|
}
|
|
3788
3790
|
/**
|
|
3789
3791
|
* Create a serialized object of the current component.
|
|
@@ -5014,6 +5016,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
5014
5016
|
}
|
|
5015
5017
|
if (doRender) {
|
|
5016
5018
|
const focusTracker = trackFocus(container);
|
|
5019
|
+
this.focusTracker = focusTracker;
|
|
5017
5020
|
const disposable = new CompositeDisposable();
|
|
5018
5021
|
disposable.addDisposables(focusTracker, focusTracker.onDidFocus(() => this._onDidFocus.fire()), focusTracker.onDidBlur(() => this._onDidBlur.fire()));
|
|
5019
5022
|
this.disposable.value = disposable;
|
|
@@ -5041,6 +5044,16 @@ class ContentContainer extends CompositeDisposable {
|
|
|
5041
5044
|
this.disposable.dispose();
|
|
5042
5045
|
super.dispose();
|
|
5043
5046
|
}
|
|
5047
|
+
/**
|
|
5048
|
+
* Refresh the focus tracker state to handle cases where focus state
|
|
5049
|
+
* gets out of sync due to programmatic panel activation
|
|
5050
|
+
*/
|
|
5051
|
+
refreshFocusState() {
|
|
5052
|
+
var _a;
|
|
5053
|
+
if ((_a = this.focusTracker) === null || _a === void 0 ? void 0 : _a.refreshState) {
|
|
5054
|
+
this.focusTracker.refreshState();
|
|
5055
|
+
}
|
|
5056
|
+
}
|
|
5044
5057
|
}
|
|
5045
5058
|
|
|
5046
5059
|
function addGhostImage(dataTransfer, ghostElement, options) {
|
|
@@ -5150,7 +5163,7 @@ class Tab extends CompositeDisposable {
|
|
|
5150
5163
|
}
|
|
5151
5164
|
}
|
|
5152
5165
|
|
|
5153
|
-
class
|
|
5166
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5154
5167
|
get kind() {
|
|
5155
5168
|
return this.options.kind;
|
|
5156
5169
|
}
|
|
@@ -5498,7 +5511,7 @@ class Tabs extends CompositeDisposable {
|
|
|
5498
5511
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5499
5512
|
});
|
|
5500
5513
|
}), tab.onWillShowOverlay((event) => {
|
|
5501
|
-
this._onWillShowOverlay.fire(new
|
|
5514
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5502
5515
|
kind: 'tab',
|
|
5503
5516
|
panel: this.group.activePanel,
|
|
5504
5517
|
api: this.accessor.api,
|
|
@@ -5662,7 +5675,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5662
5675
|
index: this.tabs.size,
|
|
5663
5676
|
});
|
|
5664
5677
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5665
|
-
this._onWillShowOverlay.fire(new
|
|
5678
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5666
5679
|
kind: 'header_space',
|
|
5667
5680
|
panel: this.group.activePanel,
|
|
5668
5681
|
api: this.accessor.api,
|
|
@@ -6056,7 +6069,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
6056
6069
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6057
6070
|
this._onWillShowOverlay.fire(event);
|
|
6058
6071
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6059
|
-
this._onWillShowOverlay.fire(new
|
|
6072
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
6060
6073
|
kind: 'content',
|
|
6061
6074
|
panel: this.activePanel,
|
|
6062
6075
|
api: this._api,
|
|
@@ -6367,8 +6380,11 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
6367
6380
|
this._activePanel = panel;
|
|
6368
6381
|
if (panel) {
|
|
6369
6382
|
this.tabsContainer.setActivePanel(panel);
|
|
6383
|
+
this.contentContainer.openPanel(panel);
|
|
6370
6384
|
panel.layout(this._width, this._height);
|
|
6371
6385
|
this.updateMru(panel);
|
|
6386
|
+
// Refresh focus state to handle programmatic activation without DOM focus change
|
|
6387
|
+
this.contentContainer.refreshFocusState();
|
|
6372
6388
|
this._onDidActivePanelChange.fire({
|
|
6373
6389
|
panel,
|
|
6374
6390
|
});
|
|
@@ -6729,7 +6745,19 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
6729
6745
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6730
6746
|
this._onDidActivePanelChange = new Emitter();
|
|
6731
6747
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6732
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange)
|
|
6748
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
|
|
6749
|
+
// When becoming visible, apply any pending size change
|
|
6750
|
+
if (event.isVisible && this._pendingSize) {
|
|
6751
|
+
super.setSize(this._pendingSize);
|
|
6752
|
+
this._pendingSize = undefined;
|
|
6753
|
+
}
|
|
6754
|
+
}));
|
|
6755
|
+
}
|
|
6756
|
+
setSize(event) {
|
|
6757
|
+
// Always store the requested size
|
|
6758
|
+
this._pendingSize = Object.assign({}, event);
|
|
6759
|
+
// Apply the size change immediately
|
|
6760
|
+
super.setSize(event);
|
|
6733
6761
|
}
|
|
6734
6762
|
close() {
|
|
6735
6763
|
if (!this._group) {
|
|
@@ -7198,6 +7226,18 @@ class DockviewPanel extends CompositeDisposable {
|
|
|
7198
7226
|
params: this._params,
|
|
7199
7227
|
});
|
|
7200
7228
|
}
|
|
7229
|
+
updateFromStateModel(state) {
|
|
7230
|
+
var _a, _b, _c;
|
|
7231
|
+
this._maximumHeight = state.maximumHeight;
|
|
7232
|
+
this._minimumHeight = state.minimumHeight;
|
|
7233
|
+
this._maximumWidth = state.maximumWidth;
|
|
7234
|
+
this._minimumWidth = state.minimumWidth;
|
|
7235
|
+
this.update({ params: (_a = state.params) !== null && _a !== void 0 ? _a : {} });
|
|
7236
|
+
this.setTitle((_b = state.title) !== null && _b !== void 0 ? _b : this.id);
|
|
7237
|
+
this.setRenderer((_c = state.renderer) !== null && _c !== void 0 ? _c : this.accessor.renderer);
|
|
7238
|
+
// state.contentComponent;
|
|
7239
|
+
// state.tabComponent;
|
|
7240
|
+
}
|
|
7201
7241
|
updateParentGroup(group, options) {
|
|
7202
7242
|
this._group = group;
|
|
7203
7243
|
this.api.group = this._group;
|
|
@@ -7669,13 +7709,16 @@ class Overlay extends CompositeDisposable {
|
|
|
7669
7709
|
let right = undefined;
|
|
7670
7710
|
let width = undefined;
|
|
7671
7711
|
const moveTop = () => {
|
|
7672
|
-
|
|
7712
|
+
// When dragging top handle, constrain top position to prevent oversizing
|
|
7713
|
+
const maxTop = startPosition.originalY +
|
|
7673
7714
|
startPosition.originalHeight >
|
|
7674
7715
|
containerRect.height
|
|
7675
|
-
?
|
|
7716
|
+
? Math.max(0, containerRect.height -
|
|
7717
|
+
Overlay.MINIMUM_HEIGHT)
|
|
7676
7718
|
: Math.max(0, startPosition.originalY +
|
|
7677
7719
|
startPosition.originalHeight -
|
|
7678
|
-
Overlay.MINIMUM_HEIGHT)
|
|
7720
|
+
Overlay.MINIMUM_HEIGHT);
|
|
7721
|
+
top = clamp(y, 0, maxTop);
|
|
7679
7722
|
height =
|
|
7680
7723
|
startPosition.originalY +
|
|
7681
7724
|
startPosition.originalHeight -
|
|
@@ -7686,22 +7729,27 @@ class Overlay extends CompositeDisposable {
|
|
|
7686
7729
|
top =
|
|
7687
7730
|
startPosition.originalY -
|
|
7688
7731
|
startPosition.originalHeight;
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7732
|
+
// When dragging bottom handle, constrain height to container height
|
|
7733
|
+
const minHeight = top < 0 &&
|
|
7734
|
+
typeof this.options.minimumInViewportHeight ===
|
|
7735
|
+
'number'
|
|
7692
7736
|
? -top +
|
|
7693
7737
|
this.options.minimumInViewportHeight
|
|
7694
|
-
: Overlay.MINIMUM_HEIGHT
|
|
7738
|
+
: Overlay.MINIMUM_HEIGHT;
|
|
7739
|
+
const maxHeight = containerRect.height - Math.max(0, top);
|
|
7740
|
+
height = clamp(y - top, minHeight, maxHeight);
|
|
7695
7741
|
bottom = containerRect.height - top - height;
|
|
7696
7742
|
};
|
|
7697
7743
|
const moveLeft = () => {
|
|
7698
|
-
|
|
7744
|
+
const maxLeft = startPosition.originalX +
|
|
7699
7745
|
startPosition.originalWidth >
|
|
7700
7746
|
containerRect.width
|
|
7701
|
-
?
|
|
7747
|
+
? Math.max(0, containerRect.width -
|
|
7748
|
+
Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
|
|
7702
7749
|
: Math.max(0, startPosition.originalX +
|
|
7703
7750
|
startPosition.originalWidth -
|
|
7704
|
-
Overlay.MINIMUM_WIDTH)
|
|
7751
|
+
Overlay.MINIMUM_WIDTH);
|
|
7752
|
+
left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
|
|
7705
7753
|
width =
|
|
7706
7754
|
startPosition.originalX +
|
|
7707
7755
|
startPosition.originalWidth -
|
|
@@ -7712,12 +7760,15 @@ class Overlay extends CompositeDisposable {
|
|
|
7712
7760
|
left =
|
|
7713
7761
|
startPosition.originalX -
|
|
7714
7762
|
startPosition.originalWidth;
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7763
|
+
// When dragging right handle, constrain width to container width
|
|
7764
|
+
const minWidth = left < 0 &&
|
|
7765
|
+
typeof this.options.minimumInViewportWidth ===
|
|
7766
|
+
'number'
|
|
7718
7767
|
? -left +
|
|
7719
7768
|
this.options.minimumInViewportWidth
|
|
7720
|
-
: Overlay.MINIMUM_WIDTH
|
|
7769
|
+
: Overlay.MINIMUM_WIDTH;
|
|
7770
|
+
const maxWidth = containerRect.width - Math.max(0, left);
|
|
7771
|
+
width = clamp(x - left, minWidth, maxWidth);
|
|
7721
7772
|
right = containerRect.width - left - width;
|
|
7722
7773
|
};
|
|
7723
7774
|
switch (direction) {
|
|
@@ -8547,7 +8598,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8547
8598
|
// option only available when no panels in primary grid
|
|
8548
8599
|
return;
|
|
8549
8600
|
}
|
|
8550
|
-
this._onWillShowOverlay.fire(new
|
|
8601
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8551
8602
|
kind: 'edge',
|
|
8552
8603
|
panel: undefined,
|
|
8553
8604
|
api: this._api,
|
|
@@ -8961,7 +9012,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8961
9012
|
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
|
|
8962
9013
|
const el = group.element.querySelector('.dv-void-container');
|
|
8963
9014
|
if (!el) {
|
|
8964
|
-
throw new Error('failed to find drag handle');
|
|
9015
|
+
throw new Error('dockview: failed to find drag handle');
|
|
8965
9016
|
}
|
|
8966
9017
|
overlay.setupDrag(el, {
|
|
8967
9018
|
inDragMode: typeof (options === null || options === void 0 ? void 0 : options.inDragMode) === 'boolean'
|
|
@@ -9033,7 +9084,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9033
9084
|
case 'right':
|
|
9034
9085
|
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
9035
9086
|
default:
|
|
9036
|
-
throw new Error(`unsupported position ${position}`);
|
|
9087
|
+
throw new Error(`dockview: unsupported position ${position}`);
|
|
9037
9088
|
}
|
|
9038
9089
|
}
|
|
9039
9090
|
updateOptions(options) {
|
|
@@ -9179,15 +9230,48 @@ class DockviewComponent extends BaseGrid {
|
|
|
9179
9230
|
}
|
|
9180
9231
|
return result;
|
|
9181
9232
|
}
|
|
9182
|
-
fromJSON(data) {
|
|
9233
|
+
fromJSON(data, options) {
|
|
9183
9234
|
var _a, _b;
|
|
9235
|
+
const existingPanels = new Map();
|
|
9236
|
+
let tempGroup;
|
|
9237
|
+
if (options === null || options === void 0 ? void 0 : options.reuseExistingPanels) {
|
|
9238
|
+
/**
|
|
9239
|
+
* What are we doing here?
|
|
9240
|
+
*
|
|
9241
|
+
* 1. Create a temporary group to hold any panels that currently exist and that also exist in the new layout
|
|
9242
|
+
* 2. Remove that temporary group from the group mapping so that it doesn't get cleared when we clear the layout
|
|
9243
|
+
*/
|
|
9244
|
+
tempGroup = this.createGroup();
|
|
9245
|
+
this._groups.delete(tempGroup.api.id);
|
|
9246
|
+
const newPanels = Object.keys(data.panels);
|
|
9247
|
+
for (const panel of this.panels) {
|
|
9248
|
+
if (newPanels.includes(panel.api.id)) {
|
|
9249
|
+
existingPanels.set(panel.api.id, panel);
|
|
9250
|
+
}
|
|
9251
|
+
}
|
|
9252
|
+
this.movingLock(() => {
|
|
9253
|
+
Array.from(existingPanels.values()).forEach((panel) => {
|
|
9254
|
+
this.moveGroupOrPanel({
|
|
9255
|
+
from: {
|
|
9256
|
+
groupId: panel.api.group.api.id,
|
|
9257
|
+
panelId: panel.api.id,
|
|
9258
|
+
},
|
|
9259
|
+
to: {
|
|
9260
|
+
group: tempGroup,
|
|
9261
|
+
position: 'center',
|
|
9262
|
+
},
|
|
9263
|
+
keepEmptyGroups: true,
|
|
9264
|
+
});
|
|
9265
|
+
});
|
|
9266
|
+
});
|
|
9267
|
+
}
|
|
9184
9268
|
this.clear();
|
|
9185
9269
|
if (typeof data !== 'object' || data === null) {
|
|
9186
|
-
throw new Error('serialized layout must be a non-null object');
|
|
9270
|
+
throw new Error('dockview: serialized layout must be a non-null object');
|
|
9187
9271
|
}
|
|
9188
9272
|
const { grid, panels, activeGroup } = data;
|
|
9189
9273
|
if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
|
|
9190
|
-
throw new Error('root must be of type branch');
|
|
9274
|
+
throw new Error('dockview: root must be of type branch');
|
|
9191
9275
|
}
|
|
9192
9276
|
try {
|
|
9193
9277
|
// take note of the existing dimensions
|
|
@@ -9196,7 +9280,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9196
9280
|
const createGroupFromSerializedState = (data) => {
|
|
9197
9281
|
const { id, locked, hideHeader, views, activeView } = data;
|
|
9198
9282
|
if (typeof id !== 'string') {
|
|
9199
|
-
throw new Error('group id must be of type string');
|
|
9283
|
+
throw new Error('dockview: group id must be of type string');
|
|
9200
9284
|
}
|
|
9201
9285
|
const group = this.createGroup({
|
|
9202
9286
|
id,
|
|
@@ -9211,17 +9295,38 @@ class DockviewComponent extends BaseGrid {
|
|
|
9211
9295
|
* In running this section first we avoid firing lots of 'add' events in the event of a failure
|
|
9212
9296
|
* due to a corruption of input data.
|
|
9213
9297
|
*/
|
|
9214
|
-
const
|
|
9215
|
-
|
|
9298
|
+
const existingPanel = existingPanels.get(child);
|
|
9299
|
+
if (tempGroup && existingPanel) {
|
|
9300
|
+
this.movingLock(() => {
|
|
9301
|
+
tempGroup.model.removePanel(existingPanel);
|
|
9302
|
+
});
|
|
9303
|
+
createdPanels.push(existingPanel);
|
|
9304
|
+
existingPanel.updateFromStateModel(panels[child]);
|
|
9305
|
+
}
|
|
9306
|
+
else {
|
|
9307
|
+
const panel = this._deserializer.fromJSON(panels[child], group);
|
|
9308
|
+
createdPanels.push(panel);
|
|
9309
|
+
}
|
|
9216
9310
|
}
|
|
9217
9311
|
for (let i = 0; i < views.length; i++) {
|
|
9218
9312
|
const panel = createdPanels[i];
|
|
9219
9313
|
const isActive = typeof activeView === 'string' &&
|
|
9220
9314
|
activeView === panel.id;
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9315
|
+
const hasExisting = existingPanels.has(panel.api.id);
|
|
9316
|
+
if (hasExisting) {
|
|
9317
|
+
this.movingLock(() => {
|
|
9318
|
+
group.model.openPanel(panel, {
|
|
9319
|
+
skipSetActive: !isActive,
|
|
9320
|
+
skipSetGroupActive: true,
|
|
9321
|
+
});
|
|
9322
|
+
});
|
|
9323
|
+
}
|
|
9324
|
+
else {
|
|
9325
|
+
group.model.openPanel(panel, {
|
|
9326
|
+
skipSetActive: !isActive,
|
|
9327
|
+
skipSetGroupActive: true,
|
|
9328
|
+
});
|
|
9329
|
+
}
|
|
9225
9330
|
}
|
|
9226
9331
|
if (!group.activePanel && group.panels.length > 0) {
|
|
9227
9332
|
group.model.openPanel(group.panels[group.panels.length - 1], {
|
|
@@ -9260,7 +9365,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
9260
9365
|
setTimeout(() => {
|
|
9261
9366
|
this.addPopoutGroup(group, {
|
|
9262
9367
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
9263
|
-
overridePopoutGroup: gridReferenceGroup
|
|
9368
|
+
overridePopoutGroup: gridReferenceGroup
|
|
9369
|
+
? group
|
|
9370
|
+
: undefined,
|
|
9264
9371
|
referenceGroup: gridReferenceGroup
|
|
9265
9372
|
? this.getPanel(gridReferenceGroup)
|
|
9266
9373
|
: undefined,
|
|
@@ -9346,11 +9453,11 @@ class DockviewComponent extends BaseGrid {
|
|
|
9346
9453
|
addPanel(options) {
|
|
9347
9454
|
var _a, _b;
|
|
9348
9455
|
if (this.panels.find((_) => _.id === options.id)) {
|
|
9349
|
-
throw new Error(`panel with id ${options.id} already exists`);
|
|
9456
|
+
throw new Error(`dockview: panel with id ${options.id} already exists`);
|
|
9350
9457
|
}
|
|
9351
9458
|
let referenceGroup;
|
|
9352
9459
|
if (options.position && options.floating) {
|
|
9353
|
-
throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9460
|
+
throw new Error('dockview: you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9354
9461
|
}
|
|
9355
9462
|
const initial = {
|
|
9356
9463
|
width: options.initialWidth,
|
|
@@ -9364,7 +9471,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9364
9471
|
: options.position.referencePanel;
|
|
9365
9472
|
index = options.position.index;
|
|
9366
9473
|
if (!referencePanel) {
|
|
9367
|
-
throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9474
|
+
throw new Error(`dockview: referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9368
9475
|
}
|
|
9369
9476
|
referenceGroup = this.findGroup(referencePanel);
|
|
9370
9477
|
}
|
|
@@ -9375,7 +9482,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9375
9482
|
: options.position.referenceGroup;
|
|
9376
9483
|
index = options.position.index;
|
|
9377
9484
|
if (!referenceGroup) {
|
|
9378
|
-
throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9485
|
+
throw new Error(`dockview: referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9379
9486
|
}
|
|
9380
9487
|
}
|
|
9381
9488
|
else {
|
|
@@ -9487,7 +9594,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9487
9594
|
}) {
|
|
9488
9595
|
const group = panel.group;
|
|
9489
9596
|
if (!group) {
|
|
9490
|
-
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9597
|
+
throw new Error(`dockview: cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9491
9598
|
}
|
|
9492
9599
|
group.model.removePanel(panel, {
|
|
9493
9600
|
skipSetActiveGroup: options.skipSetActiveGroup,
|
|
@@ -9536,11 +9643,11 @@ class DockviewComponent extends BaseGrid {
|
|
|
9536
9643
|
? this.panels.find((panel) => panel.id === options.referencePanel)
|
|
9537
9644
|
: options.referencePanel;
|
|
9538
9645
|
if (!referencePanel) {
|
|
9539
|
-
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
9646
|
+
throw new Error(`dockview: reference panel ${options.referencePanel} does not exist`);
|
|
9540
9647
|
}
|
|
9541
9648
|
referenceGroup = this.findGroup(referencePanel);
|
|
9542
9649
|
if (!referenceGroup) {
|
|
9543
|
-
throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9650
|
+
throw new Error(`dockview: reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9544
9651
|
}
|
|
9545
9652
|
}
|
|
9546
9653
|
else if (isGroupOptionsWithGroup(options)) {
|
|
@@ -9549,7 +9656,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9549
9656
|
? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
9550
9657
|
: options.referenceGroup;
|
|
9551
9658
|
if (!referenceGroup) {
|
|
9552
|
-
throw new Error(`reference group ${options.referenceGroup} does not exist`);
|
|
9659
|
+
throw new Error(`dockview: reference group ${options.referenceGroup} does not exist`);
|
|
9553
9660
|
}
|
|
9554
9661
|
}
|
|
9555
9662
|
else {
|
|
@@ -9617,7 +9724,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9617
9724
|
}
|
|
9618
9725
|
return floatingGroup.group;
|
|
9619
9726
|
}
|
|
9620
|
-
throw new Error('failed to find floating group');
|
|
9727
|
+
throw new Error('dockview: failed to find floating group');
|
|
9621
9728
|
}
|
|
9622
9729
|
if (group.api.location.type === 'popout') {
|
|
9623
9730
|
const selectedGroup = this._popoutGroups.find((_) => _.popoutGroup === group);
|
|
@@ -9648,7 +9755,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9648
9755
|
this.updateWatermark();
|
|
9649
9756
|
return selectedGroup.popoutGroup;
|
|
9650
9757
|
}
|
|
9651
|
-
throw new Error('failed to find popout group');
|
|
9758
|
+
throw new Error('dockview: failed to find popout group');
|
|
9652
9759
|
}
|
|
9653
9760
|
const re = super.doRemoveGroup(group, options);
|
|
9654
9761
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive)) {
|
|
@@ -9679,7 +9786,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9679
9786
|
? (_a = this._groups.get(sourceGroupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
9680
9787
|
: undefined;
|
|
9681
9788
|
if (!sourceGroup) {
|
|
9682
|
-
throw new Error(`Failed to find group id ${sourceGroupId}`);
|
|
9789
|
+
throw new Error(`dockview: Failed to find group id ${sourceGroupId}`);
|
|
9683
9790
|
}
|
|
9684
9791
|
if (sourceItemId === undefined) {
|
|
9685
9792
|
/**
|
|
@@ -9704,9 +9811,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
9704
9811
|
skipSetActiveGroup: true,
|
|
9705
9812
|
}));
|
|
9706
9813
|
if (!removedPanel) {
|
|
9707
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9814
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9708
9815
|
}
|
|
9709
|
-
if (sourceGroup.model.size === 0) {
|
|
9816
|
+
if (!options.keepEmptyGroups && sourceGroup.model.size === 0) {
|
|
9710
9817
|
// remove the group and do not set a new group as active
|
|
9711
9818
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9712
9819
|
}
|
|
@@ -9716,7 +9823,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
9716
9823
|
var _a;
|
|
9717
9824
|
return destinationGroup.model.openPanel(removedPanel, {
|
|
9718
9825
|
index: destinationIndex,
|
|
9719
|
-
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9826
|
+
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9827
|
+
!isDestinationGroupEmpty,
|
|
9720
9828
|
skipSetGroupActive: true,
|
|
9721
9829
|
});
|
|
9722
9830
|
});
|
|
@@ -9727,6 +9835,13 @@ class DockviewComponent extends BaseGrid {
|
|
|
9727
9835
|
panel: removedPanel,
|
|
9728
9836
|
from: sourceGroup,
|
|
9729
9837
|
});
|
|
9838
|
+
/**
|
|
9839
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
9840
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
9841
|
+
*/
|
|
9842
|
+
requestAnimationFrame(() => {
|
|
9843
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9844
|
+
});
|
|
9730
9845
|
}
|
|
9731
9846
|
else {
|
|
9732
9847
|
/**
|
|
@@ -9771,7 +9886,9 @@ class DockviewComponent extends BaseGrid {
|
|
|
9771
9886
|
}));
|
|
9772
9887
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9773
9888
|
const newGroup = this.createGroupAtLocation(targetLocation);
|
|
9774
|
-
this.movingLock(() => newGroup.model.openPanel(removedPanel
|
|
9889
|
+
this.movingLock(() => newGroup.model.openPanel(removedPanel, {
|
|
9890
|
+
skipSetActive: true,
|
|
9891
|
+
}));
|
|
9775
9892
|
this.doSetGroupAndPanelActive(newGroup);
|
|
9776
9893
|
this._onDidMovePanel.fire({
|
|
9777
9894
|
panel: this.getGroupPanel(sourceItemId),
|
|
@@ -9804,7 +9921,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9804
9921
|
skipSetActiveGroup: true,
|
|
9805
9922
|
}));
|
|
9806
9923
|
if (!removedPanel) {
|
|
9807
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9924
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9808
9925
|
}
|
|
9809
9926
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
9810
9927
|
const group = this.createGroupAtLocation(dropLocation);
|
|
@@ -9859,7 +9976,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9859
9976
|
case 'floating': {
|
|
9860
9977
|
const selectedFloatingGroup = this._floatingGroups.find((x) => x.group === from);
|
|
9861
9978
|
if (!selectedFloatingGroup) {
|
|
9862
|
-
throw new Error('failed to find floating group');
|
|
9979
|
+
throw new Error('dockview: failed to find floating group');
|
|
9863
9980
|
}
|
|
9864
9981
|
selectedFloatingGroup.dispose();
|
|
9865
9982
|
break;
|
|
@@ -9867,7 +9984,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9867
9984
|
case 'popout': {
|
|
9868
9985
|
const selectedPopoutGroup = this._popoutGroups.find((x) => x.popoutGroup === from);
|
|
9869
9986
|
if (!selectedPopoutGroup) {
|
|
9870
|
-
throw new Error('failed to find popout group');
|
|
9987
|
+
throw new Error('dockview: failed to find popout group');
|
|
9871
9988
|
}
|
|
9872
9989
|
// Remove from popout groups list to prevent automatic restoration
|
|
9873
9990
|
const index = this._popoutGroups.indexOf(selectedPopoutGroup);
|
|
@@ -12019,5 +12136,5 @@ const PaneviewReact = React.forwardRef((props, ref) => {
|
|
|
12019
12136
|
});
|
|
12020
12137
|
PaneviewReact.displayName = 'PaneviewComponent';
|
|
12021
12138
|
|
|
12022
|
-
export { BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDefaultTab, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewReact, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DraggablePaneviewPanel, Gridview, GridviewApi, GridviewComponent, GridviewPanel, GridviewReact, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewReact, PaneviewUnhandledDragOverEvent, ReactPart, ReactPartContext, SashState, Sizing, Splitview, SplitviewApi, SplitviewComponent, SplitviewPanel, SplitviewReact, Tab, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, isReactComponent, orthogonal, positionToDirection, themeAbyss, themeAbyssSpaced, themeDark, themeDracula, themeLight, themeLightSpaced, themeReplit, themeVisualStudio, toTarget, usePortalsLifecycle };
|
|
12139
|
+
export { BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDefaultTab, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewReact, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DockviewWillShowOverlayLocationEvent, DraggablePaneviewPanel, Gridview, GridviewApi, GridviewComponent, GridviewPanel, GridviewReact, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewReact, PaneviewUnhandledDragOverEvent, ReactPart, ReactPartContext, SashState, Sizing, Splitview, SplitviewApi, SplitviewComponent, SplitviewPanel, SplitviewReact, Tab, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, isReactComponent, orthogonal, positionToDirection, themeAbyss, themeAbyssSpaced, themeDark, themeDracula, themeLight, themeLightSpaced, themeReplit, themeVisualStudio, toTarget, usePortalsLifecycle };
|
|
12023
12140
|
//# sourceMappingURL=dockview-react.esm.js.map
|