@tanstack/react-query-devtools 4.10.4 → 4.11.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/devtools.d.ts +29 -6
- package/build/lib/devtools.esm.js +130 -113
- package/build/lib/devtools.esm.js.map +1 -1
- package/build/lib/devtools.js +128 -111
- package/build/lib/devtools.js.map +1 -1
- package/build/lib/devtools.mjs +130 -113
- package/build/lib/devtools.mjs.map +1 -1
- package/build/lib/index.prod.esm.js +240 -120
- package/build/lib/index.prod.esm.js.map +1 -1
- package/build/lib/index.prod.js +240 -120
- package/build/lib/index.prod.js.map +1 -1
- package/build/lib/index.prod.mjs +240 -120
- package/build/lib/index.prod.mjs.map +1 -1
- package/build/lib/utils.d.ts +56 -0
- package/build/lib/utils.esm.js +104 -1
- package/build/lib/utils.esm.js.map +1 -1
- package/build/lib/utils.js +111 -0
- package/build/lib/utils.js.map +1 -1
- package/build/lib/utils.mjs +104 -1
- package/build/lib/utils.mjs.map +1 -1
- package/build/umd/index.development.js +240 -120
- package/build/umd/index.development.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/devtools.test.tsx +99 -0
- package/src/devtools.tsx +182 -129
- package/src/utils.ts +162 -0
|
@@ -2146,18 +2146,108 @@
|
|
|
2146
2146
|
'Query Hash': queryHashSort,
|
|
2147
2147
|
'Last Updated': dateSort
|
|
2148
2148
|
};
|
|
2149
|
+
const minPanelSize = 70;
|
|
2150
|
+
const defaultPanelSize = 500;
|
|
2151
|
+
const sides = {
|
|
2152
|
+
top: 'bottom',
|
|
2153
|
+
bottom: 'top',
|
|
2154
|
+
left: 'right',
|
|
2155
|
+
right: 'left'
|
|
2156
|
+
};
|
|
2149
2157
|
|
|
2150
|
-
|
|
2151
|
-
|
|
2158
|
+
/**
|
|
2159
|
+
* Check if the given side is vertical (left/right)
|
|
2160
|
+
*/
|
|
2161
|
+
function isVerticalSide(side) {
|
|
2162
|
+
return ['left', 'right'].includes(side);
|
|
2163
|
+
}
|
|
2164
|
+
/**
|
|
2165
|
+
* Get the opposite side, eg 'left' => 'right'. 'top' => 'bottom', etc
|
|
2166
|
+
*/
|
|
2167
|
+
|
|
2168
|
+
function getOppositeSide(side) {
|
|
2169
|
+
return sides[side];
|
|
2170
|
+
}
|
|
2171
|
+
/**
|
|
2172
|
+
* Given as css prop it will return a sided css prop based on a given side
|
|
2173
|
+
* Example given `border` and `right` it return `borderRight`
|
|
2174
|
+
*/
|
|
2175
|
+
|
|
2176
|
+
function getSidedProp(prop, side) {
|
|
2177
|
+
return "" + prop + (side.charAt(0).toUpperCase() + side.slice(1));
|
|
2178
|
+
}
|
|
2179
|
+
function getSidePanelStyle({
|
|
2180
|
+
position = 'bottom',
|
|
2181
|
+
height,
|
|
2182
|
+
width,
|
|
2183
|
+
devtoolsTheme,
|
|
2184
|
+
isOpen,
|
|
2185
|
+
isResizing,
|
|
2186
|
+
panelStyle
|
|
2152
2187
|
}) {
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2188
|
+
const oppositeSide = getOppositeSide(position);
|
|
2189
|
+
const borderSide = getSidedProp('border', oppositeSide);
|
|
2190
|
+
const isVertical = isVerticalSide(position);
|
|
2191
|
+
return { ...panelStyle,
|
|
2192
|
+
direction: 'ltr',
|
|
2193
|
+
position: 'fixed',
|
|
2194
|
+
[position]: 0,
|
|
2195
|
+
[borderSide]: "1px solid " + devtoolsTheme.gray,
|
|
2196
|
+
transformOrigin: oppositeSide,
|
|
2197
|
+
boxShadow: '0 0 20px rgba(0,0,0,.3)',
|
|
2198
|
+
zIndex: 99999,
|
|
2199
|
+
// visibility will be toggled after transitions, but set initial state here
|
|
2200
|
+
visibility: isOpen ? 'visible' : 'hidden',
|
|
2201
|
+
...(isResizing ? {
|
|
2202
|
+
transition: "none"
|
|
2203
|
+
} : {
|
|
2204
|
+
transition: "all .2s ease"
|
|
2205
|
+
}),
|
|
2206
|
+
...(isOpen ? {
|
|
2207
|
+
opacity: 1,
|
|
2208
|
+
pointerEvents: 'all',
|
|
2209
|
+
transform: isVertical ? "translateX(0) scale(1)" : "translateY(0) scale(1)"
|
|
2210
|
+
} : {
|
|
2211
|
+
opacity: 0,
|
|
2212
|
+
pointerEvents: 'none',
|
|
2213
|
+
transform: isVertical ? "translateX(15px) scale(1.02)" : "translateY(15px) scale(1.02)"
|
|
2214
|
+
}),
|
|
2215
|
+
...(isVertical ? {
|
|
2216
|
+
top: 0,
|
|
2217
|
+
height: '100vh',
|
|
2218
|
+
maxWidth: '90%',
|
|
2219
|
+
width: typeof width === 'number' && width >= minPanelSize ? width : defaultPanelSize
|
|
2220
|
+
} : {
|
|
2221
|
+
left: 0,
|
|
2222
|
+
width: '100%',
|
|
2223
|
+
maxHeight: '90%',
|
|
2224
|
+
height: typeof height === 'number' && height >= minPanelSize ? height : defaultPanelSize
|
|
2225
|
+
})
|
|
2226
|
+
};
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Get resize handle style based on a given side
|
|
2230
|
+
*/
|
|
2231
|
+
|
|
2232
|
+
function getResizeHandleStyle(position = 'bottom') {
|
|
2233
|
+
const isVertical = isVerticalSide(position);
|
|
2234
|
+
const oppositeSide = getOppositeSide(position);
|
|
2235
|
+
const marginSide = getSidedProp('margin', oppositeSide);
|
|
2236
|
+
return {
|
|
2237
|
+
position: 'absolute',
|
|
2238
|
+
cursor: isVertical ? 'col-resize' : 'row-resize',
|
|
2239
|
+
zIndex: 100000,
|
|
2240
|
+
[oppositeSide]: 0,
|
|
2241
|
+
[marginSide]: "-4px",
|
|
2242
|
+
...(isVertical ? {
|
|
2243
|
+
top: 0,
|
|
2244
|
+
height: '100%',
|
|
2245
|
+
width: '4px'
|
|
2246
|
+
} : {
|
|
2247
|
+
width: '100%',
|
|
2248
|
+
height: '4px'
|
|
2249
|
+
})
|
|
2250
|
+
};
|
|
2161
2251
|
}
|
|
2162
2252
|
|
|
2163
2253
|
const Panel = styled('div', (_props, theme) => ({
|
|
@@ -2248,6 +2338,19 @@
|
|
|
2248
2338
|
}
|
|
2249
2339
|
});
|
|
2250
2340
|
|
|
2341
|
+
function ScreenReader({
|
|
2342
|
+
text
|
|
2343
|
+
}) {
|
|
2344
|
+
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
2345
|
+
style: {
|
|
2346
|
+
position: 'absolute',
|
|
2347
|
+
width: '0.1px',
|
|
2348
|
+
height: '0.1px',
|
|
2349
|
+
overflow: 'hidden'
|
|
2350
|
+
}
|
|
2351
|
+
}, text);
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2251
2354
|
const Entry = styled('div', {
|
|
2252
2355
|
fontFamily: 'Menlo, monospace',
|
|
2253
2356
|
fontSize: '1em',
|
|
@@ -2441,33 +2544,47 @@
|
|
|
2441
2544
|
position = 'bottom-left',
|
|
2442
2545
|
containerElement: Container = 'aside',
|
|
2443
2546
|
context,
|
|
2444
|
-
styleNonce
|
|
2547
|
+
styleNonce,
|
|
2548
|
+
panelPosition: initialPanelPosition = 'bottom'
|
|
2445
2549
|
}) {
|
|
2446
2550
|
const rootRef = React__namespace.useRef(null);
|
|
2447
2551
|
const panelRef = React__namespace.useRef(null);
|
|
2448
2552
|
const [isOpen, setIsOpen] = useLocalStorage('reactQueryDevtoolsOpen', initialIsOpen);
|
|
2449
|
-
const [devtoolsHeight, setDevtoolsHeight] = useLocalStorage('reactQueryDevtoolsHeight',
|
|
2553
|
+
const [devtoolsHeight, setDevtoolsHeight] = useLocalStorage('reactQueryDevtoolsHeight', defaultPanelSize);
|
|
2554
|
+
const [devtoolsWidth, setDevtoolsWidth] = useLocalStorage('reactQueryDevtoolsWidth', defaultPanelSize);
|
|
2555
|
+
const [panelPosition = 'bottom', setPanelPosition] = useLocalStorage('reactQueryDevtoolsPanelPosition', initialPanelPosition);
|
|
2450
2556
|
const [isResolvedOpen, setIsResolvedOpen] = React__namespace.useState(false);
|
|
2451
2557
|
const [isResizing, setIsResizing] = React__namespace.useState(false);
|
|
2452
2558
|
const isMounted = useIsMounted();
|
|
2453
2559
|
|
|
2454
2560
|
const handleDragStart = (panelElement, startEvent) => {
|
|
2455
|
-
|
|
2456
|
-
|
|
2561
|
+
if (!panelElement) return;
|
|
2457
2562
|
if (startEvent.button !== 0) return; // Only allow left click for drag
|
|
2458
2563
|
|
|
2564
|
+
const isVertical = isVerticalSide(panelPosition);
|
|
2459
2565
|
setIsResizing(true);
|
|
2460
|
-
const
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
};
|
|
2566
|
+
const {
|
|
2567
|
+
height,
|
|
2568
|
+
width
|
|
2569
|
+
} = panelElement.getBoundingClientRect();
|
|
2570
|
+
const startX = startEvent.clientX;
|
|
2571
|
+
const startY = startEvent.clientY;
|
|
2572
|
+
let newSize = 0;
|
|
2464
2573
|
|
|
2465
2574
|
const run = moveEvent => {
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2575
|
+
// prevent mouse selecting stuff with mouse drag
|
|
2576
|
+
moveEvent.preventDefault(); // calculate the correct size based on mouse position and current panel position
|
|
2577
|
+
// hint: it is different formula for the opposite sides
|
|
2469
2578
|
|
|
2470
|
-
if (
|
|
2579
|
+
if (isVertical) {
|
|
2580
|
+
newSize = width + (panelPosition === 'right' ? startX - moveEvent.clientX : moveEvent.clientX - startX);
|
|
2581
|
+
setDevtoolsWidth(newSize);
|
|
2582
|
+
} else {
|
|
2583
|
+
newSize = height + (panelPosition === 'bottom' ? startY - moveEvent.clientY : moveEvent.clientY - startY);
|
|
2584
|
+
setDevtoolsHeight(newSize);
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
if (newSize < minPanelSize) {
|
|
2471
2588
|
setIsOpen(false);
|
|
2472
2589
|
} else {
|
|
2473
2590
|
setIsOpen(true);
|
|
@@ -2475,13 +2592,16 @@
|
|
|
2475
2592
|
};
|
|
2476
2593
|
|
|
2477
2594
|
const unsub = () => {
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2595
|
+
if (isResizing) {
|
|
2596
|
+
setIsResizing(false);
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
document.removeEventListener('mousemove', run, false);
|
|
2600
|
+
document.removeEventListener('mouseUp', unsub, false);
|
|
2481
2601
|
};
|
|
2482
2602
|
|
|
2483
|
-
document.addEventListener('mousemove', run);
|
|
2484
|
-
document.addEventListener('mouseup', unsub);
|
|
2603
|
+
document.addEventListener('mousemove', run, false);
|
|
2604
|
+
document.addEventListener('mouseup', unsub, false);
|
|
2485
2605
|
};
|
|
2486
2606
|
|
|
2487
2607
|
React__namespace.useEffect(() => {
|
|
@@ -2518,15 +2638,20 @@
|
|
|
2518
2638
|
var _root$parentElement;
|
|
2519
2639
|
|
|
2520
2640
|
const root = rootRef.current;
|
|
2521
|
-
const
|
|
2641
|
+
const styleProp = getSidedProp('padding', panelPosition);
|
|
2642
|
+
const isVertical = isVerticalSide(panelPosition);
|
|
2643
|
+
const previousValue = root == null ? void 0 : (_root$parentElement = root.parentElement) == null ? void 0 : _root$parentElement.style[styleProp];
|
|
2522
2644
|
|
|
2523
2645
|
const run = () => {
|
|
2524
|
-
var _panelRef$current;
|
|
2525
|
-
|
|
2526
|
-
const containerHeight = (_panelRef$current = panelRef.current) == null ? void 0 : _panelRef$current.getBoundingClientRect().height;
|
|
2527
|
-
|
|
2528
2646
|
if (root != null && root.parentElement) {
|
|
2529
|
-
|
|
2647
|
+
// reset the padding
|
|
2648
|
+
root.parentElement.style.padding = '0px';
|
|
2649
|
+
root.parentElement.style.paddingTop = '0px';
|
|
2650
|
+
root.parentElement.style.paddingBottom = '0px';
|
|
2651
|
+
root.parentElement.style.paddingLeft = '0px';
|
|
2652
|
+
root.parentElement.style.paddingRight = '0px'; // set the new padding based on the new panel position
|
|
2653
|
+
|
|
2654
|
+
root.parentElement.style[styleProp] = (isVertical ? devtoolsWidth : devtoolsHeight) + "px";
|
|
2530
2655
|
}
|
|
2531
2656
|
};
|
|
2532
2657
|
|
|
@@ -2538,26 +2663,31 @@
|
|
|
2538
2663
|
window.removeEventListener('resize', run);
|
|
2539
2664
|
|
|
2540
2665
|
if (root != null && root.parentElement && typeof previousValue === 'string') {
|
|
2541
|
-
root.parentElement.style
|
|
2666
|
+
root.parentElement.style[styleProp] = previousValue;
|
|
2542
2667
|
}
|
|
2543
2668
|
};
|
|
2544
2669
|
}
|
|
2545
2670
|
}
|
|
2546
|
-
}, [isResolvedOpen]);
|
|
2671
|
+
}, [isResolvedOpen, panelPosition, devtoolsHeight, devtoolsWidth]);
|
|
2547
2672
|
const {
|
|
2548
2673
|
style: panelStyle = {},
|
|
2549
2674
|
...otherPanelProps
|
|
2550
2675
|
} = panelProps;
|
|
2551
|
-
const {
|
|
2552
|
-
style: closeButtonStyle = {},
|
|
2553
|
-
onClick: onCloseClick,
|
|
2554
|
-
...otherCloseButtonProps
|
|
2555
|
-
} = closeButtonProps;
|
|
2556
2676
|
const {
|
|
2557
2677
|
style: toggleButtonStyle = {},
|
|
2558
2678
|
onClick: onToggleClick,
|
|
2559
2679
|
...otherToggleButtonProps
|
|
2560
|
-
} = toggleButtonProps; //
|
|
2680
|
+
} = toggleButtonProps; // get computed style based on panel position
|
|
2681
|
+
|
|
2682
|
+
const style = getSidePanelStyle({
|
|
2683
|
+
position: panelPosition,
|
|
2684
|
+
devtoolsTheme: defaultTheme,
|
|
2685
|
+
isOpen: isResolvedOpen,
|
|
2686
|
+
height: devtoolsHeight,
|
|
2687
|
+
width: devtoolsWidth,
|
|
2688
|
+
isResizing,
|
|
2689
|
+
panelStyle
|
|
2690
|
+
}); // Do not render on the server
|
|
2561
2691
|
|
|
2562
2692
|
if (!isMounted()) return null;
|
|
2563
2693
|
return /*#__PURE__*/React__namespace.createElement(Container, {
|
|
@@ -2569,68 +2699,17 @@
|
|
|
2569
2699
|
}, /*#__PURE__*/React__namespace.createElement(ReactQueryDevtoolsPanel$1, _extends({
|
|
2570
2700
|
ref: panelRef,
|
|
2571
2701
|
context: context,
|
|
2572
|
-
styleNonce: styleNonce
|
|
2702
|
+
styleNonce: styleNonce,
|
|
2703
|
+
position: panelPosition,
|
|
2704
|
+
onPositionChange: setPanelPosition,
|
|
2705
|
+
showCloseButton: true,
|
|
2706
|
+
closeButtonProps: closeButtonProps
|
|
2573
2707
|
}, otherPanelProps, {
|
|
2574
|
-
style:
|
|
2575
|
-
direction: 'ltr',
|
|
2576
|
-
position: 'fixed',
|
|
2577
|
-
bottom: '0',
|
|
2578
|
-
right: '0',
|
|
2579
|
-
zIndex: 99999,
|
|
2580
|
-
width: '100%',
|
|
2581
|
-
height: devtoolsHeight != null ? devtoolsHeight : 500,
|
|
2582
|
-
maxHeight: '90%',
|
|
2583
|
-
boxShadow: '0 0 20px rgba(0,0,0,.3)',
|
|
2584
|
-
borderTop: "1px solid " + defaultTheme.gray,
|
|
2585
|
-
transformOrigin: 'top',
|
|
2586
|
-
// visibility will be toggled after transitions, but set initial state here
|
|
2587
|
-
visibility: isOpen ? 'visible' : 'hidden',
|
|
2588
|
-
...panelStyle,
|
|
2589
|
-
...(isResizing ? {
|
|
2590
|
-
transition: "none"
|
|
2591
|
-
} : {
|
|
2592
|
-
transition: "all .2s ease"
|
|
2593
|
-
}),
|
|
2594
|
-
...(isResolvedOpen ? {
|
|
2595
|
-
opacity: 1,
|
|
2596
|
-
pointerEvents: 'all',
|
|
2597
|
-
transform: "translateY(0) scale(1)"
|
|
2598
|
-
} : {
|
|
2599
|
-
opacity: 0,
|
|
2600
|
-
pointerEvents: 'none',
|
|
2601
|
-
transform: "translateY(15px) scale(1.02)"
|
|
2602
|
-
})
|
|
2603
|
-
},
|
|
2708
|
+
style: style,
|
|
2604
2709
|
isOpen: isResolvedOpen,
|
|
2605
2710
|
setIsOpen: setIsOpen,
|
|
2606
|
-
|
|
2607
|
-
})), isResolvedOpen ? /*#__PURE__*/React__namespace.createElement(
|
|
2608
|
-
type: "button",
|
|
2609
|
-
"aria-controls": "ReactQueryDevtoolsPanel",
|
|
2610
|
-
"aria-haspopup": "true",
|
|
2611
|
-
"aria-expanded": "true"
|
|
2612
|
-
}, otherCloseButtonProps, {
|
|
2613
|
-
onClick: e => {
|
|
2614
|
-
setIsOpen(false);
|
|
2615
|
-
onCloseClick == null ? void 0 : onCloseClick(e);
|
|
2616
|
-
},
|
|
2617
|
-
style: {
|
|
2618
|
-
position: 'fixed',
|
|
2619
|
-
zIndex: 99999,
|
|
2620
|
-
margin: '.5em',
|
|
2621
|
-
bottom: 0,
|
|
2622
|
-
...(position === 'top-right' ? {
|
|
2623
|
-
right: '0'
|
|
2624
|
-
} : position === 'top-left' ? {
|
|
2625
|
-
left: '0'
|
|
2626
|
-
} : position === 'bottom-right' ? {
|
|
2627
|
-
right: '0'
|
|
2628
|
-
} : {
|
|
2629
|
-
left: '0'
|
|
2630
|
-
}),
|
|
2631
|
-
...closeButtonStyle
|
|
2632
|
-
}
|
|
2633
|
-
}), "Close") : null), !isResolvedOpen ? /*#__PURE__*/React__namespace.createElement("button", _extends({
|
|
2711
|
+
onDragStart: e => handleDragStart(panelRef.current, e)
|
|
2712
|
+
}))), !isResolvedOpen ? /*#__PURE__*/React__namespace.createElement("button", _extends({
|
|
2634
2713
|
type: "button"
|
|
2635
2714
|
}, otherToggleButtonProps, {
|
|
2636
2715
|
"aria-label": "Open React Query Devtools",
|
|
@@ -2688,10 +2767,18 @@
|
|
|
2688
2767
|
isOpen = true,
|
|
2689
2768
|
styleNonce,
|
|
2690
2769
|
setIsOpen,
|
|
2691
|
-
handleDragStart,
|
|
2692
2770
|
context,
|
|
2771
|
+
onDragStart,
|
|
2772
|
+
onPositionChange,
|
|
2773
|
+
showCloseButton,
|
|
2774
|
+
position,
|
|
2775
|
+
closeButtonProps = {},
|
|
2693
2776
|
...panelProps
|
|
2694
2777
|
} = props;
|
|
2778
|
+
const {
|
|
2779
|
+
onClick: onCloseClick,
|
|
2780
|
+
...otherCloseButtonProps
|
|
2781
|
+
} = closeButtonProps;
|
|
2695
2782
|
const queryClient = reactQuery.useQueryClient({
|
|
2696
2783
|
context
|
|
2697
2784
|
});
|
|
@@ -2721,23 +2808,20 @@
|
|
|
2721
2808
|
className: "ReactQueryDevtoolsPanel",
|
|
2722
2809
|
"aria-label": "React Query Devtools Panel",
|
|
2723
2810
|
id: "ReactQueryDevtoolsPanel"
|
|
2724
|
-
}, panelProps
|
|
2811
|
+
}, panelProps, {
|
|
2812
|
+
style: {
|
|
2813
|
+
height: defaultPanelSize,
|
|
2814
|
+
position: 'relative',
|
|
2815
|
+
...panelProps.style
|
|
2816
|
+
}
|
|
2817
|
+
}), /*#__PURE__*/React__namespace.createElement("style", {
|
|
2725
2818
|
nonce: styleNonce,
|
|
2726
2819
|
dangerouslySetInnerHTML: {
|
|
2727
2820
|
__html: "\n .ReactQueryDevtoolsPanel * {\n scrollbar-color: " + defaultTheme.backgroundAlt + " " + defaultTheme.gray + ";\n }\n\n .ReactQueryDevtoolsPanel *::-webkit-scrollbar, .ReactQueryDevtoolsPanel scrollbar {\n width: 1em;\n height: 1em;\n }\n\n .ReactQueryDevtoolsPanel *::-webkit-scrollbar-track, .ReactQueryDevtoolsPanel scrollbar-track {\n background: " + defaultTheme.backgroundAlt + ";\n }\n\n .ReactQueryDevtoolsPanel *::-webkit-scrollbar-thumb, .ReactQueryDevtoolsPanel scrollbar-thumb {\n background: " + defaultTheme.gray + ";\n border-radius: .5em;\n border: 3px solid " + defaultTheme.backgroundAlt + ";\n }\n "
|
|
2728
2821
|
}
|
|
2729
2822
|
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
2730
|
-
style:
|
|
2731
|
-
|
|
2732
|
-
left: 0,
|
|
2733
|
-
top: 0,
|
|
2734
|
-
width: '100%',
|
|
2735
|
-
height: '4px',
|
|
2736
|
-
marginBottom: '-4px',
|
|
2737
|
-
cursor: 'row-resize',
|
|
2738
|
-
zIndex: 100000
|
|
2739
|
-
},
|
|
2740
|
-
onMouseDown: handleDragStart
|
|
2823
|
+
style: getResizeHandleStyle(position),
|
|
2824
|
+
onMouseDown: onDragStart
|
|
2741
2825
|
}), isOpen && /*#__PURE__*/React__namespace.createElement("div", {
|
|
2742
2826
|
style: {
|
|
2743
2827
|
flex: '1 1 500px',
|
|
@@ -2780,9 +2864,31 @@
|
|
|
2780
2864
|
display: 'flex',
|
|
2781
2865
|
flexDirection: 'column'
|
|
2782
2866
|
}
|
|
2867
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
2868
|
+
style: {
|
|
2869
|
+
display: 'flex',
|
|
2870
|
+
justifyContent: 'space-between',
|
|
2871
|
+
alignItems: 'center',
|
|
2872
|
+
marginBottom: '.5em'
|
|
2873
|
+
}
|
|
2783
2874
|
}, /*#__PURE__*/React__namespace.createElement(QueryStatusCount, {
|
|
2784
2875
|
queryCache: queryCache
|
|
2785
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
2876
|
+
}), position && onPositionChange ? /*#__PURE__*/React__namespace.createElement(Select, {
|
|
2877
|
+
"aria-label": "Panel position",
|
|
2878
|
+
value: position,
|
|
2879
|
+
style: {
|
|
2880
|
+
marginInlineStart: '.5em'
|
|
2881
|
+
},
|
|
2882
|
+
onChange: e => onPositionChange(e.target.value)
|
|
2883
|
+
}, /*#__PURE__*/React__namespace.createElement("option", {
|
|
2884
|
+
value: "left"
|
|
2885
|
+
}, "Left"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
2886
|
+
value: "right"
|
|
2887
|
+
}, "Right"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
2888
|
+
value: "top"
|
|
2889
|
+
}, "Top"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
2890
|
+
value: "bottom"
|
|
2891
|
+
}, "Bottom")) : null), /*#__PURE__*/React__namespace.createElement("div", {
|
|
2786
2892
|
style: {
|
|
2787
2893
|
display: 'flex',
|
|
2788
2894
|
alignItems: 'center'
|
|
@@ -2898,7 +3004,25 @@
|
|
|
2898
3004
|
activeQueryHash: activeQueryHash,
|
|
2899
3005
|
queryCache: queryCache,
|
|
2900
3006
|
queryClient: queryClient
|
|
2901
|
-
}) : null
|
|
3007
|
+
}) : null, showCloseButton ? /*#__PURE__*/React__namespace.createElement(Button, _extends({
|
|
3008
|
+
type: "button",
|
|
3009
|
+
"aria-controls": "ReactQueryDevtoolsPanel",
|
|
3010
|
+
"aria-haspopup": "true",
|
|
3011
|
+
"aria-expanded": "true"
|
|
3012
|
+
}, otherCloseButtonProps, {
|
|
3013
|
+
style: {
|
|
3014
|
+
position: 'absolute',
|
|
3015
|
+
zIndex: 99999,
|
|
3016
|
+
margin: '.5em',
|
|
3017
|
+
bottom: 0,
|
|
3018
|
+
left: 0,
|
|
3019
|
+
...otherCloseButtonProps.style
|
|
3020
|
+
},
|
|
3021
|
+
onClick: e => {
|
|
3022
|
+
setIsOpen(false);
|
|
3023
|
+
onCloseClick == null ? void 0 : onCloseClick(e);
|
|
3024
|
+
}
|
|
3025
|
+
}), "Close") : null));
|
|
2902
3026
|
});
|
|
2903
3027
|
|
|
2904
3028
|
const ActiveQuery = ({
|
|
@@ -3073,11 +3197,7 @@
|
|
|
3073
3197
|
const hasPaused = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().filter(q => getQueryStatusLabel(q) === 'paused').length);
|
|
3074
3198
|
const hasStale = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().filter(q => getQueryStatusLabel(q) === 'stale').length);
|
|
3075
3199
|
const hasInactive = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().filter(q => getQueryStatusLabel(q) === 'inactive').length);
|
|
3076
|
-
return /*#__PURE__*/React__namespace.createElement(QueryKeys, {
|
|
3077
|
-
style: {
|
|
3078
|
-
marginBottom: '.5em'
|
|
3079
|
-
}
|
|
3080
|
-
}, /*#__PURE__*/React__namespace.createElement(QueryKey, {
|
|
3200
|
+
return /*#__PURE__*/React__namespace.createElement(QueryKeys, null, /*#__PURE__*/React__namespace.createElement(QueryKey, {
|
|
3081
3201
|
style: {
|
|
3082
3202
|
background: defaultTheme.success,
|
|
3083
3203
|
opacity: hasFresh ? 1 : 0.3
|