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
|
*/
|
|
@@ -1294,11 +1294,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1294
1294
|
document.removeEventListener('pointermove', onPointerMove);
|
|
1295
1295
|
document.removeEventListener('pointerup', end);
|
|
1296
1296
|
document.removeEventListener('pointercancel', end);
|
|
1297
|
+
document.removeEventListener('contextmenu', end);
|
|
1297
1298
|
this._onDidSashEnd.fire(undefined);
|
|
1298
1299
|
};
|
|
1299
1300
|
document.addEventListener('pointermove', onPointerMove);
|
|
1300
1301
|
document.addEventListener('pointerup', end);
|
|
1301
1302
|
document.addEventListener('pointercancel', end);
|
|
1303
|
+
document.addEventListener('contextmenu', end);
|
|
1302
1304
|
};
|
|
1303
1305
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
1304
1306
|
const sashItem = {
|
|
@@ -3781,8 +3783,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3781
3783
|
/**
|
|
3782
3784
|
* Create a component from a serialized object.
|
|
3783
3785
|
*/
|
|
3784
|
-
fromJSON(data) {
|
|
3785
|
-
this.component.fromJSON(data);
|
|
3786
|
+
fromJSON(data, options) {
|
|
3787
|
+
this.component.fromJSON(data, options);
|
|
3786
3788
|
}
|
|
3787
3789
|
/**
|
|
3788
3790
|
* Create a serialized object of the current component.
|
|
@@ -5013,6 +5015,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5013
5015
|
}
|
|
5014
5016
|
if (doRender) {
|
|
5015
5017
|
const focusTracker = trackFocus(container);
|
|
5018
|
+
this.focusTracker = focusTracker;
|
|
5016
5019
|
const disposable = new CompositeDisposable();
|
|
5017
5020
|
disposable.addDisposables(focusTracker, focusTracker.onDidFocus(() => this._onDidFocus.fire()), focusTracker.onDidBlur(() => this._onDidBlur.fire()));
|
|
5018
5021
|
this.disposable.value = disposable;
|
|
@@ -5040,6 +5043,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5040
5043
|
this.disposable.dispose();
|
|
5041
5044
|
super.dispose();
|
|
5042
5045
|
}
|
|
5046
|
+
/**
|
|
5047
|
+
* Refresh the focus tracker state to handle cases where focus state
|
|
5048
|
+
* gets out of sync due to programmatic panel activation
|
|
5049
|
+
*/
|
|
5050
|
+
refreshFocusState() {
|
|
5051
|
+
var _a;
|
|
5052
|
+
if ((_a = this.focusTracker) === null || _a === void 0 ? void 0 : _a.refreshState) {
|
|
5053
|
+
this.focusTracker.refreshState();
|
|
5054
|
+
}
|
|
5055
|
+
}
|
|
5043
5056
|
}
|
|
5044
5057
|
|
|
5045
5058
|
function addGhostImage(dataTransfer, ghostElement, options) {
|
|
@@ -5149,7 +5162,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5149
5162
|
}
|
|
5150
5163
|
}
|
|
5151
5164
|
|
|
5152
|
-
class
|
|
5165
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5153
5166
|
get kind() {
|
|
5154
5167
|
return this.options.kind;
|
|
5155
5168
|
}
|
|
@@ -5497,7 +5510,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5497
5510
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5498
5511
|
});
|
|
5499
5512
|
}), tab.onWillShowOverlay((event) => {
|
|
5500
|
-
this._onWillShowOverlay.fire(new
|
|
5513
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5501
5514
|
kind: 'tab',
|
|
5502
5515
|
panel: this.group.activePanel,
|
|
5503
5516
|
api: this.accessor.api,
|
|
@@ -5661,7 +5674,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5661
5674
|
index: this.tabs.size,
|
|
5662
5675
|
});
|
|
5663
5676
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5664
|
-
this._onWillShowOverlay.fire(new
|
|
5677
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5665
5678
|
kind: 'header_space',
|
|
5666
5679
|
panel: this.group.activePanel,
|
|
5667
5680
|
api: this.accessor.api,
|
|
@@ -6055,7 +6068,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6055
6068
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6056
6069
|
this._onWillShowOverlay.fire(event);
|
|
6057
6070
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6058
|
-
this._onWillShowOverlay.fire(new
|
|
6071
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
6059
6072
|
kind: 'content',
|
|
6060
6073
|
panel: this.activePanel,
|
|
6061
6074
|
api: this._api,
|
|
@@ -6366,8 +6379,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6366
6379
|
this._activePanel = panel;
|
|
6367
6380
|
if (panel) {
|
|
6368
6381
|
this.tabsContainer.setActivePanel(panel);
|
|
6382
|
+
this.contentContainer.openPanel(panel);
|
|
6369
6383
|
panel.layout(this._width, this._height);
|
|
6370
6384
|
this.updateMru(panel);
|
|
6385
|
+
// Refresh focus state to handle programmatic activation without DOM focus change
|
|
6386
|
+
this.contentContainer.refreshFocusState();
|
|
6371
6387
|
this._onDidActivePanelChange.fire({
|
|
6372
6388
|
panel,
|
|
6373
6389
|
});
|
|
@@ -6728,7 +6744,19 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6728
6744
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6729
6745
|
this._onDidActivePanelChange = new Emitter();
|
|
6730
6746
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6731
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange)
|
|
6747
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
|
|
6748
|
+
// When becoming visible, apply any pending size change
|
|
6749
|
+
if (event.isVisible && this._pendingSize) {
|
|
6750
|
+
super.setSize(this._pendingSize);
|
|
6751
|
+
this._pendingSize = undefined;
|
|
6752
|
+
}
|
|
6753
|
+
}));
|
|
6754
|
+
}
|
|
6755
|
+
setSize(event) {
|
|
6756
|
+
// Always store the requested size
|
|
6757
|
+
this._pendingSize = Object.assign({}, event);
|
|
6758
|
+
// Apply the size change immediately
|
|
6759
|
+
super.setSize(event);
|
|
6732
6760
|
}
|
|
6733
6761
|
close() {
|
|
6734
6762
|
if (!this._group) {
|
|
@@ -7197,6 +7225,18 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7197
7225
|
params: this._params,
|
|
7198
7226
|
});
|
|
7199
7227
|
}
|
|
7228
|
+
updateFromStateModel(state) {
|
|
7229
|
+
var _a, _b, _c;
|
|
7230
|
+
this._maximumHeight = state.maximumHeight;
|
|
7231
|
+
this._minimumHeight = state.minimumHeight;
|
|
7232
|
+
this._maximumWidth = state.maximumWidth;
|
|
7233
|
+
this._minimumWidth = state.minimumWidth;
|
|
7234
|
+
this.update({ params: (_a = state.params) !== null && _a !== void 0 ? _a : {} });
|
|
7235
|
+
this.setTitle((_b = state.title) !== null && _b !== void 0 ? _b : this.id);
|
|
7236
|
+
this.setRenderer((_c = state.renderer) !== null && _c !== void 0 ? _c : this.accessor.renderer);
|
|
7237
|
+
// state.contentComponent;
|
|
7238
|
+
// state.tabComponent;
|
|
7239
|
+
}
|
|
7200
7240
|
updateParentGroup(group, options) {
|
|
7201
7241
|
this._group = group;
|
|
7202
7242
|
this.api.group = this._group;
|
|
@@ -7668,13 +7708,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7668
7708
|
let right = undefined;
|
|
7669
7709
|
let width = undefined;
|
|
7670
7710
|
const moveTop = () => {
|
|
7671
|
-
|
|
7711
|
+
// When dragging top handle, constrain top position to prevent oversizing
|
|
7712
|
+
const maxTop = startPosition.originalY +
|
|
7672
7713
|
startPosition.originalHeight >
|
|
7673
7714
|
containerRect.height
|
|
7674
|
-
?
|
|
7715
|
+
? Math.max(0, containerRect.height -
|
|
7716
|
+
Overlay.MINIMUM_HEIGHT)
|
|
7675
7717
|
: Math.max(0, startPosition.originalY +
|
|
7676
7718
|
startPosition.originalHeight -
|
|
7677
|
-
Overlay.MINIMUM_HEIGHT)
|
|
7719
|
+
Overlay.MINIMUM_HEIGHT);
|
|
7720
|
+
top = clamp(y, 0, maxTop);
|
|
7678
7721
|
height =
|
|
7679
7722
|
startPosition.originalY +
|
|
7680
7723
|
startPosition.originalHeight -
|
|
@@ -7685,22 +7728,27 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7685
7728
|
top =
|
|
7686
7729
|
startPosition.originalY -
|
|
7687
7730
|
startPosition.originalHeight;
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7731
|
+
// When dragging bottom handle, constrain height to container height
|
|
7732
|
+
const minHeight = top < 0 &&
|
|
7733
|
+
typeof this.options.minimumInViewportHeight ===
|
|
7734
|
+
'number'
|
|
7691
7735
|
? -top +
|
|
7692
7736
|
this.options.minimumInViewportHeight
|
|
7693
|
-
: Overlay.MINIMUM_HEIGHT
|
|
7737
|
+
: Overlay.MINIMUM_HEIGHT;
|
|
7738
|
+
const maxHeight = containerRect.height - Math.max(0, top);
|
|
7739
|
+
height = clamp(y - top, minHeight, maxHeight);
|
|
7694
7740
|
bottom = containerRect.height - top - height;
|
|
7695
7741
|
};
|
|
7696
7742
|
const moveLeft = () => {
|
|
7697
|
-
|
|
7743
|
+
const maxLeft = startPosition.originalX +
|
|
7698
7744
|
startPosition.originalWidth >
|
|
7699
7745
|
containerRect.width
|
|
7700
|
-
?
|
|
7746
|
+
? Math.max(0, containerRect.width -
|
|
7747
|
+
Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
|
|
7701
7748
|
: Math.max(0, startPosition.originalX +
|
|
7702
7749
|
startPosition.originalWidth -
|
|
7703
|
-
Overlay.MINIMUM_WIDTH)
|
|
7750
|
+
Overlay.MINIMUM_WIDTH);
|
|
7751
|
+
left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
|
|
7704
7752
|
width =
|
|
7705
7753
|
startPosition.originalX +
|
|
7706
7754
|
startPosition.originalWidth -
|
|
@@ -7711,12 +7759,15 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7711
7759
|
left =
|
|
7712
7760
|
startPosition.originalX -
|
|
7713
7761
|
startPosition.originalWidth;
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7762
|
+
// When dragging right handle, constrain width to container width
|
|
7763
|
+
const minWidth = left < 0 &&
|
|
7764
|
+
typeof this.options.minimumInViewportWidth ===
|
|
7765
|
+
'number'
|
|
7717
7766
|
? -left +
|
|
7718
7767
|
this.options.minimumInViewportWidth
|
|
7719
|
-
: Overlay.MINIMUM_WIDTH
|
|
7768
|
+
: Overlay.MINIMUM_WIDTH;
|
|
7769
|
+
const maxWidth = containerRect.width - Math.max(0, left);
|
|
7770
|
+
width = clamp(x - left, minWidth, maxWidth);
|
|
7720
7771
|
right = containerRect.width - left - width;
|
|
7721
7772
|
};
|
|
7722
7773
|
switch (direction) {
|
|
@@ -8569,7 +8620,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8569
8620
|
// option only available when no panels in primary grid
|
|
8570
8621
|
return;
|
|
8571
8622
|
}
|
|
8572
|
-
this._onWillShowOverlay.fire(new
|
|
8623
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8573
8624
|
kind: 'edge',
|
|
8574
8625
|
panel: undefined,
|
|
8575
8626
|
api: this._api,
|
|
@@ -8983,7 +9034,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8983
9034
|
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
|
|
8984
9035
|
const el = group.element.querySelector('.dv-void-container');
|
|
8985
9036
|
if (!el) {
|
|
8986
|
-
throw new Error('failed to find drag handle');
|
|
9037
|
+
throw new Error('dockview: failed to find drag handle');
|
|
8987
9038
|
}
|
|
8988
9039
|
overlay.setupDrag(el, {
|
|
8989
9040
|
inDragMode: typeof (options === null || options === void 0 ? void 0 : options.inDragMode) === 'boolean'
|
|
@@ -9055,7 +9106,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9055
9106
|
case 'right':
|
|
9056
9107
|
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
9057
9108
|
default:
|
|
9058
|
-
throw new Error(`unsupported position ${position}`);
|
|
9109
|
+
throw new Error(`dockview: unsupported position ${position}`);
|
|
9059
9110
|
}
|
|
9060
9111
|
}
|
|
9061
9112
|
updateOptions(options) {
|
|
@@ -9201,15 +9252,48 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9201
9252
|
}
|
|
9202
9253
|
return result;
|
|
9203
9254
|
}
|
|
9204
|
-
fromJSON(data) {
|
|
9255
|
+
fromJSON(data, options) {
|
|
9205
9256
|
var _a, _b;
|
|
9257
|
+
const existingPanels = new Map();
|
|
9258
|
+
let tempGroup;
|
|
9259
|
+
if (options === null || options === void 0 ? void 0 : options.reuseExistingPanels) {
|
|
9260
|
+
/**
|
|
9261
|
+
* What are we doing here?
|
|
9262
|
+
*
|
|
9263
|
+
* 1. Create a temporary group to hold any panels that currently exist and that also exist in the new layout
|
|
9264
|
+
* 2. Remove that temporary group from the group mapping so that it doesn't get cleared when we clear the layout
|
|
9265
|
+
*/
|
|
9266
|
+
tempGroup = this.createGroup();
|
|
9267
|
+
this._groups.delete(tempGroup.api.id);
|
|
9268
|
+
const newPanels = Object.keys(data.panels);
|
|
9269
|
+
for (const panel of this.panels) {
|
|
9270
|
+
if (newPanels.includes(panel.api.id)) {
|
|
9271
|
+
existingPanels.set(panel.api.id, panel);
|
|
9272
|
+
}
|
|
9273
|
+
}
|
|
9274
|
+
this.movingLock(() => {
|
|
9275
|
+
Array.from(existingPanels.values()).forEach((panel) => {
|
|
9276
|
+
this.moveGroupOrPanel({
|
|
9277
|
+
from: {
|
|
9278
|
+
groupId: panel.api.group.api.id,
|
|
9279
|
+
panelId: panel.api.id,
|
|
9280
|
+
},
|
|
9281
|
+
to: {
|
|
9282
|
+
group: tempGroup,
|
|
9283
|
+
position: 'center',
|
|
9284
|
+
},
|
|
9285
|
+
keepEmptyGroups: true,
|
|
9286
|
+
});
|
|
9287
|
+
});
|
|
9288
|
+
});
|
|
9289
|
+
}
|
|
9206
9290
|
this.clear();
|
|
9207
9291
|
if (typeof data !== 'object' || data === null) {
|
|
9208
|
-
throw new Error('serialized layout must be a non-null object');
|
|
9292
|
+
throw new Error('dockview: serialized layout must be a non-null object');
|
|
9209
9293
|
}
|
|
9210
9294
|
const { grid, panels, activeGroup } = data;
|
|
9211
9295
|
if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
|
|
9212
|
-
throw new Error('root must be of type branch');
|
|
9296
|
+
throw new Error('dockview: root must be of type branch');
|
|
9213
9297
|
}
|
|
9214
9298
|
try {
|
|
9215
9299
|
// take note of the existing dimensions
|
|
@@ -9218,7 +9302,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9218
9302
|
const createGroupFromSerializedState = (data) => {
|
|
9219
9303
|
const { id, locked, hideHeader, views, activeView } = data;
|
|
9220
9304
|
if (typeof id !== 'string') {
|
|
9221
|
-
throw new Error('group id must be of type string');
|
|
9305
|
+
throw new Error('dockview: group id must be of type string');
|
|
9222
9306
|
}
|
|
9223
9307
|
const group = this.createGroup({
|
|
9224
9308
|
id,
|
|
@@ -9233,17 +9317,38 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9233
9317
|
* In running this section first we avoid firing lots of 'add' events in the event of a failure
|
|
9234
9318
|
* due to a corruption of input data.
|
|
9235
9319
|
*/
|
|
9236
|
-
const
|
|
9237
|
-
|
|
9320
|
+
const existingPanel = existingPanels.get(child);
|
|
9321
|
+
if (tempGroup && existingPanel) {
|
|
9322
|
+
this.movingLock(() => {
|
|
9323
|
+
tempGroup.model.removePanel(existingPanel);
|
|
9324
|
+
});
|
|
9325
|
+
createdPanels.push(existingPanel);
|
|
9326
|
+
existingPanel.updateFromStateModel(panels[child]);
|
|
9327
|
+
}
|
|
9328
|
+
else {
|
|
9329
|
+
const panel = this._deserializer.fromJSON(panels[child], group);
|
|
9330
|
+
createdPanels.push(panel);
|
|
9331
|
+
}
|
|
9238
9332
|
}
|
|
9239
9333
|
for (let i = 0; i < views.length; i++) {
|
|
9240
9334
|
const panel = createdPanels[i];
|
|
9241
9335
|
const isActive = typeof activeView === 'string' &&
|
|
9242
9336
|
activeView === panel.id;
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9337
|
+
const hasExisting = existingPanels.has(panel.api.id);
|
|
9338
|
+
if (hasExisting) {
|
|
9339
|
+
this.movingLock(() => {
|
|
9340
|
+
group.model.openPanel(panel, {
|
|
9341
|
+
skipSetActive: !isActive,
|
|
9342
|
+
skipSetGroupActive: true,
|
|
9343
|
+
});
|
|
9344
|
+
});
|
|
9345
|
+
}
|
|
9346
|
+
else {
|
|
9347
|
+
group.model.openPanel(panel, {
|
|
9348
|
+
skipSetActive: !isActive,
|
|
9349
|
+
skipSetGroupActive: true,
|
|
9350
|
+
});
|
|
9351
|
+
}
|
|
9247
9352
|
}
|
|
9248
9353
|
if (!group.activePanel && group.panels.length > 0) {
|
|
9249
9354
|
group.model.openPanel(group.panels[group.panels.length - 1], {
|
|
@@ -9282,7 +9387,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9282
9387
|
setTimeout(() => {
|
|
9283
9388
|
this.addPopoutGroup(group, {
|
|
9284
9389
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
9285
|
-
overridePopoutGroup: gridReferenceGroup
|
|
9390
|
+
overridePopoutGroup: gridReferenceGroup
|
|
9391
|
+
? group
|
|
9392
|
+
: undefined,
|
|
9286
9393
|
referenceGroup: gridReferenceGroup
|
|
9287
9394
|
? this.getPanel(gridReferenceGroup)
|
|
9288
9395
|
: undefined,
|
|
@@ -9368,11 +9475,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9368
9475
|
addPanel(options) {
|
|
9369
9476
|
var _a, _b;
|
|
9370
9477
|
if (this.panels.find((_) => _.id === options.id)) {
|
|
9371
|
-
throw new Error(`panel with id ${options.id} already exists`);
|
|
9478
|
+
throw new Error(`dockview: panel with id ${options.id} already exists`);
|
|
9372
9479
|
}
|
|
9373
9480
|
let referenceGroup;
|
|
9374
9481
|
if (options.position && options.floating) {
|
|
9375
|
-
throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9482
|
+
throw new Error('dockview: you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
9376
9483
|
}
|
|
9377
9484
|
const initial = {
|
|
9378
9485
|
width: options.initialWidth,
|
|
@@ -9386,7 +9493,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9386
9493
|
: options.position.referencePanel;
|
|
9387
9494
|
index = options.position.index;
|
|
9388
9495
|
if (!referencePanel) {
|
|
9389
|
-
throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9496
|
+
throw new Error(`dockview: referencePanel '${options.position.referencePanel}' does not exist`);
|
|
9390
9497
|
}
|
|
9391
9498
|
referenceGroup = this.findGroup(referencePanel);
|
|
9392
9499
|
}
|
|
@@ -9397,7 +9504,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9397
9504
|
: options.position.referenceGroup;
|
|
9398
9505
|
index = options.position.index;
|
|
9399
9506
|
if (!referenceGroup) {
|
|
9400
|
-
throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9507
|
+
throw new Error(`dockview: referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
9401
9508
|
}
|
|
9402
9509
|
}
|
|
9403
9510
|
else {
|
|
@@ -9509,7 +9616,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9509
9616
|
}) {
|
|
9510
9617
|
const group = panel.group;
|
|
9511
9618
|
if (!group) {
|
|
9512
|
-
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9619
|
+
throw new Error(`dockview: cannot remove panel ${panel.id}. it's missing a group.`);
|
|
9513
9620
|
}
|
|
9514
9621
|
group.model.removePanel(panel, {
|
|
9515
9622
|
skipSetActiveGroup: options.skipSetActiveGroup,
|
|
@@ -9558,11 +9665,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9558
9665
|
? this.panels.find((panel) => panel.id === options.referencePanel)
|
|
9559
9666
|
: options.referencePanel;
|
|
9560
9667
|
if (!referencePanel) {
|
|
9561
|
-
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
9668
|
+
throw new Error(`dockview: reference panel ${options.referencePanel} does not exist`);
|
|
9562
9669
|
}
|
|
9563
9670
|
referenceGroup = this.findGroup(referencePanel);
|
|
9564
9671
|
if (!referenceGroup) {
|
|
9565
|
-
throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9672
|
+
throw new Error(`dockview: reference group for reference panel ${options.referencePanel} does not exist`);
|
|
9566
9673
|
}
|
|
9567
9674
|
}
|
|
9568
9675
|
else if (isGroupOptionsWithGroup(options)) {
|
|
@@ -9571,7 +9678,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9571
9678
|
? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
9572
9679
|
: options.referenceGroup;
|
|
9573
9680
|
if (!referenceGroup) {
|
|
9574
|
-
throw new Error(`reference group ${options.referenceGroup} does not exist`);
|
|
9681
|
+
throw new Error(`dockview: reference group ${options.referenceGroup} does not exist`);
|
|
9575
9682
|
}
|
|
9576
9683
|
}
|
|
9577
9684
|
else {
|
|
@@ -9639,7 +9746,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9639
9746
|
}
|
|
9640
9747
|
return floatingGroup.group;
|
|
9641
9748
|
}
|
|
9642
|
-
throw new Error('failed to find floating group');
|
|
9749
|
+
throw new Error('dockview: failed to find floating group');
|
|
9643
9750
|
}
|
|
9644
9751
|
if (group.api.location.type === 'popout') {
|
|
9645
9752
|
const selectedGroup = this._popoutGroups.find((_) => _.popoutGroup === group);
|
|
@@ -9670,7 +9777,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9670
9777
|
this.updateWatermark();
|
|
9671
9778
|
return selectedGroup.popoutGroup;
|
|
9672
9779
|
}
|
|
9673
|
-
throw new Error('failed to find popout group');
|
|
9780
|
+
throw new Error('dockview: failed to find popout group');
|
|
9674
9781
|
}
|
|
9675
9782
|
const re = super.doRemoveGroup(group, options);
|
|
9676
9783
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive)) {
|
|
@@ -9701,7 +9808,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9701
9808
|
? (_a = this._groups.get(sourceGroupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
9702
9809
|
: undefined;
|
|
9703
9810
|
if (!sourceGroup) {
|
|
9704
|
-
throw new Error(`Failed to find group id ${sourceGroupId}`);
|
|
9811
|
+
throw new Error(`dockview: Failed to find group id ${sourceGroupId}`);
|
|
9705
9812
|
}
|
|
9706
9813
|
if (sourceItemId === undefined) {
|
|
9707
9814
|
/**
|
|
@@ -9726,9 +9833,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9726
9833
|
skipSetActiveGroup: true,
|
|
9727
9834
|
}));
|
|
9728
9835
|
if (!removedPanel) {
|
|
9729
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9836
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9730
9837
|
}
|
|
9731
|
-
if (sourceGroup.model.size === 0) {
|
|
9838
|
+
if (!options.keepEmptyGroups && sourceGroup.model.size === 0) {
|
|
9732
9839
|
// remove the group and do not set a new group as active
|
|
9733
9840
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9734
9841
|
}
|
|
@@ -9738,7 +9845,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9738
9845
|
var _a;
|
|
9739
9846
|
return destinationGroup.model.openPanel(removedPanel, {
|
|
9740
9847
|
index: destinationIndex,
|
|
9741
|
-
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9848
|
+
skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
|
|
9849
|
+
!isDestinationGroupEmpty,
|
|
9742
9850
|
skipSetGroupActive: true,
|
|
9743
9851
|
});
|
|
9744
9852
|
});
|
|
@@ -9749,6 +9857,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9749
9857
|
panel: removedPanel,
|
|
9750
9858
|
from: sourceGroup,
|
|
9751
9859
|
});
|
|
9860
|
+
/**
|
|
9861
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
9862
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
9863
|
+
*/
|
|
9864
|
+
requestAnimationFrame(() => {
|
|
9865
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9866
|
+
});
|
|
9752
9867
|
}
|
|
9753
9868
|
else {
|
|
9754
9869
|
/**
|
|
@@ -9793,7 +9908,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9793
9908
|
}));
|
|
9794
9909
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9795
9910
|
const newGroup = this.createGroupAtLocation(targetLocation);
|
|
9796
|
-
this.movingLock(() => newGroup.model.openPanel(removedPanel
|
|
9911
|
+
this.movingLock(() => newGroup.model.openPanel(removedPanel, {
|
|
9912
|
+
skipSetActive: true,
|
|
9913
|
+
}));
|
|
9797
9914
|
this.doSetGroupAndPanelActive(newGroup);
|
|
9798
9915
|
this._onDidMovePanel.fire({
|
|
9799
9916
|
panel: this.getGroupPanel(sourceItemId),
|
|
@@ -9826,7 +9943,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9826
9943
|
skipSetActiveGroup: true,
|
|
9827
9944
|
}));
|
|
9828
9945
|
if (!removedPanel) {
|
|
9829
|
-
throw new Error(`No panel with id ${sourceItemId}`);
|
|
9946
|
+
throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
9830
9947
|
}
|
|
9831
9948
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
9832
9949
|
const group = this.createGroupAtLocation(dropLocation);
|
|
@@ -9881,7 +9998,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9881
9998
|
case 'floating': {
|
|
9882
9999
|
const selectedFloatingGroup = this._floatingGroups.find((x) => x.group === from);
|
|
9883
10000
|
if (!selectedFloatingGroup) {
|
|
9884
|
-
throw new Error('failed to find floating group');
|
|
10001
|
+
throw new Error('dockview: failed to find floating group');
|
|
9885
10002
|
}
|
|
9886
10003
|
selectedFloatingGroup.dispose();
|
|
9887
10004
|
break;
|
|
@@ -9889,7 +10006,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9889
10006
|
case 'popout': {
|
|
9890
10007
|
const selectedPopoutGroup = this._popoutGroups.find((x) => x.popoutGroup === from);
|
|
9891
10008
|
if (!selectedPopoutGroup) {
|
|
9892
|
-
throw new Error('failed to find popout group');
|
|
10009
|
+
throw new Error('dockview: failed to find popout group');
|
|
9893
10010
|
}
|
|
9894
10011
|
// Remove from popout groups list to prevent automatic restoration
|
|
9895
10012
|
const index = this._popoutGroups.indexOf(selectedPopoutGroup);
|
|
@@ -11192,6 +11309,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
11192
11309
|
exports.DockviewPanel = DockviewPanel;
|
|
11193
11310
|
exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
|
|
11194
11311
|
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
11312
|
+
exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
|
|
11195
11313
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
11196
11314
|
exports.Gridview = Gridview;
|
|
11197
11315
|
exports.GridviewApi = GridviewApi;
|