@tanstack/query-devtools 5.104.0 → 5.104.2
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/Devtools-BTIH1dw_.js +1238 -0
- package/build/Devtools-BTIH1dw_.js.map +1 -0
- package/build/{Devtools-XuAvSfeN.cjs → Devtools-CJHY2Wx-.cjs} +388 -66
- package/build/{Devtools-xfqOl5Dl.js → Devtools-DBqcRO2f.js} +371 -67
- package/build/Devtools-DE6wfpC3.cjs +1237 -0
- package/build/DevtoolsComponent-B-JX7seJ.js +2 -0
- package/build/DevtoolsComponent-B-JX7seJ.js.map +1 -0
- package/build/DevtoolsComponent-BdsgosNO.js +40 -0
- package/build/DevtoolsComponent-BjB9B9oL.cjs +40 -0
- package/build/DevtoolsComponent-u_hbjcma.cjs +1 -0
- package/build/DevtoolsPanelComponent-CdrNDWsc.js +2 -0
- package/build/DevtoolsPanelComponent-CdrNDWsc.js.map +1 -0
- package/build/DevtoolsPanelComponent-Co1Z91vW.cjs +47 -0
- package/build/DevtoolsPanelComponent-DyNlv9xD.cjs +1 -0
- package/build/DevtoolsPanelComponent-Jyh8juKn.js +47 -0
- package/build/dev.cjs +3 -3
- package/build/dev.js +3 -3
- package/build/index.cjs +1 -1
- package/build/index.d.cts +82 -0
- package/build/index.d.cts.map +1 -1
- package/build/index.d.ts +82 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/{utils-BSq_mRvI.cjs → utils-C0KLuaCQ.cjs} +57 -12
- package/build/{utils-Fz9uQv9N.js → utils-DPVWL709.js} +57 -12
- package/build/utils-po3vZo_N.js.map +1 -1
- package/package.json +9 -9
- package/src/Devtools.tsx +87 -82
- package/src/DevtoolsComponent.tsx +17 -5
- package/src/DevtoolsPanelComponent.tsx +23 -14
- package/src/Explorer.tsx +18 -4
- package/src/TanstackQueryDevtools.tsx +11 -0
- package/src/TanstackQueryDevtoolsPanel.tsx +14 -0
- package/src/contexts/DevtoolsOfflineContext.ts +15 -0
- package/src/contexts/DevtoolsStateContext.ts +15 -0
- package/src/contexts/DevtoolsSubscriptionsContext.ts +16 -0
- package/src/contexts/PiPContext.tsx +13 -0
- package/src/contexts/QueryDevtoolsContext.ts +4 -0
- package/src/contexts/ThemeContext.ts +4 -0
- package/src/contexts/types.ts +133 -1
- package/src/createCacheSubscriptionRegistry.ts +58 -0
- package/src/icons/index.tsx +102 -0
- package/src/providers/DevtoolsOfflineProvider.tsx +37 -0
- package/src/providers/DevtoolsStateProvider.tsx +33 -0
- package/src/providers/DevtoolsSubscriptionsProvider.tsx +35 -0
- package/src/utils.tsx +59 -15
- package/build/Devtools-DP9QP4ya.cjs +0 -1237
- package/build/Devtools-DpIxfOum.js +0 -1238
- package/build/Devtools-DpIxfOum.js.map +0 -1
- package/build/DevtoolsComponent-BEFw32kp.js +0 -2
- package/build/DevtoolsComponent-BEFw32kp.js.map +0 -1
- package/build/DevtoolsComponent-DRjJuLRU.js +0 -34
- package/build/DevtoolsComponent-DjkCvfLf.cjs +0 -34
- package/build/DevtoolsComponent-bl_b_SFT.cjs +0 -1
- package/build/DevtoolsPanelComponent-BE6hbJd6.js +0 -2
- package/build/DevtoolsPanelComponent-BE6hbJd6.js.map +0 -1
- package/build/DevtoolsPanelComponent-BTfH8T_h.cjs +0 -41
- package/build/DevtoolsPanelComponent-CkmpODyJ.js +0 -41
- package/build/DevtoolsPanelComponent-DfaRC3RE.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as untrack, A as $TRACK, B as createEffect, C as memo, D as spread, E as setStyleProperty, F as Switch, G as createUniqueId, H as createRenderEffect, I as batch, J as mergeProps, L as createComponent, M as Index, N as Match, O as template, P as Show, Q as splitProps, R as createComputed, S as insert, T as setAttribute, U as createRoot, V as createMemo, W as createSignal, X as onCleanup, Y as on, Z as onMount, _ as Portal, b as clearDelegatedEvents, c as getQueryStatusLabel, et as useContext, f as sortFns, g as Dynamic, h as stringify, i as getMutationStatusColor, j as For, k as use, l as getSidedProp, m as serialize, n as deleteNestedDataByPath, o as getQueryStatusColor, p as updateNestedDataByPath, r as displayValue, s as getQueryStatusColorByLabel, t as convertRemToPixels, tt as useTransition, u as mutationSortFns, v as addEventListener, x as delegateEvents, y as className, z as createContext } from "./utils-
|
|
1
|
+
import { $ as untrack, A as $TRACK, B as createEffect, C as memo, D as spread, E as setStyleProperty, F as Switch, G as createUniqueId, H as createRenderEffect, I as batch, J as mergeProps, L as createComponent, M as Index, N as Match, O as template, P as Show, Q as splitProps, R as createComputed, S as insert, T as setAttribute, U as createRoot, V as createMemo, W as createSignal, X as onCleanup, Y as on, Z as onMount, _ as Portal, b as clearDelegatedEvents, c as getQueryStatusLabel, et as useContext, f as sortFns, g as Dynamic, h as stringify, i as getMutationStatusColor, j as For, k as use, l as getSidedProp, m as serialize, n as deleteNestedDataByPath, o as getQueryStatusColor, p as updateNestedDataByPath, r as displayValue, s as getQueryStatusColorByLabel, t as convertRemToPixels, tt as useTransition, u as mutationSortFns, v as addEventListener, x as delegateEvents, y as className, z as createContext } from "./utils-DPVWL709.js";
|
|
2
2
|
const isNonNullable = (i) => i != null;
|
|
3
3
|
const filterNonNullable = (arr) => arr.filter(isNonNullable);
|
|
4
4
|
/**
|
|
@@ -232,6 +232,180 @@ var cookieStorage = addClearMethod({
|
|
|
232
232
|
}
|
|
233
233
|
});
|
|
234
234
|
//#endregion
|
|
235
|
+
//#region src/contexts/QueryDevtoolsContext.ts
|
|
236
|
+
const QueryDevtoolsContext = createContext({
|
|
237
|
+
client: void 0,
|
|
238
|
+
onlineManager: void 0,
|
|
239
|
+
queryFlavor: "",
|
|
240
|
+
version: "",
|
|
241
|
+
shadowDOMTarget: void 0
|
|
242
|
+
});
|
|
243
|
+
/**
|
|
244
|
+
* Returns the devtools configuration from context, such as the `client` and the `onlineManager`.
|
|
245
|
+
* @returns The devtools configuration.
|
|
246
|
+
*/
|
|
247
|
+
function useQueryDevtoolsContext() {
|
|
248
|
+
return useContext(QueryDevtoolsContext);
|
|
249
|
+
}
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/contexts/DevtoolsOfflineContext.ts
|
|
252
|
+
const DevtoolsOfflineContext = createContext();
|
|
253
|
+
/**
|
|
254
|
+
* Returns the devtools offline state provided by `DevtoolsOfflineProvider`.
|
|
255
|
+
* @returns The offline state.
|
|
256
|
+
* @throws {Error} If there is no `DevtoolsOfflineProvider` above.
|
|
257
|
+
*/
|
|
258
|
+
function useDevtoolsOffline() {
|
|
259
|
+
const state = useContext(DevtoolsOfflineContext);
|
|
260
|
+
if (!state) throw new Error("Missing DevtoolsOfflineProvider");
|
|
261
|
+
return state;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/providers/DevtoolsOfflineProvider.tsx
|
|
265
|
+
/**
|
|
266
|
+
* Provides its children with the offline state of the devtools `onlineManager`, and a function
|
|
267
|
+
* that toggles it.
|
|
268
|
+
* @param props - The `children` to render.
|
|
269
|
+
* @returns The `children`, wrapped in the context provider.
|
|
270
|
+
*/
|
|
271
|
+
function DevtoolsOfflineProvider(props) {
|
|
272
|
+
const [offline, setOffline] = createSignal(false);
|
|
273
|
+
const context = useQueryDevtoolsContext();
|
|
274
|
+
createEffect(() => {
|
|
275
|
+
const manager = context.onlineManager;
|
|
276
|
+
setOffline(!manager.isOnline());
|
|
277
|
+
const unsubscribe = manager.subscribe((online) => setOffline(!online));
|
|
278
|
+
onCleanup(unsubscribe);
|
|
279
|
+
});
|
|
280
|
+
const state = {
|
|
281
|
+
offline,
|
|
282
|
+
toggleOffline: () => {
|
|
283
|
+
const manager = context.onlineManager;
|
|
284
|
+
manager.setOnline(!manager.isOnline());
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
return createComponent(DevtoolsOfflineContext.Provider, {
|
|
288
|
+
value: state,
|
|
289
|
+
get children() {
|
|
290
|
+
return props.children;
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/createCacheSubscriptionRegistry.ts
|
|
296
|
+
/**
|
|
297
|
+
* Creates a registry of components subscribed to a cache, so each one only updates for the cache
|
|
298
|
+
* events it cares about.
|
|
299
|
+
* @returns The `register` and `notify` functions of the registry.
|
|
300
|
+
*/
|
|
301
|
+
function createCacheSubscriptionRegistry() {
|
|
302
|
+
const subscriptions = /* @__PURE__ */ new Map();
|
|
303
|
+
/**
|
|
304
|
+
* Registers a subscription that is removed when the current owner is cleaned up.
|
|
305
|
+
* @param callback - Computes the value from the cache.
|
|
306
|
+
* @param setter - Receives the computed value on every update.
|
|
307
|
+
* @param shouldUpdate - Decides whether an event updates this subscription. Defaults to every
|
|
308
|
+
* event.
|
|
309
|
+
*/
|
|
310
|
+
function register(callback, setter, shouldUpdate = () => true) {
|
|
311
|
+
const id = Symbol();
|
|
312
|
+
subscriptions.set(id, {
|
|
313
|
+
shouldUpdate,
|
|
314
|
+
update: (cache) => setter(callback(cache))
|
|
315
|
+
});
|
|
316
|
+
onCleanup(() => subscriptions.delete(id));
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Updates every subscription whose `shouldUpdate` accepts the event.
|
|
320
|
+
* @param cache - The cache to compute the values from.
|
|
321
|
+
* @param event - The cache event.
|
|
322
|
+
* @param schedule - Runs each update. Defaults to running it right away.
|
|
323
|
+
*/
|
|
324
|
+
function notify(cache, event, schedule = (update) => update()) {
|
|
325
|
+
for (const [id, subscription] of subscriptions) {
|
|
326
|
+
if (!subscription.shouldUpdate(event)) continue;
|
|
327
|
+
schedule(() => {
|
|
328
|
+
if (subscriptions.has(id)) subscription.update(cache);
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
register,
|
|
334
|
+
notify
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region src/contexts/DevtoolsSubscriptionsContext.ts
|
|
339
|
+
const DevtoolsSubscriptionsContext = createContext();
|
|
340
|
+
/**
|
|
341
|
+
* Returns the devtools cache subscription registries provided by `DevtoolsSubscriptionsProvider`.
|
|
342
|
+
* @returns The cache subscription registries.
|
|
343
|
+
* @throws {Error} If there is no `DevtoolsSubscriptionsProvider` above.
|
|
344
|
+
*/
|
|
345
|
+
function useDevtoolsSubscriptions() {
|
|
346
|
+
const subscriptions = useContext(DevtoolsSubscriptionsContext);
|
|
347
|
+
if (!subscriptions) throw new Error("Missing DevtoolsSubscriptionsProvider");
|
|
348
|
+
return subscriptions;
|
|
349
|
+
}
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/providers/DevtoolsSubscriptionsProvider.tsx
|
|
352
|
+
/**
|
|
353
|
+
* Provides the query and mutation cache subscription registries to its children.
|
|
354
|
+
* @param props - The `children` to render.
|
|
355
|
+
* @returns The `children`, wrapped in the context provider.
|
|
356
|
+
*/
|
|
357
|
+
function DevtoolsSubscriptionsProvider(props) {
|
|
358
|
+
const subscriptions = {
|
|
359
|
+
queryCacheSubscriptions: createCacheSubscriptionRegistry(),
|
|
360
|
+
mutationCacheSubscriptions: createCacheSubscriptionRegistry()
|
|
361
|
+
};
|
|
362
|
+
return createComponent(DevtoolsSubscriptionsContext.Provider, {
|
|
363
|
+
value: subscriptions,
|
|
364
|
+
get children() {
|
|
365
|
+
return props.children;
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/contexts/DevtoolsStateContext.ts
|
|
371
|
+
const DevtoolsStateContext = createContext();
|
|
372
|
+
/**
|
|
373
|
+
* Returns the devtools selection and panel state provided by `DevtoolsStateProvider`.
|
|
374
|
+
* @returns The selection and panel state.
|
|
375
|
+
* @throws {Error} If there is no `DevtoolsStateProvider` above.
|
|
376
|
+
*/
|
|
377
|
+
function useDevtoolsState() {
|
|
378
|
+
const state = useContext(DevtoolsStateContext);
|
|
379
|
+
if (!state) throw new Error("Missing DevtoolsStateProvider");
|
|
380
|
+
return state;
|
|
381
|
+
}
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region src/providers/DevtoolsStateProvider.tsx
|
|
384
|
+
/**
|
|
385
|
+
* Provides the selected query and mutation and the panel width to its children.
|
|
386
|
+
* @param props - The `children` to render.
|
|
387
|
+
* @returns The `children`, wrapped in the context provider.
|
|
388
|
+
*/
|
|
389
|
+
function DevtoolsStateProvider(props) {
|
|
390
|
+
const [selectedQueryHash, setSelectedQueryHash] = createSignal(null);
|
|
391
|
+
const [selectedMutationId, setSelectedMutationId] = createSignal(null);
|
|
392
|
+
const [panelWidth, setPanelWidth] = createSignal(0);
|
|
393
|
+
const state = {
|
|
394
|
+
selectedQueryHash,
|
|
395
|
+
setSelectedQueryHash,
|
|
396
|
+
selectedMutationId,
|
|
397
|
+
setSelectedMutationId,
|
|
398
|
+
panelWidth,
|
|
399
|
+
setPanelWidth
|
|
400
|
+
};
|
|
401
|
+
return createComponent(DevtoolsStateContext.Provider, {
|
|
402
|
+
value: state,
|
|
403
|
+
get children() {
|
|
404
|
+
return props.children;
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
//#endregion
|
|
235
409
|
//#region ../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.1.2/node_modules/@tanstack/match-sorter-utils/dist/remove-accents.js
|
|
236
410
|
const characterMap = {
|
|
237
411
|
À: "A",
|
|
@@ -7478,54 +7652,123 @@ var _tmpl$20$1 = /*#__PURE__*/ template(`<svg width=14 height=14 viewBox="0 0 24
|
|
|
7478
7652
|
var _tmpl$21$1 = /*#__PURE__*/ template(`<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>`);
|
|
7479
7653
|
var _tmpl$22$1 = /*#__PURE__*/ template(`<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>`);
|
|
7480
7654
|
var _tmpl$23$1 = /*#__PURE__*/ template(`<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>`);
|
|
7655
|
+
/**
|
|
7656
|
+
* Renders the search icon.
|
|
7657
|
+
* @returns The icon's SVG element.
|
|
7658
|
+
*/
|
|
7481
7659
|
function Search() {
|
|
7482
7660
|
return _tmpl$$2();
|
|
7483
7661
|
}
|
|
7662
|
+
/**
|
|
7663
|
+
* Renders the trash icon.
|
|
7664
|
+
* @returns The icon's SVG element.
|
|
7665
|
+
*/
|
|
7484
7666
|
function Trash() {
|
|
7485
7667
|
return _tmpl$2$2();
|
|
7486
7668
|
}
|
|
7669
|
+
/**
|
|
7670
|
+
* Renders the chevron-down icon.
|
|
7671
|
+
* @returns The icon's SVG element.
|
|
7672
|
+
*/
|
|
7487
7673
|
function ChevronDown() {
|
|
7488
7674
|
return _tmpl$3$2();
|
|
7489
7675
|
}
|
|
7676
|
+
/**
|
|
7677
|
+
* Renders the up arrow icon.
|
|
7678
|
+
* @returns The icon's SVG element.
|
|
7679
|
+
*/
|
|
7490
7680
|
function ArrowUp() {
|
|
7491
7681
|
return _tmpl$4$2();
|
|
7492
7682
|
}
|
|
7683
|
+
/**
|
|
7684
|
+
* Renders the down arrow icon.
|
|
7685
|
+
* @returns The icon's SVG element.
|
|
7686
|
+
*/
|
|
7493
7687
|
function ArrowDown() {
|
|
7494
7688
|
return _tmpl$5$2();
|
|
7495
7689
|
}
|
|
7690
|
+
/**
|
|
7691
|
+
* Renders the left arrow icon.
|
|
7692
|
+
* @returns The icon's SVG element.
|
|
7693
|
+
*/
|
|
7496
7694
|
function ArrowLeft() {
|
|
7497
7695
|
return _tmpl$6$2();
|
|
7498
7696
|
}
|
|
7697
|
+
/**
|
|
7698
|
+
* Renders the right arrow icon.
|
|
7699
|
+
* @returns The icon's SVG element.
|
|
7700
|
+
*/
|
|
7499
7701
|
function ArrowRight() {
|
|
7500
7702
|
return _tmpl$7$2();
|
|
7501
7703
|
}
|
|
7704
|
+
/**
|
|
7705
|
+
* Renders the sun (light theme) icon.
|
|
7706
|
+
* @returns The icon's SVG element.
|
|
7707
|
+
*/
|
|
7502
7708
|
function Sun() {
|
|
7503
7709
|
return _tmpl$8$2();
|
|
7504
7710
|
}
|
|
7711
|
+
/**
|
|
7712
|
+
* Renders the moon (dark theme) icon.
|
|
7713
|
+
* @returns The icon's SVG element.
|
|
7714
|
+
*/
|
|
7505
7715
|
function Moon() {
|
|
7506
7716
|
return _tmpl$9$2();
|
|
7507
7717
|
}
|
|
7718
|
+
/**
|
|
7719
|
+
* Renders the monitor (system theme) icon.
|
|
7720
|
+
* @returns The icon's SVG element.
|
|
7721
|
+
*/
|
|
7508
7722
|
function Monitor() {
|
|
7509
7723
|
return _tmpl$0$2();
|
|
7510
7724
|
}
|
|
7725
|
+
/**
|
|
7726
|
+
* Renders the Wi-Fi (online) icon.
|
|
7727
|
+
* @returns The icon's SVG element.
|
|
7728
|
+
*/
|
|
7511
7729
|
function Wifi() {
|
|
7512
7730
|
return _tmpl$1$2();
|
|
7513
7731
|
}
|
|
7732
|
+
/**
|
|
7733
|
+
* Renders the offline icon.
|
|
7734
|
+
* @returns The icon's SVG element.
|
|
7735
|
+
*/
|
|
7514
7736
|
function Offline() {
|
|
7515
7737
|
return _tmpl$10$2();
|
|
7516
7738
|
}
|
|
7739
|
+
/**
|
|
7740
|
+
* Renders the settings icon.
|
|
7741
|
+
* @returns The icon's SVG element.
|
|
7742
|
+
*/
|
|
7517
7743
|
function Settings() {
|
|
7518
7744
|
return _tmpl$11$1();
|
|
7519
7745
|
}
|
|
7746
|
+
/**
|
|
7747
|
+
* Renders the picture-in-picture icon.
|
|
7748
|
+
* @returns The icon's SVG element.
|
|
7749
|
+
*/
|
|
7520
7750
|
function PiPIcon() {
|
|
7521
7751
|
return _tmpl$12$1();
|
|
7522
7752
|
}
|
|
7753
|
+
/**
|
|
7754
|
+
* Renders the copy icon.
|
|
7755
|
+
* @returns The icon's SVG element.
|
|
7756
|
+
*/
|
|
7523
7757
|
function Copier() {
|
|
7524
7758
|
return _tmpl$13$1();
|
|
7525
7759
|
}
|
|
7760
|
+
/**
|
|
7761
|
+
* Renders the pencil (edit) icon.
|
|
7762
|
+
* @returns The icon's SVG element.
|
|
7763
|
+
*/
|
|
7526
7764
|
function Pencil() {
|
|
7527
7765
|
return _tmpl$14$1();
|
|
7528
7766
|
}
|
|
7767
|
+
/**
|
|
7768
|
+
* Renders the icon shown after a value was copied.
|
|
7769
|
+
* @param props - The `theme` that decides the icon's color.
|
|
7770
|
+
* @returns The icon's SVG element.
|
|
7771
|
+
*/
|
|
7529
7772
|
function CopiedCopier(props) {
|
|
7530
7773
|
return (() => {
|
|
7531
7774
|
var _el$15 = _tmpl$15$1(), _el$16 = _el$15.firstChild;
|
|
@@ -7533,12 +7776,25 @@ function CopiedCopier(props) {
|
|
|
7533
7776
|
return _el$15;
|
|
7534
7777
|
})();
|
|
7535
7778
|
}
|
|
7779
|
+
/**
|
|
7780
|
+
* Renders the copy error icon.
|
|
7781
|
+
* @returns The icon's SVG element.
|
|
7782
|
+
*/
|
|
7536
7783
|
function ErrorCopier() {
|
|
7537
7784
|
return _tmpl$16$1();
|
|
7538
7785
|
}
|
|
7786
|
+
/**
|
|
7787
|
+
* Renders the list icon.
|
|
7788
|
+
* @returns The icon's SVG element.
|
|
7789
|
+
*/
|
|
7539
7790
|
function List() {
|
|
7540
7791
|
return _tmpl$17$1();
|
|
7541
7792
|
}
|
|
7793
|
+
/**
|
|
7794
|
+
* Renders a checkbox icon.
|
|
7795
|
+
* @param props - Whether the checkbox is `checked`, and the `theme` that decides its color.
|
|
7796
|
+
* @returns The checked or unchecked checkbox icon.
|
|
7797
|
+
*/
|
|
7542
7798
|
function Check(props) {
|
|
7543
7799
|
return [createComponent(Show, {
|
|
7544
7800
|
get when() {
|
|
@@ -7560,18 +7816,38 @@ function Check(props) {
|
|
|
7560
7816
|
}
|
|
7561
7817
|
})];
|
|
7562
7818
|
}
|
|
7819
|
+
/**
|
|
7820
|
+
* Renders the check circle icon.
|
|
7821
|
+
* @returns The icon's SVG element.
|
|
7822
|
+
*/
|
|
7563
7823
|
function CheckCircle() {
|
|
7564
7824
|
return _tmpl$19$1();
|
|
7565
7825
|
}
|
|
7826
|
+
/**
|
|
7827
|
+
* Renders the loading circle icon.
|
|
7828
|
+
* @returns The icon's SVG element.
|
|
7829
|
+
*/
|
|
7566
7830
|
function LoadingCircle() {
|
|
7567
7831
|
return _tmpl$20$1();
|
|
7568
7832
|
}
|
|
7833
|
+
/**
|
|
7834
|
+
* Renders the X circle icon.
|
|
7835
|
+
* @returns The icon's SVG element.
|
|
7836
|
+
*/
|
|
7569
7837
|
function XCircle() {
|
|
7570
7838
|
return _tmpl$21$1();
|
|
7571
7839
|
}
|
|
7840
|
+
/**
|
|
7841
|
+
* Renders the pause circle icon.
|
|
7842
|
+
* @returns The icon's SVG element.
|
|
7843
|
+
*/
|
|
7572
7844
|
function PauseCircle() {
|
|
7573
7845
|
return _tmpl$22$1();
|
|
7574
7846
|
}
|
|
7847
|
+
/**
|
|
7848
|
+
* Renders the TanStack logo.
|
|
7849
|
+
* @returns The logo's SVG element.
|
|
7850
|
+
*/
|
|
7575
7851
|
function TanstackLogo() {
|
|
7576
7852
|
const id = createUniqueId();
|
|
7577
7853
|
return (() => {
|
|
@@ -7661,21 +7937,17 @@ const THEME_PREFERENCE = "system";
|
|
|
7661
7937
|
const DEFAULT_SORT_FN_NAME = Object.keys(sortFns)[0];
|
|
7662
7938
|
const DEFAULT_MUTATION_SORT_FN_NAME = Object.keys(mutationSortFns)[0];
|
|
7663
7939
|
//#endregion
|
|
7664
|
-
//#region src/contexts/QueryDevtoolsContext.ts
|
|
7665
|
-
const QueryDevtoolsContext = createContext({
|
|
7666
|
-
client: void 0,
|
|
7667
|
-
onlineManager: void 0,
|
|
7668
|
-
queryFlavor: "",
|
|
7669
|
-
version: "",
|
|
7670
|
-
shadowDOMTarget: void 0
|
|
7671
|
-
});
|
|
7672
|
-
function useQueryDevtoolsContext() {
|
|
7673
|
-
return useContext(QueryDevtoolsContext);
|
|
7674
|
-
}
|
|
7675
|
-
//#endregion
|
|
7676
7940
|
//#region src/contexts/PiPContext.tsx
|
|
7677
7941
|
var PipOpenError = class extends Error {};
|
|
7678
7942
|
const PiPContext = createContext(void 0);
|
|
7943
|
+
/**
|
|
7944
|
+
* Provides the picture-in-picture window of the devtools, and functions to
|
|
7945
|
+
* open and close it.
|
|
7946
|
+
* @param props - The `children` to render, the `localStore` and
|
|
7947
|
+
* `setLocalStore` that persist whether the window is open, and `disabled` to
|
|
7948
|
+
* turn picture-in-picture off.
|
|
7949
|
+
* @returns The context provider.
|
|
7950
|
+
*/
|
|
7679
7951
|
const PiPProvider = (props) => {
|
|
7680
7952
|
const [pipWindow, setPipWindow] = createSignal(null);
|
|
7681
7953
|
const closePipWindow = () => {
|
|
@@ -7777,6 +8049,11 @@ const PiPProvider = (props) => {
|
|
|
7777
8049
|
}
|
|
7778
8050
|
});
|
|
7779
8051
|
};
|
|
8052
|
+
/**
|
|
8053
|
+
* Reads the picture-in-picture context provided by {@link PiPProvider}.
|
|
8054
|
+
* @returns An accessor of the picture-in-picture window and the functions to
|
|
8055
|
+
* open and close it.
|
|
8056
|
+
*/
|
|
7780
8057
|
const usePiPWindow = () => {
|
|
7781
8058
|
return createMemo(() => {
|
|
7782
8059
|
const ctx = useContext(PiPContext);
|
|
@@ -7787,6 +8064,10 @@ const usePiPWindow = () => {
|
|
|
7787
8064
|
//#endregion
|
|
7788
8065
|
//#region src/contexts/ThemeContext.ts
|
|
7789
8066
|
const ThemeContext = createContext(() => "dark");
|
|
8067
|
+
/**
|
|
8068
|
+
* Returns the devtools theme from context.
|
|
8069
|
+
* @returns A getter for the current theme, `'light'` or `'dark'`. Defaults to `'dark'`.
|
|
8070
|
+
*/
|
|
7790
8071
|
function useTheme() {
|
|
7791
8072
|
return useContext(ThemeContext);
|
|
7792
8073
|
}
|
|
@@ -7805,11 +8086,13 @@ var _tmpl$0$1 = /*#__PURE__*/ template(`<span>`);
|
|
|
7805
8086
|
var _tmpl$1$1 = /*#__PURE__*/ template(`<div><label>:`);
|
|
7806
8087
|
var _tmpl$10$1 = /*#__PURE__*/ template(`<div><div><button> [<!>...<!>]`);
|
|
7807
8088
|
/**
|
|
7808
|
-
* Chunk elements in the array by size
|
|
7809
|
-
*
|
|
7810
|
-
* when the array cannot be chunked evenly by size, the last chunk will be
|
|
7811
|
-
* filled with the remaining elements
|
|
8089
|
+
* Chunk elements in the array by size.
|
|
7812
8090
|
*
|
|
8091
|
+
* When the array cannot be chunked evenly by size, the last chunk will be
|
|
8092
|
+
* filled with the remaining elements.
|
|
8093
|
+
* @param array - The elements to chunk.
|
|
8094
|
+
* @param size - The number of elements per chunk. Below `1`, no chunks are returned.
|
|
8095
|
+
* @returns The chunks.
|
|
7813
8096
|
* @example
|
|
7814
8097
|
* chunkArray(['a','b', 'c', 'd', 'e'], 2) // returns [['a','b'], ['c', 'd'], ['e']]
|
|
7815
8098
|
*/
|
|
@@ -7973,9 +8256,21 @@ const ToggleValueButton = (props) => {
|
|
|
7973
8256
|
return _el$5;
|
|
7974
8257
|
})();
|
|
7975
8258
|
};
|
|
8259
|
+
/**
|
|
8260
|
+
* Checks whether a value is iterable.
|
|
8261
|
+
* @param x - The value to check.
|
|
8262
|
+
* @returns `true` if `x` has a `Symbol.iterator` method.
|
|
8263
|
+
*/
|
|
7976
8264
|
function isIterable(x) {
|
|
7977
8265
|
return Symbol.iterator in x;
|
|
7978
8266
|
}
|
|
8267
|
+
/**
|
|
8268
|
+
* Renders an expandable tree view of a value, used to explore a query's data in the devtools. It
|
|
8269
|
+
* can also edit and delete entries in the query's data.
|
|
8270
|
+
* @param props - The value to show and its label, plus the options for expanding, editing, and
|
|
8271
|
+
* deleting entries.
|
|
8272
|
+
* @returns The tree view.
|
|
8273
|
+
*/
|
|
7979
8274
|
function Explorer(props) {
|
|
7980
8275
|
const theme = useTheme();
|
|
7981
8276
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
@@ -8490,25 +8785,19 @@ var _tmpl$35 = /*#__PURE__*/ template(`<form><textarea name=data aria-label="Edi
|
|
|
8490
8785
|
var _tmpl$36 = /*#__PURE__*/ template(`<div><div role=heading aria-level=2>Query Details</div><div><div class=tsqd-query-details-summary><pre><code></code></pre><span role=status aria-live=polite></span></div><div class=tsqd-query-details-observers-count><span>Observers:</span><span></span></div><div class=tsqd-query-details-last-updated><span>Last Updated:</span><span></span></div></div><div role=heading aria-level=2>Actions</div><div><button><span aria-hidden=true></span>Refetch</button><button><span aria-hidden=true></span>Invalidate</button><button><span aria-hidden=true></span>Reset</button><button><span aria-hidden=true></span>Remove</button><button><span aria-hidden=true></span> Loading</button></div><div role=heading aria-level=2>Data </div><div role=heading aria-level=2>Query Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer">`);
|
|
8491
8786
|
var _tmpl$37 = /*#__PURE__*/ template(`<option>`);
|
|
8492
8787
|
var _tmpl$38 = /*#__PURE__*/ template(`<div><div role=heading aria-level=2>Mutation Details</div><div><div class=tsqd-query-details-summary><pre><code></code></pre><span role=status aria-live=polite></span></div><div class=tsqd-query-details-last-updated><span>Submitted At:</span><span></span></div></div><div role=heading aria-level=2>Variables Details</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div role=heading aria-level=2>Context Details</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div role=heading aria-level=2>Data Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div role=heading aria-level=2>Mutations Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer">`);
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
8788
|
+
/**
|
|
8789
|
+
* The floating devtools: a toggle button that opens a resizable panel, or the
|
|
8790
|
+
* panel in a picture-in-picture window when one is open.
|
|
8791
|
+
* @param props - The `localStore` that persists the devtools settings, and its
|
|
8792
|
+
* `setLocalStore` setter.
|
|
8793
|
+
* @returns The toggle button and the panel.
|
|
8794
|
+
*/
|
|
8497
8795
|
const Devtools = (props) => {
|
|
8498
8796
|
const theme = useTheme();
|
|
8499
8797
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
8500
8798
|
const styles = createMemo(() => {
|
|
8501
8799
|
return theme() === "dark" ? darkStyles(css) : lightStyles(css);
|
|
8502
8800
|
});
|
|
8503
|
-
const onlineManager = createMemo(() => useQueryDevtoolsContext().onlineManager);
|
|
8504
|
-
onMount(() => {
|
|
8505
|
-
const unsubscribe = onlineManager().subscribe((online) => {
|
|
8506
|
-
setOffline(!online);
|
|
8507
|
-
});
|
|
8508
|
-
onCleanup(() => {
|
|
8509
|
-
unsubscribe();
|
|
8510
|
-
});
|
|
8511
|
-
});
|
|
8512
8801
|
const pip = usePiPWindow();
|
|
8513
8802
|
const buttonPosition = createMemo(() => {
|
|
8514
8803
|
return useQueryDevtoolsContext().buttonPosition || "bottom-right";
|
|
@@ -8630,6 +8919,7 @@ const Devtools = (props) => {
|
|
|
8630
8919
|
})()];
|
|
8631
8920
|
};
|
|
8632
8921
|
const PiPPanel = (props) => {
|
|
8922
|
+
const { panelWidth, setPanelWidth } = useDevtoolsState();
|
|
8633
8923
|
const pip = usePiPWindow();
|
|
8634
8924
|
const theme = useTheme();
|
|
8635
8925
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
@@ -8671,7 +8961,14 @@ const PiPPanel = (props) => {
|
|
|
8671
8961
|
return _el$5;
|
|
8672
8962
|
})();
|
|
8673
8963
|
};
|
|
8964
|
+
/**
|
|
8965
|
+
* The container of the embedded devtools panel, which tracks its width for
|
|
8966
|
+
* the responsive layout.
|
|
8967
|
+
* @param props - The `children` to render inside the panel.
|
|
8968
|
+
* @returns The panel container.
|
|
8969
|
+
*/
|
|
8674
8970
|
const ParentPanel = (props) => {
|
|
8971
|
+
const { panelWidth, setPanelWidth } = useDevtoolsState();
|
|
8675
8972
|
const theme = useTheme();
|
|
8676
8973
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
8677
8974
|
const styles = createMemo(() => {
|
|
@@ -8707,6 +9004,7 @@ const ParentPanel = (props) => {
|
|
|
8707
9004
|
})();
|
|
8708
9005
|
};
|
|
8709
9006
|
const DraggablePanel = (props) => {
|
|
9007
|
+
const { setSelectedQueryHash, panelWidth, setPanelWidth } = useDevtoolsState();
|
|
8710
9008
|
const theme = useTheme();
|
|
8711
9009
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
8712
9010
|
const styles = createMemo(() => {
|
|
@@ -8849,7 +9147,17 @@ const DraggablePanel = (props) => {
|
|
|
8849
9147
|
return _el$7;
|
|
8850
9148
|
})();
|
|
8851
9149
|
};
|
|
9150
|
+
/**
|
|
9151
|
+
* The content of the devtools panel: the query and mutation lists with their
|
|
9152
|
+
* filters and actions, and the details of the selected query or mutation.
|
|
9153
|
+
* @param props - The `localStore` and `setLocalStore` that persist the devtools
|
|
9154
|
+
* settings, `showPanelViewOnly` to hide the controls that only apply to the
|
|
9155
|
+
* floating devtools, and `onClose` to close an embedded panel.
|
|
9156
|
+
* @returns The panel content.
|
|
9157
|
+
*/
|
|
8852
9158
|
const ContentView = (props) => {
|
|
9159
|
+
const { selectedQueryHash, setSelectedQueryHash, selectedMutationId, setSelectedMutationId, panelWidth } = useDevtoolsState();
|
|
9160
|
+
const { offline, toggleOffline } = useDevtoolsOffline();
|
|
8853
9161
|
setupQueryCacheSubscription();
|
|
8854
9162
|
setupMutationCacheSubscription();
|
|
8855
9163
|
let containerRef;
|
|
@@ -8866,7 +9174,6 @@ const ContentView = (props) => {
|
|
|
8866
9174
|
const mutationSortOrder = createMemo(() => Number(props.localStore.mutationSortOrder) || 1);
|
|
8867
9175
|
const sortFn = createMemo(() => sortFns[sort()]);
|
|
8868
9176
|
const mutationSortFn = createMemo(() => mutationSortFns[mutationSort()]);
|
|
8869
|
-
const onlineManager = createMemo(() => useQueryDevtoolsContext().onlineManager);
|
|
8870
9177
|
const query_cache = createMemo(() => {
|
|
8871
9178
|
return useQueryDevtoolsContext().client.getQueryCache();
|
|
8872
9179
|
});
|
|
@@ -9063,9 +9370,7 @@ const ContentView = (props) => {
|
|
|
9063
9370
|
}
|
|
9064
9371
|
};
|
|
9065
9372
|
insert(_el$26, createComponent(Trash, {}));
|
|
9066
|
-
_el$27
|
|
9067
|
-
onlineManager().setOnline(!onlineManager().isOnline());
|
|
9068
|
-
};
|
|
9373
|
+
addEventListener(_el$27, "click", toggleOffline, true);
|
|
9069
9374
|
insert(_el$27, (() => {
|
|
9070
9375
|
var _c$ = memo(() => !!offline());
|
|
9071
9376
|
return () => _c$() ? createComponent(Offline, {}) : createComponent(Wifi, {});
|
|
@@ -9452,6 +9757,7 @@ const ContentView = (props) => {
|
|
|
9452
9757
|
];
|
|
9453
9758
|
};
|
|
9454
9759
|
const QueryRow = (props) => {
|
|
9760
|
+
const { selectedQueryHash, setSelectedQueryHash } = useDevtoolsState();
|
|
9455
9761
|
const theme = useTheme();
|
|
9456
9762
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
9457
9763
|
const styles = createMemo(() => {
|
|
@@ -9520,6 +9826,7 @@ const QueryRow = (props) => {
|
|
|
9520
9826
|
});
|
|
9521
9827
|
};
|
|
9522
9828
|
const MutationRow = (props) => {
|
|
9829
|
+
const { selectedMutationId, setSelectedMutationId } = useDevtoolsState();
|
|
9523
9830
|
const theme = useTheme();
|
|
9524
9831
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
9525
9832
|
const styles = createMemo(() => {
|
|
@@ -9732,6 +10039,7 @@ const MutationStatusCount = () => {
|
|
|
9732
10039
|
})();
|
|
9733
10040
|
};
|
|
9734
10041
|
const QueryStatus = (props) => {
|
|
10042
|
+
const { selectedQueryHash, panelWidth } = useDevtoolsState();
|
|
9735
10043
|
const theme = useTheme();
|
|
9736
10044
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
9737
10045
|
const styles = createMemo(() => {
|
|
@@ -9820,6 +10128,7 @@ const QueryStatus = (props) => {
|
|
|
9820
10128
|
})();
|
|
9821
10129
|
};
|
|
9822
10130
|
const QueryDetails = () => {
|
|
10131
|
+
const { selectedQueryHash, setSelectedQueryHash } = useDevtoolsState();
|
|
9823
10132
|
const theme = useTheme();
|
|
9824
10133
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
9825
10134
|
const styles = createMemo(() => {
|
|
@@ -10221,6 +10530,7 @@ const QueryDetails = () => {
|
|
|
10221
10530
|
});
|
|
10222
10531
|
};
|
|
10223
10532
|
const MutationDetails = () => {
|
|
10533
|
+
const { selectedMutationId } = useDevtoolsState();
|
|
10224
10534
|
const theme = useTheme();
|
|
10225
10535
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
10226
10536
|
const styles = createMemo(() => {
|
|
@@ -10346,26 +10656,23 @@ const MutationDetails = () => {
|
|
|
10346
10656
|
}
|
|
10347
10657
|
});
|
|
10348
10658
|
};
|
|
10349
|
-
const queryCacheMap = /* @__PURE__ */ new Map();
|
|
10350
10659
|
const setupQueryCacheSubscription = () => {
|
|
10660
|
+
const { queryCacheSubscriptions } = useDevtoolsSubscriptions();
|
|
10351
10661
|
const queryCache = createMemo(() => {
|
|
10352
10662
|
return useQueryDevtoolsContext().client.getQueryCache();
|
|
10353
10663
|
});
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
}
|
|
10664
|
+
createEffect(() => {
|
|
10665
|
+
const cache = queryCache();
|
|
10666
|
+
const unsubscribe = cache.subscribe((event) => {
|
|
10667
|
+
batch(() => {
|
|
10668
|
+
queryCacheSubscriptions.notify(() => cache, event);
|
|
10669
|
+
});
|
|
10360
10670
|
});
|
|
10671
|
+
onCleanup(unsubscribe);
|
|
10361
10672
|
});
|
|
10362
|
-
onCleanup(() => {
|
|
10363
|
-
queryCacheMap.clear();
|
|
10364
|
-
unsubscribe();
|
|
10365
|
-
});
|
|
10366
|
-
return unsubscribe;
|
|
10367
10673
|
};
|
|
10368
10674
|
const createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
10675
|
+
const { queryCacheSubscriptions } = useDevtoolsSubscriptions();
|
|
10369
10676
|
const queryCache = createMemo(() => {
|
|
10370
10677
|
return useQueryDevtoolsContext().client.getQueryCache();
|
|
10371
10678
|
});
|
|
@@ -10373,32 +10680,32 @@ const createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shou
|
|
|
10373
10680
|
createEffect(() => {
|
|
10374
10681
|
setValue(callback(queryCache));
|
|
10375
10682
|
});
|
|
10376
|
-
|
|
10377
|
-
setter: setValue,
|
|
10378
|
-
shouldUpdate
|
|
10379
|
-
});
|
|
10380
|
-
onCleanup(() => {
|
|
10381
|
-
queryCacheMap.delete(callback);
|
|
10382
|
-
});
|
|
10683
|
+
queryCacheSubscriptions.register(callback, setValue, shouldUpdate);
|
|
10383
10684
|
return value;
|
|
10384
10685
|
};
|
|
10385
|
-
const mutationCacheMap = /* @__PURE__ */ new Map();
|
|
10386
10686
|
const setupMutationCacheSubscription = () => {
|
|
10687
|
+
const { mutationCacheSubscriptions } = useDevtoolsSubscriptions();
|
|
10387
10688
|
const mutationCache = createMemo(() => {
|
|
10388
10689
|
return useQueryDevtoolsContext().client.getMutationCache();
|
|
10389
10690
|
});
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10691
|
+
createEffect(() => {
|
|
10692
|
+
const cache = mutationCache();
|
|
10693
|
+
let active = true;
|
|
10694
|
+
const unsubscribe = cache.subscribe((event) => {
|
|
10695
|
+
mutationCacheSubscriptions.notify(() => cache, event, (update) => {
|
|
10696
|
+
queueMicrotask(() => {
|
|
10697
|
+
if (active) update();
|
|
10698
|
+
});
|
|
10699
|
+
});
|
|
10700
|
+
});
|
|
10701
|
+
onCleanup(() => {
|
|
10702
|
+
active = false;
|
|
10703
|
+
unsubscribe();
|
|
10393
10704
|
});
|
|
10394
10705
|
});
|
|
10395
|
-
onCleanup(() => {
|
|
10396
|
-
mutationCacheMap.clear();
|
|
10397
|
-
unsubscribe();
|
|
10398
|
-
});
|
|
10399
|
-
return unsubscribe;
|
|
10400
10706
|
};
|
|
10401
10707
|
const createSubscribeToMutationCacheBatcher = (callback, equalityCheck = true) => {
|
|
10708
|
+
const { mutationCacheSubscriptions } = useDevtoolsSubscriptions();
|
|
10402
10709
|
const mutationCache = createMemo(() => {
|
|
10403
10710
|
return useQueryDevtoolsContext().client.getMutationCache();
|
|
10404
10711
|
});
|
|
@@ -10406,10 +10713,7 @@ const createSubscribeToMutationCacheBatcher = (callback, equalityCheck = true) =
|
|
|
10406
10713
|
createEffect(() => {
|
|
10407
10714
|
setValue(callback(mutationCache));
|
|
10408
10715
|
});
|
|
10409
|
-
|
|
10410
|
-
onCleanup(() => {
|
|
10411
|
-
mutationCacheMap.delete(callback);
|
|
10412
|
-
});
|
|
10716
|
+
mutationCacheSubscriptions.register(callback, setValue);
|
|
10413
10717
|
return value;
|
|
10414
10718
|
};
|
|
10415
10719
|
const DEV_TOOLS_EVENT = "@tanstack/query-devtools-event";
|
|
@@ -11480,4 +11784,4 @@ delegateEvents([
|
|
|
11480
11784
|
"input"
|
|
11481
11785
|
]);
|
|
11482
11786
|
//#endregion
|
|
11483
|
-
export { PiPProvider as a,
|
|
11787
|
+
export { PiPProvider as a, DevtoolsSubscriptionsProvider as c, createLocalStorage as d, ThemeContext as i, DevtoolsOfflineProvider as l, Devtools as n, THEME_PREFERENCE as o, ParentPanel as r, DevtoolsStateProvider as s, ContentView as t, QueryDevtoolsContext as u };
|