dockview-core 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/cjs/api/component.api.d.ts +5 -3
- package/dist/cjs/api/component.api.js +2 -2
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +3 -1
- package/dist/cjs/api/dockviewGroupPanelApi.js +24 -1
- package/dist/cjs/dockview/components/panel/content.d.ts +7 -0
- package/dist/cjs/dockview/components/panel/content.js +11 -0
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +2 -2
- package/dist/cjs/dockview/components/titlebar/tabs.js +1 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +3 -3
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +10 -4
- package/dist/cjs/dockview/dockviewComponent.js +167 -85
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +2 -2
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +4 -1
- package/dist/cjs/dockview/dockviewPanel.d.ts +6 -4
- package/dist/cjs/dockview/dockviewPanel.js +12 -0
- package/dist/cjs/dockview/events.d.ts +4 -4
- package/dist/cjs/dockview/events.js +14 -14
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +7 -2
- package/dist/cjs/overlay/overlay.js +25 -14
- package/dist/cjs/splitview/splitview.js +2 -0
- package/dist/dockview-core.amd.js +172 -54
- 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 +172 -54
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +172 -54
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +172 -55
- 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 +172 -54
- 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 +172 -54
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +5 -3
- package/dist/esm/api/component.api.js +2 -2
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +3 -1
- package/dist/esm/api/dockviewGroupPanelApi.js +13 -1
- package/dist/esm/dockview/components/panel/content.d.ts +7 -0
- package/dist/esm/dockview/components/panel/content.js +11 -0
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +2 -2
- package/dist/esm/dockview/components/titlebar/tabs.js +2 -2
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +3 -3
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +2 -2
- package/dist/esm/dockview/dockviewComponent.d.ts +10 -4
- package/dist/esm/dockview/dockviewComponent.js +99 -33
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +2 -2
- package/dist/esm/dockview/dockviewGroupPanelModel.js +5 -2
- package/dist/esm/dockview/dockviewPanel.d.ts +6 -4
- package/dist/esm/dockview/dockviewPanel.js +12 -0
- package/dist/esm/dockview/events.d.ts +4 -4
- package/dist/esm/dockview/events.js +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/overlay/overlay.js +26 -15
- package/dist/esm/splitview/splitview.js +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.13.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -1264,11 +1264,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1264
1264
|
document.removeEventListener('pointermove', onPointerMove);
|
|
1265
1265
|
document.removeEventListener('pointerup', end);
|
|
1266
1266
|
document.removeEventListener('pointercancel', end);
|
|
1267
|
+
document.removeEventListener('contextmenu', end);
|
|
1267
1268
|
this._onDidSashEnd.fire(undefined);
|
|
1268
1269
|
};
|
|
1269
1270
|
document.addEventListener('pointermove', onPointerMove);
|
|
1270
1271
|
document.addEventListener('pointerup', end);
|
|
1271
1272
|
document.addEventListener('pointercancel', end);
|
|
1273
|
+
document.addEventListener('contextmenu', end);
|
|
1272
1274
|
};
|
|
1273
1275
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
1274
1276
|
const sashItem = {
|
|
@@ -3751,8 +3753,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3751
3753
|
/**
|
|
3752
3754
|
* Create a component from a serialized object.
|
|
3753
3755
|
*/
|
|
3754
|
-
fromJSON(data) {
|
|
3755
|
-
this.component.fromJSON(data);
|
|
3756
|
+
fromJSON(data, options) {
|
|
3757
|
+
this.component.fromJSON(data, options);
|
|
3756
3758
|
}
|
|
3757
3759
|
/**
|
|
3758
3760
|
* Create a serialized object of the current component.
|
|
@@ -4983,6 +4985,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4983
4985
|
}
|
|
4984
4986
|
if (doRender) {
|
|
4985
4987
|
const focusTracker = trackFocus(container);
|
|
4988
|
+
this.focusTracker = focusTracker;
|
|
4986
4989
|
const disposable = new CompositeDisposable();
|
|
4987
4990
|
disposable.addDisposables(focusTracker, focusTracker.onDidFocus(() => this._onDidFocus.fire()), focusTracker.onDidBlur(() => this._onDidBlur.fire()));
|
|
4988
4991
|
this.disposable.value = disposable;
|
|
@@ -5010,6 +5013,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5010
5013
|
this.disposable.dispose();
|
|
5011
5014
|
super.dispose();
|
|
5012
5015
|
}
|
|
5016
|
+
/**
|
|
5017
|
+
* Refresh the focus tracker state to handle cases where focus state
|
|
5018
|
+
* gets out of sync due to programmatic panel activation
|
|
5019
|
+
*/
|
|
5020
|
+
refreshFocusState() {
|
|
5021
|
+
var _a;
|
|
5022
|
+
if ((_a = this.focusTracker) === null || _a === void 0 ? void 0 : _a.refreshState) {
|
|
5023
|
+
this.focusTracker.refreshState();
|
|
5024
|
+
}
|
|
5025
|
+
}
|
|
5013
5026
|
}
|
|
5014
5027
|
|
|
5015
5028
|
function addGhostImage(dataTransfer, ghostElement, options) {
|
|
@@ -5119,7 +5132,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5119
5132
|
}
|
|
5120
5133
|
}
|
|
5121
5134
|
|
|
5122
|
-
class
|
|
5135
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5123
5136
|
get kind() {
|
|
5124
5137
|
return this.options.kind;
|
|
5125
5138
|
}
|
|
@@ -5467,7 +5480,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5467
5480
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5468
5481
|
});
|
|
5469
5482
|
}), tab.onWillShowOverlay((event) => {
|
|
5470
|
-
this._onWillShowOverlay.fire(new
|
|
5483
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5471
5484
|
kind: 'tab',
|
|
5472
5485
|
panel: this.group.activePanel,
|
|
5473
5486
|
api: this.accessor.api,
|
|
@@ -5631,7 +5644,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5631
5644
|
index: this.tabs.size,
|
|
5632
5645
|
});
|
|
5633
5646
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5634
|
-
this._onWillShowOverlay.fire(new
|
|
5647
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5635
5648
|
kind: 'header_space',
|
|
5636
5649
|
panel: this.group.activePanel,
|
|
5637
5650
|
api: this.accessor.api,
|
|
@@ -6025,7 +6038,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6025
6038
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6026
6039
|
this._onWillShowOverlay.fire(event);
|
|
6027
6040
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6028
|
-
this._onWillShowOverlay.fire(new
|
|
6041
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
6029
6042
|
kind: 'content',
|
|
6030
6043
|
panel: this.activePanel,
|
|
6031
6044
|
api: this._api,
|
|
@@ -6336,8 +6349,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6336
6349
|
this._activePanel = panel;
|
|
6337
6350
|
if (panel) {
|
|
6338
6351
|
this.tabsContainer.setActivePanel(panel);
|
|
6352
|
+
this.contentContainer.openPanel(panel);
|
|
6339
6353
|
panel.layout(this._width, this._height);
|
|
6340
6354
|
this.updateMru(panel);
|
|
6355
|
+
// Refresh focus state to handle programmatic activation without DOM focus change
|
|
6356
|
+
this.contentContainer.refreshFocusState();
|
|
6341
6357
|
this._onDidActivePanelChange.fire({
|
|
6342
6358
|
panel,
|
|
6343
6359
|
});
|
|
@@ -6698,7 +6714,19 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6698
6714
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6699
6715
|
this._onDidActivePanelChange = new Emitter();
|
|
6700
6716
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6701
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange)
|
|
6717
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
|
|
6718
|
+
// When becoming visible, apply any pending size change
|
|
6719
|
+
if (event.isVisible && this._pendingSize) {
|
|
6720
|
+
super.setSize(this._pendingSize);
|
|
6721
|
+
this._pendingSize = undefined;
|
|
6722
|
+
}
|
|
6723
|
+
}));
|
|
6724
|
+
}
|
|
6725
|
+
setSize(event) {
|
|
6726
|
+
// Always store the requested size
|
|
6727
|
+
this._pendingSize = Object.assign({}, event);
|
|
6728
|
+
// Apply the size change immediately
|
|
6729
|
+
super.setSize(event);
|
|
6702
6730
|
}
|
|
6703
6731
|
close() {
|
|
6704
6732
|
if (!this._group) {
|
|
@@ -7167,6 +7195,18 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7167
7195
|
params: this._params,
|
|
7168
7196
|
});
|
|
7169
7197
|
}
|
|
7198
|
+
updateFromStateModel(state) {
|
|
7199
|
+
var _a, _b, _c;
|
|
7200
|
+
this._maximumHeight = state.maximumHeight;
|
|
7201
|
+
this._minimumHeight = state.minimumHeight;
|
|
7202
|
+
this._maximumWidth = state.maximumWidth;
|
|
7203
|
+
this._minimumWidth = state.minimumWidth;
|
|
7204
|
+
this.update({ params: (_a = state.params) !== null && _a !== void 0 ? _a : {} });
|
|
7205
|
+
this.setTitle((_b = state.title) !== null && _b !== void 0 ? _b : this.id);
|
|
7206
|
+
this.setRenderer((_c = state.renderer) !== null && _c !== void 0 ? _c : this.accessor.renderer);
|
|
7207
|
+
// state.contentComponent;
|
|
7208
|
+
// state.tabComponent;
|
|
7209
|
+
}
|
|
7170
7210
|
updateParentGroup(group, options) {
|
|
7171
7211
|
this._group = group;
|
|
7172
7212
|
this.api.group = this._group;
|
|
@@ -7638,13 +7678,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7638
7678
|
let right = undefined;
|
|
7639
7679
|
let width = undefined;
|
|
7640
7680
|
const moveTop = () => {
|
|
7641
|
-
|
|
7681
|
+
// When dragging top handle, constrain top position to prevent oversizing
|
|
7682
|
+
const maxTop = startPosition.originalY +
|
|
7642
7683
|
startPosition.originalHeight >
|
|
7643
7684
|
containerRect.height
|
|
7644
|
-
?
|
|
7685
|
+
? Math.max(0, containerRect.height -
|
|
7686
|
+
Overlay.MINIMUM_HEIGHT)
|
|
7645
7687
|
: Math.max(0, startPosition.originalY +
|
|
7646
7688
|
startPosition.originalHeight -
|
|
7647
|
-
Overlay.MINIMUM_HEIGHT)
|
|
7689
|
+
Overlay.MINIMUM_HEIGHT);
|
|
7690
|
+
top = clamp(y, 0, maxTop);
|
|
7648
7691
|
height =
|
|
7649
7692
|
startPosition.originalY +
|
|
7650
7693
|
startPosition.originalHeight -
|
|
@@ -7655,22 +7698,27 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7655
7698
|
top =
|
|
7656
7699
|
startPosition.originalY -
|
|
7657
7700
|
startPosition.originalHeight;
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7701
|
+
// When dragging bottom handle, constrain height to container height
|
|
7702
|
+
const minHeight = top < 0 &&
|
|
7703
|
+
typeof this.options.minimumInViewportHeight ===
|
|
7704
|
+
'number'
|
|
7661
7705
|
? -top +
|
|
7662
7706
|
this.options.minimumInViewportHeight
|
|
7663
|
-
: Overlay.MINIMUM_HEIGHT
|
|
7707
|
+
: Overlay.MINIMUM_HEIGHT;
|
|
7708
|
+
const maxHeight = containerRect.height - Math.max(0, top);
|
|
7709
|
+
height = clamp(y - top, minHeight, maxHeight);
|
|
7664
7710
|
bottom = containerRect.height - top - height;
|
|
7665
7711
|
};
|
|
7666
7712
|
const moveLeft = () => {
|
|
7667
|
-
|
|
7713
|
+
const maxLeft = startPosition.originalX +
|
|
7668
7714
|
startPosition.originalWidth >
|
|
7669
7715
|
containerRect.width
|
|
7670
|
-
?
|
|
7716
|
+
? Math.max(0, containerRect.width -
|
|
7717
|
+
Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
|
|
7671
7718
|
: Math.max(0, startPosition.originalX +
|
|
7672
7719
|
startPosition.originalWidth -
|
|
7673
|
-
Overlay.MINIMUM_WIDTH)
|
|
7720
|
+
Overlay.MINIMUM_WIDTH);
|
|
7721
|
+
left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
|
|
7674
7722
|
width =
|
|
7675
7723
|
startPosition.originalX +
|
|
7676
7724
|
startPosition.originalWidth -
|
|
@@ -7681,12 +7729,15 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7681
7729
|
left =
|
|
7682
7730
|
startPosition.originalX -
|
|
7683
7731
|
startPosition.originalWidth;
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7732
|
+
// When dragging right handle, constrain width to container width
|
|
7733
|
+
const minWidth = left < 0 &&
|
|
7734
|
+
typeof this.options.minimumInViewportWidth ===
|
|
7735
|
+
'number'
|
|
7687
7736
|
? -left +
|
|
7688
7737
|
this.options.minimumInViewportWidth
|
|
7689
|
-
: Overlay.MINIMUM_WIDTH
|
|
7738
|
+
: Overlay.MINIMUM_WIDTH;
|
|
7739
|
+
const maxWidth = containerRect.width - Math.max(0, left);
|
|
7740
|
+
width = clamp(x - left, minWidth, maxWidth);
|
|
7690
7741
|
right = containerRect.width - left - width;
|
|
7691
7742
|
};
|
|
7692
7743
|
switch (direction) {
|
|
@@ -8539,7 +8590,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8539
8590
|
// option only available when no panels in primary grid
|
|
8540
8591
|
return;
|
|
8541
8592
|
}
|
|
8542
|
-
this._onWillShowOverlay.fire(new
|
|
8593
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8543
8594
|
kind: 'edge',
|
|
8544
8595
|
panel: undefined,
|
|
8545
8596
|
api: this._api,
|
|
@@ -8953,7 +9004,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8953
9004
|
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
|
|
8954
9005
|
const el = group.element.querySelector('.dv-void-container');
|
|
8955
9006
|
if (!el) {
|
|
8956
|
-
throw new Error('failed to find drag handle');
|
|
9007
|
+
throw new Error('dockview: failed to find drag handle');
|
|
8957
9008
|
}
|
|
8958
9009
|
overlay.setupDrag(el, {
|
|
8959
9010
|
inDragMode: typeof (options === null || options === void 0 ? void 0 : options.inDragMode) === 'boolean'
|
|
@@ -9025,7 +9076,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9025
9076
|
case 'right':
|
|
9026
9077
|
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
9027
9078
|
default:
|
|
9028
|
-
throw new Error(`unsupported position ${position}`);
|
|
9079
|
+
throw new Error(`dockview: unsupported position ${position}`);
|
|
9029
9080
|
}
|
|
9030
9081
|
}
|
|
9031
9082
|
updateOptions(options) {
|
|
@@ -9171,15 +9222,48 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9171
9222
|
}
|
|
9172
9223
|
return result;
|
|
9173
9224
|
}
|
|
9174
|
-
fromJSON(data) {
|
|
9225
|
+
fromJSON(data, options) {
|
|
9175
9226
|
var _a, _b;
|
|
9227
|
+
const existingPanels = new Map();
|
|
9228
|
+
let tempGroup;
|
|
9229
|
+
if (options === null || options === void 0 ? void 0 : options.reuseExistingPanels) {
|
|
9230
|
+
/**
|
|
9231
|
+
* What are we doing here?
|
|
9232
|
+
*
|
|
9233
|
+
* 1. Create a temporary group to hold any panels that currently exist and that also exist in the new layout
|
|
9234
|
+
* 2. Remove that temporary group from the group mapping so that it doesn't get cleared when we clear the layout
|
|
9235
|
+
*/
|
|
9236
|
+
tempGroup = this.createGroup();
|
|
9237
|
+
this._groups.delete(tempGroup.api.id);
|
|
9238
|
+
const newPanels = Object.keys(data.panels);
|
|
9239
|
+
for (const panel of this.panels) {
|
|
9240
|
+
if (newPanels.includes(panel.api.id)) {
|
|
9241
|
+
existingPanels.set(panel.api.id, panel);
|
|
9242
|
+
}
|
|
9243
|
+
}
|
|
9244
|
+
this.movingLock(() => {
|
|
9245
|
+
Array.from(existingPanels.values()).forEach((panel) => {
|
|
9246
|
+
this.moveGroupOrPanel({
|
|
9247
|
+
from: {
|
|
9248
|
+
groupId: panel.api.group.api.id,
|
|
9249
|
+
panelId: panel.api.id,
|
|
9250
|
+
},
|
|
9251
|
+
to: {
|
|
9252
|
+
group: tempGroup,
|
|
9253
|
+
position: 'center',
|
|
9254
|
+
},
|
|
9255
|
+
keepEmptyGroups: true,
|
|
9256
|
+
});
|
|
9257
|
+
});
|
|
9258
|
+
});
|
|
9259
|
+
}
|
|
9176
9260
|
this.clear();
|
|
9177
9261
|
if (typeof data !== 'object' || data === null) {
|
|
9178
|
-
throw new Error('serialized layout must be a non-null object');
|
|
9262
|
+
throw new Error('dockview: serialized layout must be a non-null object');
|
|
9179
9263
|
}
|
|
9180
9264
|
const { grid, panels, activeGroup } = data;
|
|
9181
9265
|
if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
|
|
9182
|
-
throw new Error('root must be of type branch');
|
|
9266
|
+
throw new Error('dockview: root must be of type branch');
|
|
9183
9267
|
}
|
|
9184
9268
|
try {
|
|
9185
9269
|
// take note of the existing dimensions
|
|
@@ -9188,7 +9272,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9188
9272
|
const createGroupFromSerializedState = (data) => {
|
|
9189
9273
|
const { id, locked, hideHeader, views, activeView } = data;
|
|
9190
9274
|
if (typeof id !== 'string') {
|
|
9191
|
-
throw new Error('group id must be of type string');
|
|
9275
|
+
throw new Error('dockview: group id must be of type string');
|
|
9192
9276
|
}
|
|
9193
9277
|
const group = this.createGroup({
|
|
9194
9278
|
id,
|
|
@@ -9203,17 +9287,38 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9203
9287
|
* In running this section first we avoid firing lots of 'add' events in the event of a failure
|
|
9204
9288
|
* due to a corruption of input data.
|
|
9205
9289
|
*/
|
|
9206
|
-
const
|
|
9207
|
-
|
|
9290
|
+
const existingPanel = existingPanels.get(child);
|
|
9291
|
+
if (tempGroup && existingPanel) {
|
|
9292
|
+
this.movingLock(() => {
|
|
9293
|
+
tempGroup.model.removePanel(existingPanel);
|
|
9294
|
+
});
|
|
9295
|
+
createdPanels.push(existingPanel);
|
|
9296
|
+
existingPanel.updateFromStateModel(panels[child]);
|
|
9297
|
+
}
|
|
9298
|
+
else {
|
|
9299
|
+
const panel = this._deserializer.fromJSON(panels[child], group);
|
|
9300
|
+
createdPanels.push(panel);
|
|
9301
|
+
}
|
|
9208
9302
|
}
|
|
9209
9303
|
for (let i = 0; i < views.length; i++) {
|
|
9210
9304
|
const panel = createdPanels[i];
|
|
9211
9305
|
const isActive = typeof activeView === 'string' &&
|
|
9212
9306
|
activeView === panel.id;
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9307
|
+
const hasExisting = existingPanels.has(panel.api.id);
|
|
9308
|
+
if (hasExisting) {
|
|
9309
|
+
this.movingLock(() => {
|
|
9310
|
+
group.model.openPanel(panel, {
|
|
9311
|
+
skipSetActive: !isActive,
|
|
9312
|
+
skipSetGroupActive: true,
|
|
9313
|
+
});
|
|
9314
|
+
});
|
|
9315
|
+
}
|
|
9316
|
+
else {
|
|
9317
|
+
group.model.openPanel(panel, {
|
|
9318
|
+
skipSetActive: !isActive,
|
|
9319
|
+
skipSetGroupActive: true,
|
|
9320
|
+
});
|
|
9321
|
+
}
|
|
9217
9322
|
}
|
|
9218
9323
|
if (!group.activePanel && group.panels.length > 0) {
|
|
9219
9324
|
group.model.openPanel(group.panels[group.panels.length - 1], {
|
|
@@ -9252,7 +9357,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9252
9357
|
setTimeout(() => {
|
|
9253
9358
|
this.addPopoutGroup(group, {
|
|
9254
9359
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
9255
|
-
overridePopoutGroup: gridReferenceGroup
|
|
9360
|
+
overridePopoutGroup: gridReferenceGroup
|
|
9361
|
+
? group
|
|
9362
|
+
: undefined,
|
|
9256
9363
|
referenceGroup: gridReferenceGroup
|
|
9257
9364
|
? this.getPanel(gridReferenceGroup)
|
|
9258
9365
|
: undefined,
|
|
@@ -9338,11 +9445,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9338
9445
|
addPanel(options) {
|
|
9339
9446
|
var _a, _b;
|
|
9340
9447
|
if (this.panels.find((_) => _.id === options.id)) {
|
|
9341
|
-
throw new Error(`panel with id ${options.id} already exists`);
|
|
9448
|
+
throw new Error(`dockview: panel with id ${options.id} already exists`);
|
|
9342
9449
|
}
|
|
9343
9450
|
let referenceGroup;
|
|
9344
9451
|
if (options.position && options.floating) {
|
|
9345
|
-
throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9452
|
+
throw new Error('dockview: you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9346
9453
|
}
|
|
9347
9454
|
const initial = {
|
|
9348
9455
|
width: options.initialWidth,
|
|
@@ -9356,7 +9463,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9356
9463
|
: options.position.referencePanel;
|
|
9357
9464
|
index = options.position.index;
|
|
9358
9465
|
if (!referencePanel) {
|
|
9359
|
-
throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9466
|
+
throw new Error(`dockview: referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9360
9467
|
}
|
|
9361
9468
|
referenceGroup = this.findGroup(referencePanel);
|
|
9362
9469
|
}
|
|
@@ -9367,7 +9474,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9367
9474
|
: options.position.referenceGroup;
|
|
9368
9475
|
index = options.position.index;
|
|
9369
9476
|
if (!referenceGroup) {
|
|
9370
|
-
throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9477
|
+
throw new Error(`dockview: referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9371
9478
|
}
|
|
9372
9479
|
}
|
|
9373
9480
|
else {
|
|
@@ -9479,7 +9586,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9479
9586
|
}) {
|
|
9480
9587
|
const group = panel.group;
|
|
9481
9588
|
if (!group) {
|
|
9482
|
-
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9589
|
+
throw new Error(`dockview: cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9483
9590
|
}
|
|
9484
9591
|
group.model.removePanel(panel, {
|
|
9485
9592
|
skipSetActiveGroup: options.skipSetActiveGroup,
|
|
@@ -9528,11 +9635,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9528
9635
|
? this.panels.find((panel) => panel.id === options.referencePanel)
|
|
9529
9636
|
: options.referencePanel;
|
|
9530
9637
|
if (!referencePanel) {
|
|
9531
|
-
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
9638
|
+
throw new Error(`dockview: reference panel ${options.referencePanel} does not exist`);
|
|
9532
9639
|
}
|
|
9533
9640
|
referenceGroup = this.findGroup(referencePanel);
|
|
9534
9641
|
if (!referenceGroup) {
|
|
9535
|
-
throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9642
|
+
throw new Error(`dockview: reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9536
9643
|
}
|
|
9537
9644
|
}
|
|
9538
9645
|
else if (isGroupOptionsWithGroup(options)) {
|
|
@@ -9541,7 +9648,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9541
9648
|
? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
9542
9649
|
: options.referenceGroup;
|
|
9543
9650
|
if (!referenceGroup) {
|
|
9544
|
-
throw new Error(`reference group ${options.referenceGroup} does not exist`);
|
|
9651
|
+
throw new Error(`dockview: reference group ${options.referenceGroup} does not exist`);
|
|
9545
9652
|
}
|
|
9546
9653
|
}
|
|
9547
9654
|
else {
|
|
@@ -9609,7 +9716,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9609
9716
|
}
|
|
9610
9717
|
return floatingGroup.group;
|
|
9611
9718
|
}
|
|
9612
|
-
throw new Error('failed to find floating group');
|
|
9719
|
+
throw new Error('dockview: failed to find floating group');
|
|
9613
9720
|
}
|
|
9614
9721
|
if (group.api.location.type === 'popout') {
|
|
9615
9722
|
const selectedGroup = this._popoutGroups.find((_) => _.popoutGroup === group);
|
|
@@ -9640,7 +9747,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9640
9747
|
this.updateWatermark();
|
|
9641
9748
|
return selectedGroup.popoutGroup;
|
|
9642
9749
|
}
|
|
9643
|
-
throw new Error('failed to find popout group');
|
|
9750
|
+
throw new Error('dockview: failed to find popout group');
|
|
9644
9751
|
}
|
|
9645
9752
|
const re = super.doRemoveGroup(group, options);
|
|
9646
9753
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive)) {
|
|
@@ -9671,7 +9778,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9671
9778
|
? (_a = this._groups.get(sourceGroupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
9672
9779
|
: undefined;
|
|
9673
9780
|
if (!sourceGroup) {
|
|
9674
|
-
throw new Error(`Failed to find group id ${sourceGroupId}`);
|
|
9781
|
+
throw new Error(`dockview: Failed to find group id ${sourceGroupId}`);
|
|
9675
9782
|
}
|
|
9676
9783
|
if (sourceItemId === undefined) {
|
|
9677
9784
|
/**
|
|
@@ -9696,9 +9803,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9696
9803
|
skipSetActiveGroup: true,
|
|
9697
9804
|
}));
|
|
9698
9805
|
if (!removedPanel) {
|
|
9699
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9806
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9700
9807
|
}
|
|
9701
|
-
if (sourceGroup.model.size === 0) {
|
|
9808
|
+
if (!options.keepEmptyGroups && sourceGroup.model.size === 0) {
|
|
9702
9809
|
// remove the group and do not set a new group as active
|
|
9703
9810
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9704
9811
|
}
|
|
@@ -9708,7 +9815,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9708
9815
|
var _a;
|
|
9709
9816
|
return destinationGroup.model.openPanel(removedPanel, {
|
|
9710
9817
|
index: destinationIndex,
|
|
9711
|
-
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9818
|
+
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9819
|
+
!isDestinationGroupEmpty,
|
|
9712
9820
|
skipSetGroupActive: true,
|
|
9713
9821
|
});
|
|
9714
9822
|
});
|
|
@@ -9719,6 +9827,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9719
9827
|
panel: removedPanel,
|
|
9720
9828
|
from: sourceGroup,
|
|
9721
9829
|
});
|
|
9830
|
+
/**
|
|
9831
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
9832
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
9833
|
+
*/
|
|
9834
|
+
requestAnimationFrame(() => {
|
|
9835
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9836
|
+
});
|
|
9722
9837
|
}
|
|
9723
9838
|
else {
|
|
9724
9839
|
/**
|
|
@@ -9763,7 +9878,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9763
9878
|
}));
|
|
9764
9879
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9765
9880
|
const newGroup = this.createGroupAtLocation(targetLocation);
|
|
9766
|
-
this.movingLock(() => newGroup.model.openPanel(removedPanel
|
|
9881
|
+
this.movingLock(() => newGroup.model.openPanel(removedPanel, {
|
|
9882
|
+
skipSetActive: true,
|
|
9883
|
+
}));
|
|
9767
9884
|
this.doSetGroupAndPanelActive(newGroup);
|
|
9768
9885
|
this._onDidMovePanel.fire({
|
|
9769
9886
|
panel: this.getGroupPanel(sourceItemId),
|
|
@@ -9796,7 +9913,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9796
9913
|
skipSetActiveGroup: true,
|
|
9797
9914
|
}));
|
|
9798
9915
|
if (!removedPanel) {
|
|
9799
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9916
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9800
9917
|
}
|
|
9801
9918
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
9802
9919
|
const group = this.createGroupAtLocation(dropLocation);
|
|
@@ -9851,7 +9968,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9851
9968
|
case 'floating': {
|
|
9852
9969
|
const selectedFloatingGroup = this._floatingGroups.find((x) => x.group === from);
|
|
9853
9970
|
if (!selectedFloatingGroup) {
|
|
9854
|
-
throw new Error('failed to find floating group');
|
|
9971
|
+
throw new Error('dockview: failed to find floating group');
|
|
9855
9972
|
}
|
|
9856
9973
|
selectedFloatingGroup.dispose();
|
|
9857
9974
|
break;
|
|
@@ -9859,7 +9976,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9859
9976
|
case 'popout': {
|
|
9860
9977
|
const selectedPopoutGroup = this._popoutGroups.find((x) => x.popoutGroup === from);
|
|
9861
9978
|
if (!selectedPopoutGroup) {
|
|
9862
|
-
throw new Error('failed to find popout group');
|
|
9979
|
+
throw new Error('dockview: failed to find popout group');
|
|
9863
9980
|
}
|
|
9864
9981
|
// Remove from popout groups list to prevent automatic restoration
|
|
9865
9982
|
const index = this._popoutGroups.indexOf(selectedPopoutGroup);
|
|
@@ -11162,6 +11279,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
11162
11279
|
exports.DockviewPanel = DockviewPanel;
|
|
11163
11280
|
exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
|
|
11164
11281
|
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
11282
|
+
exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
|
|
11165
11283
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
11166
11284
|
exports.Gridview = Gridview;
|
|
11167
11285
|
exports.GridviewApi = GridviewApi;
|