@tanstack/query-devtools 5.4.2 → 5.8.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/index.d.cts CHANGED
@@ -26,6 +26,7 @@ interface QueryDevtoolsProps {
26
26
  }
27
27
 
28
28
  interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
29
+ styleNonce?: string;
29
30
  }
30
31
  declare class TanstackQueryDevtools {
31
32
  #private;
package/build/index.d.ts CHANGED
@@ -26,6 +26,7 @@ interface QueryDevtoolsProps {
26
26
  }
27
27
 
28
28
  interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
29
+ styleNonce?: string;
29
30
  }
30
31
  declare class TanstackQueryDevtools {
31
32
  #private;
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createSignal, render, lazy, createComponent, mergeProps } from './chunk/Z53XT47W.js';
1
+ import { createSignal, render, lazy, setupStyleSheet, createComponent, mergeProps } from './chunk/2CFRQNPI.js';
2
2
 
3
3
  // src/index.tsx
4
4
  var TanstackQueryDevtools = class {
@@ -7,6 +7,7 @@ var TanstackQueryDevtools = class {
7
7
  #queryFlavor;
8
8
  #version;
9
9
  #isMounted = false;
10
+ #styleNonce;
10
11
  #buttonPosition;
11
12
  #position;
12
13
  #initialIsOpen;
@@ -22,12 +23,14 @@ var TanstackQueryDevtools = class {
22
23
  buttonPosition,
23
24
  position,
24
25
  initialIsOpen,
25
- errorTypes
26
+ errorTypes,
27
+ styleNonce
26
28
  } = config;
27
29
  this.#client = createSignal(client);
28
30
  this.#queryFlavor = queryFlavor;
29
31
  this.#version = version;
30
32
  this.#onlineManager = onlineManager;
33
+ this.#styleNonce = styleNonce;
31
34
  this.#buttonPosition = createSignal(buttonPosition);
32
35
  this.#position = createSignal(position);
33
36
  this.#initialIsOpen = createSignal(initialIsOpen);
@@ -62,9 +65,10 @@ var TanstackQueryDevtools = class {
62
65
  if (this.#Component) {
63
66
  Devtools = this.#Component;
64
67
  } else {
65
- Devtools = lazy(() => import('./Devtools/HESZYUBG.js'));
68
+ Devtools = lazy(() => import('./Devtools/G2MVXYID.js'));
66
69
  this.#Component = Devtools;
67
70
  }
71
+ setupStyleSheet(this.#styleNonce);
68
72
  const _self$ = this;
69
73
  return createComponent(Devtools, mergeProps({
70
74
  get queryFlavor() {
package/build/index.jsx CHANGED
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  createSignal,
3
3
  lazy,
4
- render
5
- } from "./chunk/JRAMSUCV.jsx";
4
+ render,
5
+ setupStyleSheet
6
+ } from "./chunk/MJH6GUJH.jsx";
6
7
 
7
8
  // src/index.tsx
8
9
  var TanstackQueryDevtools = class {
@@ -11,6 +12,7 @@ var TanstackQueryDevtools = class {
11
12
  #queryFlavor;
12
13
  #version;
13
14
  #isMounted = false;
15
+ #styleNonce;
14
16
  #buttonPosition;
15
17
  #position;
16
18
  #initialIsOpen;
@@ -26,12 +28,14 @@ var TanstackQueryDevtools = class {
26
28
  buttonPosition,
27
29
  position,
28
30
  initialIsOpen,
29
- errorTypes
31
+ errorTypes,
32
+ styleNonce
30
33
  } = config;
31
34
  this.#client = createSignal(client);
32
35
  this.#queryFlavor = queryFlavor;
33
36
  this.#version = version;
34
37
  this.#onlineManager = onlineManager;
38
+ this.#styleNonce = styleNonce;
35
39
  this.#buttonPosition = createSignal(buttonPosition);
36
40
  this.#position = createSignal(position);
37
41
  this.#initialIsOpen = createSignal(initialIsOpen);
@@ -66,9 +70,10 @@ var TanstackQueryDevtools = class {
66
70
  if (this.#Component) {
67
71
  Devtools = this.#Component;
68
72
  } else {
69
- Devtools = lazy(() => import("./Devtools/KWB27UDF.jsx"));
73
+ Devtools = lazy(() => import("./Devtools/RGHE4TS2.jsx"));
70
74
  this.#Component = Devtools;
71
75
  }
76
+ setupStyleSheet(this.#styleNonce);
72
77
  return <Devtools
73
78
  queryFlavor={this.#queryFlavor}
74
79
  version={this.#version}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/query-devtools",
3
- "version": "5.4.2",
3
+ "version": "5.8.2",
4
4
  "description": "Developer tools to interact with and visualize the TanStack Query cache",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -45,12 +45,12 @@
45
45
  "@tanstack/match-sorter-utils": "^8.8.4",
46
46
  "clsx": "^2.0.0",
47
47
  "goober": "^2.1.13",
48
- "solid-js": "^1.7.8",
48
+ "solid-js": "^1.8.1",
49
49
  "solid-transition-group": "^0.2.2",
50
50
  "superjson": "^1.12.4",
51
51
  "tsup-preset-solid": "^2.1.0",
52
- "vite-plugin-solid": "^2.7.0",
53
- "@tanstack/query-core": "5.0.5"
52
+ "vite-plugin-solid": "^2.7.2",
53
+ "@tanstack/query-core": "5.8.2"
54
54
  },
55
55
  "scripts": {
56
56
  "clean": "rimraf ./build && rimraf ./coverage",
package/src/index.tsx CHANGED
@@ -1,5 +1,6 @@
1
1
  import { render } from 'solid-js/web'
2
2
  import { createSignal, lazy } from 'solid-js'
3
+ import { setupStyleSheet } from './utils'
3
4
  import type {
4
5
  QueryClient,
5
6
  onlineManager as TonlineManager,
@@ -14,7 +15,9 @@ import type {
14
15
  import type { Signal } from 'solid-js'
15
16
 
16
17
  export type { DevtoolsButtonPosition, DevtoolsPosition, DevToolsErrorType }
17
- export interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {}
18
+ export interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
19
+ styleNonce?: string
20
+ }
18
21
 
19
22
  class TanstackQueryDevtools {
20
23
  #client: Signal<QueryClient>
@@ -22,6 +25,7 @@ class TanstackQueryDevtools {
22
25
  #queryFlavor: string
23
26
  #version: string
24
27
  #isMounted = false
28
+ #styleNonce?: string
25
29
  #buttonPosition: Signal<DevtoolsButtonPosition | undefined>
26
30
  #position: Signal<DevtoolsPosition | undefined>
27
31
  #initialIsOpen: Signal<boolean | undefined>
@@ -39,11 +43,13 @@ class TanstackQueryDevtools {
39
43
  position,
40
44
  initialIsOpen,
41
45
  errorTypes,
46
+ styleNonce,
42
47
  } = config
43
48
  this.#client = createSignal(client)
44
49
  this.#queryFlavor = queryFlavor
45
50
  this.#version = version
46
51
  this.#onlineManager = onlineManager
52
+ this.#styleNonce = styleNonce
47
53
  this.#buttonPosition = createSignal(buttonPosition)
48
54
  this.#position = createSignal(position)
49
55
  this.#initialIsOpen = createSignal(initialIsOpen)
@@ -80,7 +86,6 @@ class TanstackQueryDevtools {
80
86
  const [isOpen] = this.#initialIsOpen
81
87
  const [errors] = this.#errorTypes
82
88
  const [queryClient] = this.#client
83
-
84
89
  let Devtools: typeof DevtoolsComponent
85
90
 
86
91
  if (this.#Component) {
@@ -90,6 +95,7 @@ class TanstackQueryDevtools {
90
95
  this.#Component = Devtools
91
96
  }
92
97
 
98
+ setupStyleSheet(this.#styleNonce)
93
99
  return (
94
100
  <Devtools
95
101
  queryFlavor={this.#queryFlavor}
package/src/utils.tsx CHANGED
@@ -310,3 +310,17 @@ export const deleteNestedDataByPath = (
310
310
 
311
311
  return oldData
312
312
  }
313
+
314
+ // Sets up the goober stylesheet
315
+ // Adds a nonce to the style tag if needed
316
+ export const setupStyleSheet = (nonce?: string) => {
317
+ if (!nonce) return
318
+ const styleExists = document.querySelector('#_goober')
319
+ if (styleExists) return
320
+ const styleTag = document.createElement('style')
321
+ const textNode = document.createTextNode('')
322
+ styleTag.appendChild(textNode)
323
+ styleTag.id = '_goober'
324
+ styleTag.setAttribute('nonce', nonce)
325
+ document.head.appendChild(styleTag)
326
+ }