@tanstack/react-query-devtools 5.91.3 → 5.94.4

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 (57) hide show
  1. package/package.json +7 -8
  2. package/build/legacy/ReactQueryDevtools-ChNsB-ya.d.cts +0 -56
  3. package/build/legacy/ReactQueryDevtools-ChNsB-ya.d.ts +0 -56
  4. package/build/legacy/ReactQueryDevtools.cjs +0 -106
  5. package/build/legacy/ReactQueryDevtools.cjs.map +0 -1
  6. package/build/legacy/ReactQueryDevtools.d.cts +0 -4
  7. package/build/legacy/ReactQueryDevtools.d.ts +0 -4
  8. package/build/legacy/ReactQueryDevtools.js +0 -72
  9. package/build/legacy/ReactQueryDevtools.js.map +0 -1
  10. package/build/legacy/ReactQueryDevtoolsPanel-D67eVd_j.d.cts +0 -51
  11. package/build/legacy/ReactQueryDevtoolsPanel-D67eVd_j.d.ts +0 -51
  12. package/build/legacy/ReactQueryDevtoolsPanel.cjs +0 -102
  13. package/build/legacy/ReactQueryDevtoolsPanel.cjs.map +0 -1
  14. package/build/legacy/ReactQueryDevtoolsPanel.d.cts +0 -4
  15. package/build/legacy/ReactQueryDevtoolsPanel.d.ts +0 -4
  16. package/build/legacy/ReactQueryDevtoolsPanel.js +0 -68
  17. package/build/legacy/ReactQueryDevtoolsPanel.js.map +0 -1
  18. package/build/legacy/index.cjs +0 -51
  19. package/build/legacy/index.cjs.map +0 -1
  20. package/build/legacy/index.d.cts +0 -11
  21. package/build/legacy/index.d.ts +0 -11
  22. package/build/legacy/index.js +0 -16
  23. package/build/legacy/index.js.map +0 -1
  24. package/build/legacy/production.cjs +0 -47
  25. package/build/legacy/production.cjs.map +0 -1
  26. package/build/legacy/production.d.cts +0 -10
  27. package/build/legacy/production.d.ts +0 -10
  28. package/build/legacy/production.js +0 -12
  29. package/build/legacy/production.js.map +0 -1
  30. package/build/modern/ReactQueryDevtools-ChNsB-ya.d.cts +0 -56
  31. package/build/modern/ReactQueryDevtools-ChNsB-ya.d.ts +0 -56
  32. package/build/modern/ReactQueryDevtools.cjs +0 -106
  33. package/build/modern/ReactQueryDevtools.cjs.map +0 -1
  34. package/build/modern/ReactQueryDevtools.d.cts +0 -4
  35. package/build/modern/ReactQueryDevtools.d.ts +0 -4
  36. package/build/modern/ReactQueryDevtools.js +0 -72
  37. package/build/modern/ReactQueryDevtools.js.map +0 -1
  38. package/build/modern/ReactQueryDevtoolsPanel-D67eVd_j.d.cts +0 -51
  39. package/build/modern/ReactQueryDevtoolsPanel-D67eVd_j.d.ts +0 -51
  40. package/build/modern/ReactQueryDevtoolsPanel.cjs +0 -102
  41. package/build/modern/ReactQueryDevtoolsPanel.cjs.map +0 -1
  42. package/build/modern/ReactQueryDevtoolsPanel.d.cts +0 -4
  43. package/build/modern/ReactQueryDevtoolsPanel.d.ts +0 -4
  44. package/build/modern/ReactQueryDevtoolsPanel.js +0 -68
  45. package/build/modern/ReactQueryDevtoolsPanel.js.map +0 -1
  46. package/build/modern/index.cjs +0 -51
  47. package/build/modern/index.cjs.map +0 -1
  48. package/build/modern/index.d.cts +0 -11
  49. package/build/modern/index.d.ts +0 -11
  50. package/build/modern/index.js +0 -16
  51. package/build/modern/index.js.map +0 -1
  52. package/build/modern/production.cjs +0 -47
  53. package/build/modern/production.cjs.map +0 -1
  54. package/build/modern/production.d.cts +0 -10
  55. package/build/modern/production.d.ts +0 -10
  56. package/build/modern/production.js +0 -12
  57. package/build/modern/production.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-query-devtools",
3
- "version": "5.91.3",
3
+ "version": "5.94.4",
4
4
  "description": "Developer tools to interact with and visualize the TanStack/react-query cache",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -59,7 +59,7 @@
59
59
  "!src/__tests__"
60
60
  ],
61
61
  "dependencies": {
62
- "@tanstack/query-devtools": "5.93.0"
62
+ "@tanstack/query-devtools": "5.94.4"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@testing-library/react": "^16.1.0",
@@ -67,26 +67,25 @@
67
67
  "@vitejs/plugin-react": "^4.3.4",
68
68
  "npm-run-all2": "^5.0.0",
69
69
  "react": "^19.2.1",
70
- "@tanstack/react-query": "5.90.20"
70
+ "@tanstack/react-query": "5.94.4"
71
71
  },
72
72
  "peerDependencies": {
73
73
  "react": "^18 || ^19",
74
- "@tanstack/react-query": "^5.90.20"
74
+ "@tanstack/react-query": "^5.94.4"
75
75
  },
76
76
  "scripts": {
77
77
  "clean": "premove ./build ./coverage ./dist-ts",
78
78
  "compile": "tsc --build",
79
79
  "test:eslint": "eslint --concurrency=auto ./src",
80
80
  "test:types": "npm-run-all --serial test:types:*",
81
- "test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js --build tsconfig.legacy.json",
82
- "test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js --build tsconfig.legacy.json",
83
- "test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js --build tsconfig.legacy.json",
84
- "test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js --build tsconfig.legacy.json",
85
81
  "test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js --build tsconfig.legacy.json",
86
82
  "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js --build tsconfig.legacy.json",
87
83
  "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --build tsconfig.legacy.json",
88
84
  "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --build tsconfig.legacy.json",
85
+ "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js --build tsconfig.legacy.json",
86
+ "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js --build tsconfig.legacy.json",
89
87
  "test:types:tscurrent": "tsc --build",
88
+ "test:types:ts60": "node ../../node_modules/typescript60/lib/tsc.js --build",
90
89
  "test:lib": "vitest",
91
90
  "test:lib:dev": "pnpm run test:lib --watch",
92
91
  "test:build": "publint --strict && attw --pack",
@@ -1,56 +0,0 @@
1
- import * as React from 'react';
2
- import { DevtoolsButtonPosition, DevtoolsPosition, DevtoolsErrorType, Theme } from '@tanstack/query-devtools';
3
- import { QueryClient } from '@tanstack/react-query';
4
-
5
- interface DevtoolsOptions {
6
- /**
7
- * Set this true if you want the dev tools to default to being open
8
- */
9
- initialIsOpen?: boolean;
10
- /**
11
- * The position of the React Query logo to open and close the devtools panel.
12
- * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
13
- * Defaults to 'bottom-right'.
14
- */
15
- buttonPosition?: DevtoolsButtonPosition;
16
- /**
17
- * The position of the React Query devtools panel.
18
- * 'top' | 'bottom' | 'left' | 'right'
19
- * Defaults to 'bottom'.
20
- */
21
- position?: DevtoolsPosition;
22
- /**
23
- * Custom instance of QueryClient
24
- */
25
- client?: QueryClient;
26
- /**
27
- * Use this so you can define custom errors that can be shown in the devtools.
28
- */
29
- errorTypes?: Array<DevtoolsErrorType>;
30
- /**
31
- * 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.
32
- */
33
- styleNonce?: string;
34
- /**
35
- * Use this so you can attach the devtool's styles to specific element in the DOM.
36
- */
37
- shadowDOMTarget?: ShadowRoot;
38
- /**
39
- * Set this to true to hide disabled queries from the devtools panel.
40
- */
41
- hideDisabledQueries?: boolean;
42
- /**
43
- * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
44
- * Defaults to 'system'.
45
- */
46
- theme?: Theme;
47
- }
48
- declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement | null;
49
-
50
- type Devtools_DevtoolsOptions = DevtoolsOptions;
51
- declare const Devtools_ReactQueryDevtools: typeof ReactQueryDevtools;
52
- declare namespace Devtools {
53
- export { type Devtools_DevtoolsOptions as DevtoolsOptions, Devtools_ReactQueryDevtools as ReactQueryDevtools };
54
- }
55
-
56
- export { Devtools as D, ReactQueryDevtools as R, type DevtoolsOptions as a };
@@ -1,56 +0,0 @@
1
- import * as React from 'react';
2
- import { DevtoolsButtonPosition, DevtoolsPosition, DevtoolsErrorType, Theme } from '@tanstack/query-devtools';
3
- import { QueryClient } from '@tanstack/react-query';
4
-
5
- interface DevtoolsOptions {
6
- /**
7
- * Set this true if you want the dev tools to default to being open
8
- */
9
- initialIsOpen?: boolean;
10
- /**
11
- * The position of the React Query logo to open and close the devtools panel.
12
- * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
13
- * Defaults to 'bottom-right'.
14
- */
15
- buttonPosition?: DevtoolsButtonPosition;
16
- /**
17
- * The position of the React Query devtools panel.
18
- * 'top' | 'bottom' | 'left' | 'right'
19
- * Defaults to 'bottom'.
20
- */
21
- position?: DevtoolsPosition;
22
- /**
23
- * Custom instance of QueryClient
24
- */
25
- client?: QueryClient;
26
- /**
27
- * Use this so you can define custom errors that can be shown in the devtools.
28
- */
29
- errorTypes?: Array<DevtoolsErrorType>;
30
- /**
31
- * 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.
32
- */
33
- styleNonce?: string;
34
- /**
35
- * Use this so you can attach the devtool's styles to specific element in the DOM.
36
- */
37
- shadowDOMTarget?: ShadowRoot;
38
- /**
39
- * Set this to true to hide disabled queries from the devtools panel.
40
- */
41
- hideDisabledQueries?: boolean;
42
- /**
43
- * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
44
- * Defaults to 'system'.
45
- */
46
- theme?: Theme;
47
- }
48
- declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement | null;
49
-
50
- type Devtools_DevtoolsOptions = DevtoolsOptions;
51
- declare const Devtools_ReactQueryDevtools: typeof ReactQueryDevtools;
52
- declare namespace Devtools {
53
- export { type Devtools_DevtoolsOptions as DevtoolsOptions, Devtools_ReactQueryDevtools as ReactQueryDevtools };
54
- }
55
-
56
- export { Devtools as D, ReactQueryDevtools as R, type DevtoolsOptions as a };
@@ -1,106 +0,0 @@
1
- "use strict";
2
- "use client";
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/ReactQueryDevtools.tsx
32
- var ReactQueryDevtools_exports = {};
33
- __export(ReactQueryDevtools_exports, {
34
- ReactQueryDevtools: () => ReactQueryDevtools
35
- });
36
- module.exports = __toCommonJS(ReactQueryDevtools_exports);
37
- var React = __toESM(require("react"), 1);
38
- var import_react_query = require("@tanstack/react-query");
39
- var import_query_devtools = require("@tanstack/query-devtools");
40
- var import_jsx_runtime = require("react/jsx-runtime");
41
- function ReactQueryDevtools(props) {
42
- const queryClient = (0, import_react_query.useQueryClient)(props.client);
43
- const ref = React.useRef(null);
44
- const {
45
- buttonPosition,
46
- position,
47
- initialIsOpen,
48
- errorTypes,
49
- styleNonce,
50
- shadowDOMTarget,
51
- hideDisabledQueries,
52
- theme
53
- } = props;
54
- const [devtools] = React.useState(
55
- new import_query_devtools.TanstackQueryDevtools({
56
- client: queryClient,
57
- queryFlavor: "React Query",
58
- version: "5",
59
- onlineManager: import_react_query.onlineManager,
60
- buttonPosition,
61
- position,
62
- initialIsOpen,
63
- errorTypes,
64
- styleNonce,
65
- shadowDOMTarget,
66
- hideDisabledQueries,
67
- theme
68
- })
69
- );
70
- React.useEffect(() => {
71
- devtools.setClient(queryClient);
72
- }, [queryClient, devtools]);
73
- React.useEffect(() => {
74
- if (buttonPosition) {
75
- devtools.setButtonPosition(buttonPosition);
76
- }
77
- }, [buttonPosition, devtools]);
78
- React.useEffect(() => {
79
- if (position) {
80
- devtools.setPosition(position);
81
- }
82
- }, [position, devtools]);
83
- React.useEffect(() => {
84
- devtools.setInitialIsOpen(initialIsOpen || false);
85
- }, [initialIsOpen, devtools]);
86
- React.useEffect(() => {
87
- devtools.setErrorTypes(errorTypes || []);
88
- }, [errorTypes, devtools]);
89
- React.useEffect(() => {
90
- devtools.setTheme(theme);
91
- }, [theme, devtools]);
92
- React.useEffect(() => {
93
- if (ref.current) {
94
- devtools.mount(ref.current);
95
- }
96
- return () => {
97
- devtools.unmount();
98
- };
99
- }, [devtools]);
100
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { dir: "ltr", className: "tsqd-parent-container", ref });
101
- }
102
- // Annotate the CommonJS export names for ESM import in node:
103
- 0 && (module.exports = {
104
- ReactQueryDevtools
105
- });
106
- //# sourceMappingURL=ReactQueryDevtools.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"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 React Query logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n * Defaults to 'bottom-right'.\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * Defaults to '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 * Defaults to '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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,yBAA8C;AAC9C,4BAAsC;AA2H7B;AAtEF,SAAS,mBACd,OAC2B;AAC3B,QAAM,kBAAc,mCAAe,MAAM,MAAM;AAC/C,QAAM,MAAY,aAAuB,IAAI;AAC7C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,IAAI,4CAAsB;AAAA,MACxB,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,UAAU,WAAW;AAAA,EAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;AAE1B,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,eAAS,kBAAkB,cAAc;AAAA,IAC3C;AAAA,EACF,GAAG,CAAC,gBAAgB,QAAQ,CAAC;AAE7B,EAAM,gBAAU,MAAM;AACpB,QAAI,UAAU;AACZ,eAAS,YAAY,QAAQ;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,UAAU,QAAQ,CAAC;AAEvB,EAAM,gBAAU,MAAM;AACpB,aAAS,iBAAiB,iBAAiB,KAAK;AAAA,EAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;AAE5B,EAAM,gBAAU,MAAM;AACpB,aAAS,cAAc,cAAc,CAAC,CAAC;AAAA,EACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;AAEzB,EAAM,gBAAU,MAAM;AACpB,aAAS,SAAS,KAAK;AAAA,EACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;AAEpB,EAAM,gBAAU,MAAM;AACpB,QAAI,IAAI,SAAS;AACf,eAAS,MAAM,IAAI,OAAO;AAAA,IAC5B;AAEA,WAAO,MAAM;AACX,eAAS,QAAQ;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,SAAO,4CAAC,SAAI,KAAI,OAAM,WAAU,yBAAwB,KAAU;AACpE;","names":[]}
@@ -1,4 +0,0 @@
1
- import 'react';
2
- import '@tanstack/query-devtools';
3
- import '@tanstack/react-query';
4
- export { a as DevtoolsOptions, R as ReactQueryDevtools } from './ReactQueryDevtools-ChNsB-ya.cjs';
@@ -1,4 +0,0 @@
1
- import 'react';
2
- import '@tanstack/query-devtools';
3
- import '@tanstack/react-query';
4
- export { a as DevtoolsOptions, R as ReactQueryDevtools } from './ReactQueryDevtools-ChNsB-ya.js';
@@ -1,72 +0,0 @@
1
- "use client";
2
-
3
- // src/ReactQueryDevtools.tsx
4
- import * as React from "react";
5
- import { onlineManager, useQueryClient } from "@tanstack/react-query";
6
- import { TanstackQueryDevtools } from "@tanstack/query-devtools";
7
- import { jsx } from "react/jsx-runtime";
8
- function ReactQueryDevtools(props) {
9
- const queryClient = useQueryClient(props.client);
10
- const ref = React.useRef(null);
11
- const {
12
- buttonPosition,
13
- position,
14
- initialIsOpen,
15
- errorTypes,
16
- styleNonce,
17
- shadowDOMTarget,
18
- hideDisabledQueries,
19
- theme
20
- } = props;
21
- const [devtools] = React.useState(
22
- new TanstackQueryDevtools({
23
- client: queryClient,
24
- queryFlavor: "React Query",
25
- version: "5",
26
- onlineManager,
27
- buttonPosition,
28
- position,
29
- initialIsOpen,
30
- errorTypes,
31
- styleNonce,
32
- shadowDOMTarget,
33
- hideDisabledQueries,
34
- theme
35
- })
36
- );
37
- React.useEffect(() => {
38
- devtools.setClient(queryClient);
39
- }, [queryClient, devtools]);
40
- React.useEffect(() => {
41
- if (buttonPosition) {
42
- devtools.setButtonPosition(buttonPosition);
43
- }
44
- }, [buttonPosition, devtools]);
45
- React.useEffect(() => {
46
- if (position) {
47
- devtools.setPosition(position);
48
- }
49
- }, [position, devtools]);
50
- React.useEffect(() => {
51
- devtools.setInitialIsOpen(initialIsOpen || false);
52
- }, [initialIsOpen, devtools]);
53
- React.useEffect(() => {
54
- devtools.setErrorTypes(errorTypes || []);
55
- }, [errorTypes, devtools]);
56
- React.useEffect(() => {
57
- devtools.setTheme(theme);
58
- }, [theme, devtools]);
59
- React.useEffect(() => {
60
- if (ref.current) {
61
- devtools.mount(ref.current);
62
- }
63
- return () => {
64
- devtools.unmount();
65
- };
66
- }, [devtools]);
67
- return /* @__PURE__ */ jsx("div", { dir: "ltr", className: "tsqd-parent-container", ref });
68
- }
69
- export {
70
- ReactQueryDevtools
71
- };
72
- //# sourceMappingURL=ReactQueryDevtools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"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 React Query logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n * Defaults to 'bottom-right'.\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * Defaults to '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 * Defaults to '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":";;;AACA,YAAY,WAAW;AACvB,SAAS,eAAe,sBAAsB;AAC9C,SAAS,6BAA6B;AA2H7B;AAtEF,SAAS,mBACd,OAC2B;AAC3B,QAAM,cAAc,eAAe,MAAM,MAAM;AAC/C,QAAM,MAAY,aAAuB,IAAI;AAC7C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,IAAI,sBAAsB;AAAA,MACxB,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,UAAU,WAAW;AAAA,EAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;AAE1B,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,eAAS,kBAAkB,cAAc;AAAA,IAC3C;AAAA,EACF,GAAG,CAAC,gBAAgB,QAAQ,CAAC;AAE7B,EAAM,gBAAU,MAAM;AACpB,QAAI,UAAU;AACZ,eAAS,YAAY,QAAQ;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,UAAU,QAAQ,CAAC;AAEvB,EAAM,gBAAU,MAAM;AACpB,aAAS,iBAAiB,iBAAiB,KAAK;AAAA,EAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;AAE5B,EAAM,gBAAU,MAAM;AACpB,aAAS,cAAc,cAAc,CAAC,CAAC;AAAA,EACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;AAEzB,EAAM,gBAAU,MAAM;AACpB,aAAS,SAAS,KAAK;AAAA,EACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;AAEpB,EAAM,gBAAU,MAAM;AACpB,QAAI,IAAI,SAAS;AACf,eAAS,MAAM,IAAI,OAAO;AAAA,IAC5B;AAEA,WAAO,MAAM;AACX,eAAS,QAAQ;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,SAAO,oBAAC,SAAI,KAAI,OAAM,WAAU,yBAAwB,KAAU;AACpE;","names":[]}
@@ -1,51 +0,0 @@
1
- import * as React from 'react';
2
- import { DevtoolsErrorType, Theme } from '@tanstack/query-devtools';
3
- import { QueryClient } from '@tanstack/react-query';
4
-
5
- interface DevtoolsPanelOptions {
6
- /**
7
- * Custom instance of QueryClient
8
- */
9
- client?: QueryClient;
10
- /**
11
- * Use this so you can define custom errors that can be shown in the devtools.
12
- */
13
- errorTypes?: Array<DevtoolsErrorType>;
14
- /**
15
- * 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.
16
- */
17
- styleNonce?: string;
18
- /**
19
- * Use this so you can attach the devtool's styles to specific element in the DOM.
20
- */
21
- shadowDOMTarget?: ShadowRoot;
22
- /**
23
- * Custom styles for the devtools panel
24
- * @default { height: '500px' }
25
- * @example { height: '100%' }
26
- * @example { height: '100%', width: '100%' }
27
- */
28
- style?: React.CSSProperties;
29
- /**
30
- * Callback function that is called when the devtools panel is closed
31
- */
32
- onClose?: () => unknown;
33
- /**
34
- * Set this to true to hide disabled queries from the devtools panel.
35
- */
36
- hideDisabledQueries?: boolean;
37
- /**
38
- * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
39
- * Defaults to 'system'.
40
- */
41
- theme?: Theme;
42
- }
43
- declare function ReactQueryDevtoolsPanel(props: DevtoolsPanelOptions): React.ReactElement | null;
44
-
45
- type DevtoolsPanel_DevtoolsPanelOptions = DevtoolsPanelOptions;
46
- declare const DevtoolsPanel_ReactQueryDevtoolsPanel: typeof ReactQueryDevtoolsPanel;
47
- declare namespace DevtoolsPanel {
48
- export { type DevtoolsPanel_DevtoolsPanelOptions as DevtoolsPanelOptions, DevtoolsPanel_ReactQueryDevtoolsPanel as ReactQueryDevtoolsPanel };
49
- }
50
-
51
- export { DevtoolsPanel as D, ReactQueryDevtoolsPanel as R, type DevtoolsPanelOptions as a };
@@ -1,51 +0,0 @@
1
- import * as React from 'react';
2
- import { DevtoolsErrorType, Theme } from '@tanstack/query-devtools';
3
- import { QueryClient } from '@tanstack/react-query';
4
-
5
- interface DevtoolsPanelOptions {
6
- /**
7
- * Custom instance of QueryClient
8
- */
9
- client?: QueryClient;
10
- /**
11
- * Use this so you can define custom errors that can be shown in the devtools.
12
- */
13
- errorTypes?: Array<DevtoolsErrorType>;
14
- /**
15
- * 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.
16
- */
17
- styleNonce?: string;
18
- /**
19
- * Use this so you can attach the devtool's styles to specific element in the DOM.
20
- */
21
- shadowDOMTarget?: ShadowRoot;
22
- /**
23
- * Custom styles for the devtools panel
24
- * @default { height: '500px' }
25
- * @example { height: '100%' }
26
- * @example { height: '100%', width: '100%' }
27
- */
28
- style?: React.CSSProperties;
29
- /**
30
- * Callback function that is called when the devtools panel is closed
31
- */
32
- onClose?: () => unknown;
33
- /**
34
- * Set this to true to hide disabled queries from the devtools panel.
35
- */
36
- hideDisabledQueries?: boolean;
37
- /**
38
- * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
39
- * Defaults to 'system'.
40
- */
41
- theme?: Theme;
42
- }
43
- declare function ReactQueryDevtoolsPanel(props: DevtoolsPanelOptions): React.ReactElement | null;
44
-
45
- type DevtoolsPanel_DevtoolsPanelOptions = DevtoolsPanelOptions;
46
- declare const DevtoolsPanel_ReactQueryDevtoolsPanel: typeof ReactQueryDevtoolsPanel;
47
- declare namespace DevtoolsPanel {
48
- export { type DevtoolsPanel_DevtoolsPanelOptions as DevtoolsPanelOptions, DevtoolsPanel_ReactQueryDevtoolsPanel as ReactQueryDevtoolsPanel };
49
- }
50
-
51
- export { DevtoolsPanel as D, ReactQueryDevtoolsPanel as R, type DevtoolsPanelOptions as a };
@@ -1,102 +0,0 @@
1
- "use strict";
2
- "use client";
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/ReactQueryDevtoolsPanel.tsx
32
- var ReactQueryDevtoolsPanel_exports = {};
33
- __export(ReactQueryDevtoolsPanel_exports, {
34
- ReactQueryDevtoolsPanel: () => ReactQueryDevtoolsPanel
35
- });
36
- module.exports = __toCommonJS(ReactQueryDevtoolsPanel_exports);
37
- var React = __toESM(require("react"), 1);
38
- var import_react_query = require("@tanstack/react-query");
39
- var import_query_devtools = require("@tanstack/query-devtools");
40
- var import_jsx_runtime = require("react/jsx-runtime");
41
- function ReactQueryDevtoolsPanel(props) {
42
- const queryClient = (0, import_react_query.useQueryClient)(props.client);
43
- const ref = React.useRef(null);
44
- const {
45
- errorTypes,
46
- styleNonce,
47
- shadowDOMTarget,
48
- hideDisabledQueries,
49
- theme
50
- } = props;
51
- const [devtools] = React.useState(
52
- new import_query_devtools.TanstackQueryDevtoolsPanel({
53
- client: queryClient,
54
- queryFlavor: "React Query",
55
- version: "5",
56
- onlineManager: import_react_query.onlineManager,
57
- buttonPosition: "bottom-left",
58
- position: "bottom",
59
- initialIsOpen: true,
60
- errorTypes,
61
- styleNonce,
62
- shadowDOMTarget,
63
- onClose: props.onClose,
64
- hideDisabledQueries,
65
- theme
66
- })
67
- );
68
- React.useEffect(() => {
69
- devtools.setClient(queryClient);
70
- }, [queryClient, devtools]);
71
- React.useEffect(() => {
72
- devtools.setOnClose(props.onClose ?? (() => {
73
- }));
74
- }, [props.onClose, devtools]);
75
- React.useEffect(() => {
76
- devtools.setErrorTypes(errorTypes || []);
77
- }, [errorTypes, devtools]);
78
- React.useEffect(() => {
79
- devtools.setTheme(theme);
80
- }, [theme, devtools]);
81
- React.useEffect(() => {
82
- if (ref.current) {
83
- devtools.mount(ref.current);
84
- }
85
- return () => {
86
- devtools.unmount();
87
- };
88
- }, [devtools]);
89
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
- "div",
91
- {
92
- style: { height: "500px", ...props.style },
93
- className: "tsqd-parent-container",
94
- ref
95
- }
96
- );
97
- }
98
- // Annotate the CommonJS export names for ESM import in node:
99
- 0 && (module.exports = {
100
- ReactQueryDevtoolsPanel
101
- });
102
- //# sourceMappingURL=ReactQueryDevtoolsPanel.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"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?: () => unknown\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 * Defaults to '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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,yBAA8C;AAC9C,4BAA2C;AAsGvC;AAzDG,SAAS,wBACd,OAC2B;AAC3B,QAAM,kBAAc,mCAAe,MAAM,MAAM;AAC/C,QAAM,MAAY,aAAuB,IAAI;AAC7C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,IAAI,iDAA2B;AAAA,MAC7B,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,SAAS;AAAA,MACT;AAAA,MACA,gBAAgB;AAAA,MAChB,UAAU;AAAA,MACV,eAAe;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,MAAM;AAAA,MACf;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,UAAU,WAAW;AAAA,EAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;AAE1B,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,MAAM,YAAY,MAAM;AAAA,IAAC,EAAE;AAAA,EACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;AAE5B,EAAM,gBAAU,MAAM;AACpB,aAAS,cAAc,cAAc,CAAC,CAAC;AAAA,EACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;AAEzB,EAAM,gBAAU,MAAM;AACpB,aAAS,SAAS,KAAK;AAAA,EACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;AAEpB,EAAM,gBAAU,MAAM;AACpB,QAAI,IAAI,SAAS;AACf,eAAS,MAAM,IAAI,OAAO;AAAA,IAC5B;AAEA,WAAO,MAAM;AACX,eAAS,QAAQ;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,QAAQ,SAAS,GAAG,MAAM,MAAM;AAAA,MACzC,WAAU;AAAA,MACV;AAAA;AAAA,EACD;AAEL;","names":[]}
@@ -1,4 +0,0 @@
1
- import 'react';
2
- import '@tanstack/query-devtools';
3
- import '@tanstack/react-query';
4
- export { a as DevtoolsPanelOptions, R as ReactQueryDevtoolsPanel } from './ReactQueryDevtoolsPanel-D67eVd_j.cjs';
@@ -1,4 +0,0 @@
1
- import 'react';
2
- import '@tanstack/query-devtools';
3
- import '@tanstack/react-query';
4
- export { a as DevtoolsPanelOptions, R as ReactQueryDevtoolsPanel } from './ReactQueryDevtoolsPanel-D67eVd_j.js';