dockview-react 4.2.1 → 4.2.4
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 +72 -20
- 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 +72 -20
- package/dist/dockview-react.amd.noStyle.js.map +1 -1
- package/dist/dockview-react.cjs.js +72 -20
- package/dist/dockview-react.cjs.js.map +1 -1
- package/dist/dockview-react.esm.js +72 -20
- 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 +72 -20
- 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 +72 -20
- package/dist/dockview-react.noStyle.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
3
|
-
* @version 4.2.
|
|
3
|
+
* @version 4.2.4
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -669,6 +669,44 @@ function onDidWindowResizeEnd(element, cb) {
|
|
|
669
669
|
}));
|
|
670
670
|
return disposable;
|
|
671
671
|
}
|
|
672
|
+
function shiftAbsoluteElementIntoView(element, root, options = { buffer: 10 }) {
|
|
673
|
+
const buffer = options.buffer;
|
|
674
|
+
const rect = element.getBoundingClientRect();
|
|
675
|
+
const rootRect = element.getBoundingClientRect();
|
|
676
|
+
const viewportWidth = root.clientWidth;
|
|
677
|
+
const viewportHeight = root.clientHeight;
|
|
678
|
+
let translateX = 0;
|
|
679
|
+
let translateY = 0;
|
|
680
|
+
const left = rect.left - rootRect.left;
|
|
681
|
+
const top = rect.top - rootRect.top;
|
|
682
|
+
const bottom = rect.bottom - rootRect.bottom;
|
|
683
|
+
const right = rect.right - rootRect.right;
|
|
684
|
+
// Check horizontal overflow
|
|
685
|
+
if (left < buffer) {
|
|
686
|
+
translateX = buffer - left;
|
|
687
|
+
}
|
|
688
|
+
else if (right > viewportWidth - buffer) {
|
|
689
|
+
translateX = viewportWidth - right - buffer;
|
|
690
|
+
}
|
|
691
|
+
// Check vertical overflow
|
|
692
|
+
if (top < buffer) {
|
|
693
|
+
translateY = buffer - top;
|
|
694
|
+
}
|
|
695
|
+
else if (bottom > viewportHeight - buffer) {
|
|
696
|
+
translateY = viewportHeight - bottom - buffer;
|
|
697
|
+
}
|
|
698
|
+
// Apply the translation if needed
|
|
699
|
+
if (translateX !== 0 || translateY !== 0) {
|
|
700
|
+
element.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
function findRelativeZIndexParent(el) {
|
|
704
|
+
let tmp = el;
|
|
705
|
+
while (tmp && (tmp.style.zIndex === 'auto' || tmp.style.zIndex === '')) {
|
|
706
|
+
tmp = tmp.parentElement;
|
|
707
|
+
}
|
|
708
|
+
return tmp;
|
|
709
|
+
}
|
|
672
710
|
|
|
673
711
|
function tail(arr) {
|
|
674
712
|
if (arr.length === 0) {
|
|
@@ -5636,7 +5674,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5636
5674
|
toggleClass(wrapper, 'dv-tab', true);
|
|
5637
5675
|
toggleClass(wrapper, 'dv-active-tab', panelObject.api.isActive);
|
|
5638
5676
|
toggleClass(wrapper, 'dv-inactive-tab', !panelObject.api.isActive);
|
|
5639
|
-
wrapper.addEventListener('
|
|
5677
|
+
wrapper.addEventListener('pointerdown', () => {
|
|
5640
5678
|
this.accessor.popupService.close();
|
|
5641
5679
|
tab.element.scrollIntoView();
|
|
5642
5680
|
tab.panel.api.setActive();
|
|
@@ -5644,9 +5682,13 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5644
5682
|
wrapper.appendChild(child);
|
|
5645
5683
|
el.appendChild(wrapper);
|
|
5646
5684
|
}
|
|
5685
|
+
const relativeParent = findRelativeZIndexParent(root);
|
|
5647
5686
|
this.accessor.popupService.openPopover(el, {
|
|
5648
5687
|
x: event.clientX,
|
|
5649
5688
|
y: event.clientY,
|
|
5689
|
+
zIndex: (relativeParent === null || relativeParent === void 0 ? void 0 : relativeParent.style.zIndex)
|
|
5690
|
+
? `calc(${relativeParent.style.zIndex} * 2)`
|
|
5691
|
+
: undefined,
|
|
5650
5692
|
});
|
|
5651
5693
|
}));
|
|
5652
5694
|
}
|
|
@@ -7988,10 +8030,11 @@ class PopupService extends CompositeDisposable {
|
|
|
7988
8030
|
}), this._activeDisposable);
|
|
7989
8031
|
}
|
|
7990
8032
|
openPopover(element, position) {
|
|
8033
|
+
var _a;
|
|
7991
8034
|
this.close();
|
|
7992
8035
|
const wrapper = document.createElement('div');
|
|
7993
8036
|
wrapper.style.position = 'absolute';
|
|
7994
|
-
wrapper.style.zIndex = '
|
|
8037
|
+
wrapper.style.zIndex = (_a = position.zIndex) !== null && _a !== void 0 ? _a : 'var(--dv-overlay-z-index)';
|
|
7995
8038
|
wrapper.appendChild(element);
|
|
7996
8039
|
const anchorBox = this._element.getBoundingClientRect();
|
|
7997
8040
|
const offsetX = anchorBox.left;
|
|
@@ -8015,6 +8058,9 @@ class PopupService extends CompositeDisposable {
|
|
|
8015
8058
|
}
|
|
8016
8059
|
this.close();
|
|
8017
8060
|
}));
|
|
8061
|
+
requestAnimationFrame(() => {
|
|
8062
|
+
shiftAbsoluteElementIntoView(wrapper, this.root);
|
|
8063
|
+
});
|
|
8018
8064
|
}
|
|
8019
8065
|
close() {
|
|
8020
8066
|
if (this._active) {
|
|
@@ -9548,24 +9594,26 @@ class DockviewComponent extends BaseGrid {
|
|
|
9548
9594
|
selectedPopoutGroup.disposable.dispose();
|
|
9549
9595
|
}
|
|
9550
9596
|
}
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9597
|
+
if (from.api.location.type !== 'popout') {
|
|
9598
|
+
const referenceLocation = getGridLocation(to.element);
|
|
9599
|
+
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
9600
|
+
let size;
|
|
9601
|
+
switch (this.gridview.orientation) {
|
|
9602
|
+
case Orientation.VERTICAL:
|
|
9603
|
+
size =
|
|
9604
|
+
referenceLocation.length % 2 == 0
|
|
9605
|
+
? from.api.width
|
|
9606
|
+
: from.api.height;
|
|
9607
|
+
break;
|
|
9608
|
+
case Orientation.HORIZONTAL:
|
|
9609
|
+
size =
|
|
9610
|
+
referenceLocation.length % 2 == 0
|
|
9611
|
+
? from.api.height
|
|
9612
|
+
: from.api.width;
|
|
9613
|
+
break;
|
|
9614
|
+
}
|
|
9615
|
+
this.gridview.addView(from, size, dropLocation);
|
|
9567
9616
|
}
|
|
9568
|
-
this.gridview.addView(from, size, dropLocation);
|
|
9569
9617
|
}
|
|
9570
9618
|
from.panels.forEach((panel) => {
|
|
9571
9619
|
this._onDidMovePanel.fire({ panel, from });
|
|
@@ -11142,6 +11190,7 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
11142
11190
|
}
|
|
11143
11191
|
dockviewRef.current = api;
|
|
11144
11192
|
return () => {
|
|
11193
|
+
dockviewRef.current = undefined;
|
|
11145
11194
|
api.dispose();
|
|
11146
11195
|
};
|
|
11147
11196
|
}, []);
|
|
@@ -11377,6 +11426,7 @@ const SplitviewReact = React.forwardRef((props, ref) => {
|
|
|
11377
11426
|
}
|
|
11378
11427
|
splitviewRef.current = api;
|
|
11379
11428
|
return () => {
|
|
11429
|
+
splitviewRef.current = undefined;
|
|
11380
11430
|
api.dispose();
|
|
11381
11431
|
};
|
|
11382
11432
|
}, []);
|
|
@@ -11460,6 +11510,7 @@ const GridviewReact = React.forwardRef((props, ref) => {
|
|
|
11460
11510
|
}
|
|
11461
11511
|
gridviewRef.current = api;
|
|
11462
11512
|
return () => {
|
|
11513
|
+
gridviewRef.current = undefined;
|
|
11463
11514
|
api.dispose();
|
|
11464
11515
|
};
|
|
11465
11516
|
}, []);
|
|
@@ -11565,6 +11616,7 @@ const PaneviewReact = React.forwardRef((props, ref) => {
|
|
|
11565
11616
|
}
|
|
11566
11617
|
paneviewRef.current = api;
|
|
11567
11618
|
return () => {
|
|
11619
|
+
paneviewRef.current = undefined;
|
|
11568
11620
|
api.dispose();
|
|
11569
11621
|
};
|
|
11570
11622
|
}, []);
|