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
|
*/
|
|
@@ -2135,6 +2135,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2135
2135
|
}
|
|
2136
2136
|
throw new Error('invalid node');
|
|
2137
2137
|
}
|
|
2138
|
+
function cloneNode(node, size, orthogonalSize) {
|
|
2139
|
+
if (node instanceof BranchNode) {
|
|
2140
|
+
const result = new BranchNode(node.orientation, node.proportionalLayout, node.styles, size, orthogonalSize, node.disabled, node.margin);
|
|
2141
|
+
for (let i = node.children.length - 1; i >= 0; i--) {
|
|
2142
|
+
const child = node.children[i];
|
|
2143
|
+
result.addChild(cloneNode(child, child.size, child.orthogonalSize), child.size, 0, true);
|
|
2144
|
+
}
|
|
2145
|
+
return result;
|
|
2146
|
+
}
|
|
2147
|
+
else {
|
|
2148
|
+
return new LeafNode(node.view, node.orientation, orthogonalSize);
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2138
2151
|
function flipNode(node, size, orthogonalSize) {
|
|
2139
2152
|
if (node instanceof BranchNode) {
|
|
2140
2153
|
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize, node.disabled, node.margin);
|
|
@@ -2485,6 +2498,29 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2485
2498
|
this._onDidChange.fire(e);
|
|
2486
2499
|
});
|
|
2487
2500
|
}
|
|
2501
|
+
normalize() {
|
|
2502
|
+
if (!this._root) {
|
|
2503
|
+
return;
|
|
2504
|
+
}
|
|
2505
|
+
if (this._root.children.length !== 1) {
|
|
2506
|
+
return;
|
|
2507
|
+
}
|
|
2508
|
+
const oldRoot = this.root;
|
|
2509
|
+
// can remove one level of redundant branching if there is only a single child
|
|
2510
|
+
const childReference = oldRoot.children[0];
|
|
2511
|
+
if (childReference instanceof LeafNode) {
|
|
2512
|
+
return;
|
|
2513
|
+
}
|
|
2514
|
+
oldRoot.element.remove();
|
|
2515
|
+
const child = oldRoot.removeChild(0); // Remove child to prevent double disposal
|
|
2516
|
+
oldRoot.dispose(); // Dispose old root (won't dispose removed child)
|
|
2517
|
+
child.dispose(); // Dispose the removed child
|
|
2518
|
+
this._root = cloneNode(childReference, childReference.size, childReference.orthogonalSize);
|
|
2519
|
+
this.element.appendChild(this._root.element);
|
|
2520
|
+
this.disposable.value = this._root.onDidChange((e) => {
|
|
2521
|
+
this._onDidChange.fire(e);
|
|
2522
|
+
});
|
|
2523
|
+
}
|
|
2488
2524
|
/**
|
|
2489
2525
|
* If the root is orientated as a VERTICAL node then nest the existing root within a new HORIZIONTAL root node
|
|
2490
2526
|
* If the root is orientated as a HORIZONTAL node then nest the existing root within a new VERITCAL root node
|
|
@@ -3876,6 +3912,48 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3876
3912
|
}
|
|
3877
3913
|
}
|
|
3878
3914
|
|
|
3915
|
+
function setGPUOptimizedBounds(element, bounds) {
|
|
3916
|
+
const { top, left, width, height } = bounds;
|
|
3917
|
+
const topPx = `${Math.round(top)}px`;
|
|
3918
|
+
const leftPx = `${Math.round(left)}px`;
|
|
3919
|
+
const widthPx = `${Math.round(width)}px`;
|
|
3920
|
+
const heightPx = `${Math.round(height)}px`;
|
|
3921
|
+
// Use traditional positioning but maintain GPU layer
|
|
3922
|
+
element.style.top = topPx;
|
|
3923
|
+
element.style.left = leftPx;
|
|
3924
|
+
element.style.width = widthPx;
|
|
3925
|
+
element.style.height = heightPx;
|
|
3926
|
+
element.style.visibility = 'visible';
|
|
3927
|
+
// Ensure GPU layer is maintained
|
|
3928
|
+
if (!element.style.transform || element.style.transform === '') {
|
|
3929
|
+
element.style.transform = 'translate3d(0, 0, 0)';
|
|
3930
|
+
}
|
|
3931
|
+
}
|
|
3932
|
+
function setGPUOptimizedBoundsFromStrings(element, bounds) {
|
|
3933
|
+
const { top, left, width, height } = bounds;
|
|
3934
|
+
// Use traditional positioning but maintain GPU layer
|
|
3935
|
+
element.style.top = top;
|
|
3936
|
+
element.style.left = left;
|
|
3937
|
+
element.style.width = width;
|
|
3938
|
+
element.style.height = height;
|
|
3939
|
+
element.style.visibility = 'visible';
|
|
3940
|
+
// Ensure GPU layer is maintained
|
|
3941
|
+
if (!element.style.transform || element.style.transform === '') {
|
|
3942
|
+
element.style.transform = 'translate3d(0, 0, 0)';
|
|
3943
|
+
}
|
|
3944
|
+
}
|
|
3945
|
+
function checkBoundsChanged(element, bounds) {
|
|
3946
|
+
const { top, left, width, height } = bounds;
|
|
3947
|
+
const topPx = `${Math.round(top)}px`;
|
|
3948
|
+
const leftPx = `${Math.round(left)}px`;
|
|
3949
|
+
const widthPx = `${Math.round(width)}px`;
|
|
3950
|
+
const heightPx = `${Math.round(height)}px`;
|
|
3951
|
+
// Check if position or size changed (back to traditional method)
|
|
3952
|
+
return element.style.top !== topPx ||
|
|
3953
|
+
element.style.left !== leftPx ||
|
|
3954
|
+
element.style.width !== widthPx ||
|
|
3955
|
+
element.style.height !== heightPx;
|
|
3956
|
+
}
|
|
3879
3957
|
class WillShowOverlayEvent extends DockviewEvent {
|
|
3880
3958
|
get nativeEvent() {
|
|
3881
3959
|
return this.options.nativeEvent;
|
|
@@ -4157,21 +4235,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4157
4235
|
box.left = rootLeft + width - 4;
|
|
4158
4236
|
box.width = 4;
|
|
4159
4237
|
}
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
const widthPx = `${Math.round(box.width)}px`;
|
|
4163
|
-
const heightPx = `${Math.round(box.height)}px`;
|
|
4164
|
-
if (overlay.style.top === topPx &&
|
|
4165
|
-
overlay.style.left === leftPx &&
|
|
4166
|
-
overlay.style.width === widthPx &&
|
|
4167
|
-
overlay.style.height === heightPx) {
|
|
4238
|
+
// Use GPU-optimized bounds checking and setting
|
|
4239
|
+
if (!checkBoundsChanged(overlay, box)) {
|
|
4168
4240
|
return;
|
|
4169
4241
|
}
|
|
4170
|
-
overlay
|
|
4171
|
-
overlay.style.left = leftPx;
|
|
4172
|
-
overlay.style.width = widthPx;
|
|
4173
|
-
overlay.style.height = heightPx;
|
|
4174
|
-
overlay.style.visibility = 'visible';
|
|
4242
|
+
setGPUOptimizedBounds(overlay, box);
|
|
4175
4243
|
overlay.className = `dv-drop-target-anchor${this.options.className ? ` ${this.options.className}` : ''}`;
|
|
4176
4244
|
toggleClass(overlay, 'dv-drop-target-left', isLeft);
|
|
4177
4245
|
toggleClass(overlay, 'dv-drop-target-right', isRight);
|
|
@@ -4223,10 +4291,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4223
4291
|
box.top = `${100 * (1 - size)}%`;
|
|
4224
4292
|
box.height = `${100 * size}%`;
|
|
4225
4293
|
}
|
|
4226
|
-
this.overlayElement
|
|
4227
|
-
this.overlayElement.style.left = box.left;
|
|
4228
|
-
this.overlayElement.style.width = box.width;
|
|
4229
|
-
this.overlayElement.style.height = box.height;
|
|
4294
|
+
setGPUOptimizedBoundsFromStrings(this.overlayElement, box);
|
|
4230
4295
|
toggleClass(this.overlayElement, 'dv-drop-target-small-vertical', isSmallY);
|
|
4231
4296
|
toggleClass(this.overlayElement, 'dv-drop-target-small-horizontal', isSmallX);
|
|
4232
4297
|
toggleClass(this.overlayElement, 'dv-drop-target-left', isLeft);
|
|
@@ -5049,6 +5114,40 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5049
5114
|
}
|
|
5050
5115
|
}
|
|
5051
5116
|
|
|
5117
|
+
class WillShowOverlayLocationEvent {
|
|
5118
|
+
get kind() {
|
|
5119
|
+
return this.options.kind;
|
|
5120
|
+
}
|
|
5121
|
+
get nativeEvent() {
|
|
5122
|
+
return this.event.nativeEvent;
|
|
5123
|
+
}
|
|
5124
|
+
get position() {
|
|
5125
|
+
return this.event.position;
|
|
5126
|
+
}
|
|
5127
|
+
get defaultPrevented() {
|
|
5128
|
+
return this.event.defaultPrevented;
|
|
5129
|
+
}
|
|
5130
|
+
get panel() {
|
|
5131
|
+
return this.options.panel;
|
|
5132
|
+
}
|
|
5133
|
+
get api() {
|
|
5134
|
+
return this.options.api;
|
|
5135
|
+
}
|
|
5136
|
+
get group() {
|
|
5137
|
+
return this.options.group;
|
|
5138
|
+
}
|
|
5139
|
+
preventDefault() {
|
|
5140
|
+
this.event.preventDefault();
|
|
5141
|
+
}
|
|
5142
|
+
getData() {
|
|
5143
|
+
return this.options.getData();
|
|
5144
|
+
}
|
|
5145
|
+
constructor(event, options) {
|
|
5146
|
+
this.event = event;
|
|
5147
|
+
this.options = options;
|
|
5148
|
+
}
|
|
5149
|
+
}
|
|
5150
|
+
|
|
5052
5151
|
class GroupDragHandler extends DragHandler {
|
|
5053
5152
|
constructor(element, accessor, group) {
|
|
5054
5153
|
super(element);
|
|
@@ -5116,6 +5215,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5116
5215
|
this._element = document.createElement('div');
|
|
5117
5216
|
this._element.className = 'dv-void-container';
|
|
5118
5217
|
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5218
|
+
toggleClass(this._element, 'dv-draggable', !this.accessor.options.disableDnd);
|
|
5119
5219
|
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
|
|
5120
5220
|
this.accessor.doSetGroupActive(this.group);
|
|
5121
5221
|
}));
|
|
@@ -5140,6 +5240,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5140
5240
|
}
|
|
5141
5241
|
updateDragAndDropState() {
|
|
5142
5242
|
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5243
|
+
toggleClass(this._element, 'dv-draggable', !this.accessor.options.disableDnd);
|
|
5143
5244
|
}
|
|
5144
5245
|
}
|
|
5145
5246
|
|
|
@@ -5660,8 +5761,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5660
5761
|
toggleClass(wrapper, 'dv-tab', true);
|
|
5661
5762
|
toggleClass(wrapper, 'dv-active-tab', panelObject.api.isActive);
|
|
5662
5763
|
toggleClass(wrapper, 'dv-inactive-tab', !panelObject.api.isActive);
|
|
5663
|
-
wrapper.addEventListener('
|
|
5764
|
+
wrapper.addEventListener('click', (event) => {
|
|
5664
5765
|
this.accessor.popupService.close();
|
|
5766
|
+
if (event.defaultPrevented) {
|
|
5767
|
+
return;
|
|
5768
|
+
}
|
|
5665
5769
|
tab.element.scrollIntoView();
|
|
5666
5770
|
tab.panel.api.setActive();
|
|
5667
5771
|
});
|
|
@@ -5778,39 +5882,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5778
5882
|
this._kind = options.kind;
|
|
5779
5883
|
}
|
|
5780
5884
|
}
|
|
5781
|
-
class WillShowOverlayLocationEvent {
|
|
5782
|
-
get kind() {
|
|
5783
|
-
return this.options.kind;
|
|
5784
|
-
}
|
|
5785
|
-
get nativeEvent() {
|
|
5786
|
-
return this.event.nativeEvent;
|
|
5787
|
-
}
|
|
5788
|
-
get position() {
|
|
5789
|
-
return this.event.position;
|
|
5790
|
-
}
|
|
5791
|
-
get defaultPrevented() {
|
|
5792
|
-
return this.event.defaultPrevented;
|
|
5793
|
-
}
|
|
5794
|
-
get panel() {
|
|
5795
|
-
return this.options.panel;
|
|
5796
|
-
}
|
|
5797
|
-
get api() {
|
|
5798
|
-
return this.options.api;
|
|
5799
|
-
}
|
|
5800
|
-
get group() {
|
|
5801
|
-
return this.options.group;
|
|
5802
|
-
}
|
|
5803
|
-
preventDefault() {
|
|
5804
|
-
this.event.preventDefault();
|
|
5805
|
-
}
|
|
5806
|
-
getData() {
|
|
5807
|
-
return this.options.getData();
|
|
5808
|
-
}
|
|
5809
|
-
constructor(event, options) {
|
|
5810
|
-
this.event = event;
|
|
5811
|
-
this.options = options;
|
|
5812
|
-
}
|
|
5813
|
-
}
|
|
5814
5885
|
class DockviewGroupPanelModel extends CompositeDisposable {
|
|
5815
5886
|
get element() {
|
|
5816
5887
|
throw new Error('dockview: not supported');
|
|
@@ -7663,7 +7734,36 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7663
7734
|
|
|
7664
7735
|
const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100;
|
|
7665
7736
|
const DEFAULT_FLOATING_GROUP_POSITION = { left: 100, top: 100, width: 300, height: 300 };
|
|
7737
|
+
const DESERIALIZATION_POPOUT_DELAY_MS = 100;
|
|
7666
7738
|
|
|
7739
|
+
class PositionCache {
|
|
7740
|
+
constructor() {
|
|
7741
|
+
this.cache = new Map();
|
|
7742
|
+
this.currentFrameId = 0;
|
|
7743
|
+
this.rafId = null;
|
|
7744
|
+
}
|
|
7745
|
+
getPosition(element) {
|
|
7746
|
+
const cached = this.cache.get(element);
|
|
7747
|
+
if (cached && cached.frameId === this.currentFrameId) {
|
|
7748
|
+
return cached.rect;
|
|
7749
|
+
}
|
|
7750
|
+
this.scheduleFrameUpdate();
|
|
7751
|
+
const rect = getDomNodePagePosition(element);
|
|
7752
|
+
this.cache.set(element, { rect, frameId: this.currentFrameId });
|
|
7753
|
+
return rect;
|
|
7754
|
+
}
|
|
7755
|
+
invalidate() {
|
|
7756
|
+
this.currentFrameId++;
|
|
7757
|
+
}
|
|
7758
|
+
scheduleFrameUpdate() {
|
|
7759
|
+
if (this.rafId)
|
|
7760
|
+
return;
|
|
7761
|
+
this.rafId = requestAnimationFrame(() => {
|
|
7762
|
+
this.currentFrameId++;
|
|
7763
|
+
this.rafId = null;
|
|
7764
|
+
});
|
|
7765
|
+
}
|
|
7766
|
+
}
|
|
7667
7767
|
function createFocusableElement() {
|
|
7668
7768
|
const element = document.createElement('div');
|
|
7669
7769
|
element.tabIndex = -1;
|
|
@@ -7676,6 +7776,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7676
7776
|
this.accessor = accessor;
|
|
7677
7777
|
this.map = {};
|
|
7678
7778
|
this._disposed = false;
|
|
7779
|
+
this.positionCache = new PositionCache();
|
|
7780
|
+
this.pendingUpdates = new Set();
|
|
7679
7781
|
this.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7680
7782
|
for (const value of Object.values(this.map)) {
|
|
7681
7783
|
value.disposable.dispose();
|
|
@@ -7684,6 +7786,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7684
7786
|
this._disposed = true;
|
|
7685
7787
|
}));
|
|
7686
7788
|
}
|
|
7789
|
+
updateAllPositions() {
|
|
7790
|
+
if (this._disposed) {
|
|
7791
|
+
return;
|
|
7792
|
+
}
|
|
7793
|
+
// Invalidate position cache to force recalculation
|
|
7794
|
+
this.positionCache.invalidate();
|
|
7795
|
+
// Call resize function directly for all visible panels
|
|
7796
|
+
for (const entry of Object.values(this.map)) {
|
|
7797
|
+
if (entry.panel.api.isVisible && entry.resize) {
|
|
7798
|
+
entry.resize();
|
|
7799
|
+
}
|
|
7800
|
+
}
|
|
7801
|
+
}
|
|
7687
7802
|
detatch(panel) {
|
|
7688
7803
|
if (this.map[panel.api.id]) {
|
|
7689
7804
|
const { disposable, destroy } = this.map[panel.api.id];
|
|
@@ -7714,17 +7829,33 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7714
7829
|
this.element.appendChild(focusContainer);
|
|
7715
7830
|
}
|
|
7716
7831
|
const resize = () => {
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7832
|
+
const panelId = panel.api.id;
|
|
7833
|
+
if (this.pendingUpdates.has(panelId)) {
|
|
7834
|
+
return; // Update already scheduled
|
|
7835
|
+
}
|
|
7836
|
+
this.pendingUpdates.add(panelId);
|
|
7837
|
+
requestAnimationFrame(() => {
|
|
7838
|
+
this.pendingUpdates.delete(panelId);
|
|
7839
|
+
if (this.isDisposed || !this.map[panelId]) {
|
|
7840
|
+
return;
|
|
7841
|
+
}
|
|
7842
|
+
const box = this.positionCache.getPosition(referenceContainer.element);
|
|
7843
|
+
const box2 = this.positionCache.getPosition(this.element);
|
|
7844
|
+
// Use traditional positioning for overlay containers
|
|
7845
|
+
const left = box.left - box2.left;
|
|
7846
|
+
const top = box.top - box2.top;
|
|
7847
|
+
const width = box.width;
|
|
7848
|
+
const height = box.height;
|
|
7849
|
+
focusContainer.style.left = `${left}px`;
|
|
7850
|
+
focusContainer.style.top = `${top}px`;
|
|
7851
|
+
focusContainer.style.width = `${width}px`;
|
|
7852
|
+
focusContainer.style.height = `${height}px`;
|
|
7853
|
+
toggleClass(focusContainer, 'dv-render-overlay-float', panel.group.api.location.type === 'floating');
|
|
7854
|
+
});
|
|
7725
7855
|
};
|
|
7726
7856
|
const visibilityChanged = () => {
|
|
7727
7857
|
if (panel.api.isVisible) {
|
|
7858
|
+
this.positionCache.invalidate();
|
|
7728
7859
|
resize();
|
|
7729
7860
|
}
|
|
7730
7861
|
focusContainer.style.display = panel.api.isVisible ? '' : 'none';
|
|
@@ -7819,6 +7950,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7819
7950
|
this.map[panel.api.id].disposable.dispose();
|
|
7820
7951
|
// and reset the disposable to the active reference-container
|
|
7821
7952
|
this.map[panel.api.id].disposable = disposable;
|
|
7953
|
+
// store the resize function for direct access
|
|
7954
|
+
this.map[panel.api.id].resize = resize;
|
|
7822
7955
|
return focusContainer;
|
|
7823
7956
|
}
|
|
7824
7957
|
}
|
|
@@ -8188,6 +8321,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8188
8321
|
get floatingGroups() {
|
|
8189
8322
|
return this._floatingGroups;
|
|
8190
8323
|
}
|
|
8324
|
+
/**
|
|
8325
|
+
* Promise that resolves when all popout groups from the last fromJSON call are restored.
|
|
8326
|
+
* Useful for tests that need to wait for delayed popout creation.
|
|
8327
|
+
*/
|
|
8328
|
+
get popoutRestorationPromise() {
|
|
8329
|
+
return this._popoutRestorationPromise;
|
|
8330
|
+
}
|
|
8191
8331
|
constructor(container, options) {
|
|
8192
8332
|
var _a, _b, _c;
|
|
8193
8333
|
super(container, {
|
|
@@ -8236,6 +8376,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8236
8376
|
this.onDidMaximizedGroupChange = this._onDidMaximizedGroupChange.event;
|
|
8237
8377
|
this._floatingGroups = [];
|
|
8238
8378
|
this._popoutGroups = [];
|
|
8379
|
+
this._popoutRestorationPromise = Promise.resolve();
|
|
8239
8380
|
this._onDidRemoveGroup = new Emitter();
|
|
8240
8381
|
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
8241
8382
|
this._onDidAddGroup = new Emitter();
|
|
@@ -8785,6 +8926,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8785
8926
|
this.updateWatermark();
|
|
8786
8927
|
}
|
|
8787
8928
|
orthogonalize(position, options) {
|
|
8929
|
+
this.gridview.normalize();
|
|
8788
8930
|
switch (position) {
|
|
8789
8931
|
case 'top':
|
|
8790
8932
|
case 'bottom':
|
|
@@ -9028,18 +9170,30 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9028
9170
|
});
|
|
9029
9171
|
}
|
|
9030
9172
|
const serializedPopoutGroups = (_b = data.popoutGroups) !== null && _b !== void 0 ? _b : [];
|
|
9031
|
-
|
|
9173
|
+
// Create a promise that resolves when all popout groups are created
|
|
9174
|
+
const popoutPromises = [];
|
|
9175
|
+
// Queue popup group creation with delays to avoid browser blocking
|
|
9176
|
+
serializedPopoutGroups.forEach((serializedPopoutGroup, index) => {
|
|
9032
9177
|
const { data, position, gridReferenceGroup, url } = serializedPopoutGroup;
|
|
9033
9178
|
const group = createGroupFromSerializedState(data);
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9179
|
+
// Add a small delay for each popup after the first to avoid browser popup blocking
|
|
9180
|
+
const popoutPromise = new Promise((resolve) => {
|
|
9181
|
+
setTimeout(() => {
|
|
9182
|
+
this.addPopoutGroup(group, {
|
|
9183
|
+
position: position !== null && position !== void 0 ? position : undefined,
|
|
9184
|
+
overridePopoutGroup: gridReferenceGroup ? group : undefined,
|
|
9185
|
+
referenceGroup: gridReferenceGroup
|
|
9186
|
+
? this.getPanel(gridReferenceGroup)
|
|
9187
|
+
: undefined,
|
|
9188
|
+
popoutUrl: url,
|
|
9189
|
+
});
|
|
9190
|
+
resolve();
|
|
9191
|
+
}, index * DESERIALIZATION_POPOUT_DELAY_MS); // 100ms delay between each popup
|
|
9041
9192
|
});
|
|
9042
|
-
|
|
9193
|
+
popoutPromises.push(popoutPromise);
|
|
9194
|
+
});
|
|
9195
|
+
// Store the promise for tests to wait on
|
|
9196
|
+
this._popoutRestorationPromise = Promise.all(popoutPromises).then(() => void 0);
|
|
9043
9197
|
for (const floatingGroup of this._floatingGroups) {
|
|
9044
9198
|
floatingGroup.overlay.setBounds();
|
|
9045
9199
|
}
|
|
@@ -9086,6 +9240,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9086
9240
|
throw err;
|
|
9087
9241
|
}
|
|
9088
9242
|
this.updateWatermark();
|
|
9243
|
+
// Force position updates for always visible panels after DOM layout is complete
|
|
9244
|
+
requestAnimationFrame(() => {
|
|
9245
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9246
|
+
});
|
|
9089
9247
|
this._onDidLayoutFromJSON.fire();
|
|
9090
9248
|
}
|
|
9091
9249
|
clear() {
|
|
@@ -9586,7 +9744,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9586
9744
|
const target = options.to.position;
|
|
9587
9745
|
if (target === 'center') {
|
|
9588
9746
|
const activePanel = from.activePanel;
|
|
9589
|
-
const targetActivePanel = to.activePanel;
|
|
9590
9747
|
const panels = this.movingLock(() => [...from.panels].map((p) => from.model.removePanel(p.id, {
|
|
9591
9748
|
skipSetActive: true,
|
|
9592
9749
|
})));
|
|
@@ -9596,22 +9753,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9596
9753
|
this.movingLock(() => {
|
|
9597
9754
|
for (const panel of panels) {
|
|
9598
9755
|
to.model.openPanel(panel, {
|
|
9599
|
-
skipSetActive:
|
|
9756
|
+
skipSetActive: panel !== activePanel,
|
|
9600
9757
|
skipSetGroupActive: true,
|
|
9601
9758
|
});
|
|
9602
9759
|
}
|
|
9603
9760
|
});
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9761
|
+
// Ensure group becomes active after move
|
|
9762
|
+
if (options.skipSetActive !== true) {
|
|
9763
|
+
// For center moves (merges), we need to ensure the target group is active
|
|
9764
|
+
// unless explicitly told not to (skipSetActive: true)
|
|
9765
|
+
this.doSetGroupAndPanelActive(to);
|
|
9609
9766
|
}
|
|
9610
|
-
else if (
|
|
9611
|
-
//
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
});
|
|
9767
|
+
else if (!this.activePanel) {
|
|
9768
|
+
// Even with skipSetActive: true, ensure there's an active panel if none exists
|
|
9769
|
+
// This maintains basic functionality while respecting skipSetActive
|
|
9770
|
+
this.doSetGroupAndPanelActive(to);
|
|
9615
9771
|
}
|
|
9616
9772
|
}
|
|
9617
9773
|
else {
|
|
@@ -9641,20 +9797,26 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9641
9797
|
if (selectedPopoutGroup.referenceGroup) {
|
|
9642
9798
|
const referenceGroup = this.getPanel(selectedPopoutGroup.referenceGroup);
|
|
9643
9799
|
if (referenceGroup && !referenceGroup.api.isVisible) {
|
|
9644
|
-
this.doRemoveGroup(referenceGroup, {
|
|
9800
|
+
this.doRemoveGroup(referenceGroup, {
|
|
9801
|
+
skipActive: true,
|
|
9802
|
+
});
|
|
9645
9803
|
}
|
|
9646
9804
|
}
|
|
9647
9805
|
// Manually dispose the window without triggering restoration
|
|
9648
9806
|
selectedPopoutGroup.window.dispose();
|
|
9649
9807
|
// Update group's location and containers for target
|
|
9650
9808
|
if (to.api.location.type === 'grid') {
|
|
9651
|
-
from.model.renderContainer =
|
|
9652
|
-
|
|
9809
|
+
from.model.renderContainer =
|
|
9810
|
+
this.overlayRenderContainer;
|
|
9811
|
+
from.model.dropTargetContainer =
|
|
9812
|
+
this.rootDropTargetContainer;
|
|
9653
9813
|
from.model.location = { type: 'grid' };
|
|
9654
9814
|
}
|
|
9655
9815
|
else if (to.api.location.type === 'floating') {
|
|
9656
|
-
from.model.renderContainer =
|
|
9657
|
-
|
|
9816
|
+
from.model.renderContainer =
|
|
9817
|
+
this.overlayRenderContainer;
|
|
9818
|
+
from.model.dropTargetContainer =
|
|
9819
|
+
this.rootDropTargetContainer;
|
|
9658
9820
|
from.model.location = { type: 'floating' };
|
|
9659
9821
|
}
|
|
9660
9822
|
break;
|
|
@@ -9722,8 +9884,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9722
9884
|
from.panels.forEach((panel) => {
|
|
9723
9885
|
this._onDidMovePanel.fire({ panel, from });
|
|
9724
9886
|
});
|
|
9725
|
-
|
|
9726
|
-
|
|
9887
|
+
// Ensure group becomes active after move
|
|
9888
|
+
if (options.skipSetActive === false) {
|
|
9889
|
+
// Only activate when explicitly requested (skipSetActive: false)
|
|
9890
|
+
// Use 'to' group for non-center moves since 'from' may have been destroyed
|
|
9891
|
+
const targetGroup = to !== null && to !== void 0 ? to : from;
|
|
9892
|
+
this.doSetGroupAndPanelActive(targetGroup);
|
|
9727
9893
|
}
|
|
9728
9894
|
}
|
|
9729
9895
|
doSetGroupActive(group) {
|
|
@@ -11465,7 +11631,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
11465
11631
|
}, [onPointerLeave]);
|
|
11466
11632
|
return (React.createElement("div", Object.assign({ "data-testid": "dockview-dv-default-tab" }, rest, { onPointerDown: _onPointerDown, onPointerUp: _onPointerUp, onPointerLeave: _onPointerLeave, className: "dv-default-tab" }),
|
|
11467
11633
|
React.createElement("span", { className: "dv-default-tab-content" }, title),
|
|
11468
|
-
!hideClose &&
|
|
11634
|
+
!hideClose && (React.createElement("div", { className: "dv-default-tab-action", onPointerDown: onBtnPointerDown, onClick: onClose },
|
|
11469
11635
|
React.createElement(CloseButton, null)))));
|
|
11470
11636
|
};
|
|
11471
11637
|
|
|
@@ -11812,7 +11978,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
11812
11978
|
exports.SplitviewPanel = SplitviewPanel;
|
|
11813
11979
|
exports.SplitviewReact = SplitviewReact;
|
|
11814
11980
|
exports.Tab = Tab;
|
|
11815
|
-
exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
|
|
11816
11981
|
exports.createDockview = createDockview;
|
|
11817
11982
|
exports.createGridview = createGridview;
|
|
11818
11983
|
exports.createPaneview = createPaneview;
|