@tanstack/react-query-devtools 5.101.3 → 5.102.0

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 (73) hide show
  1. package/build/legacy/ReactQueryDevtools.cjs +57 -102
  2. package/build/legacy/ReactQueryDevtools.cjs.map +1 -1
  3. package/build/legacy/ReactQueryDevtools.d.cts +53 -2
  4. package/build/legacy/ReactQueryDevtools.d.cts.map +1 -0
  5. package/build/legacy/ReactQueryDevtools.d.ts +53 -2
  6. package/build/legacy/ReactQueryDevtools.d.ts.map +1 -0
  7. package/build/legacy/ReactQueryDevtools.js +50 -64
  8. package/build/legacy/ReactQueryDevtools.js.map +1 -1
  9. package/build/legacy/ReactQueryDevtoolsPanel.cjs +55 -98
  10. package/build/legacy/ReactQueryDevtoolsPanel.cjs.map +1 -1
  11. package/build/legacy/ReactQueryDevtoolsPanel.d.cts +48 -2
  12. package/build/legacy/ReactQueryDevtoolsPanel.d.cts.map +1 -0
  13. package/build/legacy/ReactQueryDevtoolsPanel.d.ts +48 -2
  14. package/build/legacy/ReactQueryDevtoolsPanel.d.ts.map +1 -0
  15. package/build/legacy/ReactQueryDevtoolsPanel.js +48 -60
  16. package/build/legacy/ReactQueryDevtoolsPanel.js.map +1 -1
  17. package/build/legacy/index.cjs +13 -48
  18. package/build/legacy/index.cjs.map +1 -1
  19. package/build/legacy/index.d.cts +9 -3
  20. package/build/legacy/index.d.cts.map +1 -0
  21. package/build/legacy/index.d.ts +9 -3
  22. package/build/legacy/index.d.ts.map +1 -0
  23. package/build/legacy/index.js +11 -13
  24. package/build/legacy/index.js.map +1 -1
  25. package/build/legacy/production.cjs +9 -44
  26. package/build/legacy/production.cjs.map +1 -1
  27. package/build/legacy/production.d.cts +8 -2
  28. package/build/legacy/production.d.cts.map +1 -0
  29. package/build/legacy/production.d.ts +8 -2
  30. package/build/legacy/production.d.ts.map +1 -0
  31. package/build/legacy/production.js +7 -9
  32. package/build/legacy/production.js.map +1 -1
  33. package/build/legacy/rolldown-runtime-D7D4PA-g.js +13 -0
  34. package/build/legacy/rolldown-runtime-VH7oDXx4.cjs +28 -0
  35. package/build/modern/ReactQueryDevtools.cjs +57 -102
  36. package/build/modern/ReactQueryDevtools.cjs.map +1 -1
  37. package/build/modern/ReactQueryDevtools.d.cts +53 -2
  38. package/build/modern/ReactQueryDevtools.d.cts.map +1 -0
  39. package/build/modern/ReactQueryDevtools.d.ts +53 -2
  40. package/build/modern/ReactQueryDevtools.d.ts.map +1 -0
  41. package/build/modern/ReactQueryDevtools.js +50 -64
  42. package/build/modern/ReactQueryDevtools.js.map +1 -1
  43. package/build/modern/ReactQueryDevtoolsPanel.cjs +55 -98
  44. package/build/modern/ReactQueryDevtoolsPanel.cjs.map +1 -1
  45. package/build/modern/ReactQueryDevtoolsPanel.d.cts +48 -2
  46. package/build/modern/ReactQueryDevtoolsPanel.d.cts.map +1 -0
  47. package/build/modern/ReactQueryDevtoolsPanel.d.ts +48 -2
  48. package/build/modern/ReactQueryDevtoolsPanel.d.ts.map +1 -0
  49. package/build/modern/ReactQueryDevtoolsPanel.js +48 -60
  50. package/build/modern/ReactQueryDevtoolsPanel.js.map +1 -1
  51. package/build/modern/index.cjs +13 -48
  52. package/build/modern/index.cjs.map +1 -1
  53. package/build/modern/index.d.cts +9 -3
  54. package/build/modern/index.d.cts.map +1 -0
  55. package/build/modern/index.d.ts +9 -3
  56. package/build/modern/index.d.ts.map +1 -0
  57. package/build/modern/index.js +11 -13
  58. package/build/modern/index.js.map +1 -1
  59. package/build/modern/production.cjs +9 -44
  60. package/build/modern/production.cjs.map +1 -1
  61. package/build/modern/production.d.cts +8 -2
  62. package/build/modern/production.d.cts.map +1 -0
  63. package/build/modern/production.d.ts +8 -2
  64. package/build/modern/production.d.ts.map +1 -0
  65. package/build/modern/production.js +7 -9
  66. package/build/modern/production.js.map +1 -1
  67. package/build/modern/rolldown-runtime-D7D4PA-g.js +13 -0
  68. package/build/modern/rolldown-runtime-VH7oDXx4.cjs +28 -0
  69. package/package.json +7 -9
  70. package/build/legacy/_tsup-dts-rollup.d.cts +0 -119
  71. package/build/legacy/_tsup-dts-rollup.d.ts +0 -119
  72. package/build/modern/_tsup-dts-rollup.d.cts +0 -119
  73. package/build/modern/_tsup-dts-rollup.d.ts +0 -119
@@ -1,106 +1,61 @@
1
- "use strict";
2
1
  "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");
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
4
+ let react = require("react");
5
+ react = require_rolldown_runtime.__toESM(react, 1);
6
+ let _tanstack_react_query = require("@tanstack/react-query");
7
+ let _tanstack_query_devtools = require("@tanstack/query-devtools");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ //#region src/ReactQueryDevtools.tsx
41
10
  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 });
11
+ const queryClient = (0, _tanstack_react_query.useQueryClient)(props.client);
12
+ const ref = react.useRef(null);
13
+ const { buttonPosition, position, initialIsOpen, errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries, theme } = props;
14
+ const [devtools] = react.useState(new _tanstack_query_devtools.TanstackQueryDevtools({
15
+ client: queryClient,
16
+ queryFlavor: "React Query",
17
+ version: "5",
18
+ onlineManager: _tanstack_react_query.onlineManager,
19
+ buttonPosition,
20
+ position,
21
+ initialIsOpen,
22
+ errorTypes,
23
+ styleNonce,
24
+ shadowDOMTarget,
25
+ hideDisabledQueries,
26
+ theme
27
+ }));
28
+ react.useEffect(() => {
29
+ devtools.setClient(queryClient);
30
+ }, [queryClient, devtools]);
31
+ react.useEffect(() => {
32
+ if (buttonPosition) devtools.setButtonPosition(buttonPosition);
33
+ }, [buttonPosition, devtools]);
34
+ react.useEffect(() => {
35
+ if (position) devtools.setPosition(position);
36
+ }, [position, devtools]);
37
+ react.useEffect(() => {
38
+ devtools.setInitialIsOpen(initialIsOpen || false);
39
+ }, [initialIsOpen, devtools]);
40
+ react.useEffect(() => {
41
+ devtools.setErrorTypes(errorTypes || []);
42
+ }, [errorTypes, devtools]);
43
+ react.useEffect(() => {
44
+ devtools.setTheme(theme);
45
+ }, [theme, devtools]);
46
+ react.useEffect(() => {
47
+ if (ref.current) devtools.mount(ref.current);
48
+ return () => {
49
+ devtools.unmount();
50
+ };
51
+ }, [devtools]);
52
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
53
+ dir: "ltr",
54
+ className: "tsqd-parent-container",
55
+ ref
56
+ });
101
57
  }
102
- // Annotate the CommonJS export names for ESM import in node:
103
- 0 && (module.exports = {
104
- ReactQueryDevtools
105
- });
58
+ //#endregion
59
+ exports.ReactQueryDevtools = ReactQueryDevtools;
60
+
106
61
  //# sourceMappingURL=ReactQueryDevtools.cjs.map
@@ -1 +1 @@
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 TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\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
+ {"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 * 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":";;;;;;;;;AAwDA,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,2 +1,53 @@
1
- export { ReactQueryDevtools } from './_tsup-dts-rollup.cjs';
2
- export { DevtoolsOptions } from './_tsup-dts-rollup.cjs';
1
+ import * as React from "react";
2
+ import { DevtoolsButtonPosition, DevtoolsErrorType, DevtoolsPosition, Theme } from "@tanstack/query-devtools";
3
+ import { QueryClient } from "@tanstack/react-query";
4
+ declare namespace ReactQueryDevtools_d_exports {
5
+ export { DevtoolsOptions, ReactQueryDevtools };
6
+ }
7
+ interface DevtoolsOptions {
8
+ /**
9
+ * Set this true if you want the dev tools to default to being open
10
+ */
11
+ initialIsOpen?: boolean;
12
+ /**
13
+ * The position of the TanStack logo to open and close the devtools panel.
14
+ * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
15
+ * Defaults to 'bottom-right'.
16
+ */
17
+ buttonPosition?: DevtoolsButtonPosition;
18
+ /**
19
+ * The position of the React Query devtools panel.
20
+ * 'top' | 'bottom' | 'left' | 'right'
21
+ * Defaults to 'bottom'.
22
+ */
23
+ position?: DevtoolsPosition;
24
+ /**
25
+ * Custom instance of QueryClient
26
+ */
27
+ client?: QueryClient;
28
+ /**
29
+ * Use this so you can define custom errors that can be shown in the devtools.
30
+ */
31
+ errorTypes?: Array<DevtoolsErrorType>;
32
+ /**
33
+ * 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.
34
+ */
35
+ styleNonce?: string;
36
+ /**
37
+ * Use this so you can attach the devtool's styles to specific element in the DOM.
38
+ */
39
+ shadowDOMTarget?: ShadowRoot;
40
+ /**
41
+ * Set this to true to hide disabled queries from the devtools panel.
42
+ */
43
+ hideDisabledQueries?: boolean;
44
+ /**
45
+ * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
46
+ * Defaults to 'system'.
47
+ */
48
+ theme?: Theme;
49
+ }
50
+ declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement | null;
51
+ //#endregion
52
+ export { DevtoolsOptions, ReactQueryDevtools, ReactQueryDevtools_d_exports as t };
53
+ //# sourceMappingURL=ReactQueryDevtools.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactQueryDevtools.d.cts","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"mappings":";;;;;;UAYiB;;;;EAIf;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;EAIA,kBAAkB;;;;EAIlB;;;;;EAKA,QAAQ;;iBAGM,mBACd,OAAO,kBACN,MAAM"}
@@ -1,2 +1,53 @@
1
- export { ReactQueryDevtools } from './_tsup-dts-rollup.js';
2
- export { DevtoolsOptions } from './_tsup-dts-rollup.js';
1
+ import * as React from "react";
2
+ import { QueryClient } from "@tanstack/react-query";
3
+ import { DevtoolsButtonPosition, DevtoolsErrorType, DevtoolsPosition, Theme } from "@tanstack/query-devtools";
4
+ declare namespace ReactQueryDevtools_d_exports {
5
+ export { DevtoolsOptions, ReactQueryDevtools };
6
+ }
7
+ interface DevtoolsOptions {
8
+ /**
9
+ * Set this true if you want the dev tools to default to being open
10
+ */
11
+ initialIsOpen?: boolean;
12
+ /**
13
+ * The position of the TanStack logo to open and close the devtools panel.
14
+ * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
15
+ * Defaults to 'bottom-right'.
16
+ */
17
+ buttonPosition?: DevtoolsButtonPosition;
18
+ /**
19
+ * The position of the React Query devtools panel.
20
+ * 'top' | 'bottom' | 'left' | 'right'
21
+ * Defaults to 'bottom'.
22
+ */
23
+ position?: DevtoolsPosition;
24
+ /**
25
+ * Custom instance of QueryClient
26
+ */
27
+ client?: QueryClient;
28
+ /**
29
+ * Use this so you can define custom errors that can be shown in the devtools.
30
+ */
31
+ errorTypes?: Array<DevtoolsErrorType>;
32
+ /**
33
+ * 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.
34
+ */
35
+ styleNonce?: string;
36
+ /**
37
+ * Use this so you can attach the devtool's styles to specific element in the DOM.
38
+ */
39
+ shadowDOMTarget?: ShadowRoot;
40
+ /**
41
+ * Set this to true to hide disabled queries from the devtools panel.
42
+ */
43
+ hideDisabledQueries?: boolean;
44
+ /**
45
+ * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
46
+ * Defaults to 'system'.
47
+ */
48
+ theme?: Theme;
49
+ }
50
+ declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement | null;
51
+ //#endregion
52
+ export { DevtoolsOptions, ReactQueryDevtools, ReactQueryDevtools_d_exports as t };
53
+ //# sourceMappingURL=ReactQueryDevtools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactQueryDevtools.d.ts","names":[],"sources":["../../src/ReactQueryDevtools.tsx"],"mappings":";;;;;;UAYiB;;;;EAIf;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;EAIA,kBAAkB;;;;EAIlB;;;;;EAKA,QAAQ;;iBAGM,mBACd,OAAO,kBACN,MAAM"}
@@ -1,72 +1,58 @@
1
1
  "use client";
2
-
3
- // src/ReactQueryDevtools.tsx
4
2
  import * as React from "react";
5
3
  import { onlineManager, useQueryClient } from "@tanstack/react-query";
6
4
  import { TanstackQueryDevtools } from "@tanstack/query-devtools";
7
5
  import { jsx } from "react/jsx-runtime";
6
+ //#region src/ReactQueryDevtools.tsx
8
7
  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 });
8
+ const queryClient = useQueryClient(props.client);
9
+ const ref = React.useRef(null);
10
+ const { buttonPosition, position, initialIsOpen, errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries, theme } = props;
11
+ const [devtools] = React.useState(new TanstackQueryDevtools({
12
+ client: queryClient,
13
+ queryFlavor: "React Query",
14
+ version: "5",
15
+ onlineManager,
16
+ buttonPosition,
17
+ position,
18
+ initialIsOpen,
19
+ errorTypes,
20
+ styleNonce,
21
+ shadowDOMTarget,
22
+ hideDisabledQueries,
23
+ theme
24
+ }));
25
+ React.useEffect(() => {
26
+ devtools.setClient(queryClient);
27
+ }, [queryClient, devtools]);
28
+ React.useEffect(() => {
29
+ if (buttonPosition) devtools.setButtonPosition(buttonPosition);
30
+ }, [buttonPosition, devtools]);
31
+ React.useEffect(() => {
32
+ if (position) devtools.setPosition(position);
33
+ }, [position, devtools]);
34
+ React.useEffect(() => {
35
+ devtools.setInitialIsOpen(initialIsOpen || false);
36
+ }, [initialIsOpen, devtools]);
37
+ React.useEffect(() => {
38
+ devtools.setErrorTypes(errorTypes || []);
39
+ }, [errorTypes, devtools]);
40
+ React.useEffect(() => {
41
+ devtools.setTheme(theme);
42
+ }, [theme, devtools]);
43
+ React.useEffect(() => {
44
+ if (ref.current) devtools.mount(ref.current);
45
+ return () => {
46
+ devtools.unmount();
47
+ };
48
+ }, [devtools]);
49
+ return /* @__PURE__ */ jsx("div", {
50
+ dir: "ltr",
51
+ className: "tsqd-parent-container",
52
+ ref
53
+ });
68
54
  }
69
- export {
70
- ReactQueryDevtools
71
- };
55
+ //#endregion
56
+ export { ReactQueryDevtools };
57
+
72
58
  //# sourceMappingURL=ReactQueryDevtools.js.map
@@ -1 +1 @@
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 TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\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
+ {"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 * 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":";;;;;;AAwDA,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,102 +1,59 @@
1
- "use strict";
2
1
  "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");
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
4
+ let react = require("react");
5
+ react = require_rolldown_runtime.__toESM(react, 1);
6
+ let _tanstack_react_query = require("@tanstack/react-query");
7
+ let _tanstack_query_devtools = require("@tanstack/query-devtools");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ //#region src/ReactQueryDevtoolsPanel.tsx
41
10
  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
- );
11
+ const queryClient = (0, _tanstack_react_query.useQueryClient)(props.client);
12
+ const ref = react.useRef(null);
13
+ const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries, theme } = props;
14
+ const [devtools] = react.useState(new _tanstack_query_devtools.TanstackQueryDevtoolsPanel({
15
+ client: queryClient,
16
+ queryFlavor: "React Query",
17
+ version: "5",
18
+ onlineManager: _tanstack_react_query.onlineManager,
19
+ buttonPosition: "bottom-left",
20
+ position: "bottom",
21
+ initialIsOpen: true,
22
+ errorTypes,
23
+ styleNonce,
24
+ shadowDOMTarget,
25
+ onClose: props.onClose,
26
+ hideDisabledQueries,
27
+ theme
28
+ }));
29
+ react.useEffect(() => {
30
+ devtools.setClient(queryClient);
31
+ }, [queryClient, devtools]);
32
+ react.useEffect(() => {
33
+ devtools.setOnClose(props.onClose ?? (() => {}));
34
+ }, [props.onClose, devtools]);
35
+ react.useEffect(() => {
36
+ devtools.setErrorTypes(errorTypes || []);
37
+ }, [errorTypes, devtools]);
38
+ react.useEffect(() => {
39
+ devtools.setTheme(theme);
40
+ }, [theme, devtools]);
41
+ react.useEffect(() => {
42
+ if (ref.current) devtools.mount(ref.current);
43
+ return () => {
44
+ devtools.unmount();
45
+ };
46
+ }, [devtools]);
47
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
48
+ style: {
49
+ height: "500px",
50
+ ...props.style
51
+ },
52
+ className: "tsqd-parent-container",
53
+ ref
54
+ });
97
55
  }
98
- // Annotate the CommonJS export names for ESM import in node:
99
- 0 && (module.exports = {
100
- ReactQueryDevtoolsPanel
101
- });
56
+ //#endregion
57
+ exports.ReactQueryDevtoolsPanel = ReactQueryDevtoolsPanel;
58
+
102
59
  //# sourceMappingURL=ReactQueryDevtoolsPanel.cjs.map