@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.
@@ -709,25 +709,38 @@ function ReactQueryDevtools$1({
709
709
  }
710
710
  }, [isResolvedOpen]);
711
711
  React__namespace.useEffect(() => {
712
- if (isResolvedOpen) {
713
- var _root$parentElement;
712
+ var _rootRef$current;
714
713
 
715
- const root = rootRef.current;
714
+ if (isResolvedOpen && (_rootRef$current = rootRef.current) != null && _rootRef$current.parentElement) {
715
+ const {
716
+ parentElement
717
+ } = rootRef.current;
716
718
  const styleProp = getSidedProp('padding', panelPosition);
717
719
  const isVertical = isVerticalSide(panelPosition);
718
- const previousValue = root == null ? void 0 : (_root$parentElement = root.parentElement) == null ? void 0 : _root$parentElement.style[styleProp];
720
+
721
+ const previousPaddings = (({
722
+ padding,
723
+ paddingTop,
724
+ paddingBottom,
725
+ paddingLeft,
726
+ paddingRight
727
+ }) => ({
728
+ padding,
729
+ paddingTop,
730
+ paddingBottom,
731
+ paddingLeft,
732
+ paddingRight
733
+ }))(parentElement.style);
719
734
 
720
735
  const run = () => {
721
- if (root != null && root.parentElement) {
722
- // reset the padding
723
- root.parentElement.style.padding = '0px';
724
- root.parentElement.style.paddingTop = '0px';
725
- root.parentElement.style.paddingBottom = '0px';
726
- root.parentElement.style.paddingLeft = '0px';
727
- root.parentElement.style.paddingRight = '0px'; // set the new padding based on the new panel position
728
-
729
- root.parentElement.style[styleProp] = (isVertical ? devtoolsWidth : devtoolsHeight) + "px";
730
- }
736
+ // reset the padding
737
+ parentElement.style.padding = '0px';
738
+ parentElement.style.paddingTop = '0px';
739
+ parentElement.style.paddingBottom = '0px';
740
+ parentElement.style.paddingLeft = '0px';
741
+ parentElement.style.paddingRight = '0px'; // set the new padding based on the new panel position
742
+
743
+ parentElement.style[styleProp] = (isVertical ? devtoolsWidth : devtoolsHeight) + "px";
731
744
  };
732
745
 
733
746
  run();
@@ -736,10 +749,9 @@ function ReactQueryDevtools$1({
736
749
  window.addEventListener('resize', run);
737
750
  return () => {
738
751
  window.removeEventListener('resize', run);
739
-
740
- if (root != null && root.parentElement && typeof previousValue === 'string') {
741
- root.parentElement.style[styleProp] = previousValue;
742
- }
752
+ Object.entries(previousPaddings).forEach(([property, previousValue]) => {
753
+ parentElement.style[property] = previousValue;
754
+ });
743
755
  };
744
756
  }
745
757
  }