@tanstack/react-query-devtools 5.0.0-alpha.25 → 5.0.0-alpha.27
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__/devtools.test.d.ts +0 -1
- package/build/lib/__tests__/devtools.test.d.ts.map +1 -0
- package/build/lib/__tests__/utils.d.ts.map +1 -0
- package/build/lib/devtools.d.ts +8 -30
- package/build/lib/devtools.d.ts.map +1 -0
- package/build/lib/devtools.esm.js +47 -226
- package/build/lib/devtools.esm.js.map +1 -1
- package/build/lib/devtools.js +45 -244
- package/build/lib/devtools.js.map +1 -1
- package/build/lib/devtools.mjs +47 -225
- package/build/lib/devtools.mjs.map +1 -1
- package/build/lib/index.d.ts +0 -1
- package/build/lib/index.d.ts.map +1 -0
- package/build/lib/index.esm.js +8 -5
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +7 -5
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +8 -5
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/index.prod.d.ts +0 -1
- package/build/lib/index.prod.esm.js +7901 -1501
- package/build/lib/index.prod.esm.js.map +1 -1
- package/build/lib/index.prod.js +7909 -1528
- package/build/lib/index.prod.js.map +1 -1
- package/build/lib/index.prod.mjs +7922 -1489
- package/build/lib/index.prod.mjs.map +1 -1
- package/build/umd/index.development.js +7146 -2375
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +4 -5
- package/src/__tests__/devtools.test.tsx +1 -1135
- package/src/devtools.tsx +52 -306
- package/src/index.ts +6 -6
- package/build/lib/CachePanel/ActiveQuery.d.ts +0 -19
- package/build/lib/CachePanel/ActiveQuery.esm.js +0 -277
- package/build/lib/CachePanel/ActiveQuery.esm.js.map +0 -1
- package/build/lib/CachePanel/ActiveQuery.js +0 -281
- package/build/lib/CachePanel/ActiveQuery.js.map +0 -1
- package/build/lib/CachePanel/ActiveQuery.mjs +0 -261
- package/build/lib/CachePanel/ActiveQuery.mjs.map +0 -1
- package/build/lib/CachePanel/CachePanel.d.ts +0 -58
- package/build/lib/CachePanel/CachePanel.esm.js +0 -310
- package/build/lib/CachePanel/CachePanel.esm.js.map +0 -1
- package/build/lib/CachePanel/CachePanel.js +0 -315
- package/build/lib/CachePanel/CachePanel.js.map +0 -1
- package/build/lib/CachePanel/CachePanel.mjs +0 -310
- package/build/lib/CachePanel/CachePanel.mjs.map +0 -1
- package/build/lib/CachePanel/Header/QueryStatusCount.d.ts +0 -8
- package/build/lib/CachePanel/Header/QueryStatusCount.esm.js +0 -49
- package/build/lib/CachePanel/Header/QueryStatusCount.esm.js.map +0 -1
- package/build/lib/CachePanel/Header/QueryStatusCount.js +0 -53
- package/build/lib/CachePanel/Header/QueryStatusCount.js.map +0 -1
- package/build/lib/CachePanel/Header/QueryStatusCount.mjs +0 -49
- package/build/lib/CachePanel/Header/QueryStatusCount.mjs.map +0 -1
- package/build/lib/CachePanel/QueryRow.d.ts +0 -14
- package/build/lib/CachePanel/QueryRow.esm.js +0 -98
- package/build/lib/CachePanel/QueryRow.esm.js.map +0 -1
- package/build/lib/CachePanel/QueryRow.js +0 -102
- package/build/lib/CachePanel/QueryRow.js.map +0 -1
- package/build/lib/CachePanel/QueryRow.mjs +0 -82
- package/build/lib/CachePanel/QueryRow.mjs.map +0 -1
- package/build/lib/Explorer.d.ts +0 -51
- package/build/lib/Explorer.esm.js +0 -254
- package/build/lib/Explorer.esm.js.map +0 -1
- package/build/lib/Explorer.js +0 -288
- package/build/lib/Explorer.js.map +0 -1
- package/build/lib/Explorer.mjs +0 -254
- package/build/lib/Explorer.mjs.map +0 -1
- package/build/lib/Logo.d.ts +0 -2
- package/build/lib/Logo.esm.js +0 -32
- package/build/lib/Logo.esm.js.map +0 -1
- package/build/lib/Logo.js +0 -55
- package/build/lib/Logo.js.map +0 -1
- package/build/lib/Logo.mjs +0 -32
- package/build/lib/Logo.mjs.map +0 -1
- package/build/lib/__tests__/Explorer.test.d.ts +0 -2
- package/build/lib/_virtual/_rollupPluginBabelHelpers.esm.js +0 -17
- package/build/lib/_virtual/_rollupPluginBabelHelpers.esm.js.map +0 -1
- package/build/lib/_virtual/_rollupPluginBabelHelpers.js +0 -19
- package/build/lib/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
- package/build/lib/_virtual/_rollupPluginBabelHelpers.mjs +0 -17
- package/build/lib/_virtual/_rollupPluginBabelHelpers.mjs.map +0 -1
- package/build/lib/noop.d.ts +0 -3
- package/build/lib/screenreader.d.ts +0 -4
- package/build/lib/screenreader.esm.js +0 -17
- package/build/lib/screenreader.esm.js.map +0 -1
- package/build/lib/screenreader.js +0 -40
- package/build/lib/screenreader.js.map +0 -1
- package/build/lib/screenreader.mjs +0 -17
- package/build/lib/screenreader.mjs.map +0 -1
- package/build/lib/styledComponents.d.ts +0 -9
- package/build/lib/styledComponents.esm.js +0 -103
- package/build/lib/styledComponents.esm.js.map +0 -1
- package/build/lib/styledComponents.js +0 -112
- package/build/lib/styledComponents.js.map +0 -1
- package/build/lib/styledComponents.mjs +0 -103
- package/build/lib/styledComponents.mjs.map +0 -1
- package/build/lib/theme.d.ts +0 -37
- package/build/lib/theme.esm.js +0 -33
- package/build/lib/theme.esm.js.map +0 -1
- package/build/lib/theme.js +0 -56
- package/build/lib/theme.js.map +0 -1
- package/build/lib/theme.mjs +0 -33
- package/build/lib/theme.mjs.map +0 -1
- package/build/lib/types.d.ts +0 -12
- package/build/lib/useLocalStorage.d.ts +0 -2
- package/build/lib/useLocalStorage.esm.js +0 -40
- package/build/lib/useLocalStorage.esm.js.map +0 -1
- package/build/lib/useLocalStorage.js +0 -63
- package/build/lib/useLocalStorage.js.map +0 -1
- package/build/lib/useLocalStorage.mjs +0 -40
- package/build/lib/useLocalStorage.mjs.map +0 -1
- package/build/lib/useMediaQuery.d.ts +0 -2
- package/build/lib/useMediaQuery.esm.js +0 -36
- package/build/lib/useMediaQuery.esm.js.map +0 -1
- package/build/lib/useMediaQuery.js +0 -59
- package/build/lib/useMediaQuery.js.map +0 -1
- package/build/lib/useMediaQuery.mjs +0 -36
- package/build/lib/useMediaQuery.mjs.map +0 -1
- package/build/lib/useSubscribeToQueryCache.d.ts +0 -4
- package/build/lib/useSubscribeToQueryCache.esm.js +0 -15
- package/build/lib/useSubscribeToQueryCache.esm.js.map +0 -1
- package/build/lib/useSubscribeToQueryCache.js +0 -19
- package/build/lib/useSubscribeToQueryCache.js.map +0 -1
- package/build/lib/useSubscribeToQueryCache.mjs +0 -15
- package/build/lib/useSubscribeToQueryCache.mjs.map +0 -1
- package/build/lib/utils.d.ts +0 -80
- package/build/lib/utils.esm.js +0 -184
- package/build/lib/utils.esm.js.map +0 -1
- package/build/lib/utils.js +0 -218
- package/build/lib/utils.js.map +0 -1
- package/build/lib/utils.mjs +0 -184
- package/build/lib/utils.mjs.map +0 -1
- package/src/CachePanel/ActiveQuery.tsx +0 -388
- package/src/CachePanel/CachePanel.tsx +0 -439
- package/src/CachePanel/Header/QueryStatusCount.tsx +0 -93
- package/src/CachePanel/QueryRow.tsx +0 -125
- package/src/Explorer.tsx +0 -385
- package/src/Logo.tsx +0 -32
- package/src/__tests__/Explorer.test.tsx +0 -150
- package/src/noop.ts +0 -7
- package/src/screenreader.tsx +0 -16
- package/src/styledComponents.ts +0 -126
- package/src/theme.tsx +0 -33
- package/src/types.ts +0 -12
- package/src/useLocalStorage.ts +0 -52
- package/src/useMediaQuery.ts +0 -34
- package/src/useSubscribeToQueryCache.ts +0 -26
- package/src/utils.ts +0 -319
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import useSubscribeToQueryCache from '../useSubscribeToQueryCache.mjs';
|
|
3
|
-
import { ActiveQueryPanel, Code, Button, Select } from '../styledComponents.mjs';
|
|
4
|
-
import { displayValue, getQueryStatusColor, getQueryStatusLabel } from '../utils.mjs';
|
|
5
|
-
import Explorer from '../Explorer.mjs';
|
|
6
|
-
import { defaultTheme } from '../theme.mjs';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
9
|
-
function noop() {}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Panel for the query currently being inspected
|
|
13
|
-
*
|
|
14
|
-
* It displays query details (key, observers...), query actions,
|
|
15
|
-
* the data explorer and the query explorer
|
|
16
|
-
*/
|
|
17
|
-
const ActiveQuery = ({
|
|
18
|
-
queryCache,
|
|
19
|
-
activeQueryHash,
|
|
20
|
-
queryClient,
|
|
21
|
-
errorTypes
|
|
22
|
-
}) => {
|
|
23
|
-
const activeQuery = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().find(query => query.queryHash === activeQueryHash));
|
|
24
|
-
const activeQueryState = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().find(query => query.queryHash === activeQueryHash)?.state);
|
|
25
|
-
const isStale = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().find(query => query.queryHash === activeQueryHash)?.isStale()) ?? false;
|
|
26
|
-
const observerCount = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().find(query => query.queryHash === activeQueryHash)?.getObserversCount()) ?? 0;
|
|
27
|
-
const handleRefetch = () => {
|
|
28
|
-
const promise = activeQuery?.fetch();
|
|
29
|
-
promise?.catch(noop);
|
|
30
|
-
};
|
|
31
|
-
const currentErrorTypeName = React__default.useMemo(() => {
|
|
32
|
-
if (activeQuery && activeQueryState?.error) {
|
|
33
|
-
const errorType = errorTypes.find(type => type.initializer(activeQuery).toString() === activeQueryState.error?.toString());
|
|
34
|
-
return errorType?.name;
|
|
35
|
-
}
|
|
36
|
-
return undefined;
|
|
37
|
-
}, [activeQuery, activeQueryState?.error, errorTypes]);
|
|
38
|
-
if (!activeQuery || !activeQueryState) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
const triggerError = errorType => {
|
|
42
|
-
const error = errorType?.initializer(activeQuery) ?? new Error('Unknown error from devtools');
|
|
43
|
-
const __previousQueryOptions = activeQuery.options;
|
|
44
|
-
activeQuery.setState({
|
|
45
|
-
status: 'error',
|
|
46
|
-
error,
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
48
|
-
fetchMeta: {
|
|
49
|
-
...activeQuery.state.fetchMeta,
|
|
50
|
-
__previousQueryOptions
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
const restoreQueryAfterLoadingOrError = () => {
|
|
55
|
-
activeQuery.fetch(activeQuery.state.fetchMeta?.__previousQueryOptions, {
|
|
56
|
-
// Make sure this fetch will cancel the previous one
|
|
57
|
-
cancelRefetch: true
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
return /*#__PURE__*/React__default.createElement(ActiveQueryPanel, null, /*#__PURE__*/React__default.createElement("div", {
|
|
61
|
-
style: {
|
|
62
|
-
padding: '.5em',
|
|
63
|
-
background: defaultTheme.backgroundAlt,
|
|
64
|
-
position: 'sticky',
|
|
65
|
-
top: 0,
|
|
66
|
-
zIndex: 1
|
|
67
|
-
}
|
|
68
|
-
}, "Query Details"), /*#__PURE__*/React__default.createElement("div", {
|
|
69
|
-
style: {
|
|
70
|
-
padding: '.5em'
|
|
71
|
-
}
|
|
72
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
73
|
-
style: {
|
|
74
|
-
marginBottom: '.5em',
|
|
75
|
-
display: 'flex',
|
|
76
|
-
alignItems: 'flex-start',
|
|
77
|
-
justifyContent: 'space-between'
|
|
78
|
-
}
|
|
79
|
-
}, /*#__PURE__*/React__default.createElement(Code, {
|
|
80
|
-
style: {
|
|
81
|
-
lineHeight: '1.8em'
|
|
82
|
-
}
|
|
83
|
-
}, /*#__PURE__*/React__default.createElement("pre", {
|
|
84
|
-
style: {
|
|
85
|
-
margin: 0,
|
|
86
|
-
padding: 0,
|
|
87
|
-
overflow: 'auto'
|
|
88
|
-
}
|
|
89
|
-
}, displayValue(activeQuery.queryKey, true))), /*#__PURE__*/React__default.createElement("span", {
|
|
90
|
-
style: {
|
|
91
|
-
padding: '0.3em .6em',
|
|
92
|
-
borderRadius: '0.4em',
|
|
93
|
-
fontWeight: 'bold',
|
|
94
|
-
textShadow: '0 2px 10px black',
|
|
95
|
-
background: getQueryStatusColor({
|
|
96
|
-
queryState: activeQueryState,
|
|
97
|
-
isStale: isStale,
|
|
98
|
-
observerCount: observerCount,
|
|
99
|
-
theme: defaultTheme
|
|
100
|
-
}),
|
|
101
|
-
flexShrink: 0
|
|
102
|
-
}
|
|
103
|
-
}, getQueryStatusLabel(activeQuery))), /*#__PURE__*/React__default.createElement("div", {
|
|
104
|
-
style: {
|
|
105
|
-
marginBottom: '.5em',
|
|
106
|
-
display: 'flex',
|
|
107
|
-
alignItems: 'center',
|
|
108
|
-
justifyContent: 'space-between'
|
|
109
|
-
}
|
|
110
|
-
}, "Observers: ", /*#__PURE__*/React__default.createElement(Code, null, observerCount)), /*#__PURE__*/React__default.createElement("div", {
|
|
111
|
-
style: {
|
|
112
|
-
display: 'flex',
|
|
113
|
-
alignItems: 'center',
|
|
114
|
-
justifyContent: 'space-between'
|
|
115
|
-
}
|
|
116
|
-
}, "Last Updated:", ' ', /*#__PURE__*/React__default.createElement(Code, null, new Date(activeQueryState.dataUpdatedAt).toLocaleTimeString()))), /*#__PURE__*/React__default.createElement("div", {
|
|
117
|
-
style: {
|
|
118
|
-
background: defaultTheme.backgroundAlt,
|
|
119
|
-
padding: '.5em',
|
|
120
|
-
position: 'sticky',
|
|
121
|
-
top: 0,
|
|
122
|
-
zIndex: 1
|
|
123
|
-
}
|
|
124
|
-
}, "Actions"), /*#__PURE__*/React__default.createElement("div", {
|
|
125
|
-
style: {
|
|
126
|
-
padding: '0.5em',
|
|
127
|
-
display: 'flex',
|
|
128
|
-
flexWrap: 'wrap',
|
|
129
|
-
gap: '0.5em',
|
|
130
|
-
alignItems: 'flex-end'
|
|
131
|
-
}
|
|
132
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
133
|
-
type: "button",
|
|
134
|
-
onClick: handleRefetch,
|
|
135
|
-
disabled: activeQueryState.fetchStatus === 'fetching',
|
|
136
|
-
style: {
|
|
137
|
-
background: defaultTheme.active
|
|
138
|
-
}
|
|
139
|
-
}, "Refetch"), ' ', /*#__PURE__*/React__default.createElement(Button, {
|
|
140
|
-
type: "button",
|
|
141
|
-
onClick: () => queryClient.invalidateQueries(activeQuery),
|
|
142
|
-
style: {
|
|
143
|
-
background: defaultTheme.warning,
|
|
144
|
-
color: defaultTheme.inputTextColor
|
|
145
|
-
}
|
|
146
|
-
}, "Invalidate"), ' ', /*#__PURE__*/React__default.createElement(Button, {
|
|
147
|
-
type: "button",
|
|
148
|
-
onClick: () => queryClient.resetQueries(activeQuery),
|
|
149
|
-
style: {
|
|
150
|
-
background: defaultTheme.gray
|
|
151
|
-
}
|
|
152
|
-
}, "Reset"), ' ', /*#__PURE__*/React__default.createElement(Button, {
|
|
153
|
-
type: "button",
|
|
154
|
-
onClick: () => queryClient.removeQueries(activeQuery),
|
|
155
|
-
style: {
|
|
156
|
-
background: defaultTheme.danger
|
|
157
|
-
}
|
|
158
|
-
}, "Remove"), ' ', /*#__PURE__*/React__default.createElement(Button, {
|
|
159
|
-
type: "button",
|
|
160
|
-
onClick: () => {
|
|
161
|
-
// Return early if the query is already restoring
|
|
162
|
-
if (activeQuery.state.fetchStatus === 'fetching' && typeof activeQuery.state.fetchMeta?.__previousQueryOptions === 'undefined') {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
if (activeQuery.state.data === undefined) {
|
|
166
|
-
restoreQueryAfterLoadingOrError();
|
|
167
|
-
} else {
|
|
168
|
-
const __previousQueryOptions = activeQuery.options;
|
|
169
|
-
// Trigger a fetch in order to trigger suspense as well.
|
|
170
|
-
activeQuery.fetch({
|
|
171
|
-
...__previousQueryOptions,
|
|
172
|
-
queryFn: () => {
|
|
173
|
-
return new Promise(() => {
|
|
174
|
-
// Never resolve
|
|
175
|
-
});
|
|
176
|
-
},
|
|
177
|
-
gcTime: -1
|
|
178
|
-
});
|
|
179
|
-
activeQuery.setState({
|
|
180
|
-
data: undefined,
|
|
181
|
-
status: 'pending',
|
|
182
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
183
|
-
fetchMeta: {
|
|
184
|
-
...activeQuery.state.fetchMeta,
|
|
185
|
-
__previousQueryOptions
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
style: {
|
|
191
|
-
background: defaultTheme.paused
|
|
192
|
-
}
|
|
193
|
-
}, activeQuery.state.status === 'pending' ? 'Restore' : 'Trigger', ' ', "loading"), ' ', errorTypes.length === 0 || activeQuery.state.status === 'error' ? /*#__PURE__*/React__default.createElement(Button, {
|
|
194
|
-
type: "button",
|
|
195
|
-
onClick: () => {
|
|
196
|
-
if (!activeQuery.state.error) {
|
|
197
|
-
triggerError();
|
|
198
|
-
} else {
|
|
199
|
-
queryClient.resetQueries(activeQuery);
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
style: {
|
|
203
|
-
background: defaultTheme.danger
|
|
204
|
-
}
|
|
205
|
-
}, activeQuery.state.status === 'error' ? 'Restore' : 'Trigger', " error") : /*#__PURE__*/React__default.createElement("label", null, "Trigger error:", /*#__PURE__*/React__default.createElement(Select, {
|
|
206
|
-
value: currentErrorTypeName ?? '',
|
|
207
|
-
style: {
|
|
208
|
-
marginInlineStart: '.5em'
|
|
209
|
-
},
|
|
210
|
-
onChange: e => {
|
|
211
|
-
const errorType = errorTypes.find(t => t.name === e.target.value);
|
|
212
|
-
triggerError(errorType);
|
|
213
|
-
}
|
|
214
|
-
}, /*#__PURE__*/React__default.createElement("option", {
|
|
215
|
-
key: "",
|
|
216
|
-
value: ""
|
|
217
|
-
}), errorTypes.map(errorType => /*#__PURE__*/React__default.createElement("option", {
|
|
218
|
-
key: errorType.name,
|
|
219
|
-
value: errorType.name
|
|
220
|
-
}, errorType.name))))), /*#__PURE__*/React__default.createElement("div", {
|
|
221
|
-
style: {
|
|
222
|
-
background: defaultTheme.backgroundAlt,
|
|
223
|
-
padding: '.5em',
|
|
224
|
-
position: 'sticky',
|
|
225
|
-
top: 0,
|
|
226
|
-
zIndex: 1
|
|
227
|
-
}
|
|
228
|
-
}, "Data Explorer"), /*#__PURE__*/React__default.createElement("div", {
|
|
229
|
-
style: {
|
|
230
|
-
padding: '.5em'
|
|
231
|
-
}
|
|
232
|
-
}, /*#__PURE__*/React__default.createElement(Explorer, {
|
|
233
|
-
label: "Data",
|
|
234
|
-
value: activeQueryState.data,
|
|
235
|
-
defaultExpanded: {},
|
|
236
|
-
copyable: true
|
|
237
|
-
})), /*#__PURE__*/React__default.createElement("div", {
|
|
238
|
-
style: {
|
|
239
|
-
background: defaultTheme.backgroundAlt,
|
|
240
|
-
padding: '.5em',
|
|
241
|
-
position: 'sticky',
|
|
242
|
-
top: 0,
|
|
243
|
-
zIndex: 1
|
|
244
|
-
}
|
|
245
|
-
}, "Query Explorer"), /*#__PURE__*/React__default.createElement("div", {
|
|
246
|
-
style: {
|
|
247
|
-
padding: '.5em'
|
|
248
|
-
}
|
|
249
|
-
}, /*#__PURE__*/React__default.createElement(Explorer, {
|
|
250
|
-
label: "Query",
|
|
251
|
-
value: activeQuery,
|
|
252
|
-
defaultExpanded: {
|
|
253
|
-
queryKey: true
|
|
254
|
-
}
|
|
255
|
-
})));
|
|
256
|
-
};
|
|
257
|
-
ActiveQuery.displayName = 'ActiveQuery';
|
|
258
|
-
var ActiveQuery$1 = ActiveQuery;
|
|
259
|
-
|
|
260
|
-
export { ActiveQuery$1 as default };
|
|
261
|
-
//# sourceMappingURL=ActiveQuery.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveQuery.mjs","sources":["../../../src/CachePanel/ActiveQuery.tsx"],"sourcesContent":["import React from 'react'\nimport type { QueryCache, QueryClient } from '@tanstack/react-query'\n\nimport useSubscribeToQueryCache from '../useSubscribeToQueryCache'\nimport { Button, Code, Select, ActiveQueryPanel } from '../styledComponents'\n\nimport {\n getQueryStatusLabel,\n getQueryStatusColor,\n displayValue,\n} from '../utils'\nimport Explorer from '../Explorer'\nimport type { DevToolsErrorType } from '../types'\nimport { defaultTheme as theme } from '../theme'\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() {}\n\n/**\n * Panel for the query currently being inspected\n *\n * It displays query details (key, observers...), query actions,\n * the data explorer and the query explorer\n */\nconst ActiveQuery = ({\n queryCache,\n activeQueryHash,\n queryClient,\n errorTypes,\n}: {\n queryCache: QueryCache\n activeQueryHash: string\n queryClient: QueryClient\n errorTypes: DevToolsErrorType[]\n}) => {\n const activeQuery = useSubscribeToQueryCache(queryCache, () =>\n queryCache.getAll().find((query) => query.queryHash === activeQueryHash),\n )\n\n const activeQueryState = useSubscribeToQueryCache(\n queryCache,\n () =>\n queryCache.getAll().find((query) => query.queryHash === activeQueryHash)\n ?.state,\n )\n\n const isStale =\n useSubscribeToQueryCache(queryCache, () =>\n queryCache\n .getAll()\n .find((query) => query.queryHash === activeQueryHash)\n ?.isStale(),\n ) ?? false\n\n const observerCount =\n useSubscribeToQueryCache(queryCache, () =>\n queryCache\n .getAll()\n .find((query) => query.queryHash === activeQueryHash)\n ?.getObserversCount(),\n ) ?? 0\n\n const handleRefetch = () => {\n const promise = activeQuery?.fetch()\n promise?.catch(noop)\n }\n\n const currentErrorTypeName = React.useMemo(() => {\n if (activeQuery && activeQueryState?.error) {\n const errorType = errorTypes.find(\n (type) =>\n type.initializer(activeQuery).toString() ===\n activeQueryState.error?.toString(),\n )\n return errorType?.name\n }\n return undefined\n }, [activeQuery, activeQueryState?.error, errorTypes])\n\n if (!activeQuery || !activeQueryState) {\n return null\n }\n\n const triggerError = (errorType?: DevToolsErrorType) => {\n const error =\n errorType?.initializer(activeQuery) ??\n new Error('Unknown error from devtools')\n\n const __previousQueryOptions = activeQuery.options\n\n activeQuery.setState({\n status: 'error',\n error,\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n fetchMeta: {\n ...activeQuery.state.fetchMeta,\n __previousQueryOptions,\n } as any,\n })\n }\n\n const restoreQueryAfterLoadingOrError = () => {\n activeQuery.fetch(\n (activeQuery.state.fetchMeta as any)?.__previousQueryOptions,\n {\n // Make sure this fetch will cancel the previous one\n cancelRefetch: true,\n },\n )\n }\n\n return (\n <ActiveQueryPanel>\n <div\n style={{\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n zIndex: 1,\n }}\n >\n Query Details\n </div>\n <div\n style={{\n padding: '.5em',\n }}\n >\n <div\n style={{\n marginBottom: '.5em',\n display: 'flex',\n alignItems: 'flex-start',\n justifyContent: 'space-between',\n }}\n >\n <Code\n style={{\n lineHeight: '1.8em',\n }}\n >\n <pre\n style={{\n margin: 0,\n padding: 0,\n overflow: 'auto',\n }}\n >\n {displayValue(activeQuery.queryKey, true)}\n </pre>\n </Code>\n <span\n style={{\n padding: '0.3em .6em',\n borderRadius: '0.4em',\n fontWeight: 'bold',\n textShadow: '0 2px 10px black',\n background: getQueryStatusColor({\n queryState: activeQueryState,\n isStale: isStale,\n observerCount: observerCount,\n theme,\n }),\n flexShrink: 0,\n }}\n >\n {getQueryStatusLabel(activeQuery)}\n </span>\n </div>\n <div\n style={{\n marginBottom: '.5em',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }}\n >\n Observers: <Code>{observerCount}</Code>\n </div>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }}\n >\n Last Updated:{' '}\n <Code>\n {new Date(activeQueryState.dataUpdatedAt).toLocaleTimeString()}\n </Code>\n </div>\n </div>\n <div\n style={{\n background: theme.backgroundAlt,\n padding: '.5em',\n position: 'sticky',\n top: 0,\n zIndex: 1,\n }}\n >\n Actions\n </div>\n <div\n style={{\n padding: '0.5em',\n display: 'flex',\n flexWrap: 'wrap',\n gap: '0.5em',\n alignItems: 'flex-end',\n }}\n >\n <Button\n type=\"button\"\n onClick={handleRefetch}\n disabled={activeQueryState.fetchStatus === 'fetching'}\n style={{\n background: theme.active,\n }}\n >\n Refetch\n </Button>{' '}\n <Button\n type=\"button\"\n onClick={() => queryClient.invalidateQueries(activeQuery)}\n style={{\n background: theme.warning,\n color: theme.inputTextColor,\n }}\n >\n Invalidate\n </Button>{' '}\n <Button\n type=\"button\"\n onClick={() => queryClient.resetQueries(activeQuery)}\n style={{\n background: theme.gray,\n }}\n >\n Reset\n </Button>{' '}\n <Button\n type=\"button\"\n onClick={() => queryClient.removeQueries(activeQuery)}\n style={{\n background: theme.danger,\n }}\n >\n Remove\n </Button>{' '}\n <Button\n type=\"button\"\n onClick={() => {\n // Return early if the query is already restoring\n if (\n activeQuery.state.fetchStatus === 'fetching' &&\n typeof (activeQuery.state.fetchMeta as any)\n ?.__previousQueryOptions === 'undefined'\n ) {\n return\n }\n if (activeQuery.state.data === undefined) {\n restoreQueryAfterLoadingOrError()\n } else {\n const __previousQueryOptions = activeQuery.options\n // Trigger a fetch in order to trigger suspense as well.\n activeQuery.fetch({\n ...__previousQueryOptions,\n queryFn: () => {\n return new Promise(() => {\n // Never resolve\n })\n },\n gcTime: -1,\n })\n activeQuery.setState({\n data: undefined,\n status: 'pending',\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n fetchMeta: {\n ...activeQuery.state.fetchMeta,\n __previousQueryOptions,\n } as any,\n })\n }\n }}\n style={{\n background: theme.paused,\n }}\n >\n {activeQuery.state.status === 'pending' ? 'Restore' : 'Trigger'}{' '}\n loading\n </Button>{' '}\n {errorTypes.length === 0 || activeQuery.state.status === 'error' ? (\n <Button\n type=\"button\"\n onClick={() => {\n if (!activeQuery.state.error) {\n triggerError()\n } else {\n queryClient.resetQueries(activeQuery)\n }\n }}\n style={{\n background: theme.danger,\n }}\n >\n {activeQuery.state.status === 'error' ? 'Restore' : 'Trigger'} error\n </Button>\n ) : (\n <label>\n Trigger error:\n <Select\n value={currentErrorTypeName ?? ''}\n style={{ marginInlineStart: '.5em' }}\n onChange={(e) => {\n const errorType = errorTypes.find(\n (t) => t.name === e.target.value,\n )\n\n triggerError(errorType)\n }}\n >\n <option key=\"\" value=\"\" />\n {errorTypes.map((errorType) => (\n <option key={errorType.name} value={errorType.name}>\n {errorType.name}\n </option>\n ))}\n </Select>\n </label>\n )}\n </div>\n <div\n style={{\n background: theme.backgroundAlt,\n padding: '.5em',\n position: 'sticky',\n top: 0,\n zIndex: 1,\n }}\n >\n Data Explorer\n </div>\n <div\n style={{\n padding: '.5em',\n }}\n >\n <Explorer\n label=\"Data\"\n value={activeQueryState.data}\n defaultExpanded={{}}\n copyable\n />\n </div>\n <div\n style={{\n background: theme.backgroundAlt,\n padding: '.5em',\n position: 'sticky',\n top: 0,\n zIndex: 1,\n }}\n >\n Query Explorer\n </div>\n <div\n style={{\n padding: '.5em',\n }}\n >\n <Explorer\n label=\"Query\"\n value={activeQuery}\n defaultExpanded={{\n queryKey: true,\n }}\n />\n </div>\n </ActiveQueryPanel>\n )\n}\n\nActiveQuery.displayName = 'ActiveQuery'\n\nexport default ActiveQuery\n"],"names":["noop","ActiveQuery","queryCache","activeQueryHash","queryClient","errorTypes","activeQuery","useSubscribeToQueryCache","getAll","find","query","queryHash","activeQueryState","state","isStale","observerCount","getObserversCount","handleRefetch","promise","fetch","catch","currentErrorTypeName","React","useMemo","error","errorType","type","initializer","toString","name","undefined","triggerError","Error","__previousQueryOptions","options","setState","status","fetchMeta","restoreQueryAfterLoadingOrError","cancelRefetch","padding","background","theme","backgroundAlt","position","top","zIndex","marginBottom","display","alignItems","justifyContent","lineHeight","margin","overflow","displayValue","queryKey","borderRadius","fontWeight","textShadow","getQueryStatusColor","queryState","flexShrink","getQueryStatusLabel","Date","dataUpdatedAt","toLocaleTimeString","flexWrap","gap","fetchStatus","active","invalidateQueries","warning","color","inputTextColor","resetQueries","gray","removeQueries","danger","data","queryFn","Promise","gcTime","paused","length","marginInl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MAAM;AACfI,MAAAA,QAAQ,EAAE,QAAQ;AAClBC,MAAAA,GAAG,EAAE,CAAC;AACNC,MAAAA,MAAM,EAAE,CAAA;AACV,KAAA;GACD,EAAA,eAED,CAAM,eACNxB,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,KAAK,EAAE;AACLkB,MAAAA,OAAO,EAAE,MAAA;AACX,KAAA;AAAE,GAAA,eAEFlB,6BAAC,QAAQ,EAAA;AACP,IAAA,KAAK,EAAC,MAAM;IACZ,KAAK,EAAEV,gBAAgB,CAACkE,IAAK;IAC7B,eAAe,EAAE,EAAG;IACpB,QAAQ,EAAA,IAAA;AAAA,GAAA,CACR,CACE,eACNxD,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,KAAK,EAAE;MACLmB,UAAU,EAAEC,YAAK,CAACC,aAAa;AAC/BH,MAAAA,OAAO,EAAE,MAAM;AACfI,MAAAA,QAAQ,EAAE,QAAQ;AAClBC,MAAAA,GAAG,EAAE,CAAC;AACNC,MAAAA,MAAM,EAAE,CAAA;AACV,KAAA;GACD,EAAA,gBAED,CAAM,eACNxB,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,KAAK,EAAE;AACLkB,MAAAA,OAAO,EAAE,MAAA;AACX,KAAA;AAAE,GAAA,eAEFlB,6BAAC,QAAQ,EAAA;AACP,IAAA,KAAK,EAAC,OAAO;AACb,IAAA,KAAK,EAAEhB,WAAY;AACnB,IAAA,eAAe,EAAE;AACfiD,MAAAA,QAAQ,EAAE,IAAA;AACZ,KAAA;AAAE,GAAA,CACF,CACE,CACW,CAAA;AAEvB,CAAC,CAAA;AAEDtD,WAAW,CAACyF,WAAW,GAAG,aAAa,CAAA;AAEvC,oBAAezF,WAAW;;;;"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { QueryClient } from '@tanstack/react-query';
|
|
3
|
-
import type { Side } from '../utils';
|
|
4
|
-
import type { DevToolsErrorType } from '../types';
|
|
5
|
-
interface DevtoolsPanelOptions {
|
|
6
|
-
/**
|
|
7
|
-
* The standard React style object used to style a component with inline styles
|
|
8
|
-
*/
|
|
9
|
-
style?: React.CSSProperties;
|
|
10
|
-
/**
|
|
11
|
-
* The standard React className property used to style a component with classes
|
|
12
|
-
*/
|
|
13
|
-
className?: string;
|
|
14
|
-
/**
|
|
15
|
-
* A boolean variable indicating whether the panel is open or closed
|
|
16
|
-
*/
|
|
17
|
-
isOpen?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* nonce for style element for CSP
|
|
20
|
-
*/
|
|
21
|
-
styleNonce?: string;
|
|
22
|
-
/**
|
|
23
|
-
* A function that toggles the open and close state of the panel
|
|
24
|
-
*/
|
|
25
|
-
setIsOpen: (isOpen: boolean) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Handles the opening and closing the devtools panel
|
|
28
|
-
*/
|
|
29
|
-
onDragStart: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
30
|
-
/**
|
|
31
|
-
* The position of the React Query devtools panel.
|
|
32
|
-
* Defaults to 'bottom'.
|
|
33
|
-
*/
|
|
34
|
-
position?: Side;
|
|
35
|
-
/**
|
|
36
|
-
* Handles the panel position select change
|
|
37
|
-
*/
|
|
38
|
-
onPositionChange?: (side: Side) => void;
|
|
39
|
-
/**
|
|
40
|
-
* Show a close button inside the panel
|
|
41
|
-
*/
|
|
42
|
-
showCloseButton?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Use this to add props to the close button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.
|
|
45
|
-
*/
|
|
46
|
-
closeButtonProps?: React.ComponentPropsWithoutRef<'button'>;
|
|
47
|
-
/**
|
|
48
|
-
* Custom instance of QueryClient
|
|
49
|
-
*/
|
|
50
|
-
queryClient?: QueryClient;
|
|
51
|
-
/**
|
|
52
|
-
* Use this so you can define custom errors that can be shown in the devtools.
|
|
53
|
-
*/
|
|
54
|
-
errorTypes?: DevToolsErrorType[];
|
|
55
|
-
}
|
|
56
|
-
export declare const ReactQueryDevtoolsPanel: React.ForwardRefExoticComponent<DevtoolsPanelOptions & React.RefAttributes<HTMLDivElement>>;
|
|
57
|
-
export default ReactQueryDevtoolsPanel;
|
|
58
|
-
//# sourceMappingURL=CachePanel.d.ts.map
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
import { extends as _extends } from '../_virtual/_rollupPluginBabelHelpers.esm.js';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
import { useQueryClient, onlineManager } from '@tanstack/react-query';
|
|
4
|
-
import { rankItem } from '@tanstack/match-sorter-utils';
|
|
5
|
-
import { Panel, Select, Input, Button } from '../styledComponents.esm.js';
|
|
6
|
-
import useSubscribeToQueryCache from '../useSubscribeToQueryCache.esm.js';
|
|
7
|
-
import QueryStatusCount from './Header/QueryStatusCount.esm.js';
|
|
8
|
-
import QueryRow from './QueryRow.esm.js';
|
|
9
|
-
import ActiveQuery from './ActiveQuery.esm.js';
|
|
10
|
-
import { sortFns, defaultPanelSize, getResizeHandleStyle } from '../utils.esm.js';
|
|
11
|
-
import { ThemeProvider, defaultTheme } from '../theme.esm.js';
|
|
12
|
-
import useLocalStorage from '../useLocalStorage.esm.js';
|
|
13
|
-
import Logo from '../Logo.esm.js';
|
|
14
|
-
import ScreenReader from '../screenreader.esm.js';
|
|
15
|
-
|
|
16
|
-
const ReactQueryDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(function ReactQueryDevtoolsPanel(props, ref) {
|
|
17
|
-
const {
|
|
18
|
-
isOpen = true,
|
|
19
|
-
styleNonce,
|
|
20
|
-
setIsOpen,
|
|
21
|
-
queryClient,
|
|
22
|
-
onDragStart,
|
|
23
|
-
onPositionChange,
|
|
24
|
-
showCloseButton,
|
|
25
|
-
position,
|
|
26
|
-
closeButtonProps = {},
|
|
27
|
-
errorTypes = [],
|
|
28
|
-
...panelProps
|
|
29
|
-
} = props;
|
|
30
|
-
const {
|
|
31
|
-
onClick: onCloseClick,
|
|
32
|
-
...otherCloseButtonProps
|
|
33
|
-
} = closeButtonProps;
|
|
34
|
-
const client = useQueryClient(queryClient);
|
|
35
|
-
const queryCache = client.getQueryCache();
|
|
36
|
-
const [sort, setSort] = useLocalStorage('reactQueryDevtoolsSortFn', Object.keys(sortFns)[0]);
|
|
37
|
-
const [filter, setFilter] = useLocalStorage('reactQueryDevtoolsFilter', '');
|
|
38
|
-
const [baseSort, setBaseSort] = useLocalStorage('reactQueryDevtoolsBaseSort', 1);
|
|
39
|
-
const sortFn = React__default.useMemo(() => sortFns[sort], [sort]);
|
|
40
|
-
const queriesCount = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().length, !isOpen);
|
|
41
|
-
const [activeQueryHash, setActiveQueryHash] = useLocalStorage('reactQueryDevtoolsActiveQueryHash', '');
|
|
42
|
-
const queries = React__default.useMemo(() => {
|
|
43
|
-
const unsortedQueries = queryCache.getAll();
|
|
44
|
-
if (queriesCount === 0) {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
const filtered = filter ? unsortedQueries.filter(item => rankItem(item.queryHash, filter).passed) : [...unsortedQueries];
|
|
48
|
-
const sorted = sortFn ? filtered.sort((a, b) => sortFn(a, b) * baseSort) : filtered;
|
|
49
|
-
return sorted;
|
|
50
|
-
}, [baseSort, sortFn, filter, queriesCount, queryCache]);
|
|
51
|
-
const [isMockOffline, setMockOffline] = React__default.useState(false);
|
|
52
|
-
return /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
53
|
-
theme: defaultTheme
|
|
54
|
-
}, /*#__PURE__*/React__default.createElement(Panel, _extends({
|
|
55
|
-
ref: ref,
|
|
56
|
-
className: "ReactQueryDevtoolsPanel",
|
|
57
|
-
"aria-label": "React Query Devtools Panel",
|
|
58
|
-
id: "ReactQueryDevtoolsPanel"
|
|
59
|
-
}, panelProps, {
|
|
60
|
-
style: {
|
|
61
|
-
height: defaultPanelSize,
|
|
62
|
-
position: 'relative',
|
|
63
|
-
...panelProps.style
|
|
64
|
-
}
|
|
65
|
-
}), /*#__PURE__*/React__default.createElement("style", {
|
|
66
|
-
nonce: styleNonce,
|
|
67
|
-
dangerouslySetInnerHTML: {
|
|
68
|
-
__html: `
|
|
69
|
-
.ReactQueryDevtoolsPanel * {
|
|
70
|
-
scrollbar-color: ${defaultTheme.backgroundAlt} ${defaultTheme.gray};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.ReactQueryDevtoolsPanel *::-webkit-scrollbar, .ReactQueryDevtoolsPanel scrollbar {
|
|
74
|
-
width: 1em;
|
|
75
|
-
height: 1em;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.ReactQueryDevtoolsPanel *::-webkit-scrollbar-track, .ReactQueryDevtoolsPanel scrollbar-track {
|
|
79
|
-
background: ${defaultTheme.backgroundAlt};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.ReactQueryDevtoolsPanel *::-webkit-scrollbar-thumb, .ReactQueryDevtoolsPanel scrollbar-thumb {
|
|
83
|
-
background: ${defaultTheme.gray};
|
|
84
|
-
border-radius: .5em;
|
|
85
|
-
border: 3px solid ${defaultTheme.backgroundAlt};
|
|
86
|
-
}
|
|
87
|
-
`
|
|
88
|
-
}
|
|
89
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
90
|
-
style: getResizeHandleStyle(position),
|
|
91
|
-
onMouseDown: onDragStart
|
|
92
|
-
}), isOpen && /*#__PURE__*/React__default.createElement("div", {
|
|
93
|
-
style: {
|
|
94
|
-
flex: '1 1 500px',
|
|
95
|
-
minHeight: '40%',
|
|
96
|
-
maxHeight: '100%',
|
|
97
|
-
overflow: 'auto',
|
|
98
|
-
borderRight: `1px solid ${defaultTheme.grayAlt}`,
|
|
99
|
-
display: 'flex',
|
|
100
|
-
flexDirection: 'column'
|
|
101
|
-
}
|
|
102
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
103
|
-
style: {
|
|
104
|
-
padding: '.5em',
|
|
105
|
-
background: defaultTheme.backgroundAlt,
|
|
106
|
-
display: 'flex',
|
|
107
|
-
justifyContent: 'space-between',
|
|
108
|
-
alignItems: 'center'
|
|
109
|
-
}
|
|
110
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
111
|
-
type: "button",
|
|
112
|
-
"aria-label": "Close React Query Devtools",
|
|
113
|
-
"aria-controls": "ReactQueryDevtoolsPanel",
|
|
114
|
-
"aria-haspopup": "true",
|
|
115
|
-
"aria-expanded": "true",
|
|
116
|
-
onClick: () => setIsOpen(false),
|
|
117
|
-
style: {
|
|
118
|
-
display: 'inline-flex',
|
|
119
|
-
background: 'none',
|
|
120
|
-
border: 0,
|
|
121
|
-
padding: 0,
|
|
122
|
-
marginRight: '.5em',
|
|
123
|
-
cursor: 'pointer'
|
|
124
|
-
}
|
|
125
|
-
}, /*#__PURE__*/React__default.createElement(Logo, {
|
|
126
|
-
"aria-hidden": true
|
|
127
|
-
}), /*#__PURE__*/React__default.createElement(ScreenReader, {
|
|
128
|
-
text: "Close React Query Devtools"
|
|
129
|
-
})), /*#__PURE__*/React__default.createElement("div", {
|
|
130
|
-
style: {
|
|
131
|
-
display: 'flex',
|
|
132
|
-
flexDirection: 'column'
|
|
133
|
-
}
|
|
134
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
135
|
-
style: {
|
|
136
|
-
display: 'flex',
|
|
137
|
-
justifyContent: 'space-between',
|
|
138
|
-
alignItems: 'center',
|
|
139
|
-
marginBottom: '.5em'
|
|
140
|
-
}
|
|
141
|
-
}, /*#__PURE__*/React__default.createElement(QueryStatusCount, {
|
|
142
|
-
queryCache: queryCache
|
|
143
|
-
}), position && onPositionChange ? /*#__PURE__*/React__default.createElement(Select, {
|
|
144
|
-
"aria-label": "Panel position",
|
|
145
|
-
value: position,
|
|
146
|
-
style: {
|
|
147
|
-
marginInlineStart: '.5em'
|
|
148
|
-
},
|
|
149
|
-
onChange: e => onPositionChange(e.target.value)
|
|
150
|
-
}, /*#__PURE__*/React__default.createElement("option", {
|
|
151
|
-
value: "left"
|
|
152
|
-
}, "Left"), /*#__PURE__*/React__default.createElement("option", {
|
|
153
|
-
value: "right"
|
|
154
|
-
}, "Right"), /*#__PURE__*/React__default.createElement("option", {
|
|
155
|
-
value: "top"
|
|
156
|
-
}, "Top"), /*#__PURE__*/React__default.createElement("option", {
|
|
157
|
-
value: "bottom"
|
|
158
|
-
}, "Bottom")) : null), /*#__PURE__*/React__default.createElement("div", {
|
|
159
|
-
style: {
|
|
160
|
-
display: 'flex',
|
|
161
|
-
alignItems: 'center',
|
|
162
|
-
flexWrap: 'wrap',
|
|
163
|
-
gap: '0.5em'
|
|
164
|
-
}
|
|
165
|
-
}, /*#__PURE__*/React__default.createElement(Input, {
|
|
166
|
-
placeholder: "Filter",
|
|
167
|
-
"aria-label": "Filter by queryhash",
|
|
168
|
-
value: filter != null ? filter : '',
|
|
169
|
-
onChange: e => setFilter(e.target.value),
|
|
170
|
-
onKeyDown: e => {
|
|
171
|
-
if (e.key === 'Escape') setFilter('');
|
|
172
|
-
},
|
|
173
|
-
style: {
|
|
174
|
-
flex: '1',
|
|
175
|
-
width: '100%'
|
|
176
|
-
}
|
|
177
|
-
}), /*#__PURE__*/React__default.createElement(Select, {
|
|
178
|
-
"aria-label": "Sort queries",
|
|
179
|
-
value: sort,
|
|
180
|
-
onChange: e => setSort(e.target.value),
|
|
181
|
-
style: {
|
|
182
|
-
flex: '1',
|
|
183
|
-
minWidth: 75,
|
|
184
|
-
marginRight: '.5em'
|
|
185
|
-
}
|
|
186
|
-
}, Object.keys(sortFns).map(key => /*#__PURE__*/React__default.createElement("option", {
|
|
187
|
-
key: key,
|
|
188
|
-
value: key
|
|
189
|
-
}, "Sort by ", key))), /*#__PURE__*/React__default.createElement(Button, {
|
|
190
|
-
type: "button",
|
|
191
|
-
onClick: () => setBaseSort(old => old * -1),
|
|
192
|
-
style: {
|
|
193
|
-
padding: '.3em .4em',
|
|
194
|
-
marginRight: '.5em'
|
|
195
|
-
}
|
|
196
|
-
}, baseSort === 1 ? '⬆ Asc' : '⬇ Desc'), /*#__PURE__*/React__default.createElement(Button, {
|
|
197
|
-
title: "Clear cache",
|
|
198
|
-
"aria-label": "Clear cache",
|
|
199
|
-
type: "button",
|
|
200
|
-
onClick: () => queryCache.clear(),
|
|
201
|
-
style: {
|
|
202
|
-
padding: '.3em .4em',
|
|
203
|
-
marginRight: '.5em'
|
|
204
|
-
}
|
|
205
|
-
}, "Clear"), /*#__PURE__*/React__default.createElement(Button, {
|
|
206
|
-
type: "button",
|
|
207
|
-
onClick: () => {
|
|
208
|
-
if (isMockOffline) {
|
|
209
|
-
onlineManager.setOnline(undefined);
|
|
210
|
-
setMockOffline(false);
|
|
211
|
-
window.dispatchEvent(new Event('online'));
|
|
212
|
-
} else {
|
|
213
|
-
onlineManager.setOnline(false);
|
|
214
|
-
setMockOffline(true);
|
|
215
|
-
window.dispatchEvent(new Event('offline'));
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
"aria-label": isMockOffline ? 'Restore offline mock' : 'Mock offline behavior',
|
|
219
|
-
title: isMockOffline ? 'Restore offline mock' : 'Mock offline behavior',
|
|
220
|
-
style: {
|
|
221
|
-
padding: '0',
|
|
222
|
-
height: '2em'
|
|
223
|
-
}
|
|
224
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
225
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
226
|
-
width: "2em",
|
|
227
|
-
height: "2em",
|
|
228
|
-
viewBox: "0 0 24 24",
|
|
229
|
-
stroke: isMockOffline ? defaultTheme.danger : 'currentColor',
|
|
230
|
-
fill: "none"
|
|
231
|
-
}, isMockOffline ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("path", {
|
|
232
|
-
stroke: "none",
|
|
233
|
-
d: "M0 0h24v24H0z",
|
|
234
|
-
fill: "none"
|
|
235
|
-
}), /*#__PURE__*/React__default.createElement("line", {
|
|
236
|
-
x1: "12",
|
|
237
|
-
y1: "18",
|
|
238
|
-
x2: "12.01",
|
|
239
|
-
y2: "18"
|
|
240
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
241
|
-
d: "M9.172 15.172a4 4 0 0 1 5.656 0"
|
|
242
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
243
|
-
d: "M6.343 12.343a7.963 7.963 0 0 1 3.864 -2.14m4.163 .155a7.965 7.965 0 0 1 3.287 2"
|
|
244
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
245
|
-
d: "M3.515 9.515a12 12 0 0 1 3.544 -2.455m3.101 -.92a12 12 0 0 1 10.325 3.374"
|
|
246
|
-
}), /*#__PURE__*/React__default.createElement("line", {
|
|
247
|
-
x1: "3",
|
|
248
|
-
y1: "3",
|
|
249
|
-
x2: "21",
|
|
250
|
-
y2: "21"
|
|
251
|
-
})) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("path", {
|
|
252
|
-
stroke: "none",
|
|
253
|
-
d: "M0 0h24v24H0z",
|
|
254
|
-
fill: "none"
|
|
255
|
-
}), /*#__PURE__*/React__default.createElement("line", {
|
|
256
|
-
x1: "12",
|
|
257
|
-
y1: "18",
|
|
258
|
-
x2: "12.01",
|
|
259
|
-
y2: "18"
|
|
260
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
261
|
-
d: "M9.172 15.172a4 4 0 0 1 5.656 0"
|
|
262
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
263
|
-
d: "M6.343 12.343a8 8 0 0 1 11.314 0"
|
|
264
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
265
|
-
d: "M3.515 9.515c4.686 -4.687 12.284 -4.687 17 0"
|
|
266
|
-
}))), /*#__PURE__*/React__default.createElement(ScreenReader, {
|
|
267
|
-
text: isMockOffline ? 'Restore offline mock' : 'Mock offline behavior'
|
|
268
|
-
}))))), /*#__PURE__*/React__default.createElement("div", {
|
|
269
|
-
style: {
|
|
270
|
-
overflowY: 'auto',
|
|
271
|
-
flex: '1'
|
|
272
|
-
}
|
|
273
|
-
}, queries.map(query => {
|
|
274
|
-
return /*#__PURE__*/React__default.createElement(QueryRow, {
|
|
275
|
-
queryKey: query.queryKey,
|
|
276
|
-
activeQueryHash: activeQueryHash,
|
|
277
|
-
setActiveQueryHash: setActiveQueryHash,
|
|
278
|
-
key: query.queryHash,
|
|
279
|
-
queryCache: queryCache
|
|
280
|
-
});
|
|
281
|
-
}))), activeQueryHash && isOpen ? /*#__PURE__*/React__default.createElement(ActiveQuery, {
|
|
282
|
-
activeQueryHash: activeQueryHash,
|
|
283
|
-
queryCache: queryCache,
|
|
284
|
-
queryClient: client,
|
|
285
|
-
errorTypes: errorTypes
|
|
286
|
-
}) : null, showCloseButton ? /*#__PURE__*/React__default.createElement(Button, _extends({
|
|
287
|
-
type: "button",
|
|
288
|
-
"aria-controls": "ReactQueryDevtoolsPanel",
|
|
289
|
-
"aria-haspopup": "true",
|
|
290
|
-
"aria-expanded": "true"
|
|
291
|
-
}, otherCloseButtonProps, {
|
|
292
|
-
style: {
|
|
293
|
-
position: 'absolute',
|
|
294
|
-
zIndex: 99999,
|
|
295
|
-
margin: '.5em',
|
|
296
|
-
bottom: 0,
|
|
297
|
-
left: 0,
|
|
298
|
-
...otherCloseButtonProps.style
|
|
299
|
-
},
|
|
300
|
-
onClick: e => {
|
|
301
|
-
setIsOpen(false);
|
|
302
|
-
onCloseClick == null ? void 0 : onCloseClick(e);
|
|
303
|
-
}
|
|
304
|
-
}), "Close") : null));
|
|
305
|
-
});
|
|
306
|
-
ReactQueryDevtoolsPanel.displayName = 'ReactQueryDevtoolsPanel';
|
|
307
|
-
var ReactQueryDevtoolsPanel$1 = ReactQueryDevtoolsPanel;
|
|
308
|
-
|
|
309
|
-
export { ReactQueryDevtoolsPanel, ReactQueryDevtoolsPanel$1 as default };
|
|
310
|
-
//# sourceMappingURL=CachePanel.esm.js.map
|