@tanstack/react-query-devtools 4.14.6 → 4.15.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/build/lib/__tests__/utils.d.ts +2 -2
- package/build/lib/devtools.esm.js +30 -18
- package/build/lib/devtools.esm.js.map +1 -1
- package/build/lib/devtools.js +30 -18
- package/build/lib/devtools.js.map +1 -1
- package/build/lib/devtools.mjs +30 -18
- package/build/lib/devtools.mjs.map +1 -1
- package/build/lib/index.prod.esm.js +30 -18
- package/build/lib/index.prod.esm.js.map +1 -1
- package/build/lib/index.prod.js +30 -18
- package/build/lib/index.prod.js.map +1 -1
- package/build/lib/index.prod.mjs +30 -18
- package/build/lib/index.prod.mjs.map +1 -1
- package/build/umd/index.development.js +30 -18
- package/build/umd/index.development.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/devtools.test.tsx +53 -1
- package/src/__tests__/utils.tsx +3 -1
- package/src/devtools.tsx +33 -19
package/build/lib/index.prod.mjs
CHANGED
|
@@ -682,25 +682,38 @@ function ReactQueryDevtools$1({
|
|
|
682
682
|
}
|
|
683
683
|
}, [isResolvedOpen]);
|
|
684
684
|
React.useEffect(() => {
|
|
685
|
-
|
|
686
|
-
var _root$parentElement;
|
|
685
|
+
var _rootRef$current;
|
|
687
686
|
|
|
688
|
-
|
|
687
|
+
if (isResolvedOpen && (_rootRef$current = rootRef.current) != null && _rootRef$current.parentElement) {
|
|
688
|
+
const {
|
|
689
|
+
parentElement
|
|
690
|
+
} = rootRef.current;
|
|
689
691
|
const styleProp = getSidedProp('padding', panelPosition);
|
|
690
692
|
const isVertical = isVerticalSide(panelPosition);
|
|
691
|
-
|
|
693
|
+
|
|
694
|
+
const previousPaddings = (({
|
|
695
|
+
padding,
|
|
696
|
+
paddingTop,
|
|
697
|
+
paddingBottom,
|
|
698
|
+
paddingLeft,
|
|
699
|
+
paddingRight
|
|
700
|
+
}) => ({
|
|
701
|
+
padding,
|
|
702
|
+
paddingTop,
|
|
703
|
+
paddingBottom,
|
|
704
|
+
paddingLeft,
|
|
705
|
+
paddingRight
|
|
706
|
+
}))(parentElement.style);
|
|
692
707
|
|
|
693
708
|
const run = () => {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
root.parentElement.style[styleProp] = (isVertical ? devtoolsWidth : devtoolsHeight) + "px";
|
|
703
|
-
}
|
|
709
|
+
// reset the padding
|
|
710
|
+
parentElement.style.padding = '0px';
|
|
711
|
+
parentElement.style.paddingTop = '0px';
|
|
712
|
+
parentElement.style.paddingBottom = '0px';
|
|
713
|
+
parentElement.style.paddingLeft = '0px';
|
|
714
|
+
parentElement.style.paddingRight = '0px'; // set the new padding based on the new panel position
|
|
715
|
+
|
|
716
|
+
parentElement.style[styleProp] = (isVertical ? devtoolsWidth : devtoolsHeight) + "px";
|
|
704
717
|
};
|
|
705
718
|
|
|
706
719
|
run();
|
|
@@ -709,10 +722,9 @@ function ReactQueryDevtools$1({
|
|
|
709
722
|
window.addEventListener('resize', run);
|
|
710
723
|
return () => {
|
|
711
724
|
window.removeEventListener('resize', run);
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
}
|
|
725
|
+
Object.entries(previousPaddings).forEach(([property, previousValue]) => {
|
|
726
|
+
parentElement.style[property] = previousValue;
|
|
727
|
+
});
|
|
716
728
|
};
|
|
717
729
|
}
|
|
718
730
|
}
|