@tanstack/react-query-devtools 4.14.5 → 4.14.8

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.
@@ -2635,25 +2635,38 @@
2635
2635
  }
2636
2636
  }, [isResolvedOpen]);
2637
2637
  React__namespace.useEffect(() => {
2638
- if (isResolvedOpen) {
2639
- var _root$parentElement;
2638
+ var _rootRef$current;
2640
2639
 
2641
- const root = rootRef.current;
2640
+ if (isResolvedOpen && (_rootRef$current = rootRef.current) != null && _rootRef$current.parentElement) {
2641
+ const {
2642
+ parentElement
2643
+ } = rootRef.current;
2642
2644
  const styleProp = getSidedProp('padding', panelPosition);
2643
2645
  const isVertical = isVerticalSide(panelPosition);
2644
- const previousValue = root == null ? void 0 : (_root$parentElement = root.parentElement) == null ? void 0 : _root$parentElement.style[styleProp];
2646
+
2647
+ const previousPaddings = (({
2648
+ padding,
2649
+ paddingTop,
2650
+ paddingBottom,
2651
+ paddingLeft,
2652
+ paddingRight
2653
+ }) => ({
2654
+ padding,
2655
+ paddingTop,
2656
+ paddingBottom,
2657
+ paddingLeft,
2658
+ paddingRight
2659
+ }))(parentElement.style);
2645
2660
 
2646
2661
  const run = () => {
2647
- if (root != null && root.parentElement) {
2648
- // reset the padding
2649
- root.parentElement.style.padding = '0px';
2650
- root.parentElement.style.paddingTop = '0px';
2651
- root.parentElement.style.paddingBottom = '0px';
2652
- root.parentElement.style.paddingLeft = '0px';
2653
- root.parentElement.style.paddingRight = '0px'; // set the new padding based on the new panel position
2654
-
2655
- root.parentElement.style[styleProp] = (isVertical ? devtoolsWidth : devtoolsHeight) + "px";
2656
- }
2662
+ // reset the padding
2663
+ parentElement.style.padding = '0px';
2664
+ parentElement.style.paddingTop = '0px';
2665
+ parentElement.style.paddingBottom = '0px';
2666
+ parentElement.style.paddingLeft = '0px';
2667
+ parentElement.style.paddingRight = '0px'; // set the new padding based on the new panel position
2668
+
2669
+ parentElement.style[styleProp] = (isVertical ? devtoolsWidth : devtoolsHeight) + "px";
2657
2670
  };
2658
2671
 
2659
2672
  run();
@@ -2662,10 +2675,9 @@
2662
2675
  window.addEventListener('resize', run);
2663
2676
  return () => {
2664
2677
  window.removeEventListener('resize', run);
2665
-
2666
- if (root != null && root.parentElement && typeof previousValue === 'string') {
2667
- root.parentElement.style[styleProp] = previousValue;
2668
- }
2678
+ Object.entries(previousPaddings).forEach(([property, previousValue]) => {
2679
+ parentElement.style[property] = previousValue;
2680
+ });
2669
2681
  };
2670
2682
  }
2671
2683
  }