@tanstack/react-query-devtools 5.104.1 → 5.104.3

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 (48) hide show
  1. package/build/legacy/ReactQueryDevtools.cjs +6 -0
  2. package/build/legacy/ReactQueryDevtools.cjs.map +1 -1
  3. package/build/legacy/ReactQueryDevtools.d.cts +12 -4
  4. package/build/legacy/ReactQueryDevtools.d.cts.map +1 -1
  5. package/build/legacy/ReactQueryDevtools.d.ts +12 -4
  6. package/build/legacy/ReactQueryDevtools.d.ts.map +1 -1
  7. package/build/legacy/ReactQueryDevtools.js +6 -0
  8. package/build/legacy/ReactQueryDevtools.js.map +1 -1
  9. package/build/legacy/ReactQueryDevtoolsPanel.cjs +5 -0
  10. package/build/legacy/ReactQueryDevtoolsPanel.cjs.map +1 -1
  11. package/build/legacy/ReactQueryDevtoolsPanel.d.cts +10 -2
  12. package/build/legacy/ReactQueryDevtoolsPanel.d.cts.map +1 -1
  13. package/build/legacy/ReactQueryDevtoolsPanel.d.ts +10 -2
  14. package/build/legacy/ReactQueryDevtoolsPanel.d.ts.map +1 -1
  15. package/build/legacy/ReactQueryDevtoolsPanel.js +5 -0
  16. package/build/legacy/ReactQueryDevtoolsPanel.js.map +1 -1
  17. package/build/legacy/index.cjs.map +1 -1
  18. package/build/legacy/index.d.cts +3 -0
  19. package/build/legacy/index.d.cts.map +1 -1
  20. package/build/legacy/index.d.ts +3 -0
  21. package/build/legacy/index.d.ts.map +1 -1
  22. package/build/legacy/index.js.map +1 -1
  23. package/build/modern/ReactQueryDevtools.cjs +6 -0
  24. package/build/modern/ReactQueryDevtools.cjs.map +1 -1
  25. package/build/modern/ReactQueryDevtools.d.cts +12 -4
  26. package/build/modern/ReactQueryDevtools.d.cts.map +1 -1
  27. package/build/modern/ReactQueryDevtools.d.ts +12 -4
  28. package/build/modern/ReactQueryDevtools.d.ts.map +1 -1
  29. package/build/modern/ReactQueryDevtools.js +6 -0
  30. package/build/modern/ReactQueryDevtools.js.map +1 -1
  31. package/build/modern/ReactQueryDevtoolsPanel.cjs +5 -0
  32. package/build/modern/ReactQueryDevtoolsPanel.cjs.map +1 -1
  33. package/build/modern/ReactQueryDevtoolsPanel.d.cts +10 -2
  34. package/build/modern/ReactQueryDevtoolsPanel.d.cts.map +1 -1
  35. package/build/modern/ReactQueryDevtoolsPanel.d.ts +10 -2
  36. package/build/modern/ReactQueryDevtoolsPanel.d.ts.map +1 -1
  37. package/build/modern/ReactQueryDevtoolsPanel.js +5 -0
  38. package/build/modern/ReactQueryDevtoolsPanel.js.map +1 -1
  39. package/build/modern/index.cjs.map +1 -1
  40. package/build/modern/index.d.cts +3 -0
  41. package/build/modern/index.d.cts.map +1 -1
  42. package/build/modern/index.d.ts +3 -0
  43. package/build/modern/index.d.ts.map +1 -1
  44. package/build/modern/index.js.map +1 -1
  45. package/package.json +7 -7
  46. package/src/ReactQueryDevtools.tsx +12 -4
  47. package/src/ReactQueryDevtoolsPanel.tsx +10 -2
  48. package/src/index.ts +3 -0
@@ -7,6 +7,12 @@ let _tanstack_react_query = require("@tanstack/react-query");
7
7
  let _tanstack_query_devtools = require("@tanstack/query-devtools");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  //#region src/ReactQueryDevtools.tsx
10
+ /**
11
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
12
+ * nearest `QueryClient`.
13
+ * @param props - The devtools options.
14
+ * @returns The element the devtools are mounted in.
15
+ */
10
16
  function ReactQueryDevtools(props) {
11
17
  const queryClient = (0, _tanstack_react_query.useQueryClient)(props.client);
12
18
  const ref = react.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtools.cjs","names":["useQueryClient","React","TanstackQueryDevtools"],"sources":["../../src/ReactQueryDevtools.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsErrorType,\n DevtoolsPosition,\n Theme,\n} from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n *\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n *\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this so you can attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n *\n * @defaultValue system\n */\n theme?: Theme\n}\n\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n React.useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n React.useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref}></div>\n}\n"],"mappings":";;;;;;;;;AA2DA,SAAgB,mBACd,OAC2B;CAC3B,MAAM,eAAA,GAAcA,sBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,MAAMC,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAYA,MAAM,SACvB,IAAIC,yBAAAA,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,sBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,MAAM,gBAAgB;EACpB,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,MAAM,gBAAgB;EACpB,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAU,CAAA;AACzE"}
1
+ {"version":3,"file":"ReactQueryDevtools.cjs","names":["useQueryClient","React","TanstackQueryDevtools"],"sources":["../../src/ReactQueryDevtools.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsErrorType,\n DevtoolsPosition,\n Theme,\n} from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\n/**\n * The props of `ReactQueryDevtools`, which renders the devtools with a toggle button that opens\n * them.\n */\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or\n * nearest `QueryClient`.\n * @param props - The devtools options.\n * @returns The element the devtools are mounted in.\n */\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n React.useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n React.useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref}></div>\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmEA,SAAgB,mBACd,OAC2B;CAC3B,MAAM,eAAA,GAAcA,sBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,MAAMC,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAYA,MAAM,SACvB,IAAIC,yBAAAA,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,sBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,MAAM,gBAAgB;EACpB,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,MAAM,gBAAgB;EACpB,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAU,CAAA;AACzE"}
@@ -4,6 +4,10 @@ import { QueryClient } from "@tanstack/react-query";
4
4
  declare namespace ReactQueryDevtools_d_exports {
5
5
  export { DevtoolsOptions, ReactQueryDevtools };
6
6
  }
7
+ /**
8
+ * The props of `ReactQueryDevtools`, which renders the devtools with a toggle button that opens
9
+ * them.
10
+ */
7
11
  export interface DevtoolsOptions {
8
12
  /**
9
13
  * Set this true if you want the dev tools to default to being open
@@ -12,14 +16,12 @@ export interface DevtoolsOptions {
12
16
  /**
13
17
  * The position of the TanStack logo to open and close the devtools panel.
14
18
  * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
15
- *
16
19
  * @defaultValue bottom-right
17
20
  */
18
21
  buttonPosition?: DevtoolsButtonPosition;
19
22
  /**
20
23
  * The position of the React Query devtools panel.
21
24
  * 'top' | 'bottom' | 'left' | 'right'
22
- *
23
25
  * @defaultValue bottom
24
26
  */
25
27
  position?: DevtoolsPosition;
@@ -36,7 +38,8 @@ export interface DevtoolsOptions {
36
38
  */
37
39
  styleNonce?: string;
38
40
  /**
39
- * Use this so you can attach the devtool's styles to specific element in the DOM.
41
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
42
+ * within the shadow DOM instead of within the head tag in the light DOM.
40
43
  */
41
44
  shadowDOMTarget?: ShadowRoot;
42
45
  /**
@@ -45,11 +48,16 @@ export interface DevtoolsOptions {
45
48
  hideDisabledQueries?: boolean;
46
49
  /**
47
50
  * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
48
- *
49
51
  * @defaultValue system
50
52
  */
51
53
  theme?: Theme;
52
54
  }
55
+ /**
56
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
57
+ * nearest `QueryClient`.
58
+ * @param props - The devtools options.
59
+ * @returns The element the devtools are mounted in.
60
+ */
53
61
  export declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement | null;
54
62
  //#endregion
55
63
  export { ReactQueryDevtools_d_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtools.d.cts","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"mappings":";;;;;;iBAYiB;;;;EAIf;;;;;;;EAOA,iBAAiB;;;;;;;EAOjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;EAIA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;wBAGM,mBACd,OAAO,kBACN,MAAM"}
1
+ {"version":3,"file":"ReactQueryDevtools.d.cts","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"mappings":";;;;;;;;;;iBAgBiB;;;;EAIf;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;EAKA,QAAQ;;;;;;;;wBASM,mBACd,OAAO,kBACN,MAAM"}
@@ -4,6 +4,10 @@ import { DevtoolsButtonPosition, DevtoolsErrorType, DevtoolsPosition, Theme } fr
4
4
  declare namespace ReactQueryDevtools_d_exports {
5
5
  export { DevtoolsOptions, ReactQueryDevtools };
6
6
  }
7
+ /**
8
+ * The props of `ReactQueryDevtools`, which renders the devtools with a toggle button that opens
9
+ * them.
10
+ */
7
11
  export interface DevtoolsOptions {
8
12
  /**
9
13
  * Set this true if you want the dev tools to default to being open
@@ -12,14 +16,12 @@ export interface DevtoolsOptions {
12
16
  /**
13
17
  * The position of the TanStack logo to open and close the devtools panel.
14
18
  * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
15
- *
16
19
  * @defaultValue bottom-right
17
20
  */
18
21
  buttonPosition?: DevtoolsButtonPosition;
19
22
  /**
20
23
  * The position of the React Query devtools panel.
21
24
  * 'top' | 'bottom' | 'left' | 'right'
22
- *
23
25
  * @defaultValue bottom
24
26
  */
25
27
  position?: DevtoolsPosition;
@@ -36,7 +38,8 @@ export interface DevtoolsOptions {
36
38
  */
37
39
  styleNonce?: string;
38
40
  /**
39
- * Use this so you can attach the devtool's styles to specific element in the DOM.
41
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
42
+ * within the shadow DOM instead of within the head tag in the light DOM.
40
43
  */
41
44
  shadowDOMTarget?: ShadowRoot;
42
45
  /**
@@ -45,11 +48,16 @@ export interface DevtoolsOptions {
45
48
  hideDisabledQueries?: boolean;
46
49
  /**
47
50
  * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
48
- *
49
51
  * @defaultValue system
50
52
  */
51
53
  theme?: Theme;
52
54
  }
55
+ /**
56
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
57
+ * nearest `QueryClient`.
58
+ * @param props - The devtools options.
59
+ * @returns The element the devtools are mounted in.
60
+ */
53
61
  export declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement | null;
54
62
  //#endregion
55
63
  export { ReactQueryDevtools_d_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtools.d.ts","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"mappings":";;;;;;iBAYiB;;;;EAIf;;;;;;;EAOA,iBAAiB;;;;;;;EAOjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;EAIA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;wBAGM,mBACd,OAAO,kBACN,MAAM"}
1
+ {"version":3,"file":"ReactQueryDevtools.d.ts","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"mappings":";;;;;;;;;;iBAgBiB;;;;EAIf;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;EAKA,QAAQ;;;;;;;;wBASM,mBACd,OAAO,kBACN,MAAM"}
@@ -4,6 +4,12 @@ import { onlineManager, useQueryClient } from "@tanstack/react-query";
4
4
  import { TanstackQueryDevtools } from "@tanstack/query-devtools";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region src/ReactQueryDevtools.tsx
7
+ /**
8
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
9
+ * nearest `QueryClient`.
10
+ * @param props - The devtools options.
11
+ * @returns The element the devtools are mounted in.
12
+ */
7
13
  function ReactQueryDevtools(props) {
8
14
  const queryClient = useQueryClient(props.client);
9
15
  const ref = React.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtools.js","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsErrorType,\n DevtoolsPosition,\n Theme,\n} from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n *\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n *\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this so you can attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n *\n * @defaultValue system\n */\n theme?: Theme\n}\n\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n React.useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n React.useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref}></div>\n}\n"],"mappings":";;;;;;AA2DA,SAAgB,mBACd,OAC2B;CAC3B,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,MAAM,SACvB,IAAI,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,MAAM,gBAAgB;EACpB,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,MAAM,gBAAgB;EACpB,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,oBAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAU,CAAA;AACzE"}
1
+ {"version":3,"file":"ReactQueryDevtools.js","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsErrorType,\n DevtoolsPosition,\n Theme,\n} from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\n/**\n * The props of `ReactQueryDevtools`, which renders the devtools with a toggle button that opens\n * them.\n */\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or\n * nearest `QueryClient`.\n * @param props - The devtools options.\n * @returns The element the devtools are mounted in.\n */\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n React.useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n React.useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref}></div>\n}\n"],"mappings":";;;;;;;;;;;;AAmEA,SAAgB,mBACd,OAC2B;CAC3B,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,MAAM,SACvB,IAAI,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,MAAM,gBAAgB;EACpB,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,MAAM,gBAAgB;EACpB,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,oBAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAU,CAAA;AACzE"}
@@ -7,6 +7,11 @@ let _tanstack_react_query = require("@tanstack/react-query");
7
7
  let _tanstack_query_devtools = require("@tanstack/query-devtools");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  //#region src/ReactQueryDevtoolsPanel.tsx
10
+ /**
11
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
12
+ * @param props - The devtools panel options.
13
+ * @returns The element the devtools panel is mounted in.
14
+ */
10
15
  function ReactQueryDevtoolsPanel(props) {
11
16
  const queryClient = (0, _tanstack_react_query.useQueryClient)(props.client);
12
17
  const ref = react.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtoolsPanel.cjs","names":["useQueryClient","React","TanstackQueryDevtoolsPanel"],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\nexport interface DevtoolsPanelOptions {\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this so you can attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n\n /**\n * Custom styles for the devtools panel\n * @default { height: '500px' }\n * @example { height: '100%' }\n * @example { height: '100%', width: '100%' }\n */\n style?: React.CSSProperties\n\n /**\n * Callback function that is called when the devtools panel is closed\n */\n onClose?: () => void\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n *\n * @defaultValue system\n */\n theme?: Theme\n}\n\nexport function ReactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition: 'bottom-left',\n position: 'bottom',\n initialIsOpen: true,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n onClose: props.onClose,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return (\n <div\n style={{ height: '500px', ...props.style }}\n className=\"tsqd-parent-container\"\n ref={ref}\n ></div>\n )\n}\n"],"mappings":";;;;;;;;;AAiDA,SAAgB,wBACd,OAC2B;CAC3B,MAAM,eAAA,GAAcA,sBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,MAAMC,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAYA,MAAM,SACvB,IAAIC,yBAAAA,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,sBAAA;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACD,CAAA;AAEV"}
1
+ {"version":3,"file":"ReactQueryDevtoolsPanel.cjs","names":["useQueryClient","React","TanstackQueryDevtoolsPanel"],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\n/**\n * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport interface DevtoolsPanelOptions {\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n\n /**\n * Custom styles for the devtools panel\n * @default { height: '500px' }\n * @example { height: '100%' }\n * @example { height: '100%', width: '100%' }\n */\n style?: React.CSSProperties\n\n /**\n * Callback function that is called when the devtools panel is closed\n */\n onClose?: () => void\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.\n * @param props - The devtools panel options.\n * @returns The element the devtools panel is mounted in.\n */\nexport function ReactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition: 'bottom-left',\n position: 'bottom',\n initialIsOpen: true,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n onClose: props.onClose,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return (\n <div\n style={{ height: '500px', ...props.style }}\n className=\"tsqd-parent-container\"\n ref={ref}\n ></div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAyDA,SAAgB,wBACd,OAC2B;CAC3B,MAAM,eAAA,GAAcA,sBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,MAAMC,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAYA,MAAM,SACvB,IAAIC,yBAAAA,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,sBAAA;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACD,CAAA;AAEV"}
@@ -4,6 +4,9 @@ import { QueryClient } from "@tanstack/react-query";
4
4
  declare namespace ReactQueryDevtoolsPanel_d_exports {
5
5
  export { DevtoolsPanelOptions, ReactQueryDevtoolsPanel };
6
6
  }
7
+ /**
8
+ * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.
9
+ */
7
10
  export interface DevtoolsPanelOptions {
8
11
  /**
9
12
  * Custom instance of QueryClient
@@ -18,7 +21,8 @@ export interface DevtoolsPanelOptions {
18
21
  */
19
22
  styleNonce?: string;
20
23
  /**
21
- * Use this so you can attach the devtool's styles to specific element in the DOM.
24
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
25
+ * within the shadow DOM instead of within the head tag in the light DOM.
22
26
  */
23
27
  shadowDOMTarget?: ShadowRoot;
24
28
  /**
@@ -38,11 +42,15 @@ export interface DevtoolsPanelOptions {
38
42
  hideDisabledQueries?: boolean;
39
43
  /**
40
44
  * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
41
- *
42
45
  * @defaultValue system
43
46
  */
44
47
  theme?: Theme;
45
48
  }
49
+ /**
50
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
51
+ * @param props - The devtools panel options.
52
+ * @returns The element the devtools panel is mounted in.
53
+ */
46
54
  export declare function ReactQueryDevtoolsPanel(props: DevtoolsPanelOptions): React.ReactElement | null;
47
55
  //#endregion
48
56
  export { ReactQueryDevtoolsPanel_d_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtoolsPanel.d.cts","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;iBAOiB;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;EAIA,kBAAkB;;;;;;;EAQlB,QAAQ,MAAM;;;;EAKd;;;;EAIA;;;;;;EAMA,QAAQ;;wBAGM,wBACd,OAAO,uBACN,MAAM"}
1
+ {"version":3,"file":"ReactQueryDevtoolsPanel.d.cts","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;;;;iBAUiB;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQ,MAAM;;;;EAKd;;;;EAIA;;;;;EAKA,QAAQ;;;;;;;wBAQM,wBACd,OAAO,uBACN,MAAM"}
@@ -4,6 +4,9 @@ import { DevtoolsErrorType, Theme } from "@tanstack/query-devtools";
4
4
  declare namespace ReactQueryDevtoolsPanel_d_exports {
5
5
  export { DevtoolsPanelOptions, ReactQueryDevtoolsPanel };
6
6
  }
7
+ /**
8
+ * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.
9
+ */
7
10
  export interface DevtoolsPanelOptions {
8
11
  /**
9
12
  * Custom instance of QueryClient
@@ -18,7 +21,8 @@ export interface DevtoolsPanelOptions {
18
21
  */
19
22
  styleNonce?: string;
20
23
  /**
21
- * Use this so you can attach the devtool's styles to specific element in the DOM.
24
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
25
+ * within the shadow DOM instead of within the head tag in the light DOM.
22
26
  */
23
27
  shadowDOMTarget?: ShadowRoot;
24
28
  /**
@@ -38,11 +42,15 @@ export interface DevtoolsPanelOptions {
38
42
  hideDisabledQueries?: boolean;
39
43
  /**
40
44
  * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
41
- *
42
45
  * @defaultValue system
43
46
  */
44
47
  theme?: Theme;
45
48
  }
49
+ /**
50
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
51
+ * @param props - The devtools panel options.
52
+ * @returns The element the devtools panel is mounted in.
53
+ */
46
54
  export declare function ReactQueryDevtoolsPanel(props: DevtoolsPanelOptions): React.ReactElement | null;
47
55
  //#endregion
48
56
  export { ReactQueryDevtoolsPanel_d_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtoolsPanel.d.ts","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;iBAOiB;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;EAIA,kBAAkB;;;;;;;EAQlB,QAAQ,MAAM;;;;EAKd;;;;EAIA;;;;;;EAMA,QAAQ;;wBAGM,wBACd,OAAO,uBACN,MAAM"}
1
+ {"version":3,"file":"ReactQueryDevtoolsPanel.d.ts","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;;;;iBAUiB;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQ,MAAM;;;;EAKd;;;;EAIA;;;;;EAKA,QAAQ;;;;;;;wBAQM,wBACd,OAAO,uBACN,MAAM"}
@@ -4,6 +4,11 @@ import { onlineManager, useQueryClient } from "@tanstack/react-query";
4
4
  import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region src/ReactQueryDevtoolsPanel.tsx
7
+ /**
8
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
9
+ * @param props - The devtools panel options.
10
+ * @returns The element the devtools panel is mounted in.
11
+ */
7
12
  function ReactQueryDevtoolsPanel(props) {
8
13
  const queryClient = useQueryClient(props.client);
9
14
  const ref = React.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtoolsPanel.js","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\nexport interface DevtoolsPanelOptions {\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this so you can attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n\n /**\n * Custom styles for the devtools panel\n * @default { height: '500px' }\n * @example { height: '100%' }\n * @example { height: '100%', width: '100%' }\n */\n style?: React.CSSProperties\n\n /**\n * Callback function that is called when the devtools panel is closed\n */\n onClose?: () => void\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n *\n * @defaultValue system\n */\n theme?: Theme\n}\n\nexport function ReactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition: 'bottom-left',\n position: 'bottom',\n initialIsOpen: true,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n onClose: props.onClose,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return (\n <div\n style={{ height: '500px', ...props.style }}\n className=\"tsqd-parent-container\"\n ref={ref}\n ></div>\n )\n}\n"],"mappings":";;;;;;AAiDA,SAAgB,wBACd,OAC2B;CAC3B,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,MAAM,SACvB,IAAI,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,oBAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACD,CAAA;AAEV"}
1
+ {"version":3,"file":"ReactQueryDevtoolsPanel.js","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\n/**\n * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport interface DevtoolsPanelOptions {\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n\n /**\n * Custom styles for the devtools panel\n * @default { height: '500px' }\n * @example { height: '100%' }\n * @example { height: '100%', width: '100%' }\n */\n style?: React.CSSProperties\n\n /**\n * Callback function that is called when the devtools panel is closed\n */\n onClose?: () => void\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.\n * @param props - The devtools panel options.\n * @returns The element the devtools panel is mounted in.\n */\nexport function ReactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition: 'bottom-left',\n position: 'bottom',\n initialIsOpen: true,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n onClose: props.onClose,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return (\n <div\n style={{ height: '500px', ...props.style }}\n className=\"tsqd-parent-container\"\n ref={ref}\n ></div>\n )\n}\n"],"mappings":";;;;;;;;;;;AAyDA,SAAgB,wBACd,OAC2B;CAC3B,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,MAAM,SACvB,IAAI,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,oBAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACD,CAAA;AAEV"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["'use client'\n\nimport * as Devtools from './ReactQueryDevtools'\nimport * as DevtoolsPanel from './ReactQueryDevtoolsPanel'\n\nexport const ReactQueryDevtools: (typeof Devtools)['ReactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.ReactQueryDevtools\n\nexport const ReactQueryDevtoolsPanel: (typeof DevtoolsPanel)['ReactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.ReactQueryDevtoolsPanel\n\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;;AAKA,MAAa,qBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,2BAAA;AAGN,MAAa,0BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,gCAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["'use client'\n\nimport * as Devtools from './ReactQueryDevtools'\nimport * as DevtoolsPanel from './ReactQueryDevtoolsPanel'\n\nexport const ReactQueryDevtools: (typeof Devtools)['ReactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.ReactQueryDevtools\n\nexport const ReactQueryDevtoolsPanel: (typeof DevtoolsPanel)['ReactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.ReactQueryDevtoolsPanel\n\n/**\n * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;;AAKA,MAAa,qBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,2BAAA;AAGN,MAAa,0BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,gCAAA"}
@@ -3,6 +3,9 @@ import { DevtoolsPanelOptions as DevtoolsPanelOptions$1, t as ReactQueryDevtools
3
3
  //#region src/index.d.ts
4
4
  export declare const ReactQueryDevtools: (typeof ReactQueryDevtools_d_exports)['ReactQueryDevtools'];
5
5
  export declare const ReactQueryDevtoolsPanel: (typeof ReactQueryDevtoolsPanel_d_exports)['ReactQueryDevtoolsPanel'];
6
+ /**
7
+ * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.
8
+ */
6
9
  export type DevtoolsPanelOptions = DevtoolsPanelOptions$1;
7
10
  //#endregion
8
11
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAKa,4BAA4BA;qBAO5B,iCAAiCC;YAOlC,uBAAuBC"}
1
+ {"version":3,"file":"index.d.cts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAKa,4BAA4BA;qBAO5B,iCAAiCC;;;;YAUlC,uBAAuBC"}
@@ -3,6 +3,9 @@ import { DevtoolsPanelOptions as DevtoolsPanelOptions$1, t as ReactQueryDevtools
3
3
  //#region src/index.d.ts
4
4
  export declare const ReactQueryDevtools: (typeof ReactQueryDevtools_d_exports)['ReactQueryDevtools'];
5
5
  export declare const ReactQueryDevtoolsPanel: (typeof ReactQueryDevtoolsPanel_d_exports)['ReactQueryDevtoolsPanel'];
6
+ /**
7
+ * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.
8
+ */
6
9
  export type DevtoolsPanelOptions = DevtoolsPanelOptions$1;
7
10
  //#endregion
8
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAKa,4BAA4BA;qBAO5B,iCAAiCC;YAOlC,uBAAuBC"}
1
+ {"version":3,"file":"index.d.ts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAKa,4BAA4BA;qBAO5B,iCAAiCC;;;;YAUlC,uBAAuBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Devtools.ReactQueryDevtools","DevtoolsPanel.ReactQueryDevtoolsPanel"],"sources":["../../src/index.ts"],"sourcesContent":["'use client'\n\nimport * as Devtools from './ReactQueryDevtools'\nimport * as DevtoolsPanel from './ReactQueryDevtoolsPanel'\n\nexport const ReactQueryDevtools: (typeof Devtools)['ReactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.ReactQueryDevtools\n\nexport const ReactQueryDevtoolsPanel: (typeof DevtoolsPanel)['ReactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.ReactQueryDevtoolsPanel\n\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;AAKA,MAAa,qBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAA;AAEN,MAAa,0BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAC"}
1
+ {"version":3,"file":"index.js","names":["Devtools.ReactQueryDevtools","DevtoolsPanel.ReactQueryDevtoolsPanel"],"sources":["../../src/index.ts"],"sourcesContent":["'use client'\n\nimport * as Devtools from './ReactQueryDevtools'\nimport * as DevtoolsPanel from './ReactQueryDevtoolsPanel'\n\nexport const ReactQueryDevtools: (typeof Devtools)['ReactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.ReactQueryDevtools\n\nexport const ReactQueryDevtoolsPanel: (typeof DevtoolsPanel)['ReactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.ReactQueryDevtoolsPanel\n\n/**\n * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;AAKA,MAAa,qBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAA;AAEN,MAAa,0BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAC"}
@@ -7,6 +7,12 @@ let _tanstack_react_query = require("@tanstack/react-query");
7
7
  let _tanstack_query_devtools = require("@tanstack/query-devtools");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  //#region src/ReactQueryDevtools.tsx
10
+ /**
11
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
12
+ * nearest `QueryClient`.
13
+ * @param props - The devtools options.
14
+ * @returns The element the devtools are mounted in.
15
+ */
10
16
  function ReactQueryDevtools(props) {
11
17
  const queryClient = (0, _tanstack_react_query.useQueryClient)(props.client);
12
18
  const ref = react.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtools.cjs","names":["useQueryClient","React","TanstackQueryDevtools"],"sources":["../../src/ReactQueryDevtools.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsErrorType,\n DevtoolsPosition,\n Theme,\n} from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n *\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n *\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this so you can attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n *\n * @defaultValue system\n */\n theme?: Theme\n}\n\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n React.useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n React.useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref}></div>\n}\n"],"mappings":";;;;;;;;;AA2DA,SAAgB,mBACd,OAC2B;CAC3B,MAAM,eAAA,GAAcA,sBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,MAAMC,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAYA,MAAM,SACvB,IAAIC,yBAAAA,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,sBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,MAAM,gBAAgB;EACpB,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,MAAM,gBAAgB;EACpB,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAU,CAAA;AACzE"}
1
+ {"version":3,"file":"ReactQueryDevtools.cjs","names":["useQueryClient","React","TanstackQueryDevtools"],"sources":["../../src/ReactQueryDevtools.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsErrorType,\n DevtoolsPosition,\n Theme,\n} from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\n/**\n * The props of `ReactQueryDevtools`, which renders the devtools with a toggle button that opens\n * them.\n */\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or\n * nearest `QueryClient`.\n * @param props - The devtools options.\n * @returns The element the devtools are mounted in.\n */\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n React.useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n React.useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref}></div>\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmEA,SAAgB,mBACd,OAC2B;CAC3B,MAAM,eAAA,GAAcA,sBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,MAAMC,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAYA,MAAM,SACvB,IAAIC,yBAAAA,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,sBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,MAAM,gBAAgB;EACpB,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,MAAM,gBAAgB;EACpB,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAU,CAAA;AACzE"}
@@ -4,6 +4,10 @@ import { QueryClient } from "@tanstack/react-query";
4
4
  declare namespace ReactQueryDevtools_d_exports {
5
5
  export { DevtoolsOptions, ReactQueryDevtools };
6
6
  }
7
+ /**
8
+ * The props of `ReactQueryDevtools`, which renders the devtools with a toggle button that opens
9
+ * them.
10
+ */
7
11
  export interface DevtoolsOptions {
8
12
  /**
9
13
  * Set this true if you want the dev tools to default to being open
@@ -12,14 +16,12 @@ export interface DevtoolsOptions {
12
16
  /**
13
17
  * The position of the TanStack logo to open and close the devtools panel.
14
18
  * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
15
- *
16
19
  * @defaultValue bottom-right
17
20
  */
18
21
  buttonPosition?: DevtoolsButtonPosition;
19
22
  /**
20
23
  * The position of the React Query devtools panel.
21
24
  * 'top' | 'bottom' | 'left' | 'right'
22
- *
23
25
  * @defaultValue bottom
24
26
  */
25
27
  position?: DevtoolsPosition;
@@ -36,7 +38,8 @@ export interface DevtoolsOptions {
36
38
  */
37
39
  styleNonce?: string;
38
40
  /**
39
- * Use this so you can attach the devtool's styles to specific element in the DOM.
41
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
42
+ * within the shadow DOM instead of within the head tag in the light DOM.
40
43
  */
41
44
  shadowDOMTarget?: ShadowRoot;
42
45
  /**
@@ -45,11 +48,16 @@ export interface DevtoolsOptions {
45
48
  hideDisabledQueries?: boolean;
46
49
  /**
47
50
  * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
48
- *
49
51
  * @defaultValue system
50
52
  */
51
53
  theme?: Theme;
52
54
  }
55
+ /**
56
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
57
+ * nearest `QueryClient`.
58
+ * @param props - The devtools options.
59
+ * @returns The element the devtools are mounted in.
60
+ */
53
61
  export declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement | null;
54
62
  //#endregion
55
63
  export { ReactQueryDevtools_d_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtools.d.cts","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"mappings":";;;;;;iBAYiB;;;;EAIf;;;;;;;EAOA,iBAAiB;;;;;;;EAOjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;EAIA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;wBAGM,mBACd,OAAO,kBACN,MAAM"}
1
+ {"version":3,"file":"ReactQueryDevtools.d.cts","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"mappings":";;;;;;;;;;iBAgBiB;;;;EAIf;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;EAKA,QAAQ;;;;;;;;wBASM,mBACd,OAAO,kBACN,MAAM"}
@@ -4,6 +4,10 @@ import { DevtoolsButtonPosition, DevtoolsErrorType, DevtoolsPosition, Theme } fr
4
4
  declare namespace ReactQueryDevtools_d_exports {
5
5
  export { DevtoolsOptions, ReactQueryDevtools };
6
6
  }
7
+ /**
8
+ * The props of `ReactQueryDevtools`, which renders the devtools with a toggle button that opens
9
+ * them.
10
+ */
7
11
  export interface DevtoolsOptions {
8
12
  /**
9
13
  * Set this true if you want the dev tools to default to being open
@@ -12,14 +16,12 @@ export interface DevtoolsOptions {
12
16
  /**
13
17
  * The position of the TanStack logo to open and close the devtools panel.
14
18
  * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
15
- *
16
19
  * @defaultValue bottom-right
17
20
  */
18
21
  buttonPosition?: DevtoolsButtonPosition;
19
22
  /**
20
23
  * The position of the React Query devtools panel.
21
24
  * 'top' | 'bottom' | 'left' | 'right'
22
- *
23
25
  * @defaultValue bottom
24
26
  */
25
27
  position?: DevtoolsPosition;
@@ -36,7 +38,8 @@ export interface DevtoolsOptions {
36
38
  */
37
39
  styleNonce?: string;
38
40
  /**
39
- * Use this so you can attach the devtool's styles to specific element in the DOM.
41
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
42
+ * within the shadow DOM instead of within the head tag in the light DOM.
40
43
  */
41
44
  shadowDOMTarget?: ShadowRoot;
42
45
  /**
@@ -45,11 +48,16 @@ export interface DevtoolsOptions {
45
48
  hideDisabledQueries?: boolean;
46
49
  /**
47
50
  * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
48
- *
49
51
  * @defaultValue system
50
52
  */
51
53
  theme?: Theme;
52
54
  }
55
+ /**
56
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
57
+ * nearest `QueryClient`.
58
+ * @param props - The devtools options.
59
+ * @returns The element the devtools are mounted in.
60
+ */
53
61
  export declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement | null;
54
62
  //#endregion
55
63
  export { ReactQueryDevtools_d_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtools.d.ts","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"mappings":";;;;;;iBAYiB;;;;EAIf;;;;;;;EAOA,iBAAiB;;;;;;;EAOjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;EAIA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;wBAGM,mBACd,OAAO,kBACN,MAAM"}
1
+ {"version":3,"file":"ReactQueryDevtools.d.ts","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"mappings":";;;;;;;;;;iBAgBiB;;;;EAIf;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;EAKA,QAAQ;;;;;;;;wBASM,mBACd,OAAO,kBACN,MAAM"}
@@ -4,6 +4,12 @@ import { onlineManager, useQueryClient } from "@tanstack/react-query";
4
4
  import { TanstackQueryDevtools } from "@tanstack/query-devtools";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region src/ReactQueryDevtools.tsx
7
+ /**
8
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
9
+ * nearest `QueryClient`.
10
+ * @param props - The devtools options.
11
+ * @returns The element the devtools are mounted in.
12
+ */
7
13
  function ReactQueryDevtools(props) {
8
14
  const queryClient = useQueryClient(props.client);
9
15
  const ref = React.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtools.js","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsErrorType,\n DevtoolsPosition,\n Theme,\n} from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n *\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n *\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this so you can attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n *\n * @defaultValue system\n */\n theme?: Theme\n}\n\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n React.useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n React.useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref}></div>\n}\n"],"mappings":";;;;;;AA2DA,SAAgB,mBACd,OAC2B;CAC3B,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,MAAM,SACvB,IAAI,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,MAAM,gBAAgB;EACpB,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,MAAM,gBAAgB;EACpB,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,oBAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAU,CAAA;AACzE"}
1
+ {"version":3,"file":"ReactQueryDevtools.js","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsErrorType,\n DevtoolsPosition,\n Theme,\n} from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\n/**\n * The props of `ReactQueryDevtools`, which renders the devtools with a toggle button that opens\n * them.\n */\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or\n * nearest `QueryClient`.\n * @param props - The devtools options.\n * @returns The element the devtools are mounted in.\n */\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n React.useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n React.useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref}></div>\n}\n"],"mappings":";;;;;;;;;;;;AAmEA,SAAgB,mBACd,OAC2B;CAC3B,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,MAAM,SACvB,IAAI,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,MAAM,gBAAgB;EACpB,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,MAAM,gBAAgB;EACpB,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,oBAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAU,CAAA;AACzE"}
@@ -7,6 +7,11 @@ let _tanstack_react_query = require("@tanstack/react-query");
7
7
  let _tanstack_query_devtools = require("@tanstack/query-devtools");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  //#region src/ReactQueryDevtoolsPanel.tsx
10
+ /**
11
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
12
+ * @param props - The devtools panel options.
13
+ * @returns The element the devtools panel is mounted in.
14
+ */
10
15
  function ReactQueryDevtoolsPanel(props) {
11
16
  const queryClient = (0, _tanstack_react_query.useQueryClient)(props.client);
12
17
  const ref = react.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtoolsPanel.cjs","names":["useQueryClient","React","TanstackQueryDevtoolsPanel"],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\nexport interface DevtoolsPanelOptions {\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this so you can attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n\n /**\n * Custom styles for the devtools panel\n * @default { height: '500px' }\n * @example { height: '100%' }\n * @example { height: '100%', width: '100%' }\n */\n style?: React.CSSProperties\n\n /**\n * Callback function that is called when the devtools panel is closed\n */\n onClose?: () => void\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n *\n * @defaultValue system\n */\n theme?: Theme\n}\n\nexport function ReactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition: 'bottom-left',\n position: 'bottom',\n initialIsOpen: true,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n onClose: props.onClose,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return (\n <div\n style={{ height: '500px', ...props.style }}\n className=\"tsqd-parent-container\"\n ref={ref}\n ></div>\n )\n}\n"],"mappings":";;;;;;;;;AAiDA,SAAgB,wBACd,OAC2B;CAC3B,MAAM,eAAA,GAAcA,sBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,MAAMC,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAYA,MAAM,SACvB,IAAIC,yBAAAA,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,sBAAA;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACD,CAAA;AAEV"}
1
+ {"version":3,"file":"ReactQueryDevtoolsPanel.cjs","names":["useQueryClient","React","TanstackQueryDevtoolsPanel"],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\n/**\n * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport interface DevtoolsPanelOptions {\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n\n /**\n * Custom styles for the devtools panel\n * @default { height: '500px' }\n * @example { height: '100%' }\n * @example { height: '100%', width: '100%' }\n */\n style?: React.CSSProperties\n\n /**\n * Callback function that is called when the devtools panel is closed\n */\n onClose?: () => void\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.\n * @param props - The devtools panel options.\n * @returns The element the devtools panel is mounted in.\n */\nexport function ReactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition: 'bottom-left',\n position: 'bottom',\n initialIsOpen: true,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n onClose: props.onClose,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return (\n <div\n style={{ height: '500px', ...props.style }}\n className=\"tsqd-parent-container\"\n ref={ref}\n ></div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAyDA,SAAgB,wBACd,OAC2B;CAC3B,MAAM,eAAA,GAAcA,sBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,MAAMC,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAYA,MAAM,SACvB,IAAIC,yBAAAA,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,sBAAA;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACD,CAAA;AAEV"}
@@ -4,6 +4,9 @@ import { QueryClient } from "@tanstack/react-query";
4
4
  declare namespace ReactQueryDevtoolsPanel_d_exports {
5
5
  export { DevtoolsPanelOptions, ReactQueryDevtoolsPanel };
6
6
  }
7
+ /**
8
+ * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.
9
+ */
7
10
  export interface DevtoolsPanelOptions {
8
11
  /**
9
12
  * Custom instance of QueryClient
@@ -18,7 +21,8 @@ export interface DevtoolsPanelOptions {
18
21
  */
19
22
  styleNonce?: string;
20
23
  /**
21
- * Use this so you can attach the devtool's styles to specific element in the DOM.
24
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
25
+ * within the shadow DOM instead of within the head tag in the light DOM.
22
26
  */
23
27
  shadowDOMTarget?: ShadowRoot;
24
28
  /**
@@ -38,11 +42,15 @@ export interface DevtoolsPanelOptions {
38
42
  hideDisabledQueries?: boolean;
39
43
  /**
40
44
  * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
41
- *
42
45
  * @defaultValue system
43
46
  */
44
47
  theme?: Theme;
45
48
  }
49
+ /**
50
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
51
+ * @param props - The devtools panel options.
52
+ * @returns The element the devtools panel is mounted in.
53
+ */
46
54
  export declare function ReactQueryDevtoolsPanel(props: DevtoolsPanelOptions): React.ReactElement | null;
47
55
  //#endregion
48
56
  export { ReactQueryDevtoolsPanel_d_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtoolsPanel.d.cts","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;iBAOiB;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;EAIA,kBAAkB;;;;;;;EAQlB,QAAQ,MAAM;;;;EAKd;;;;EAIA;;;;;;EAMA,QAAQ;;wBAGM,wBACd,OAAO,uBACN,MAAM"}
1
+ {"version":3,"file":"ReactQueryDevtoolsPanel.d.cts","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;;;;iBAUiB;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQ,MAAM;;;;EAKd;;;;EAIA;;;;;EAKA,QAAQ;;;;;;;wBAQM,wBACd,OAAO,uBACN,MAAM"}
@@ -4,6 +4,9 @@ import { DevtoolsErrorType, Theme } from "@tanstack/query-devtools";
4
4
  declare namespace ReactQueryDevtoolsPanel_d_exports {
5
5
  export { DevtoolsPanelOptions, ReactQueryDevtoolsPanel };
6
6
  }
7
+ /**
8
+ * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.
9
+ */
7
10
  export interface DevtoolsPanelOptions {
8
11
  /**
9
12
  * Custom instance of QueryClient
@@ -18,7 +21,8 @@ export interface DevtoolsPanelOptions {
18
21
  */
19
22
  styleNonce?: string;
20
23
  /**
21
- * Use this so you can attach the devtool's styles to specific element in the DOM.
24
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
25
+ * within the shadow DOM instead of within the head tag in the light DOM.
22
26
  */
23
27
  shadowDOMTarget?: ShadowRoot;
24
28
  /**
@@ -38,11 +42,15 @@ export interface DevtoolsPanelOptions {
38
42
  hideDisabledQueries?: boolean;
39
43
  /**
40
44
  * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
41
- *
42
45
  * @defaultValue system
43
46
  */
44
47
  theme?: Theme;
45
48
  }
49
+ /**
50
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
51
+ * @param props - The devtools panel options.
52
+ * @returns The element the devtools panel is mounted in.
53
+ */
46
54
  export declare function ReactQueryDevtoolsPanel(props: DevtoolsPanelOptions): React.ReactElement | null;
47
55
  //#endregion
48
56
  export { ReactQueryDevtoolsPanel_d_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtoolsPanel.d.ts","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;iBAOiB;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;EAIA,kBAAkB;;;;;;;EAQlB,QAAQ,MAAM;;;;EAKd;;;;EAIA;;;;;;EAMA,QAAQ;;wBAGM,wBACd,OAAO,uBACN,MAAM"}
1
+ {"version":3,"file":"ReactQueryDevtoolsPanel.d.ts","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;;;;iBAUiB;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQ,MAAM;;;;EAKd;;;;EAIA;;;;;EAKA,QAAQ;;;;;;;wBAQM,wBACd,OAAO,uBACN,MAAM"}
@@ -4,6 +4,11 @@ import { onlineManager, useQueryClient } from "@tanstack/react-query";
4
4
  import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region src/ReactQueryDevtoolsPanel.tsx
7
+ /**
8
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
9
+ * @param props - The devtools panel options.
10
+ * @returns The element the devtools panel is mounted in.
11
+ */
7
12
  function ReactQueryDevtoolsPanel(props) {
8
13
  const queryClient = useQueryClient(props.client);
9
14
  const ref = React.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryDevtoolsPanel.js","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\nexport interface DevtoolsPanelOptions {\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this so you can attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n\n /**\n * Custom styles for the devtools panel\n * @default { height: '500px' }\n * @example { height: '100%' }\n * @example { height: '100%', width: '100%' }\n */\n style?: React.CSSProperties\n\n /**\n * Callback function that is called when the devtools panel is closed\n */\n onClose?: () => void\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n *\n * @defaultValue system\n */\n theme?: Theme\n}\n\nexport function ReactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition: 'bottom-left',\n position: 'bottom',\n initialIsOpen: true,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n onClose: props.onClose,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return (\n <div\n style={{ height: '500px', ...props.style }}\n className=\"tsqd-parent-container\"\n ref={ref}\n ></div>\n )\n}\n"],"mappings":";;;;;;AAiDA,SAAgB,wBACd,OAC2B;CAC3B,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,MAAM,SACvB,IAAI,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,oBAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACD,CAAA;AAEV"}
1
+ {"version":3,"file":"ReactQueryDevtoolsPanel.js","names":[],"sources":["../../src/ReactQueryDevtoolsPanel.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { onlineManager, useQueryClient } from '@tanstack/react-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/react-query'\n\n/**\n * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport interface DevtoolsPanelOptions {\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n\n /**\n * Custom styles for the devtools panel\n * @default { height: '500px' }\n * @example { height: '100%' }\n * @example { height: '100%', width: '100%' }\n */\n style?: React.CSSProperties\n\n /**\n * Callback function that is called when the devtools panel is closed\n */\n onClose?: () => void\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.\n * @param props - The devtools panel options.\n * @returns The element the devtools panel is mounted in.\n */\nexport function ReactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient(props.client)\n const ref = React.useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = React.useState(\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition: 'bottom-left',\n position: 'bottom',\n initialIsOpen: true,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n onClose: props.onClose,\n hideDisabledQueries,\n theme,\n }),\n )\n\n React.useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n React.useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n React.useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n React.useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n React.useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return (\n <div\n style={{ height: '500px', ...props.style }}\n className=\"tsqd-parent-container\"\n ref={ref}\n ></div>\n )\n}\n"],"mappings":";;;;;;;;;;;AAyDA,SAAgB,wBACd,OAC2B;CAC3B,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,MAAM,OAAuB,IAAI;CAC7C,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,MAAM,SACvB,IAAI,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACH;CAEA,MAAM,gBAAgB;EACpB,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,MAAM,gBAAgB;EACpB,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,MAAM,gBAAgB;EACpB,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,MAAM,gBAAgB;EACpB,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB;EACpB,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAG5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,oBAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACD,CAAA;AAEV"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["'use client'\n\nimport * as Devtools from './ReactQueryDevtools'\nimport * as DevtoolsPanel from './ReactQueryDevtoolsPanel'\n\nexport const ReactQueryDevtools: (typeof Devtools)['ReactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.ReactQueryDevtools\n\nexport const ReactQueryDevtoolsPanel: (typeof DevtoolsPanel)['ReactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.ReactQueryDevtoolsPanel\n\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;;AAKA,MAAa,qBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,2BAAA;AAGN,MAAa,0BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,gCAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["'use client'\n\nimport * as Devtools from './ReactQueryDevtools'\nimport * as DevtoolsPanel from './ReactQueryDevtoolsPanel'\n\nexport const ReactQueryDevtools: (typeof Devtools)['ReactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.ReactQueryDevtools\n\nexport const ReactQueryDevtoolsPanel: (typeof DevtoolsPanel)['ReactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.ReactQueryDevtoolsPanel\n\n/**\n * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;;AAKA,MAAa,qBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,2BAAA;AAGN,MAAa,0BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,gCAAA"}
@@ -3,6 +3,9 @@ import { DevtoolsPanelOptions as DevtoolsPanelOptions$1, t as ReactQueryDevtools
3
3
  //#region src/index.d.ts
4
4
  export declare const ReactQueryDevtools: (typeof ReactQueryDevtools_d_exports)['ReactQueryDevtools'];
5
5
  export declare const ReactQueryDevtoolsPanel: (typeof ReactQueryDevtoolsPanel_d_exports)['ReactQueryDevtoolsPanel'];
6
+ /**
7
+ * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.
8
+ */
6
9
  export type DevtoolsPanelOptions = DevtoolsPanelOptions$1;
7
10
  //#endregion
8
11
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAKa,4BAA4BA;qBAO5B,iCAAiCC;YAOlC,uBAAuBC"}
1
+ {"version":3,"file":"index.d.cts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAKa,4BAA4BA;qBAO5B,iCAAiCC;;;;YAUlC,uBAAuBC"}
@@ -3,6 +3,9 @@ import { DevtoolsPanelOptions as DevtoolsPanelOptions$1, t as ReactQueryDevtools
3
3
  //#region src/index.d.ts
4
4
  export declare const ReactQueryDevtools: (typeof ReactQueryDevtools_d_exports)['ReactQueryDevtools'];
5
5
  export declare const ReactQueryDevtoolsPanel: (typeof ReactQueryDevtoolsPanel_d_exports)['ReactQueryDevtoolsPanel'];
6
+ /**
7
+ * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.
8
+ */
6
9
  export type DevtoolsPanelOptions = DevtoolsPanelOptions$1;
7
10
  //#endregion
8
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAKa,4BAA4BA;qBAO5B,iCAAiCC;YAOlC,uBAAuBC"}
1
+ {"version":3,"file":"index.d.ts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAKa,4BAA4BA;qBAO5B,iCAAiCC;;;;YAUlC,uBAAuBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Devtools.ReactQueryDevtools","DevtoolsPanel.ReactQueryDevtoolsPanel"],"sources":["../../src/index.ts"],"sourcesContent":["'use client'\n\nimport * as Devtools from './ReactQueryDevtools'\nimport * as DevtoolsPanel from './ReactQueryDevtoolsPanel'\n\nexport const ReactQueryDevtools: (typeof Devtools)['ReactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.ReactQueryDevtools\n\nexport const ReactQueryDevtoolsPanel: (typeof DevtoolsPanel)['ReactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.ReactQueryDevtoolsPanel\n\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;AAKA,MAAa,qBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAA;AAEN,MAAa,0BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAC"}
1
+ {"version":3,"file":"index.js","names":["Devtools.ReactQueryDevtools","DevtoolsPanel.ReactQueryDevtoolsPanel"],"sources":["../../src/index.ts"],"sourcesContent":["'use client'\n\nimport * as Devtools from './ReactQueryDevtools'\nimport * as DevtoolsPanel from './ReactQueryDevtoolsPanel'\n\nexport const ReactQueryDevtools: (typeof Devtools)['ReactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.ReactQueryDevtools\n\nexport const ReactQueryDevtoolsPanel: (typeof DevtoolsPanel)['ReactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.ReactQueryDevtoolsPanel\n\n/**\n * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;AAKA,MAAa,qBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAA;AAEN,MAAa,0BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-query-devtools",
3
- "version": "5.104.1",
3
+ "version": "5.104.3",
4
4
  "description": "Developer tools to interact with and visualize the TanStack/react-query cache",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -59,11 +59,11 @@
59
59
  "!src/__tests__"
60
60
  ],
61
61
  "dependencies": {
62
- "@tanstack/query-devtools": "5.104.1"
62
+ "@tanstack/query-devtools": "5.104.3"
63
63
  },
64
64
  "devDependencies": {
65
- "@eslint-react/eslint-plugin": "^5.21.0",
66
- "@tanstack/react-query": "5.104.1",
65
+ "@eslint-react/eslint-plugin": "^5.23.3",
66
+ "@tanstack/react-query": "5.104.3",
67
67
  "@testing-library/react": "^16.1.0",
68
68
  "@types/react": "^19.2.7",
69
69
  "@vitejs/plugin-react": "^6.1.1",
@@ -72,21 +72,21 @@
72
72
  "typescript": "6.0.3"
73
73
  },
74
74
  "peerDependencies": {
75
- "@tanstack/react-query": "^5.104.1",
75
+ "@tanstack/react-query": "^5.104.3",
76
76
  "@types/react": "^18 || ^19",
77
77
  "react": "^18 || ^19"
78
78
  },
79
79
  "scripts": {
80
80
  "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types",
81
81
  "compile": "tsc --project tsconfig.json",
82
- "test:eslint": "eslint --concurrency=auto ./src",
82
+ "test:oxlint": "oxlint ./src",
83
83
  "test:types": "npm-run-all --serial test:types:*",
84
- "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo",
85
84
  "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo",
86
85
  "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts58 --tsBuildInfoFile .cache/test-types/ts58.tsbuildinfo",
87
86
  "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts59 --tsBuildInfoFile .cache/test-types/ts59.tsbuildinfo",
88
87
  "test:types:tscurrent": "tsc --project tsconfig.json --outDir .cache/test-types/tscurrent --tsBuildInfoFile .cache/test-types/tscurrent.tsbuildinfo",
89
88
  "test:types:ts70": "node ../../node_modules/typescript70/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts70 --tsBuildInfoFile .cache/test-types/ts70.tsbuildinfo",
89
+ "test:types:ts71": "node ../../node_modules/typescript71/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts71 --tsBuildInfoFile .cache/test-types/ts71.tsbuildinfo",
90
90
  "test:lib": "vitest",
91
91
  "test:lib:dev": "pnpm run test:lib --watch",
92
92
  "test:build": "publint --strict && attw --pack",
@@ -10,6 +10,10 @@ import type {
10
10
  } from '@tanstack/query-devtools'
11
11
  import type { QueryClient } from '@tanstack/react-query'
12
12
 
13
+ /**
14
+ * The props of `ReactQueryDevtools`, which renders the devtools with a toggle button that opens
15
+ * them.
16
+ */
13
17
  export interface DevtoolsOptions {
14
18
  /**
15
19
  * Set this true if you want the dev tools to default to being open
@@ -18,14 +22,12 @@ export interface DevtoolsOptions {
18
22
  /**
19
23
  * The position of the TanStack logo to open and close the devtools panel.
20
24
  * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
21
- *
22
25
  * @defaultValue bottom-right
23
26
  */
24
27
  buttonPosition?: DevtoolsButtonPosition
25
28
  /**
26
29
  * The position of the React Query devtools panel.
27
30
  * 'top' | 'bottom' | 'left' | 'right'
28
- *
29
31
  * @defaultValue bottom
30
32
  */
31
33
  position?: DevtoolsPosition
@@ -42,7 +44,8 @@ export interface DevtoolsOptions {
42
44
  */
43
45
  styleNonce?: string
44
46
  /**
45
- * Use this so you can attach the devtool's styles to specific element in the DOM.
47
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
48
+ * within the shadow DOM instead of within the head tag in the light DOM.
46
49
  */
47
50
  shadowDOMTarget?: ShadowRoot
48
51
  /**
@@ -51,12 +54,17 @@ export interface DevtoolsOptions {
51
54
  hideDisabledQueries?: boolean
52
55
  /**
53
56
  * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
54
- *
55
57
  * @defaultValue system
56
58
  */
57
59
  theme?: Theme
58
60
  }
59
61
 
62
+ /**
63
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
64
+ * nearest `QueryClient`.
65
+ * @param props - The devtools options.
66
+ * @returns The element the devtools are mounted in.
67
+ */
60
68
  export function ReactQueryDevtools(
61
69
  props: DevtoolsOptions,
62
70
  ): React.ReactElement | null {
@@ -5,6 +5,9 @@ import { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'
5
5
  import type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'
6
6
  import type { QueryClient } from '@tanstack/react-query'
7
7
 
8
+ /**
9
+ * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.
10
+ */
8
11
  export interface DevtoolsPanelOptions {
9
12
  /**
10
13
  * Custom instance of QueryClient
@@ -19,7 +22,8 @@ export interface DevtoolsPanelOptions {
19
22
  */
20
23
  styleNonce?: string
21
24
  /**
22
- * Use this so you can attach the devtool's styles to specific element in the DOM.
25
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
26
+ * within the shadow DOM instead of within the head tag in the light DOM.
23
27
  */
24
28
  shadowDOMTarget?: ShadowRoot
25
29
 
@@ -41,12 +45,16 @@ export interface DevtoolsPanelOptions {
41
45
  hideDisabledQueries?: boolean
42
46
  /**
43
47
  * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
44
- *
45
48
  * @defaultValue system
46
49
  */
47
50
  theme?: Theme
48
51
  }
49
52
 
53
+ /**
54
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
55
+ * @param props - The devtools panel options.
56
+ * @returns The element the devtools panel is mounted in.
57
+ */
50
58
  export function ReactQueryDevtoolsPanel(
51
59
  props: DevtoolsPanelOptions,
52
60
  ): React.ReactElement | null {
package/src/index.ts CHANGED
@@ -17,4 +17,7 @@ export const ReactQueryDevtoolsPanel: (typeof DevtoolsPanel)['ReactQueryDevtools
17
17
  }
18
18
  : DevtoolsPanel.ReactQueryDevtoolsPanel
19
19
 
20
+ /**
21
+ * The props of `ReactQueryDevtoolsPanel`, which renders the devtools panel inline.
22
+ */
20
23
  export type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions