dockview-react 4.5.0 → 4.7.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 +256 -91
- 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 +255 -90
- package/dist/dockview-react.amd.noStyle.js.map +1 -1
- package/dist/dockview-react.cjs.js +256 -91
- package/dist/dockview-react.cjs.js.map +1 -1
- package/dist/dockview-react.esm.js +257 -91
- 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 +256 -91
- 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 +255 -90
- package/dist/dockview-react.noStyle.js.map +1 -1
- package/dist/styles/dockview.css +42 -5
- package/package.json +5 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.7.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -2139,6 +2139,19 @@
|
|
|
2139
2139
|
}
|
|
2140
2140
|
throw new Error('invalid node');
|
|
2141
2141
|
}
|
|
2142
|
+
function cloneNode(node, size, orthogonalSize) {
|
|
2143
|
+
if (node instanceof BranchNode) {
|
|
2144
|
+
const result = new BranchNode(node.orientation, node.proportionalLayout, node.styles, size, orthogonalSize, node.disabled, node.margin);
|
|
2145
|
+
for (let i = node.children.length - 1; i >= 0; i--) {
|
|
2146
|
+
const child = node.children[i];
|
|
2147
|
+
result.addChild(cloneNode(child, child.size, child.orthogonalSize), child.size, 0, true);
|
|
2148
|
+
}
|
|
2149
|
+
return result;
|
|
2150
|
+
}
|
|
2151
|
+
else {
|
|
2152
|
+
return new LeafNode(node.view, node.orientation, orthogonalSize);
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2142
2155
|
function flipNode(node, size, orthogonalSize) {
|
|
2143
2156
|
if (node instanceof BranchNode) {
|
|
2144
2157
|
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize, node.disabled, node.margin);
|
|
@@ -2489,6 +2502,29 @@
|
|
|
2489
2502
|
this._onDidChange.fire(e);
|
|
2490
2503
|
});
|
|
2491
2504
|
}
|
|
2505
|
+
normalize() {
|
|
2506
|
+
if (!this._root) {
|
|
2507
|
+
return;
|
|
2508
|
+
}
|
|
2509
|
+
if (this._root.children.length !== 1) {
|
|
2510
|
+
return;
|
|
2511
|
+
}
|
|
2512
|
+
const oldRoot = this.root;
|
|
2513
|
+
// can remove one level of redundant branching if there is only a single child
|
|
2514
|
+
const childReference = oldRoot.children[0];
|
|
2515
|
+
if (childReference instanceof LeafNode) {
|
|
2516
|
+
return;
|
|
2517
|
+
}
|
|
2518
|
+
oldRoot.element.remove();
|
|
2519
|
+
const child = oldRoot.removeChild(0); // Remove child to prevent double disposal
|
|
2520
|
+
oldRoot.dispose(); // Dispose old root (won't dispose removed child)
|
|
2521
|
+
child.dispose(); // Dispose the removed child
|
|
2522
|
+
this._root = cloneNode(childReference, childReference.size, childReference.orthogonalSize);
|
|
2523
|
+
this.element.appendChild(this._root.element);
|
|
2524
|
+
this.disposable.value = this._root.onDidChange((e) => {
|
|
2525
|
+
this._onDidChange.fire(e);
|
|
2526
|
+
});
|
|
2527
|
+
}
|
|
2492
2528
|
/**
|
|
2493
2529
|
* If the root is orientated as a VERTICAL node then nest the existing root within a new HORIZIONTAL root node
|
|
2494
2530
|
* If the root is orientated as a HORIZONTAL node then nest the existing root within a new VERITCAL root node
|
|
@@ -3880,6 +3916,48 @@
|
|
|
3880
3916
|
}
|
|
3881
3917
|
}
|
|
3882
3918
|
|
|
3919
|
+
function setGPUOptimizedBounds(element, bounds) {
|
|
3920
|
+
const { top, left, width, height } = bounds;
|
|
3921
|
+
const topPx = `${Math.round(top)}px`;
|
|
3922
|
+
const leftPx = `${Math.round(left)}px`;
|
|
3923
|
+
const widthPx = `${Math.round(width)}px`;
|
|
3924
|
+
const heightPx = `${Math.round(height)}px`;
|
|
3925
|
+
// Use traditional positioning but maintain GPU layer
|
|
3926
|
+
element.style.top = topPx;
|
|
3927
|
+
element.style.left = leftPx;
|
|
3928
|
+
element.style.width = widthPx;
|
|
3929
|
+
element.style.height = heightPx;
|
|
3930
|
+
element.style.visibility = 'visible';
|
|
3931
|
+
// Ensure GPU layer is maintained
|
|
3932
|
+
if (!element.style.transform || element.style.transform === '') {
|
|
3933
|
+
element.style.transform = 'translate3d(0, 0, 0)';
|
|
3934
|
+
}
|
|
3935
|
+
}
|
|
3936
|
+
function setGPUOptimizedBoundsFromStrings(element, bounds) {
|
|
3937
|
+
const { top, left, width, height } = bounds;
|
|
3938
|
+
// Use traditional positioning but maintain GPU layer
|
|
3939
|
+
element.style.top = top;
|
|
3940
|
+
element.style.left = left;
|
|
3941
|
+
element.style.width = width;
|
|
3942
|
+
element.style.height = height;
|
|
3943
|
+
element.style.visibility = 'visible';
|
|
3944
|
+
// Ensure GPU layer is maintained
|
|
3945
|
+
if (!element.style.transform || element.style.transform === '') {
|
|
3946
|
+
element.style.transform = 'translate3d(0, 0, 0)';
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
function checkBoundsChanged(element, bounds) {
|
|
3950
|
+
const { top, left, width, height } = bounds;
|
|
3951
|
+
const topPx = `${Math.round(top)}px`;
|
|
3952
|
+
const leftPx = `${Math.round(left)}px`;
|
|
3953
|
+
const widthPx = `${Math.round(width)}px`;
|
|
3954
|
+
const heightPx = `${Math.round(height)}px`;
|
|
3955
|
+
// Check if position or size changed (back to traditional method)
|
|
3956
|
+
return element.style.top !== topPx ||
|
|
3957
|
+
element.style.left !== leftPx ||
|
|
3958
|
+
element.style.width !== widthPx ||
|
|
3959
|
+
element.style.height !== heightPx;
|
|
3960
|
+
}
|
|
3883
3961
|
class WillShowOverlayEvent extends DockviewEvent {
|
|
3884
3962
|
get nativeEvent() {
|
|
3885
3963
|
return this.options.nativeEvent;
|
|
@@ -4161,21 +4239,11 @@
|
|
|
4161
4239
|
box.left = rootLeft + width - 4;
|
|
4162
4240
|
box.width = 4;
|
|
4163
4241
|
}
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
const widthPx = `${Math.round(box.width)}px`;
|
|
4167
|
-
const heightPx = `${Math.round(box.height)}px`;
|
|
4168
|
-
if (overlay.style.top === topPx &&
|
|
4169
|
-
overlay.style.left === leftPx &&
|
|
4170
|
-
overlay.style.width === widthPx &&
|
|
4171
|
-
overlay.style.height === heightPx) {
|
|
4242
|
+
// Use GPU-optimized bounds checking and setting
|
|
4243
|
+
if (!checkBoundsChanged(overlay, box)) {
|
|
4172
4244
|
return;
|
|
4173
4245
|
}
|
|
4174
|
-
overlay
|
|
4175
|
-
overlay.style.left = leftPx;
|
|
4176
|
-
overlay.style.width = widthPx;
|
|
4177
|
-
overlay.style.height = heightPx;
|
|
4178
|
-
overlay.style.visibility = 'visible';
|
|
4246
|
+
setGPUOptimizedBounds(overlay, box);
|
|
4179
4247
|
overlay.className = `dv-drop-target-anchor${this.options.className ? ` ${this.options.className}` : ''}`;
|
|
4180
4248
|
toggleClass(overlay, 'dv-drop-target-left', isLeft);
|
|
4181
4249
|
toggleClass(overlay, 'dv-drop-target-right', isRight);
|
|
@@ -4227,10 +4295,7 @@
|
|
|
4227
4295
|
box.top = `${100 * (1 - size)}%`;
|
|
4228
4296
|
box.height = `${100 * size}%`;
|
|
4229
4297
|
}
|
|
4230
|
-
this.overlayElement
|
|
4231
|
-
this.overlayElement.style.left = box.left;
|
|
4232
|
-
this.overlayElement.style.width = box.width;
|
|
4233
|
-
this.overlayElement.style.height = box.height;
|
|
4298
|
+
setGPUOptimizedBoundsFromStrings(this.overlayElement, box);
|
|
4234
4299
|
toggleClass(this.overlayElement, 'dv-drop-target-small-vertical', isSmallY);
|
|
4235
4300
|
toggleClass(this.overlayElement, 'dv-drop-target-small-horizontal', isSmallX);
|
|
4236
4301
|
toggleClass(this.overlayElement, 'dv-drop-target-left', isLeft);
|
|
@@ -5053,6 +5118,40 @@
|
|
|
5053
5118
|
}
|
|
5054
5119
|
}
|
|
5055
5120
|
|
|
5121
|
+
class WillShowOverlayLocationEvent {
|
|
5122
|
+
get kind() {
|
|
5123
|
+
return this.options.kind;
|
|
5124
|
+
}
|
|
5125
|
+
get nativeEvent() {
|
|
5126
|
+
return this.event.nativeEvent;
|
|
5127
|
+
}
|
|
5128
|
+
get position() {
|
|
5129
|
+
return this.event.position;
|
|
5130
|
+
}
|
|
5131
|
+
get defaultPrevented() {
|
|
5132
|
+
return this.event.defaultPrevented;
|
|
5133
|
+
}
|
|
5134
|
+
get panel() {
|
|
5135
|
+
return this.options.panel;
|
|
5136
|
+
}
|
|
5137
|
+
get api() {
|
|
5138
|
+
return this.options.api;
|
|
5139
|
+
}
|
|
5140
|
+
get group() {
|
|
5141
|
+
return this.options.group;
|
|
5142
|
+
}
|
|
5143
|
+
preventDefault() {
|
|
5144
|
+
this.event.preventDefault();
|
|
5145
|
+
}
|
|
5146
|
+
getData() {
|
|
5147
|
+
return this.options.getData();
|
|
5148
|
+
}
|
|
5149
|
+
constructor(event, options) {
|
|
5150
|
+
this.event = event;
|
|
5151
|
+
this.options = options;
|
|
5152
|
+
}
|
|
5153
|
+
}
|
|
5154
|
+
|
|
5056
5155
|
class GroupDragHandler extends DragHandler {
|
|
5057
5156
|
constructor(element, accessor, group) {
|
|
5058
5157
|
super(element);
|
|
@@ -5120,6 +5219,7 @@
|
|
|
5120
5219
|
this._element = document.createElement('div');
|
|
5121
5220
|
this._element.className = 'dv-void-container';
|
|
5122
5221
|
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5222
|
+
toggleClass(this._element, 'dv-draggable', !this.accessor.options.disableDnd);
|
|
5123
5223
|
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
|
|
5124
5224
|
this.accessor.doSetGroupActive(this.group);
|
|
5125
5225
|
}));
|
|
@@ -5144,6 +5244,7 @@
|
|
|
5144
5244
|
}
|
|
5145
5245
|
updateDragAndDropState() {
|
|
5146
5246
|
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5247
|
+
toggleClass(this._element, 'dv-draggable', !this.accessor.options.disableDnd);
|
|
5147
5248
|
}
|
|
5148
5249
|
}
|
|
5149
5250
|
|
|
@@ -5664,8 +5765,11 @@
|
|
|
5664
5765
|
toggleClass(wrapper, 'dv-tab', true);
|
|
5665
5766
|
toggleClass(wrapper, 'dv-active-tab', panelObject.api.isActive);
|
|
5666
5767
|
toggleClass(wrapper, 'dv-inactive-tab', !panelObject.api.isActive);
|
|
5667
|
-
wrapper.addEventListener('
|
|
5768
|
+
wrapper.addEventListener('click', (event) => {
|
|
5668
5769
|
this.accessor.popupService.close();
|
|
5770
|
+
if (event.defaultPrevented) {
|
|
5771
|
+
return;
|
|
5772
|
+
}
|
|
5669
5773
|
tab.element.scrollIntoView();
|
|
5670
5774
|
tab.panel.api.setActive();
|
|
5671
5775
|
});
|
|
@@ -5782,39 +5886,6 @@
|
|
|
5782
5886
|
this._kind = options.kind;
|
|
5783
5887
|
}
|
|
5784
5888
|
}
|
|
5785
|
-
class WillShowOverlayLocationEvent {
|
|
5786
|
-
get kind() {
|
|
5787
|
-
return this.options.kind;
|
|
5788
|
-
}
|
|
5789
|
-
get nativeEvent() {
|
|
5790
|
-
return this.event.nativeEvent;
|
|
5791
|
-
}
|
|
5792
|
-
get position() {
|
|
5793
|
-
return this.event.position;
|
|
5794
|
-
}
|
|
5795
|
-
get defaultPrevented() {
|
|
5796
|
-
return this.event.defaultPrevented;
|
|
5797
|
-
}
|
|
5798
|
-
get panel() {
|
|
5799
|
-
return this.options.panel;
|
|
5800
|
-
}
|
|
5801
|
-
get api() {
|
|
5802
|
-
return this.options.api;
|
|
5803
|
-
}
|
|
5804
|
-
get group() {
|
|
5805
|
-
return this.options.group;
|
|
5806
|
-
}
|
|
5807
|
-
preventDefault() {
|
|
5808
|
-
this.event.preventDefault();
|
|
5809
|
-
}
|
|
5810
|
-
getData() {
|
|
5811
|
-
return this.options.getData();
|
|
5812
|
-
}
|
|
5813
|
-
constructor(event, options) {
|
|
5814
|
-
this.event = event;
|
|
5815
|
-
this.options = options;
|
|
5816
|
-
}
|
|
5817
|
-
}
|
|
5818
5889
|
class DockviewGroupPanelModel extends CompositeDisposable {
|
|
5819
5890
|
get element() {
|
|
5820
5891
|
throw new Error('dockview: not supported');
|
|
@@ -7667,7 +7738,36 @@
|
|
|
7667
7738
|
|
|
7668
7739
|
const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
|
|
7669
7740
|
const DEFAULT_FLOATING_GROUP_POSITION = { left: 100, top: 100, width: 300, height: 300 };
|
|
7741
|
+
const DESERIALIZATION_POPOUT_DELAY_MS = 100;
|
|
7670
7742
|
|
|
7743
|
+
class PositionCache {
|
|
7744
|
+
constructor() {
|
|
7745
|
+
this.cache = new Map();
|
|
7746
|
+
this.currentFrameId = 0;
|
|
7747
|
+
this.rafId = null;
|
|
7748
|
+
}
|
|
7749
|
+
getPosition(element) {
|
|
7750
|
+
const cached = this.cache.get(element);
|
|
7751
|
+
if (cached && cached.frameId === this.currentFrameId) {
|
|
7752
|
+
return cached.rect;
|
|
7753
|
+
}
|
|
7754
|
+
this.scheduleFrameUpdate();
|
|
7755
|
+
const rect = getDomNodePagePosition(element);
|
|
7756
|
+
this.cache.set(element, { rect, frameId: this.currentFrameId });
|
|
7757
|
+
return rect;
|
|
7758
|
+
}
|
|
7759
|
+
invalidate() {
|
|
7760
|
+
this.currentFrameId++;
|
|
7761
|
+
}
|
|
7762
|
+
scheduleFrameUpdate() {
|
|
7763
|
+
if (this.rafId)
|
|
7764
|
+
return;
|
|
7765
|
+
this.rafId = requestAnimationFrame(() => {
|
|
7766
|
+
this.currentFrameId++;
|
|
7767
|
+
this.rafId = null;
|
|
7768
|
+
});
|
|
7769
|
+
}
|
|
7770
|
+
}
|
|
7671
7771
|
function createFocusableElement() {
|
|
7672
7772
|
const element = document.createElement('div');
|
|
7673
7773
|
element.tabIndex = -1;
|
|
@@ -7680,6 +7780,8 @@
|
|
|
7680
7780
|
this.accessor = accessor;
|
|
7681
7781
|
this.map = {};
|
|
7682
7782
|
this._disposed = false;
|
|
7783
|
+
this.positionCache = new PositionCache();
|
|
7784
|
+
this.pendingUpdates = new Set();
|
|
7683
7785
|
this.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7684
7786
|
for (const value of Object.values(this.map)) {
|
|
7685
7787
|
value.disposable.dispose();
|
|
@@ -7688,6 +7790,19 @@
|
|
|
7688
7790
|
this._disposed = true;
|
|
7689
7791
|
}));
|
|
7690
7792
|
}
|
|
7793
|
+
updateAllPositions() {
|
|
7794
|
+
if (this._disposed) {
|
|
7795
|
+
return;
|
|
7796
|
+
}
|
|
7797
|
+
// Invalidate position cache to force recalculation
|
|
7798
|
+
this.positionCache.invalidate();
|
|
7799
|
+
// Call resize function directly for all visible panels
|
|
7800
|
+
for (const entry of Object.values(this.map)) {
|
|
7801
|
+
if (entry.panel.api.isVisible && entry.resize) {
|
|
7802
|
+
entry.resize();
|
|
7803
|
+
}
|
|
7804
|
+
}
|
|
7805
|
+
}
|
|
7691
7806
|
detatch(panel) {
|
|
7692
7807
|
if (this.map[panel.api.id]) {
|
|
7693
7808
|
const { disposable, destroy } = this.map[panel.api.id];
|
|
@@ -7718,17 +7833,33 @@
|
|
|
7718
7833
|
this.element.appendChild(focusContainer);
|
|
7719
7834
|
}
|
|
7720
7835
|
const resize = () => {
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7836
|
+
const panelId = panel.api.id;
|
|
7837
|
+
if (this.pendingUpdates.has(panelId)) {
|
|
7838
|
+
return; // Update already scheduled
|
|
7839
|
+
}
|
|
7840
|
+
this.pendingUpdates.add(panelId);
|
|
7841
|
+
requestAnimationFrame(() => {
|
|
7842
|
+
this.pendingUpdates.delete(panelId);
|
|
7843
|
+
if (this.isDisposed || !this.map[panelId]) {
|
|
7844
|
+
return;
|
|
7845
|
+
}
|
|
7846
|
+
const box = this.positionCache.getPosition(referenceContainer.element);
|
|
7847
|
+
const box2 = this.positionCache.getPosition(this.element);
|
|
7848
|
+
// Use traditional positioning for overlay containers
|
|
7849
|
+
const left = box.left - box2.left;
|
|
7850
|
+
const top = box.top - box2.top;
|
|
7851
|
+
const width = box.width;
|
|
7852
|
+
const height = box.height;
|
|
7853
|
+
focusContainer.style.left = `${left}px`;
|
|
7854
|
+
focusContainer.style.top = `${top}px`;
|
|
7855
|
+
focusContainer.style.width = `${width}px`;
|
|
7856
|
+
focusContainer.style.height = `${height}px`;
|
|
7857
|
+
toggleClass(focusContainer, 'dv-render-overlay-float', panel.group.api.location.type === 'floating');
|
|
7858
|
+
});
|
|
7729
7859
|
};
|
|
7730
7860
|
const visibilityChanged = () => {
|
|
7731
7861
|
if (panel.api.isVisible) {
|
|
7862
|
+
this.positionCache.invalidate();
|
|
7732
7863
|
resize();
|
|
7733
7864
|
}
|
|
7734
7865
|
focusContainer.style.display = panel.api.isVisible ? '' : 'none';
|
|
@@ -7823,6 +7954,8 @@
|
|
|
7823
7954
|
this.map[panel.api.id].disposable.dispose();
|
|
7824
7955
|
// and reset the disposable to the active reference-container
|
|
7825
7956
|
this.map[panel.api.id].disposable = disposable;
|
|
7957
|
+
// store the resize function for direct access
|
|
7958
|
+
this.map[panel.api.id].resize = resize;
|
|
7826
7959
|
return focusContainer;
|
|
7827
7960
|
}
|
|
7828
7961
|
}
|
|
@@ -8192,6 +8325,13 @@
|
|
|
8192
8325
|
get floatingGroups() {
|
|
8193
8326
|
return this._floatingGroups;
|
|
8194
8327
|
}
|
|
8328
|
+
/**
|
|
8329
|
+
* Promise that resolves when all popout groups from the last fromJSON call are restored.
|
|
8330
|
+
* Useful for tests that need to wait for delayed popout creation.
|
|
8331
|
+
*/
|
|
8332
|
+
get popoutRestorationPromise() {
|
|
8333
|
+
return this._popoutRestorationPromise;
|
|
8334
|
+
}
|
|
8195
8335
|
constructor(container, options) {
|
|
8196
8336
|
var _a, _b, _c;
|
|
8197
8337
|
super(container, {
|
|
@@ -8240,6 +8380,7 @@
|
|
|
8240
8380
|
this.onDidMaximizedGroupChange = this._onDidMaximizedGroupChange.event;
|
|
8241
8381
|
this._floatingGroups = [];
|
|
8242
8382
|
this._popoutGroups = [];
|
|
8383
|
+
this._popoutRestorationPromise = Promise.resolve();
|
|
8243
8384
|
this._onDidRemoveGroup = new Emitter();
|
|
8244
8385
|
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
8245
8386
|
this._onDidAddGroup = new Emitter();
|
|
@@ -8789,6 +8930,7 @@
|
|
|
8789
8930
|
this.updateWatermark();
|
|
8790
8931
|
}
|
|
8791
8932
|
orthogonalize(position, options) {
|
|
8933
|
+
this.gridview.normalize();
|
|
8792
8934
|
switch (position) {
|
|
8793
8935
|
case 'top':
|
|
8794
8936
|
case 'bottom':
|
|
@@ -9032,18 +9174,30 @@
|
|
|
9032
9174
|
});
|
|
9033
9175
|
}
|
|
9034
9176
|
const serializedPopoutGroups = (_b = data.popoutGroups) !== null && _b !== void 0 ? _b : [];
|
|
9035
|
-
|
|
9177
|
+
// Create a promise that resolves when all popout groups are created
|
|
9178
|
+
const popoutPromises = [];
|
|
9179
|
+
// Queue popup group creation with delays to avoid browser blocking
|
|
9180
|
+
serializedPopoutGroups.forEach((serializedPopoutGroup, index) => {
|
|
9036
9181
|
const { data, position, gridReferenceGroup, url } = serializedPopoutGroup;
|
|
9037
9182
|
const group = createGroupFromSerializedState(data);
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9183
|
+
// Add a small delay for each popup after the first to avoid browser popup blocking
|
|
9184
|
+
const popoutPromise = new Promise((resolve) => {
|
|
9185
|
+
setTimeout(() => {
|
|
9186
|
+
this.addPopoutGroup(group, {
|
|
9187
|
+
position: position !== null && position !== void 0 ? position : undefined,
|
|
9188
|
+
overridePopoutGroup: gridReferenceGroup ? group : undefined,
|
|
9189
|
+
referenceGroup: gridReferenceGroup
|
|
9190
|
+
? this.getPanel(gridReferenceGroup)
|
|
9191
|
+
: undefined,
|
|
9192
|
+
popoutUrl: url,
|
|
9193
|
+
});
|
|
9194
|
+
resolve();
|
|
9195
|
+
}, index * DESERIALIZATION_POPOUT_DELAY_MS); // 100ms delay between each popup
|
|
9045
9196
|
});
|
|
9046
|
-
|
|
9197
|
+
popoutPromises.push(popoutPromise);
|
|
9198
|
+
});
|
|
9199
|
+
// Store the promise for tests to wait on
|
|
9200
|
+
this._popoutRestorationPromise = Promise.all(popoutPromises).then(() => void 0);
|
|
9047
9201
|
for (const floatingGroup of this._floatingGroups) {
|
|
9048
9202
|
floatingGroup.overlay.setBounds();
|
|
9049
9203
|
}
|
|
@@ -9090,6 +9244,10 @@
|
|
|
9090
9244
|
throw err;
|
|
9091
9245
|
}
|
|
9092
9246
|
this.updateWatermark();
|
|
9247
|
+
// Force position updates for always visible panels after DOM layout is complete
|
|
9248
|
+
requestAnimationFrame(() => {
|
|
9249
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9250
|
+
});
|
|
9093
9251
|
this._onDidLayoutFromJSON.fire();
|
|
9094
9252
|
}
|
|
9095
9253
|
clear() {
|
|
@@ -9590,7 +9748,6 @@
|
|
|
9590
9748
|
const target = options.to.position;
|
|
9591
9749
|
if (target === 'center') {
|
|
9592
9750
|
const activePanel = from.activePanel;
|
|
9593
|
-
const targetActivePanel = to.activePanel;
|
|
9594
9751
|
const panels = this.movingLock(() => [...from.panels].map((p) => from.model.removePanel(p.id, {
|
|
9595
9752
|
skipSetActive: true,
|
|
9596
9753
|
})));
|
|
@@ -9600,22 +9757,21 @@
|
|
|
9600
9757
|
this.movingLock(() => {
|
|
9601
9758
|
for (const panel of panels) {
|
|
9602
9759
|
to.model.openPanel(panel, {
|
|
9603
|
-
skipSetActive:
|
|
9760
|
+
skipSetActive: panel !== activePanel,
|
|
9604
9761
|
skipSetGroupActive: true,
|
|
9605
9762
|
});
|
|
9606
9763
|
}
|
|
9607
9764
|
});
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9765
|
+
// Ensure group becomes active after move
|
|
9766
|
+
if (options.skipSetActive !== true) {
|
|
9767
|
+
// For center moves (merges), we need to ensure the target group is active
|
|
9768
|
+
// unless explicitly told not to (skipSetActive: true)
|
|
9769
|
+
this.doSetGroupAndPanelActive(to);
|
|
9613
9770
|
}
|
|
9614
|
-
else if (
|
|
9615
|
-
//
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
});
|
|
9771
|
+
else if (!this.activePanel) {
|
|
9772
|
+
// Even with skipSetActive: true, ensure there's an active panel if none exists
|
|
9773
|
+
// This maintains basic functionality while respecting skipSetActive
|
|
9774
|
+
this.doSetGroupAndPanelActive(to);
|
|
9619
9775
|
}
|
|
9620
9776
|
}
|
|
9621
9777
|
else {
|
|
@@ -9645,20 +9801,26 @@
|
|
|
9645
9801
|
if (selectedPopoutGroup.referenceGroup) {
|
|
9646
9802
|
const referenceGroup = this.getPanel(selectedPopoutGroup.referenceGroup);
|
|
9647
9803
|
if (referenceGroup && !referenceGroup.api.isVisible) {
|
|
9648
|
-
this.doRemoveGroup(referenceGroup, {
|
|
9804
|
+
this.doRemoveGroup(referenceGroup, {
|
|
9805
|
+
skipActive: true,
|
|
9806
|
+
});
|
|
9649
9807
|
}
|
|
9650
9808
|
}
|
|
9651
9809
|
// Manually dispose the window without triggering restoration
|
|
9652
9810
|
selectedPopoutGroup.window.dispose();
|
|
9653
9811
|
// Update group's location and containers for target
|
|
9654
9812
|
if (to.api.location.type === 'grid') {
|
|
9655
|
-
from.model.renderContainer =
|
|
9656
|
-
|
|
9813
|
+
from.model.renderContainer =
|
|
9814
|
+
this.overlayRenderContainer;
|
|
9815
|
+
from.model.dropTargetContainer =
|
|
9816
|
+
this.rootDropTargetContainer;
|
|
9657
9817
|
from.model.location = { type: 'grid' };
|
|
9658
9818
|
}
|
|
9659
9819
|
else if (to.api.location.type === 'floating') {
|
|
9660
|
-
from.model.renderContainer =
|
|
9661
|
-
|
|
9820
|
+
from.model.renderContainer =
|
|
9821
|
+
this.overlayRenderContainer;
|
|
9822
|
+
from.model.dropTargetContainer =
|
|
9823
|
+
this.rootDropTargetContainer;
|
|
9662
9824
|
from.model.location = { type: 'floating' };
|
|
9663
9825
|
}
|
|
9664
9826
|
break;
|
|
@@ -9726,8 +9888,12 @@
|
|
|
9726
9888
|
from.panels.forEach((panel) => {
|
|
9727
9889
|
this._onDidMovePanel.fire({ panel, from });
|
|
9728
9890
|
});
|
|
9729
|
-
|
|
9730
|
-
|
|
9891
|
+
// Ensure group becomes active after move
|
|
9892
|
+
if (options.skipSetActive === false) {
|
|
9893
|
+
// Only activate when explicitly requested (skipSetActive: false)
|
|
9894
|
+
// Use 'to' group for non-center moves since 'from' may have been destroyed
|
|
9895
|
+
const targetGroup = to !== null && to !== void 0 ? to : from;
|
|
9896
|
+
this.doSetGroupAndPanelActive(targetGroup);
|
|
9731
9897
|
}
|
|
9732
9898
|
}
|
|
9733
9899
|
doSetGroupActive(group) {
|
|
@@ -11469,7 +11635,7 @@
|
|
|
11469
11635
|
}, [onPointerLeave]);
|
|
11470
11636
|
return (React.createElement("div", Object.assign({ "data-testid": "dockview-dv-default-tab" }, rest, { onPointerDown: _onPointerDown, onPointerUp: _onPointerUp, onPointerLeave: _onPointerLeave, className: "dv-default-tab" }),
|
|
11471
11637
|
React.createElement("span", { className: "dv-default-tab-content" }, title),
|
|
11472
|
-
!hideClose &&
|
|
11638
|
+
!hideClose && (React.createElement("div", { className: "dv-default-tab-action", onPointerDown: onBtnPointerDown, onClick: onClose },
|
|
11473
11639
|
React.createElement(CloseButton, null)))));
|
|
11474
11640
|
};
|
|
11475
11641
|
|
|
@@ -11816,7 +11982,6 @@
|
|
|
11816
11982
|
exports.SplitviewPanel = SplitviewPanel;
|
|
11817
11983
|
exports.SplitviewReact = SplitviewReact;
|
|
11818
11984
|
exports.Tab = Tab;
|
|
11819
|
-
exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
|
|
11820
11985
|
exports.createDockview = createDockview;
|
|
11821
11986
|
exports.createGridview = createGridview;
|
|
11822
11987
|
exports.createPaneview = createPaneview;
|