@tanstack/query-devtools 5.104.1 → 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.
Files changed (35) hide show
  1. package/build/Devtools-BTIH1dw_.js.map +1 -1
  2. package/build/{Devtools-DDPb_OXS.cjs → Devtools-CJHY2Wx-.cjs} +212 -5
  3. package/build/{Devtools-BR7-Ww0_.js → Devtools-DBqcRO2f.js} +212 -5
  4. package/build/{DevtoolsComponent-PDsMk_-d.js → DevtoolsComponent-BdsgosNO.js} +2 -2
  5. package/build/{DevtoolsComponent-DdJdz_3E.cjs → DevtoolsComponent-BjB9B9oL.cjs} +2 -2
  6. package/build/{DevtoolsPanelComponent-D7InkRel.cjs → DevtoolsPanelComponent-Co1Z91vW.cjs} +2 -2
  7. package/build/{DevtoolsPanelComponent-DWMNAgBe.js → DevtoolsPanelComponent-Jyh8juKn.js} +2 -2
  8. package/build/dev.cjs +3 -3
  9. package/build/dev.js +3 -3
  10. package/build/index.d.cts +81 -0
  11. package/build/index.d.cts.map +1 -1
  12. package/build/index.d.ts +81 -0
  13. package/build/index.d.ts.map +1 -1
  14. package/build/index.js.map +1 -1
  15. package/build/{utils-BSq_mRvI.cjs → utils-C0KLuaCQ.cjs} +57 -12
  16. package/build/{utils-Fz9uQv9N.js → utils-DPVWL709.js} +57 -12
  17. package/build/utils-po3vZo_N.js.map +1 -1
  18. package/package.json +4 -4
  19. package/src/Devtools.tsx +25 -0
  20. package/src/Explorer.tsx +18 -4
  21. package/src/TanstackQueryDevtools.tsx +11 -0
  22. package/src/TanstackQueryDevtoolsPanel.tsx +14 -0
  23. package/src/contexts/DevtoolsOfflineContext.ts +5 -0
  24. package/src/contexts/DevtoolsStateContext.ts +5 -0
  25. package/src/contexts/DevtoolsSubscriptionsContext.ts +5 -0
  26. package/src/contexts/PiPContext.tsx +13 -0
  27. package/src/contexts/QueryDevtoolsContext.ts +4 -0
  28. package/src/contexts/ThemeContext.ts +4 -0
  29. package/src/contexts/types.ts +96 -0
  30. package/src/createCacheSubscriptionRegistry.ts +18 -0
  31. package/src/icons/index.tsx +102 -0
  32. package/src/providers/DevtoolsOfflineProvider.tsx +6 -0
  33. package/src/providers/DevtoolsStateProvider.tsx +5 -0
  34. package/src/providers/DevtoolsSubscriptionsProvider.tsx +5 -0
  35. package/src/utils.tsx +59 -15
@@ -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-Fz9uQv9N.js";
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
  /**
@@ -240,12 +240,21 @@ const QueryDevtoolsContext = createContext({
240
240
  version: "",
241
241
  shadowDOMTarget: void 0
242
242
  });
243
+ /**
244
+ * Returns the devtools configuration from context, such as the `client` and the `onlineManager`.
245
+ * @returns The devtools configuration.
246
+ */
243
247
  function useQueryDevtoolsContext() {
244
248
  return useContext(QueryDevtoolsContext);
245
249
  }
246
250
  //#endregion
247
251
  //#region src/contexts/DevtoolsOfflineContext.ts
248
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
+ */
249
258
  function useDevtoolsOffline() {
250
259
  const state = useContext(DevtoolsOfflineContext);
251
260
  if (!state) throw new Error("Missing DevtoolsOfflineProvider");
@@ -253,6 +262,12 @@ function useDevtoolsOffline() {
253
262
  }
254
263
  //#endregion
255
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
+ */
256
271
  function DevtoolsOfflineProvider(props) {
257
272
  const [offline, setOffline] = createSignal(false);
258
273
  const context = useQueryDevtoolsContext();
@@ -278,8 +293,20 @@ function DevtoolsOfflineProvider(props) {
278
293
  }
279
294
  //#endregion
280
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
+ */
281
301
  function createCacheSubscriptionRegistry() {
282
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
+ */
283
310
  function register(callback, setter, shouldUpdate = () => true) {
284
311
  const id = Symbol();
285
312
  subscriptions.set(id, {
@@ -288,6 +315,12 @@ function createCacheSubscriptionRegistry() {
288
315
  });
289
316
  onCleanup(() => subscriptions.delete(id));
290
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
+ */
291
324
  function notify(cache, event, schedule = (update) => update()) {
292
325
  for (const [id, subscription] of subscriptions) {
293
326
  if (!subscription.shouldUpdate(event)) continue;
@@ -304,6 +337,11 @@ function createCacheSubscriptionRegistry() {
304
337
  //#endregion
305
338
  //#region src/contexts/DevtoolsSubscriptionsContext.ts
306
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
+ */
307
345
  function useDevtoolsSubscriptions() {
308
346
  const subscriptions = useContext(DevtoolsSubscriptionsContext);
309
347
  if (!subscriptions) throw new Error("Missing DevtoolsSubscriptionsProvider");
@@ -311,6 +349,11 @@ function useDevtoolsSubscriptions() {
311
349
  }
312
350
  //#endregion
313
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
+ */
314
357
  function DevtoolsSubscriptionsProvider(props) {
315
358
  const subscriptions = {
316
359
  queryCacheSubscriptions: createCacheSubscriptionRegistry(),
@@ -326,6 +369,11 @@ function DevtoolsSubscriptionsProvider(props) {
326
369
  //#endregion
327
370
  //#region src/contexts/DevtoolsStateContext.ts
328
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
+ */
329
377
  function useDevtoolsState() {
330
378
  const state = useContext(DevtoolsStateContext);
331
379
  if (!state) throw new Error("Missing DevtoolsStateProvider");
@@ -333,6 +381,11 @@ function useDevtoolsState() {
333
381
  }
334
382
  //#endregion
335
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
+ */
336
389
  function DevtoolsStateProvider(props) {
337
390
  const [selectedQueryHash, setSelectedQueryHash] = createSignal(null);
338
391
  const [selectedMutationId, setSelectedMutationId] = createSignal(null);
@@ -7599,54 +7652,123 @@ var _tmpl$20$1 = /*#__PURE__*/ template(`<svg width=14 height=14 viewBox="0 0 24
7599
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>`);
7600
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>`);
7601
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
+ */
7602
7659
  function Search() {
7603
7660
  return _tmpl$$2();
7604
7661
  }
7662
+ /**
7663
+ * Renders the trash icon.
7664
+ * @returns The icon's SVG element.
7665
+ */
7605
7666
  function Trash() {
7606
7667
  return _tmpl$2$2();
7607
7668
  }
7669
+ /**
7670
+ * Renders the chevron-down icon.
7671
+ * @returns The icon's SVG element.
7672
+ */
7608
7673
  function ChevronDown() {
7609
7674
  return _tmpl$3$2();
7610
7675
  }
7676
+ /**
7677
+ * Renders the up arrow icon.
7678
+ * @returns The icon's SVG element.
7679
+ */
7611
7680
  function ArrowUp() {
7612
7681
  return _tmpl$4$2();
7613
7682
  }
7683
+ /**
7684
+ * Renders the down arrow icon.
7685
+ * @returns The icon's SVG element.
7686
+ */
7614
7687
  function ArrowDown() {
7615
7688
  return _tmpl$5$2();
7616
7689
  }
7690
+ /**
7691
+ * Renders the left arrow icon.
7692
+ * @returns The icon's SVG element.
7693
+ */
7617
7694
  function ArrowLeft() {
7618
7695
  return _tmpl$6$2();
7619
7696
  }
7697
+ /**
7698
+ * Renders the right arrow icon.
7699
+ * @returns The icon's SVG element.
7700
+ */
7620
7701
  function ArrowRight() {
7621
7702
  return _tmpl$7$2();
7622
7703
  }
7704
+ /**
7705
+ * Renders the sun (light theme) icon.
7706
+ * @returns The icon's SVG element.
7707
+ */
7623
7708
  function Sun() {
7624
7709
  return _tmpl$8$2();
7625
7710
  }
7711
+ /**
7712
+ * Renders the moon (dark theme) icon.
7713
+ * @returns The icon's SVG element.
7714
+ */
7626
7715
  function Moon() {
7627
7716
  return _tmpl$9$2();
7628
7717
  }
7718
+ /**
7719
+ * Renders the monitor (system theme) icon.
7720
+ * @returns The icon's SVG element.
7721
+ */
7629
7722
  function Monitor() {
7630
7723
  return _tmpl$0$2();
7631
7724
  }
7725
+ /**
7726
+ * Renders the Wi-Fi (online) icon.
7727
+ * @returns The icon's SVG element.
7728
+ */
7632
7729
  function Wifi() {
7633
7730
  return _tmpl$1$2();
7634
7731
  }
7732
+ /**
7733
+ * Renders the offline icon.
7734
+ * @returns The icon's SVG element.
7735
+ */
7635
7736
  function Offline() {
7636
7737
  return _tmpl$10$2();
7637
7738
  }
7739
+ /**
7740
+ * Renders the settings icon.
7741
+ * @returns The icon's SVG element.
7742
+ */
7638
7743
  function Settings() {
7639
7744
  return _tmpl$11$1();
7640
7745
  }
7746
+ /**
7747
+ * Renders the picture-in-picture icon.
7748
+ * @returns The icon's SVG element.
7749
+ */
7641
7750
  function PiPIcon() {
7642
7751
  return _tmpl$12$1();
7643
7752
  }
7753
+ /**
7754
+ * Renders the copy icon.
7755
+ * @returns The icon's SVG element.
7756
+ */
7644
7757
  function Copier() {
7645
7758
  return _tmpl$13$1();
7646
7759
  }
7760
+ /**
7761
+ * Renders the pencil (edit) icon.
7762
+ * @returns The icon's SVG element.
7763
+ */
7647
7764
  function Pencil() {
7648
7765
  return _tmpl$14$1();
7649
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
+ */
7650
7772
  function CopiedCopier(props) {
7651
7773
  return (() => {
7652
7774
  var _el$15 = _tmpl$15$1(), _el$16 = _el$15.firstChild;
@@ -7654,12 +7776,25 @@ function CopiedCopier(props) {
7654
7776
  return _el$15;
7655
7777
  })();
7656
7778
  }
7779
+ /**
7780
+ * Renders the copy error icon.
7781
+ * @returns The icon's SVG element.
7782
+ */
7657
7783
  function ErrorCopier() {
7658
7784
  return _tmpl$16$1();
7659
7785
  }
7786
+ /**
7787
+ * Renders the list icon.
7788
+ * @returns The icon's SVG element.
7789
+ */
7660
7790
  function List() {
7661
7791
  return _tmpl$17$1();
7662
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
+ */
7663
7798
  function Check(props) {
7664
7799
  return [createComponent(Show, {
7665
7800
  get when() {
@@ -7681,18 +7816,38 @@ function Check(props) {
7681
7816
  }
7682
7817
  })];
7683
7818
  }
7819
+ /**
7820
+ * Renders the check circle icon.
7821
+ * @returns The icon's SVG element.
7822
+ */
7684
7823
  function CheckCircle() {
7685
7824
  return _tmpl$19$1();
7686
7825
  }
7826
+ /**
7827
+ * Renders the loading circle icon.
7828
+ * @returns The icon's SVG element.
7829
+ */
7687
7830
  function LoadingCircle() {
7688
7831
  return _tmpl$20$1();
7689
7832
  }
7833
+ /**
7834
+ * Renders the X circle icon.
7835
+ * @returns The icon's SVG element.
7836
+ */
7690
7837
  function XCircle() {
7691
7838
  return _tmpl$21$1();
7692
7839
  }
7840
+ /**
7841
+ * Renders the pause circle icon.
7842
+ * @returns The icon's SVG element.
7843
+ */
7693
7844
  function PauseCircle() {
7694
7845
  return _tmpl$22$1();
7695
7846
  }
7847
+ /**
7848
+ * Renders the TanStack logo.
7849
+ * @returns The logo's SVG element.
7850
+ */
7696
7851
  function TanstackLogo() {
7697
7852
  const id = createUniqueId();
7698
7853
  return (() => {
@@ -7785,6 +7940,14 @@ const DEFAULT_MUTATION_SORT_FN_NAME = Object.keys(mutationSortFns)[0];
7785
7940
  //#region src/contexts/PiPContext.tsx
7786
7941
  var PipOpenError = class extends Error {};
7787
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
+ */
7788
7951
  const PiPProvider = (props) => {
7789
7952
  const [pipWindow, setPipWindow] = createSignal(null);
7790
7953
  const closePipWindow = () => {
@@ -7886,6 +8049,11 @@ const PiPProvider = (props) => {
7886
8049
  }
7887
8050
  });
7888
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
+ */
7889
8057
  const usePiPWindow = () => {
7890
8058
  return createMemo(() => {
7891
8059
  const ctx = useContext(PiPContext);
@@ -7896,6 +8064,10 @@ const usePiPWindow = () => {
7896
8064
  //#endregion
7897
8065
  //#region src/contexts/ThemeContext.ts
7898
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
+ */
7899
8071
  function useTheme() {
7900
8072
  return useContext(ThemeContext);
7901
8073
  }
@@ -7914,11 +8086,13 @@ var _tmpl$0$1 = /*#__PURE__*/ template(`<span>`);
7914
8086
  var _tmpl$1$1 = /*#__PURE__*/ template(`<div><label>:`);
7915
8087
  var _tmpl$10$1 = /*#__PURE__*/ template(`<div><div><button> [<!>...<!>]`);
7916
8088
  /**
7917
- * Chunk elements in the array by size
7918
- *
7919
- * when the array cannot be chunked evenly by size, the last chunk will be
7920
- * filled with the remaining elements
8089
+ * Chunk elements in the array by size.
7921
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.
7922
8096
  * @example
7923
8097
  * chunkArray(['a','b', 'c', 'd', 'e'], 2) // returns [['a','b'], ['c', 'd'], ['e']]
7924
8098
  */
@@ -8082,9 +8256,21 @@ const ToggleValueButton = (props) => {
8082
8256
  return _el$5;
8083
8257
  })();
8084
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
+ */
8085
8264
  function isIterable(x) {
8086
8265
  return Symbol.iterator in x;
8087
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
+ */
8088
8274
  function Explorer(props) {
8089
8275
  const theme = useTheme();
8090
8276
  const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
@@ -8599,6 +8785,13 @@ var _tmpl$35 = /*#__PURE__*/ template(`<form><textarea name=data aria-label="Edi
8599
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">`);
8600
8786
  var _tmpl$37 = /*#__PURE__*/ template(`<option>`);
8601
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">`);
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
+ */
8602
8795
  const Devtools = (props) => {
8603
8796
  const theme = useTheme();
8604
8797
  const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
@@ -8768,6 +8961,12 @@ const PiPPanel = (props) => {
8768
8961
  return _el$5;
8769
8962
  })();
8770
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
+ */
8771
8970
  const ParentPanel = (props) => {
8772
8971
  const { panelWidth, setPanelWidth } = useDevtoolsState();
8773
8972
  const theme = useTheme();
@@ -8948,6 +9147,14 @@ const DraggablePanel = (props) => {
8948
9147
  return _el$7;
8949
9148
  })();
8950
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
+ */
8951
9158
  const ContentView = (props) => {
8952
9159
  const { selectedQueryHash, setSelectedQueryHash, selectedMutationId, setSelectedMutationId, panelWidth } = useDevtoolsState();
8953
9160
  const { offline, toggleOffline } = useDevtoolsOffline();
@@ -1,5 +1,5 @@
1
- import { L as createComponent, V as createMemo, a as getPreferredColorScheme } from "./utils-Fz9uQv9N.js";
2
- import { a as PiPProvider, c as DevtoolsSubscriptionsProvider, d as createLocalStorage, i as ThemeContext, l as DevtoolsOfflineProvider, n as Devtools, s as DevtoolsStateProvider, u as QueryDevtoolsContext } from "./Devtools-BR7-Ww0_.js";
1
+ import { L as createComponent, V as createMemo, a as getPreferredColorScheme } from "./utils-DPVWL709.js";
2
+ import { a as PiPProvider, c as DevtoolsSubscriptionsProvider, d as createLocalStorage, i as ThemeContext, l as DevtoolsOfflineProvider, n as Devtools, s as DevtoolsStateProvider, u as QueryDevtoolsContext } from "./Devtools-DBqcRO2f.js";
3
3
  //#region src/DevtoolsComponent.tsx
4
4
  const DevtoolsComponent = (props) => {
5
5
  const [localStore, setLocalStore] = createLocalStorage({ prefix: "TanstackQueryDevtools" });
@@ -1,5 +1,5 @@
1
- const require_utils = require("./utils-BSq_mRvI.cjs");
2
- const require_Devtools = require("./Devtools-DDPb_OXS.cjs");
1
+ const require_utils = require("./utils-C0KLuaCQ.cjs");
2
+ const require_Devtools = require("./Devtools-CJHY2Wx-.cjs");
3
3
  //#region src/DevtoolsComponent.tsx
4
4
  const DevtoolsComponent = (props) => {
5
5
  const [localStore, setLocalStore] = require_Devtools.createLocalStorage({ prefix: "TanstackQueryDevtools" });
@@ -1,5 +1,5 @@
1
- const require_utils = require("./utils-BSq_mRvI.cjs");
2
- const require_Devtools = require("./Devtools-DDPb_OXS.cjs");
1
+ const require_utils = require("./utils-C0KLuaCQ.cjs");
2
+ const require_Devtools = require("./Devtools-CJHY2Wx-.cjs");
3
3
  //#region src/DevtoolsPanelComponent.tsx
4
4
  const DevtoolsPanelComponent = (props) => {
5
5
  const [localStore, setLocalStore] = require_Devtools.createLocalStorage({ prefix: "TanstackQueryDevtools" });
@@ -1,5 +1,5 @@
1
- import { L as createComponent, V as createMemo, a as getPreferredColorScheme } from "./utils-Fz9uQv9N.js";
2
- import { a as PiPProvider, c as DevtoolsSubscriptionsProvider, d as createLocalStorage, i as ThemeContext, l as DevtoolsOfflineProvider, r as ParentPanel, s as DevtoolsStateProvider, t as ContentView, u as QueryDevtoolsContext } from "./Devtools-BR7-Ww0_.js";
1
+ import { L as createComponent, V as createMemo, a as getPreferredColorScheme } from "./utils-DPVWL709.js";
2
+ import { a as PiPProvider, c as DevtoolsSubscriptionsProvider, d as createLocalStorage, i as ThemeContext, l as DevtoolsOfflineProvider, r as ParentPanel, s as DevtoolsStateProvider, t as ContentView, u as QueryDevtoolsContext } from "./Devtools-DBqcRO2f.js";
3
3
  //#region src/DevtoolsPanelComponent.tsx
4
4
  const DevtoolsPanelComponent = (props) => {
5
5
  const [localStore, setLocalStore] = createLocalStorage({ prefix: "TanstackQueryDevtools" });
package/build/dev.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_utils = require("./utils-BSq_mRvI.cjs");
2
+ const require_utils = require("./utils-C0KLuaCQ.cjs");
3
3
  //#region src/TanstackQueryDevtools.tsx
4
4
  var TanstackQueryDevtools = class {
5
5
  #client;
@@ -64,7 +64,7 @@ var TanstackQueryDevtools = class {
64
64
  let Devtools;
65
65
  if (this.#Component) Devtools = this.#Component;
66
66
  else {
67
- Devtools = require_utils.lazy(() => Promise.resolve().then(() => require("./DevtoolsComponent-DdJdz_3E.cjs")));
67
+ Devtools = require_utils.lazy(() => Promise.resolve().then(() => require("./DevtoolsComponent-BjB9B9oL.cjs")));
68
68
  this.#Component = Devtools;
69
69
  }
70
70
  require_utils.setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
@@ -185,7 +185,7 @@ var TanstackQueryDevtoolsPanel = class {
185
185
  let Devtools;
186
186
  if (this.#Component) Devtools = this.#Component;
187
187
  else {
188
- Devtools = require_utils.lazy(() => Promise.resolve().then(() => require("./DevtoolsPanelComponent-D7InkRel.cjs")));
188
+ Devtools = require_utils.lazy(() => Promise.resolve().then(() => require("./DevtoolsPanelComponent-Co1Z91vW.cjs")));
189
189
  this.#Component = Devtools;
190
190
  }
191
191
  require_utils.setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
package/build/dev.js CHANGED
@@ -1,4 +1,4 @@
1
- import { J as mergeProps, L as createComponent, W as createSignal, d as setupStyleSheet, q as lazy, w as render } from "./utils-Fz9uQv9N.js";
1
+ import { J as mergeProps, L as createComponent, W as createSignal, d as setupStyleSheet, q as lazy, w as render } from "./utils-DPVWL709.js";
2
2
  //#region src/TanstackQueryDevtools.tsx
3
3
  var TanstackQueryDevtools = class {
4
4
  #client;
@@ -63,7 +63,7 @@ var TanstackQueryDevtools = class {
63
63
  let Devtools;
64
64
  if (this.#Component) Devtools = this.#Component;
65
65
  else {
66
- Devtools = lazy(() => import("./DevtoolsComponent-PDsMk_-d.js"));
66
+ Devtools = lazy(() => import("./DevtoolsComponent-BdsgosNO.js"));
67
67
  this.#Component = Devtools;
68
68
  }
69
69
  setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
@@ -184,7 +184,7 @@ var TanstackQueryDevtoolsPanel = class {
184
184
  let Devtools;
185
185
  if (this.#Component) Devtools = this.#Component;
186
186
  else {
187
- Devtools = lazy(() => import("./DevtoolsPanelComponent-DWMNAgBe.js"));
187
+ Devtools = lazy(() => import("./DevtoolsPanelComponent-Jyh8juKn.js"));
188
188
  this.#Component = Devtools;
189
189
  }
190
190
  setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
package/build/index.d.cts CHANGED
@@ -3,9 +3,22 @@ import "solid-js";
3
3
  //#region src/contexts/types.d.ts
4
4
  type XPosition = 'left' | 'right';
5
5
  type YPosition = 'top' | 'bottom';
6
+ /**
7
+ * The side of the screen the devtools panel opens on.
8
+ */
6
9
  type DevtoolsPosition = XPosition | YPosition;
10
+ /**
11
+ * The corner of the screen the toggle button is placed in, or `'relative'` to place it in the
12
+ * normal document flow.
13
+ */
7
14
  type DevtoolsButtonPosition = `${YPosition}-${XPosition}` | 'relative';
15
+ /**
16
+ * The color theme of the devtools. `'system'` follows the user's color scheme preference.
17
+ */
8
18
  type Theme = 'dark' | 'light' | 'system';
19
+ /**
20
+ * A custom error that can be triggered on a query from the devtools.
21
+ */
9
22
  interface DevtoolsErrorType {
10
23
  /**
11
24
  * The name of the error.
@@ -16,24 +29,78 @@ interface DevtoolsErrorType {
16
29
  */
17
30
  initializer: (query: Query) => Error;
18
31
  }
32
+ /**
33
+ * The options shared by every devtools entry point: the `client` to inspect, the adapter's
34
+ * `queryFlavor` and `version` shown in the header, and the display options.
35
+ * `onClose` is only used by the panel entry point.
36
+ */
19
37
  interface QueryDevtoolsProps {
38
+ /**
39
+ * The `QueryClient` whose caches the devtools inspect.
40
+ */
20
41
  readonly client: QueryClient;
42
+ /**
43
+ * The adapter name shown next to the logo in the header, e.g. `'React Query'`.
44
+ */
21
45
  queryFlavor: string;
46
+ /**
47
+ * The adapter version shown next to `queryFlavor` in the header.
48
+ */
22
49
  version: string;
50
+ /**
51
+ * The `onlineManager` the devtools read and toggle to simulate going offline.
52
+ */
23
53
  onlineManager: typeof onlineManager;
54
+ /**
55
+ * The position of the TanStack logo to open and close the devtools panel.
56
+ */
24
57
  buttonPosition?: DevtoolsButtonPosition;
58
+ /**
59
+ * The position of the devtools panel.
60
+ */
25
61
  position?: DevtoolsPosition;
62
+ /**
63
+ * Set this to `true` if you want the devtools to default to being open.
64
+ */
26
65
  initialIsOpen?: boolean;
66
+ /**
67
+ * Use this so you can define custom errors that can be shown in the devtools.
68
+ */
27
69
  errorTypes?: Array<DevtoolsErrorType>;
70
+ /**
71
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
72
+ * within the shadow DOM instead of within the head tag in the light DOM.
73
+ */
28
74
  shadowDOMTarget?: ShadowRoot;
75
+ /**
76
+ * Callback function that is called when the devtools panel is closed. Only used by the panel
77
+ * entry point.
78
+ */
29
79
  onClose?: () => void;
80
+ /**
81
+ * Set this to `true` to hide disabled queries from the devtools panel.
82
+ */
30
83
  hideDisabledQueries?: boolean;
84
+ /**
85
+ * Set this to `'light'`, `'dark'`, or `'system'` to change the theme of the devtools panel.
86
+ */
31
87
  theme?: Theme;
32
88
  }
33
89
  //#endregion
34
90
  //#region src/TanstackQueryDevtools.d.ts
91
+ /**
92
+ * The options for `TanstackQueryDevtools`, which mounts the floating devtools.
93
+ */
35
94
  interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
95
+ /**
96
+ * Use this to pass a nonce to the style tag that is added to the document head. This is useful if
97
+ * you are using a Content Security Policy (CSP) nonce to allow inline styles.
98
+ */
36
99
  styleNonce?: string;
100
+ /**
101
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
102
+ * within the shadow DOM instead of within the head tag in the light DOM.
103
+ */
37
104
  shadowDOMTarget?: ShadowRoot;
38
105
  }
39
106
  declare class TanstackQueryDevtools {
@@ -50,9 +117,23 @@ declare class TanstackQueryDevtools {
50
117
  }
51
118
  //#endregion
52
119
  //#region src/TanstackQueryDevtoolsPanel.d.ts
120
+ /**
121
+ * The options for `TanstackQueryDevtoolsPanel`, which mounts the devtools as an embedded panel.
122
+ */
53
123
  interface TanstackQueryDevtoolsPanelConfig extends QueryDevtoolsProps {
124
+ /**
125
+ * Use this to pass a nonce to the style tag that is added to the document head. This is useful if
126
+ * you are using a Content Security Policy (CSP) nonce to allow inline styles.
127
+ */
54
128
  styleNonce?: string;
129
+ /**
130
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
131
+ * within the shadow DOM instead of within the head tag in the light DOM.
132
+ */
55
133
  shadowDOMTarget?: ShadowRoot;
134
+ /**
135
+ * Callback function that is called when the devtools panel is closed.
136
+ */
56
137
  onClose?: () => void;
57
138
  }
58
139
  declare class TanstackQueryDevtoolsPanel {