@tanstack/react-query-devtools 5.101.4 → 5.102.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/ReactQueryDevtools.cjs +57 -102
- package/build/legacy/ReactQueryDevtools.cjs.map +1 -1
- package/build/legacy/ReactQueryDevtools.d.cts +53 -2
- package/build/legacy/ReactQueryDevtools.d.cts.map +1 -0
- package/build/legacy/ReactQueryDevtools.d.ts +53 -2
- package/build/legacy/ReactQueryDevtools.d.ts.map +1 -0
- package/build/legacy/ReactQueryDevtools.js +50 -64
- package/build/legacy/ReactQueryDevtools.js.map +1 -1
- package/build/legacy/ReactQueryDevtoolsPanel.cjs +55 -98
- package/build/legacy/ReactQueryDevtoolsPanel.cjs.map +1 -1
- package/build/legacy/ReactQueryDevtoolsPanel.d.cts +48 -2
- package/build/legacy/ReactQueryDevtoolsPanel.d.cts.map +1 -0
- package/build/legacy/ReactQueryDevtoolsPanel.d.ts +48 -2
- package/build/legacy/ReactQueryDevtoolsPanel.d.ts.map +1 -0
- package/build/legacy/ReactQueryDevtoolsPanel.js +48 -60
- package/build/legacy/ReactQueryDevtoolsPanel.js.map +1 -1
- package/build/legacy/index.cjs +13 -48
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +9 -3
- package/build/legacy/index.d.cts.map +1 -0
- package/build/legacy/index.d.ts +9 -3
- package/build/legacy/index.d.ts.map +1 -0
- package/build/legacy/index.js +11 -13
- package/build/legacy/index.js.map +1 -1
- package/build/legacy/production.cjs +9 -44
- package/build/legacy/production.cjs.map +1 -1
- package/build/legacy/production.d.cts +8 -2
- package/build/legacy/production.d.cts.map +1 -0
- package/build/legacy/production.d.ts +8 -2
- package/build/legacy/production.d.ts.map +1 -0
- package/build/legacy/production.js +7 -9
- package/build/legacy/production.js.map +1 -1
- package/build/legacy/rolldown-runtime-D7D4PA-g.js +13 -0
- package/build/legacy/rolldown-runtime-VH7oDXx4.cjs +28 -0
- package/build/modern/ReactQueryDevtools.cjs +57 -102
- package/build/modern/ReactQueryDevtools.cjs.map +1 -1
- package/build/modern/ReactQueryDevtools.d.cts +53 -2
- package/build/modern/ReactQueryDevtools.d.cts.map +1 -0
- package/build/modern/ReactQueryDevtools.d.ts +53 -2
- package/build/modern/ReactQueryDevtools.d.ts.map +1 -0
- package/build/modern/ReactQueryDevtools.js +50 -64
- package/build/modern/ReactQueryDevtools.js.map +1 -1
- package/build/modern/ReactQueryDevtoolsPanel.cjs +55 -98
- package/build/modern/ReactQueryDevtoolsPanel.cjs.map +1 -1
- package/build/modern/ReactQueryDevtoolsPanel.d.cts +48 -2
- package/build/modern/ReactQueryDevtoolsPanel.d.cts.map +1 -0
- package/build/modern/ReactQueryDevtoolsPanel.d.ts +48 -2
- package/build/modern/ReactQueryDevtoolsPanel.d.ts.map +1 -0
- package/build/modern/ReactQueryDevtoolsPanel.js +48 -60
- package/build/modern/ReactQueryDevtoolsPanel.js.map +1 -1
- package/build/modern/index.cjs +13 -48
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +9 -3
- package/build/modern/index.d.cts.map +1 -0
- package/build/modern/index.d.ts +9 -3
- package/build/modern/index.d.ts.map +1 -0
- package/build/modern/index.js +11 -13
- package/build/modern/index.js.map +1 -1
- package/build/modern/production.cjs +9 -44
- package/build/modern/production.cjs.map +1 -1
- package/build/modern/production.d.cts +8 -2
- package/build/modern/production.d.cts.map +1 -0
- package/build/modern/production.d.ts +8 -2
- package/build/modern/production.d.ts.map +1 -0
- package/build/modern/production.js +7 -9
- package/build/modern/production.js.map +1 -1
- package/build/modern/rolldown-runtime-D7D4PA-g.js +13 -0
- package/build/modern/rolldown-runtime-VH7oDXx4.cjs +28 -0
- package/package.json +7 -9
- package/build/legacy/_tsup-dts-rollup.d.cts +0 -119
- package/build/legacy/_tsup-dts-rollup.d.ts +0 -119
- package/build/modern/_tsup-dts-rollup.d.cts +0 -119
- package/build/modern/_tsup-dts-rollup.d.ts +0 -119
|
@@ -1,106 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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":"
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
70
|
-
|
|
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":"
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
});
|
|
56
|
+
//#endregion
|
|
57
|
+
exports.ReactQueryDevtoolsPanel = ReactQueryDevtoolsPanel;
|
|
58
|
+
|
|
102
59
|
//# sourceMappingURL=ReactQueryDevtoolsPanel.cjs.map
|