@tanstack/preact-query-devtools 5.104.0 → 5.104.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/PreactQueryDevtools.cjs +6 -0
- package/build/legacy/PreactQueryDevtools.cjs.map +1 -1
- package/build/legacy/PreactQueryDevtools.d.cts +12 -4
- package/build/legacy/PreactQueryDevtools.d.cts.map +1 -1
- package/build/legacy/PreactQueryDevtools.d.ts +12 -4
- package/build/legacy/PreactQueryDevtools.d.ts.map +1 -1
- package/build/legacy/PreactQueryDevtools.js +6 -0
- package/build/legacy/PreactQueryDevtools.js.map +1 -1
- package/build/legacy/PreactQueryDevtoolsPanel.cjs +5 -0
- package/build/legacy/PreactQueryDevtoolsPanel.cjs.map +1 -1
- package/build/legacy/PreactQueryDevtoolsPanel.d.cts +10 -2
- package/build/legacy/PreactQueryDevtoolsPanel.d.cts.map +1 -1
- package/build/legacy/PreactQueryDevtoolsPanel.d.ts +10 -2
- package/build/legacy/PreactQueryDevtoolsPanel.d.ts.map +1 -1
- package/build/legacy/PreactQueryDevtoolsPanel.js +5 -0
- package/build/legacy/PreactQueryDevtoolsPanel.js.map +1 -1
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +3 -0
- package/build/legacy/index.d.cts.map +1 -1
- package/build/legacy/index.d.ts +3 -0
- package/build/legacy/index.d.ts.map +1 -1
- package/build/legacy/index.js.map +1 -1
- package/build/modern/PreactQueryDevtools.cjs +6 -0
- package/build/modern/PreactQueryDevtools.cjs.map +1 -1
- package/build/modern/PreactQueryDevtools.d.cts +12 -4
- package/build/modern/PreactQueryDevtools.d.cts.map +1 -1
- package/build/modern/PreactQueryDevtools.d.ts +12 -4
- package/build/modern/PreactQueryDevtools.d.ts.map +1 -1
- package/build/modern/PreactQueryDevtools.js +6 -0
- package/build/modern/PreactQueryDevtools.js.map +1 -1
- package/build/modern/PreactQueryDevtoolsPanel.cjs +5 -0
- package/build/modern/PreactQueryDevtoolsPanel.cjs.map +1 -1
- package/build/modern/PreactQueryDevtoolsPanel.d.cts +10 -2
- package/build/modern/PreactQueryDevtoolsPanel.d.cts.map +1 -1
- package/build/modern/PreactQueryDevtoolsPanel.d.ts +10 -2
- package/build/modern/PreactQueryDevtoolsPanel.d.ts.map +1 -1
- package/build/modern/PreactQueryDevtoolsPanel.js +5 -0
- package/build/modern/PreactQueryDevtoolsPanel.js.map +1 -1
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +3 -0
- package/build/modern/index.d.cts.map +1 -1
- package/build/modern/index.d.ts +3 -0
- package/build/modern/index.d.ts.map +1 -1
- package/build/modern/index.js.map +1 -1
- package/package.json +9 -12
- package/src/PreactQueryDevtools.tsx +13 -5
- package/src/PreactQueryDevtoolsPanel.tsx +11 -3
- package/src/index.ts +3 -0
|
@@ -4,6 +4,12 @@ let _tanstack_preact_query = require("@tanstack/preact-query");
|
|
|
4
4
|
let _tanstack_query_devtools = require("@tanstack/query-devtools");
|
|
5
5
|
let preact_jsx_runtime = require("preact/jsx-runtime");
|
|
6
6
|
//#region src/PreactQueryDevtools.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
9
|
+
* nearest `QueryClient`.
|
|
10
|
+
* @param props - The devtools options.
|
|
11
|
+
* @returns The element the devtools are mounted in.
|
|
12
|
+
*/
|
|
7
13
|
function PreactQueryDevtools(props) {
|
|
8
14
|
const queryClient = (0, _tanstack_preact_query.useQueryClient)(props.client);
|
|
9
15
|
const ref = (0, preact_hooks.useRef)(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtools.cjs","names":["useQueryClient","useRef","useState","TanstackQueryDevtools"],"sources":["../../src/PreactQueryDevtools.tsx"],"sourcesContent":["import { useRef, useState
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtools.cjs","names":["useQueryClient","useRef","useState","TanstackQueryDevtools"],"sources":["../../src/PreactQueryDevtools.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport { onlineManager, useQueryClient } from '@tanstack/preact-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/preact-query'\nimport type { VNode } from 'preact'\n\n/**\n * The props of `PreactQueryDevtools`, which renders the devtools with a toggle button that opens\n * them.\n */\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the Preact Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Use this to provide a custom QueryClient. Otherwise, the one from the\n * nearest QueryClientProvider will be used.\n */\n client?: QueryClient\n /**\n * Use this to provide custom error type handlers for the devtools panel.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document\n * head. This is useful if you are using a Content Security Policy (CSP)\n * nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Use this to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Use this to set the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or\n * nearest `QueryClient`.\n * @param props - The devtools options.\n * @returns The element the devtools are mounted in.\n */\nexport function PreactQueryDevtools(props: DevtoolsOptions): VNode | null {\n const queryClient = useQueryClient(props.client)\n const ref = 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] = useState(\n () =>\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'Preact 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 useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref} />\n}\n"],"mappings":";;;;;;;;;;;;AAsEA,SAAgB,oBAAoB,OAAsC;CACxE,MAAM,eAAA,GAAcA,uBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,OAAA,GAAMC,aAAAA,OAAAA,CAAuB,IAAI;CACvC,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,aAAA,GAAYC,aAAAA,SAAAA,OAEf,IAAIC,yBAAAA,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,uBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACL;CAEA,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAE5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,iBAAA,GAAA,mBAAA,IAAA,CAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAM,CAAA;AACrE"}
|
|
@@ -4,6 +4,10 @@ import { VNode } from "preact";
|
|
|
4
4
|
declare namespace PreactQueryDevtools_d_exports {
|
|
5
5
|
export { DevtoolsOptions, PreactQueryDevtools };
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The props of `PreactQueryDevtools`, which renders the devtools with a toggle button that opens
|
|
9
|
+
* them.
|
|
10
|
+
*/
|
|
7
11
|
export interface DevtoolsOptions {
|
|
8
12
|
/**
|
|
9
13
|
* Set this true if you want the dev tools to default to being open
|
|
@@ -12,14 +16,12 @@ export interface DevtoolsOptions {
|
|
|
12
16
|
/**
|
|
13
17
|
* The position of the TanStack logo to open and close the devtools panel.
|
|
14
18
|
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
15
|
-
*
|
|
16
19
|
* @defaultValue bottom-right
|
|
17
20
|
*/
|
|
18
21
|
buttonPosition?: DevtoolsButtonPosition;
|
|
19
22
|
/**
|
|
20
23
|
* The position of the Preact Query devtools panel.
|
|
21
24
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
22
|
-
*
|
|
23
25
|
* @defaultValue bottom
|
|
24
26
|
*/
|
|
25
27
|
position?: DevtoolsPosition;
|
|
@@ -39,7 +41,8 @@ export interface DevtoolsOptions {
|
|
|
39
41
|
*/
|
|
40
42
|
styleNonce?: string;
|
|
41
43
|
/**
|
|
42
|
-
* Use this to
|
|
44
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
45
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
43
46
|
*/
|
|
44
47
|
shadowDOMTarget?: ShadowRoot;
|
|
45
48
|
/**
|
|
@@ -48,11 +51,16 @@ export interface DevtoolsOptions {
|
|
|
48
51
|
hideDisabledQueries?: boolean;
|
|
49
52
|
/**
|
|
50
53
|
* Use this to set the theme of the devtools panel.
|
|
51
|
-
*
|
|
52
54
|
* @defaultValue system
|
|
53
55
|
*/
|
|
54
56
|
theme?: Theme;
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
60
|
+
* nearest `QueryClient`.
|
|
61
|
+
* @param props - The devtools options.
|
|
62
|
+
* @returns The element the devtools are mounted in.
|
|
63
|
+
*/
|
|
56
64
|
export declare function PreactQueryDevtools(props: DevtoolsOptions): VNode | null;
|
|
57
65
|
//#endregion
|
|
58
66
|
export { PreactQueryDevtools_d_exports as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtools.d.cts","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtools.d.cts","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"mappings":";;;;;;;;;;iBAgBiB;;;;EAIf;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;;EAKX,SAAS;;;;EAIT,aAAa,MAAM;;;;;;EAMnB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;EAKA,QAAQ;;;;;;;;wBASM,oBAAoB,OAAO,kBAAkB"}
|
|
@@ -4,6 +4,10 @@ import { VNode } from "preact";
|
|
|
4
4
|
declare namespace PreactQueryDevtools_d_exports {
|
|
5
5
|
export { DevtoolsOptions, PreactQueryDevtools };
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The props of `PreactQueryDevtools`, which renders the devtools with a toggle button that opens
|
|
9
|
+
* them.
|
|
10
|
+
*/
|
|
7
11
|
export interface DevtoolsOptions {
|
|
8
12
|
/**
|
|
9
13
|
* Set this true if you want the dev tools to default to being open
|
|
@@ -12,14 +16,12 @@ export interface DevtoolsOptions {
|
|
|
12
16
|
/**
|
|
13
17
|
* The position of the TanStack logo to open and close the devtools panel.
|
|
14
18
|
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
15
|
-
*
|
|
16
19
|
* @defaultValue bottom-right
|
|
17
20
|
*/
|
|
18
21
|
buttonPosition?: DevtoolsButtonPosition;
|
|
19
22
|
/**
|
|
20
23
|
* The position of the Preact Query devtools panel.
|
|
21
24
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
22
|
-
*
|
|
23
25
|
* @defaultValue bottom
|
|
24
26
|
*/
|
|
25
27
|
position?: DevtoolsPosition;
|
|
@@ -39,7 +41,8 @@ export interface DevtoolsOptions {
|
|
|
39
41
|
*/
|
|
40
42
|
styleNonce?: string;
|
|
41
43
|
/**
|
|
42
|
-
* Use this to
|
|
44
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
45
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
43
46
|
*/
|
|
44
47
|
shadowDOMTarget?: ShadowRoot;
|
|
45
48
|
/**
|
|
@@ -48,11 +51,16 @@ export interface DevtoolsOptions {
|
|
|
48
51
|
hideDisabledQueries?: boolean;
|
|
49
52
|
/**
|
|
50
53
|
* Use this to set the theme of the devtools panel.
|
|
51
|
-
*
|
|
52
54
|
* @defaultValue system
|
|
53
55
|
*/
|
|
54
56
|
theme?: Theme;
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
60
|
+
* nearest `QueryClient`.
|
|
61
|
+
* @param props - The devtools options.
|
|
62
|
+
* @returns The element the devtools are mounted in.
|
|
63
|
+
*/
|
|
56
64
|
export declare function PreactQueryDevtools(props: DevtoolsOptions): VNode | null;
|
|
57
65
|
//#endregion
|
|
58
66
|
export { PreactQueryDevtools_d_exports as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtools.d.ts","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtools.d.ts","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"mappings":";;;;;;;;;;iBAgBiB;;;;EAIf;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;;EAKX,SAAS;;;;EAIT,aAAa,MAAM;;;;;;EAMnB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;EAKA,QAAQ;;;;;;;;wBASM,oBAAoB,OAAO,kBAAkB"}
|
|
@@ -3,6 +3,12 @@ import { onlineManager, useQueryClient } from "@tanstack/preact-query";
|
|
|
3
3
|
import { TanstackQueryDevtools } from "@tanstack/query-devtools";
|
|
4
4
|
import { jsx } from "preact/jsx-runtime";
|
|
5
5
|
//#region src/PreactQueryDevtools.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
8
|
+
* nearest `QueryClient`.
|
|
9
|
+
* @param props - The devtools options.
|
|
10
|
+
* @returns The element the devtools are mounted in.
|
|
11
|
+
*/
|
|
6
12
|
function PreactQueryDevtools(props) {
|
|
7
13
|
const queryClient = useQueryClient(props.client);
|
|
8
14
|
const ref = useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtools.js","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"sourcesContent":["import { useRef, useState
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtools.js","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport { onlineManager, useQueryClient } from '@tanstack/preact-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/preact-query'\nimport type { VNode } from 'preact'\n\n/**\n * The props of `PreactQueryDevtools`, which renders the devtools with a toggle button that opens\n * them.\n */\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the Preact Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Use this to provide a custom QueryClient. Otherwise, the one from the\n * nearest QueryClientProvider will be used.\n */\n client?: QueryClient\n /**\n * Use this to provide custom error type handlers for the devtools panel.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document\n * head. This is useful if you are using a Content Security Policy (CSP)\n * nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Use this to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Use this to set the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or\n * nearest `QueryClient`.\n * @param props - The devtools options.\n * @returns The element the devtools are mounted in.\n */\nexport function PreactQueryDevtools(props: DevtoolsOptions): VNode | null {\n const queryClient = useQueryClient(props.client)\n const ref = 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] = useState(\n () =>\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'Preact 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 useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref} />\n}\n"],"mappings":";;;;;;;;;;;AAsEA,SAAgB,oBAAoB,OAAsC;CACxE,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,OAAuB,IAAI;CACvC,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,eAEf,IAAI,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACL;CAEA,gBAAgB;EACd,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,gBAAgB;EACd,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,gBAAgB;EACd,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,gBAAgB;EACd,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,gBAAgB;EACd,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,gBAAgB;EACd,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,gBAAgB;EACd,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAE5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,oBAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAM,CAAA;AACrE"}
|
|
@@ -4,6 +4,11 @@ let _tanstack_preact_query = require("@tanstack/preact-query");
|
|
|
4
4
|
let _tanstack_query_devtools = require("@tanstack/query-devtools");
|
|
5
5
|
let preact_jsx_runtime = require("preact/jsx-runtime");
|
|
6
6
|
//#region src/PreactQueryDevtoolsPanel.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
9
|
+
* @param props - The devtools panel options.
|
|
10
|
+
* @returns The element the devtools panel is mounted in.
|
|
11
|
+
*/
|
|
7
12
|
function PreactQueryDevtoolsPanel(props) {
|
|
8
13
|
const queryClient = (0, _tanstack_preact_query.useQueryClient)(props.client);
|
|
9
14
|
const ref = (0, preact_hooks.useRef)(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtoolsPanel.cjs","names":["useQueryClient","useRef","useState","TanstackQueryDevtoolsPanel"],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"sourcesContent":["import { useRef, useState
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtoolsPanel.cjs","names":["useQueryClient","useRef","useState","TanstackQueryDevtoolsPanel"],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport { onlineManager, useQueryClient } from '@tanstack/preact-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/preact-query'\nimport type { CSSProperties, VNode } from 'preact'\n\n/**\n * The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport interface DevtoolsPanelOptions {\n /**\n * Use this to provide a custom QueryClient. Otherwise, the one from the\n * nearest QueryClientProvider will be used.\n */\n client?: QueryClient\n /**\n * Custom error types to 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\n * head. This is useful if you are using a Content Security Policy (CSP)\n * nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Custom styles for the devtools panel container.\n */\n style?: CSSProperties\n /**\n * Callback function when the devtools panel is closed.\n */\n onClose?: () => unknown\n /**\n * Use this to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Use this to set the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.\n * @param props - The devtools panel options.\n * @returns The element the devtools panel is mounted in.\n */\nexport function PreactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): VNode | null {\n const queryClient = useQueryClient(props.client)\n const ref = useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = useState(\n () =>\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'Preact 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 useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\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 />\n )\n}\n"],"mappings":";;;;;;;;;;;AAuDA,SAAgB,yBACd,OACc;CACd,MAAM,eAAA,GAAcA,uBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,OAAA,GAAMC,aAAAA,OAAAA,CAAuB,IAAI;CACvC,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,aAAA,GAAYC,aAAAA,SAAAA,OAEf,IAAIC,yBAAAA,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,uBAAA;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACL;CAEA,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAE5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,iBAAA,GAAA,mBAAA,IAAA,CAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACN,CAAA;AAEL"}
|
|
@@ -4,6 +4,9 @@ import { CSSProperties, VNode } from "preact";
|
|
|
4
4
|
declare namespace PreactQueryDevtoolsPanel_d_exports {
|
|
5
5
|
export { DevtoolsPanelOptions, PreactQueryDevtoolsPanel };
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
9
|
+
*/
|
|
7
10
|
export interface DevtoolsPanelOptions {
|
|
8
11
|
/**
|
|
9
12
|
* Use this to provide a custom QueryClient. Otherwise, the one from the
|
|
@@ -21,7 +24,8 @@ export interface DevtoolsPanelOptions {
|
|
|
21
24
|
*/
|
|
22
25
|
styleNonce?: string;
|
|
23
26
|
/**
|
|
24
|
-
* Use this to
|
|
27
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
28
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
25
29
|
*/
|
|
26
30
|
shadowDOMTarget?: ShadowRoot;
|
|
27
31
|
/**
|
|
@@ -38,11 +42,15 @@ export interface DevtoolsPanelOptions {
|
|
|
38
42
|
hideDisabledQueries?: boolean;
|
|
39
43
|
/**
|
|
40
44
|
* Use this to set the theme of the devtools panel.
|
|
41
|
-
*
|
|
42
45
|
* @defaultValue system
|
|
43
46
|
*/
|
|
44
47
|
theme?: Theme;
|
|
45
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
51
|
+
* @param props - The devtools panel options.
|
|
52
|
+
* @returns The element the devtools panel is mounted in.
|
|
53
|
+
*/
|
|
46
54
|
export declare function PreactQueryDevtoolsPanel(props: DevtoolsPanelOptions): VNode | null;
|
|
47
55
|
//#endregion
|
|
48
56
|
export { PreactQueryDevtoolsPanel_d_exports as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtoolsPanel.d.cts","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtoolsPanel.d.cts","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;;;;iBAUiB;;;;;EAKf,SAAS;;;;EAIT,aAAa,MAAM;;;;;;EAMnB;;;;;EAKA,kBAAkB;;;;EAIlB,QAAQ;;;;EAIR;;;;EAIA;;;;;EAKA,QAAQ;;;;;;;wBAQM,yBACd,OAAO,uBACN"}
|
|
@@ -4,6 +4,9 @@ import { CSSProperties, VNode } from "preact";
|
|
|
4
4
|
declare namespace PreactQueryDevtoolsPanel_d_exports {
|
|
5
5
|
export { DevtoolsPanelOptions, PreactQueryDevtoolsPanel };
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
9
|
+
*/
|
|
7
10
|
export interface DevtoolsPanelOptions {
|
|
8
11
|
/**
|
|
9
12
|
* Use this to provide a custom QueryClient. Otherwise, the one from the
|
|
@@ -21,7 +24,8 @@ export interface DevtoolsPanelOptions {
|
|
|
21
24
|
*/
|
|
22
25
|
styleNonce?: string;
|
|
23
26
|
/**
|
|
24
|
-
* Use this to
|
|
27
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
28
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
25
29
|
*/
|
|
26
30
|
shadowDOMTarget?: ShadowRoot;
|
|
27
31
|
/**
|
|
@@ -38,11 +42,15 @@ export interface DevtoolsPanelOptions {
|
|
|
38
42
|
hideDisabledQueries?: boolean;
|
|
39
43
|
/**
|
|
40
44
|
* Use this to set the theme of the devtools panel.
|
|
41
|
-
*
|
|
42
45
|
* @defaultValue system
|
|
43
46
|
*/
|
|
44
47
|
theme?: Theme;
|
|
45
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
51
|
+
* @param props - The devtools panel options.
|
|
52
|
+
* @returns The element the devtools panel is mounted in.
|
|
53
|
+
*/
|
|
46
54
|
export declare function PreactQueryDevtoolsPanel(props: DevtoolsPanelOptions): VNode | null;
|
|
47
55
|
//#endregion
|
|
48
56
|
export { PreactQueryDevtoolsPanel_d_exports as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtoolsPanel.d.ts","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtoolsPanel.d.ts","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;;;;iBAUiB;;;;;EAKf,SAAS;;;;EAIT,aAAa,MAAM;;;;;;EAMnB;;;;;EAKA,kBAAkB;;;;EAIlB,QAAQ;;;;EAIR;;;;EAIA;;;;;EAKA,QAAQ;;;;;;;wBAQM,yBACd,OAAO,uBACN"}
|
|
@@ -3,6 +3,11 @@ import { onlineManager, useQueryClient } from "@tanstack/preact-query";
|
|
|
3
3
|
import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
|
|
4
4
|
import { jsx } from "preact/jsx-runtime";
|
|
5
5
|
//#region src/PreactQueryDevtoolsPanel.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
8
|
+
* @param props - The devtools panel options.
|
|
9
|
+
* @returns The element the devtools panel is mounted in.
|
|
10
|
+
*/
|
|
6
11
|
function PreactQueryDevtoolsPanel(props) {
|
|
7
12
|
const queryClient = useQueryClient(props.client);
|
|
8
13
|
const ref = useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtoolsPanel.js","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"sourcesContent":["import { useRef, useState
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtoolsPanel.js","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport { onlineManager, useQueryClient } from '@tanstack/preact-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/preact-query'\nimport type { CSSProperties, VNode } from 'preact'\n\n/**\n * The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport interface DevtoolsPanelOptions {\n /**\n * Use this to provide a custom QueryClient. Otherwise, the one from the\n * nearest QueryClientProvider will be used.\n */\n client?: QueryClient\n /**\n * Custom error types to 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\n * head. This is useful if you are using a Content Security Policy (CSP)\n * nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Custom styles for the devtools panel container.\n */\n style?: CSSProperties\n /**\n * Callback function when the devtools panel is closed.\n */\n onClose?: () => unknown\n /**\n * Use this to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Use this to set the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.\n * @param props - The devtools panel options.\n * @returns The element the devtools panel is mounted in.\n */\nexport function PreactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): VNode | null {\n const queryClient = useQueryClient(props.client)\n const ref = useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = useState(\n () =>\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'Preact 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 useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\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 />\n )\n}\n"],"mappings":";;;;;;;;;;AAuDA,SAAgB,yBACd,OACc;CACd,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,OAAuB,IAAI;CACvC,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,eAEf,IAAI,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACL;CAEA,gBAAgB;EACd,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,gBAAgB;EACd,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,gBAAgB;EACd,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,gBAAgB;EACd,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,gBAAgB;EACd,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAE5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,oBAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACN,CAAA;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import * as Devtools from './PreactQueryDevtools'\nimport * as DevtoolsPanel from './PreactQueryDevtoolsPanel'\n\nexport const PreactQueryDevtools: (typeof Devtools)['PreactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.PreactQueryDevtools\n\nexport const PreactQueryDevtoolsPanel: (typeof DevtoolsPanel)['PreactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.PreactQueryDevtoolsPanel\n\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;AAGA,MAAa,sBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,4BAAA;AAGN,MAAa,2BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,iCAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import * as Devtools from './PreactQueryDevtools'\nimport * as DevtoolsPanel from './PreactQueryDevtoolsPanel'\n\nexport const PreactQueryDevtools: (typeof Devtools)['PreactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.PreactQueryDevtools\n\nexport const PreactQueryDevtoolsPanel: (typeof DevtoolsPanel)['PreactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.PreactQueryDevtoolsPanel\n\n/**\n * The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;AAGA,MAAa,sBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,4BAAA;AAGN,MAAa,2BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,iCAAA"}
|
package/build/legacy/index.d.cts
CHANGED
|
@@ -3,6 +3,9 @@ import { DevtoolsPanelOptions as DevtoolsPanelOptions$1, t as PreactQueryDevtool
|
|
|
3
3
|
//#region src/index.d.ts
|
|
4
4
|
export declare const PreactQueryDevtools: (typeof PreactQueryDevtools_d_exports)['PreactQueryDevtools'];
|
|
5
5
|
export declare const PreactQueryDevtoolsPanel: (typeof PreactQueryDevtoolsPanel_d_exports)['PreactQueryDevtoolsPanel'];
|
|
6
|
+
/**
|
|
7
|
+
* The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
8
|
+
*/
|
|
6
9
|
export type DevtoolsPanelOptions = DevtoolsPanelOptions$1;
|
|
7
10
|
//#endregion
|
|
8
11
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAGa,6BAA6BA;qBAO7B,kCAAkCC
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAGa,6BAA6BA;qBAO7B,kCAAkCC;;;;YAUnC,uBAAuBC"}
|
package/build/legacy/index.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { DevtoolsPanelOptions as DevtoolsPanelOptions$1, t as PreactQueryDevtool
|
|
|
3
3
|
//#region src/index.d.ts
|
|
4
4
|
export declare const PreactQueryDevtools: (typeof PreactQueryDevtools_d_exports)['PreactQueryDevtools'];
|
|
5
5
|
export declare const PreactQueryDevtoolsPanel: (typeof PreactQueryDevtoolsPanel_d_exports)['PreactQueryDevtoolsPanel'];
|
|
6
|
+
/**
|
|
7
|
+
* The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
8
|
+
*/
|
|
6
9
|
export type DevtoolsPanelOptions = DevtoolsPanelOptions$1;
|
|
7
10
|
//#endregion
|
|
8
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAGa,6BAA6BA;qBAO7B,kCAAkCC
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAGa,6BAA6BA;qBAO7B,kCAAkCC;;;;YAUnC,uBAAuBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Devtools.PreactQueryDevtools","DevtoolsPanel.PreactQueryDevtoolsPanel"],"sources":["../../src/index.ts"],"sourcesContent":["import * as Devtools from './PreactQueryDevtools'\nimport * as DevtoolsPanel from './PreactQueryDevtoolsPanel'\n\nexport const PreactQueryDevtools: (typeof Devtools)['PreactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.PreactQueryDevtools\n\nexport const PreactQueryDevtoolsPanel: (typeof DevtoolsPanel)['PreactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.PreactQueryDevtoolsPanel\n\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;AAGA,MAAa,sBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAA;AAEN,MAAa,2BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Devtools.PreactQueryDevtools","DevtoolsPanel.PreactQueryDevtoolsPanel"],"sources":["../../src/index.ts"],"sourcesContent":["import * as Devtools from './PreactQueryDevtools'\nimport * as DevtoolsPanel from './PreactQueryDevtoolsPanel'\n\nexport const PreactQueryDevtools: (typeof Devtools)['PreactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.PreactQueryDevtools\n\nexport const PreactQueryDevtoolsPanel: (typeof DevtoolsPanel)['PreactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.PreactQueryDevtoolsPanel\n\n/**\n * The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;AAGA,MAAa,sBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAA;AAEN,MAAa,2BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAC"}
|
|
@@ -4,6 +4,12 @@ let _tanstack_preact_query = require("@tanstack/preact-query");
|
|
|
4
4
|
let _tanstack_query_devtools = require("@tanstack/query-devtools");
|
|
5
5
|
let preact_jsx_runtime = require("preact/jsx-runtime");
|
|
6
6
|
//#region src/PreactQueryDevtools.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
9
|
+
* nearest `QueryClient`.
|
|
10
|
+
* @param props - The devtools options.
|
|
11
|
+
* @returns The element the devtools are mounted in.
|
|
12
|
+
*/
|
|
7
13
|
function PreactQueryDevtools(props) {
|
|
8
14
|
const queryClient = (0, _tanstack_preact_query.useQueryClient)(props.client);
|
|
9
15
|
const ref = (0, preact_hooks.useRef)(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtools.cjs","names":["useQueryClient","useRef","useState","TanstackQueryDevtools"],"sources":["../../src/PreactQueryDevtools.tsx"],"sourcesContent":["import { useRef, useState
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtools.cjs","names":["useQueryClient","useRef","useState","TanstackQueryDevtools"],"sources":["../../src/PreactQueryDevtools.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport { onlineManager, useQueryClient } from '@tanstack/preact-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/preact-query'\nimport type { VNode } from 'preact'\n\n/**\n * The props of `PreactQueryDevtools`, which renders the devtools with a toggle button that opens\n * them.\n */\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the Preact Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Use this to provide a custom QueryClient. Otherwise, the one from the\n * nearest QueryClientProvider will be used.\n */\n client?: QueryClient\n /**\n * Use this to provide custom error type handlers for the devtools panel.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document\n * head. This is useful if you are using a Content Security Policy (CSP)\n * nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Use this to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Use this to set the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or\n * nearest `QueryClient`.\n * @param props - The devtools options.\n * @returns The element the devtools are mounted in.\n */\nexport function PreactQueryDevtools(props: DevtoolsOptions): VNode | null {\n const queryClient = useQueryClient(props.client)\n const ref = 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] = useState(\n () =>\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'Preact 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 useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref} />\n}\n"],"mappings":";;;;;;;;;;;;AAsEA,SAAgB,oBAAoB,OAAsC;CACxE,MAAM,eAAA,GAAcA,uBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,OAAA,GAAMC,aAAAA,OAAAA,CAAuB,IAAI;CACvC,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,aAAA,GAAYC,aAAAA,SAAAA,OAEf,IAAIC,yBAAAA,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,uBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACL;CAEA,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAE5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,iBAAA,GAAA,mBAAA,IAAA,CAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAM,CAAA;AACrE"}
|
|
@@ -4,6 +4,10 @@ import { VNode } from "preact";
|
|
|
4
4
|
declare namespace PreactQueryDevtools_d_exports {
|
|
5
5
|
export { DevtoolsOptions, PreactQueryDevtools };
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The props of `PreactQueryDevtools`, which renders the devtools with a toggle button that opens
|
|
9
|
+
* them.
|
|
10
|
+
*/
|
|
7
11
|
export interface DevtoolsOptions {
|
|
8
12
|
/**
|
|
9
13
|
* Set this true if you want the dev tools to default to being open
|
|
@@ -12,14 +16,12 @@ export interface DevtoolsOptions {
|
|
|
12
16
|
/**
|
|
13
17
|
* The position of the TanStack logo to open and close the devtools panel.
|
|
14
18
|
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
15
|
-
*
|
|
16
19
|
* @defaultValue bottom-right
|
|
17
20
|
*/
|
|
18
21
|
buttonPosition?: DevtoolsButtonPosition;
|
|
19
22
|
/**
|
|
20
23
|
* The position of the Preact Query devtools panel.
|
|
21
24
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
22
|
-
*
|
|
23
25
|
* @defaultValue bottom
|
|
24
26
|
*/
|
|
25
27
|
position?: DevtoolsPosition;
|
|
@@ -39,7 +41,8 @@ export interface DevtoolsOptions {
|
|
|
39
41
|
*/
|
|
40
42
|
styleNonce?: string;
|
|
41
43
|
/**
|
|
42
|
-
* Use this to
|
|
44
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
45
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
43
46
|
*/
|
|
44
47
|
shadowDOMTarget?: ShadowRoot;
|
|
45
48
|
/**
|
|
@@ -48,11 +51,16 @@ export interface DevtoolsOptions {
|
|
|
48
51
|
hideDisabledQueries?: boolean;
|
|
49
52
|
/**
|
|
50
53
|
* Use this to set the theme of the devtools panel.
|
|
51
|
-
*
|
|
52
54
|
* @defaultValue system
|
|
53
55
|
*/
|
|
54
56
|
theme?: Theme;
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
60
|
+
* nearest `QueryClient`.
|
|
61
|
+
* @param props - The devtools options.
|
|
62
|
+
* @returns The element the devtools are mounted in.
|
|
63
|
+
*/
|
|
56
64
|
export declare function PreactQueryDevtools(props: DevtoolsOptions): VNode | null;
|
|
57
65
|
//#endregion
|
|
58
66
|
export { PreactQueryDevtools_d_exports as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtools.d.cts","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtools.d.cts","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"mappings":";;;;;;;;;;iBAgBiB;;;;EAIf;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;;EAKX,SAAS;;;;EAIT,aAAa,MAAM;;;;;;EAMnB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;EAKA,QAAQ;;;;;;;;wBASM,oBAAoB,OAAO,kBAAkB"}
|
|
@@ -4,6 +4,10 @@ import { VNode } from "preact";
|
|
|
4
4
|
declare namespace PreactQueryDevtools_d_exports {
|
|
5
5
|
export { DevtoolsOptions, PreactQueryDevtools };
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The props of `PreactQueryDevtools`, which renders the devtools with a toggle button that opens
|
|
9
|
+
* them.
|
|
10
|
+
*/
|
|
7
11
|
export interface DevtoolsOptions {
|
|
8
12
|
/**
|
|
9
13
|
* Set this true if you want the dev tools to default to being open
|
|
@@ -12,14 +16,12 @@ export interface DevtoolsOptions {
|
|
|
12
16
|
/**
|
|
13
17
|
* The position of the TanStack logo to open and close the devtools panel.
|
|
14
18
|
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
15
|
-
*
|
|
16
19
|
* @defaultValue bottom-right
|
|
17
20
|
*/
|
|
18
21
|
buttonPosition?: DevtoolsButtonPosition;
|
|
19
22
|
/**
|
|
20
23
|
* The position of the Preact Query devtools panel.
|
|
21
24
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
22
|
-
*
|
|
23
25
|
* @defaultValue bottom
|
|
24
26
|
*/
|
|
25
27
|
position?: DevtoolsPosition;
|
|
@@ -39,7 +41,8 @@ export interface DevtoolsOptions {
|
|
|
39
41
|
*/
|
|
40
42
|
styleNonce?: string;
|
|
41
43
|
/**
|
|
42
|
-
* Use this to
|
|
44
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
45
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
43
46
|
*/
|
|
44
47
|
shadowDOMTarget?: ShadowRoot;
|
|
45
48
|
/**
|
|
@@ -48,11 +51,16 @@ export interface DevtoolsOptions {
|
|
|
48
51
|
hideDisabledQueries?: boolean;
|
|
49
52
|
/**
|
|
50
53
|
* Use this to set the theme of the devtools panel.
|
|
51
|
-
*
|
|
52
54
|
* @defaultValue system
|
|
53
55
|
*/
|
|
54
56
|
theme?: Theme;
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
60
|
+
* nearest `QueryClient`.
|
|
61
|
+
* @param props - The devtools options.
|
|
62
|
+
* @returns The element the devtools are mounted in.
|
|
63
|
+
*/
|
|
56
64
|
export declare function PreactQueryDevtools(props: DevtoolsOptions): VNode | null;
|
|
57
65
|
//#endregion
|
|
58
66
|
export { PreactQueryDevtools_d_exports as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtools.d.ts","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtools.d.ts","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"mappings":";;;;;;;;;;iBAgBiB;;;;EAIf;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;;EAKX,SAAS;;;;EAIT,aAAa,MAAM;;;;;;EAMnB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;EAKA,QAAQ;;;;;;;;wBASM,oBAAoB,OAAO,kBAAkB"}
|
|
@@ -3,6 +3,12 @@ import { onlineManager, useQueryClient } from "@tanstack/preact-query";
|
|
|
3
3
|
import { TanstackQueryDevtools } from "@tanstack/query-devtools";
|
|
4
4
|
import { jsx } from "preact/jsx-runtime";
|
|
5
5
|
//#region src/PreactQueryDevtools.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
8
|
+
* nearest `QueryClient`.
|
|
9
|
+
* @param props - The devtools options.
|
|
10
|
+
* @returns The element the devtools are mounted in.
|
|
11
|
+
*/
|
|
6
12
|
function PreactQueryDevtools(props) {
|
|
7
13
|
const queryClient = useQueryClient(props.client);
|
|
8
14
|
const ref = useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtools.js","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"sourcesContent":["import { useRef, useState
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtools.js","names":[],"sources":["../../src/PreactQueryDevtools.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport { onlineManager, useQueryClient } from '@tanstack/preact-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/preact-query'\nimport type { VNode } from 'preact'\n\n/**\n * The props of `PreactQueryDevtools`, which renders the devtools with a toggle button that opens\n * them.\n */\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the Preact Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Use this to provide a custom QueryClient. Otherwise, the one from the\n * nearest QueryClientProvider will be used.\n */\n client?: QueryClient\n /**\n * Use this to provide custom error type handlers for the devtools panel.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document\n * head. This is useful if you are using a Content Security Policy (CSP)\n * nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Use this to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Use this to set the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or\n * nearest `QueryClient`.\n * @param props - The devtools options.\n * @returns The element the devtools are mounted in.\n */\nexport function PreactQueryDevtools(props: DevtoolsOptions): VNode | null {\n const queryClient = useQueryClient(props.client)\n const ref = 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] = useState(\n () =>\n new TanstackQueryDevtools({\n client: queryClient,\n queryFlavor: 'Preact 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 useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div dir=\"ltr\" className=\"tsqd-parent-container\" ref={ref} />\n}\n"],"mappings":";;;;;;;;;;;AAsEA,SAAgB,oBAAoB,OAAsC;CACxE,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,OAAuB,IAAI;CACvC,MAAM,EACJ,gBACA,UACA,eACA,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,eAEf,IAAI,sBAAsB;EACxB,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CACL;CAEA,gBAAgB;EACd,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,gBAAgB;EACd,IAAI,gBACF,SAAS,kBAAkB,cAAc;CAE7C,GAAG,CAAC,gBAAgB,QAAQ,CAAC;CAE7B,gBAAgB;EACd,IAAI,UACF,SAAS,YAAY,QAAQ;CAEjC,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,gBAAgB;EACd,SAAS,iBAAiB,iBAAiB,KAAK;CAClD,GAAG,CAAC,eAAe,QAAQ,CAAC;CAE5B,gBAAgB;EACd,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,gBAAgB;EACd,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,gBAAgB;EACd,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAE5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,oBAAC,OAAD;EAAK,KAAI;EAAM,WAAU;EAA6B;CAAM,CAAA;AACrE"}
|
|
@@ -4,6 +4,11 @@ let _tanstack_preact_query = require("@tanstack/preact-query");
|
|
|
4
4
|
let _tanstack_query_devtools = require("@tanstack/query-devtools");
|
|
5
5
|
let preact_jsx_runtime = require("preact/jsx-runtime");
|
|
6
6
|
//#region src/PreactQueryDevtoolsPanel.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
9
|
+
* @param props - The devtools panel options.
|
|
10
|
+
* @returns The element the devtools panel is mounted in.
|
|
11
|
+
*/
|
|
7
12
|
function PreactQueryDevtoolsPanel(props) {
|
|
8
13
|
const queryClient = (0, _tanstack_preact_query.useQueryClient)(props.client);
|
|
9
14
|
const ref = (0, preact_hooks.useRef)(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtoolsPanel.cjs","names":["useQueryClient","useRef","useState","TanstackQueryDevtoolsPanel"],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"sourcesContent":["import { useRef, useState
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtoolsPanel.cjs","names":["useQueryClient","useRef","useState","TanstackQueryDevtoolsPanel"],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport { onlineManager, useQueryClient } from '@tanstack/preact-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/preact-query'\nimport type { CSSProperties, VNode } from 'preact'\n\n/**\n * The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport interface DevtoolsPanelOptions {\n /**\n * Use this to provide a custom QueryClient. Otherwise, the one from the\n * nearest QueryClientProvider will be used.\n */\n client?: QueryClient\n /**\n * Custom error types to 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\n * head. This is useful if you are using a Content Security Policy (CSP)\n * nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Custom styles for the devtools panel container.\n */\n style?: CSSProperties\n /**\n * Callback function when the devtools panel is closed.\n */\n onClose?: () => unknown\n /**\n * Use this to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Use this to set the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.\n * @param props - The devtools panel options.\n * @returns The element the devtools panel is mounted in.\n */\nexport function PreactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): VNode | null {\n const queryClient = useQueryClient(props.client)\n const ref = useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = useState(\n () =>\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'Preact 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 useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\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 />\n )\n}\n"],"mappings":";;;;;;;;;;;AAuDA,SAAgB,yBACd,OACc;CACd,MAAM,eAAA,GAAcA,uBAAAA,eAAAA,CAAe,MAAM,MAAM;CAC/C,MAAM,OAAA,GAAMC,aAAAA,OAAAA,CAAuB,IAAI;CACvC,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,aAAA,GAAYC,aAAAA,SAAAA,OAEf,IAAIC,yBAAAA,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT,eAAA,uBAAA;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACL;CAEA,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAE5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,iBAAA,GAAA,mBAAA,IAAA,CAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACN,CAAA;AAEL"}
|
|
@@ -4,6 +4,9 @@ import { CSSProperties, VNode } from "preact";
|
|
|
4
4
|
declare namespace PreactQueryDevtoolsPanel_d_exports {
|
|
5
5
|
export { DevtoolsPanelOptions, PreactQueryDevtoolsPanel };
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
9
|
+
*/
|
|
7
10
|
export interface DevtoolsPanelOptions {
|
|
8
11
|
/**
|
|
9
12
|
* Use this to provide a custom QueryClient. Otherwise, the one from the
|
|
@@ -21,7 +24,8 @@ export interface DevtoolsPanelOptions {
|
|
|
21
24
|
*/
|
|
22
25
|
styleNonce?: string;
|
|
23
26
|
/**
|
|
24
|
-
* Use this to
|
|
27
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
28
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
25
29
|
*/
|
|
26
30
|
shadowDOMTarget?: ShadowRoot;
|
|
27
31
|
/**
|
|
@@ -38,11 +42,15 @@ export interface DevtoolsPanelOptions {
|
|
|
38
42
|
hideDisabledQueries?: boolean;
|
|
39
43
|
/**
|
|
40
44
|
* Use this to set the theme of the devtools panel.
|
|
41
|
-
*
|
|
42
45
|
* @defaultValue system
|
|
43
46
|
*/
|
|
44
47
|
theme?: Theme;
|
|
45
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
51
|
+
* @param props - The devtools panel options.
|
|
52
|
+
* @returns The element the devtools panel is mounted in.
|
|
53
|
+
*/
|
|
46
54
|
export declare function PreactQueryDevtoolsPanel(props: DevtoolsPanelOptions): VNode | null;
|
|
47
55
|
//#endregion
|
|
48
56
|
export { PreactQueryDevtoolsPanel_d_exports as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtoolsPanel.d.cts","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtoolsPanel.d.cts","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;;;;iBAUiB;;;;;EAKf,SAAS;;;;EAIT,aAAa,MAAM;;;;;;EAMnB;;;;;EAKA,kBAAkB;;;;EAIlB,QAAQ;;;;EAIR;;;;EAIA;;;;;EAKA,QAAQ;;;;;;;wBAQM,yBACd,OAAO,uBACN"}
|
|
@@ -4,6 +4,9 @@ import { CSSProperties, VNode } from "preact";
|
|
|
4
4
|
declare namespace PreactQueryDevtoolsPanel_d_exports {
|
|
5
5
|
export { DevtoolsPanelOptions, PreactQueryDevtoolsPanel };
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
9
|
+
*/
|
|
7
10
|
export interface DevtoolsPanelOptions {
|
|
8
11
|
/**
|
|
9
12
|
* Use this to provide a custom QueryClient. Otherwise, the one from the
|
|
@@ -21,7 +24,8 @@ export interface DevtoolsPanelOptions {
|
|
|
21
24
|
*/
|
|
22
25
|
styleNonce?: string;
|
|
23
26
|
/**
|
|
24
|
-
* Use this to
|
|
27
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
28
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
25
29
|
*/
|
|
26
30
|
shadowDOMTarget?: ShadowRoot;
|
|
27
31
|
/**
|
|
@@ -38,11 +42,15 @@ export interface DevtoolsPanelOptions {
|
|
|
38
42
|
hideDisabledQueries?: boolean;
|
|
39
43
|
/**
|
|
40
44
|
* Use this to set the theme of the devtools panel.
|
|
41
|
-
*
|
|
42
45
|
* @defaultValue system
|
|
43
46
|
*/
|
|
44
47
|
theme?: Theme;
|
|
45
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
51
|
+
* @param props - The devtools panel options.
|
|
52
|
+
* @returns The element the devtools panel is mounted in.
|
|
53
|
+
*/
|
|
46
54
|
export declare function PreactQueryDevtoolsPanel(props: DevtoolsPanelOptions): VNode | null;
|
|
47
55
|
//#endregion
|
|
48
56
|
export { PreactQueryDevtoolsPanel_d_exports as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtoolsPanel.d.ts","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtoolsPanel.d.ts","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"mappings":";;;;;;;;;iBAUiB;;;;;EAKf,SAAS;;;;EAIT,aAAa,MAAM;;;;;;EAMnB;;;;;EAKA,kBAAkB;;;;EAIlB,QAAQ;;;;EAIR;;;;EAIA;;;;;EAKA,QAAQ;;;;;;;wBAQM,yBACd,OAAO,uBACN"}
|
|
@@ -3,6 +3,11 @@ import { onlineManager, useQueryClient } from "@tanstack/preact-query";
|
|
|
3
3
|
import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
|
|
4
4
|
import { jsx } from "preact/jsx-runtime";
|
|
5
5
|
//#region src/PreactQueryDevtoolsPanel.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
8
|
+
* @param props - The devtools panel options.
|
|
9
|
+
* @returns The element the devtools panel is mounted in.
|
|
10
|
+
*/
|
|
6
11
|
function PreactQueryDevtoolsPanel(props) {
|
|
7
12
|
const queryClient = useQueryClient(props.client);
|
|
8
13
|
const ref = useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreactQueryDevtoolsPanel.js","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"sourcesContent":["import { useRef, useState
|
|
1
|
+
{"version":3,"file":"PreactQueryDevtoolsPanel.js","names":[],"sources":["../../src/PreactQueryDevtoolsPanel.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport { onlineManager, useQueryClient } from '@tanstack/preact-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/preact-query'\nimport type { CSSProperties, VNode } from 'preact'\n\n/**\n * The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport interface DevtoolsPanelOptions {\n /**\n * Use this to provide a custom QueryClient. Otherwise, the one from the\n * nearest QueryClientProvider will be used.\n */\n client?: QueryClient\n /**\n * Custom error types to 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\n * head. This is useful if you are using a Content Security Policy (CSP)\n * nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Custom styles for the devtools panel container.\n */\n style?: CSSProperties\n /**\n * Callback function when the devtools panel is closed.\n */\n onClose?: () => unknown\n /**\n * Use this to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Use this to set the theme of the devtools panel.\n * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.\n * @param props - The devtools panel options.\n * @returns The element the devtools panel is mounted in.\n */\nexport function PreactQueryDevtoolsPanel(\n props: DevtoolsPanelOptions,\n): VNode | null {\n const queryClient = useQueryClient(props.client)\n const ref = useRef<HTMLDivElement>(null)\n const {\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n hideDisabledQueries,\n theme,\n } = props\n const [devtools] = useState(\n () =>\n new TanstackQueryDevtoolsPanel({\n client: queryClient,\n queryFlavor: 'Preact 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 useEffect(() => {\n devtools.setClient(queryClient)\n }, [queryClient, devtools])\n\n useEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n }, [props.onClose, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n devtools.setTheme(theme)\n }, [theme, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\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 />\n )\n}\n"],"mappings":";;;;;;;;;;AAuDA,SAAgB,yBACd,OACc;CACd,MAAM,cAAc,eAAe,MAAM,MAAM;CAC/C,MAAM,MAAM,OAAuB,IAAI;CACvC,MAAM,EACJ,YACA,YACA,iBACA,qBACA,UACE;CACJ,MAAM,CAAC,YAAY,eAEf,IAAI,2BAA2B;EAC7B,QAAQ;EACR,aAAa;EACb,SAAS;EACT;EACA,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACF,CAAC,CACL;CAEA,gBAAgB;EACd,SAAS,UAAU,WAAW;CAChC,GAAG,CAAC,aAAa,QAAQ,CAAC;CAE1B,gBAAgB;EACd,SAAS,WAAW,MAAM,kBAAkB,CAAC,EAAE;CACjD,GAAG,CAAC,MAAM,SAAS,QAAQ,CAAC;CAE5B,gBAAgB;EACd,SAAS,cAAc,cAAc,CAAC,CAAC;CACzC,GAAG,CAAC,YAAY,QAAQ,CAAC;CAEzB,gBAAgB;EACd,SAAS,SAAS,KAAK;CACzB,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,gBAAgB;EACd,IAAI,IAAI,SACN,SAAS,MAAM,IAAI,OAAO;EAE5B,aAAa;GACX,SAAS,QAAQ;EACnB;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,oBAAC,OAAD;EACE,OAAO;GAAE,QAAQ;GAAS,GAAG,MAAM;EAAM;EACzC,WAAU;EACL;CACN,CAAA;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import * as Devtools from './PreactQueryDevtools'\nimport * as DevtoolsPanel from './PreactQueryDevtoolsPanel'\n\nexport const PreactQueryDevtools: (typeof Devtools)['PreactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.PreactQueryDevtools\n\nexport const PreactQueryDevtoolsPanel: (typeof DevtoolsPanel)['PreactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.PreactQueryDevtoolsPanel\n\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;AAGA,MAAa,sBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,4BAAA;AAGN,MAAa,2BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,iCAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import * as Devtools from './PreactQueryDevtools'\nimport * as DevtoolsPanel from './PreactQueryDevtoolsPanel'\n\nexport const PreactQueryDevtools: (typeof Devtools)['PreactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.PreactQueryDevtools\n\nexport const PreactQueryDevtoolsPanel: (typeof DevtoolsPanel)['PreactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.PreactQueryDevtoolsPanel\n\n/**\n * The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;;AAGA,MAAa,sBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,4BAAA;AAGN,MAAa,2BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IAAA,iCAAA"}
|
package/build/modern/index.d.cts
CHANGED
|
@@ -3,6 +3,9 @@ import { DevtoolsPanelOptions as DevtoolsPanelOptions$1, t as PreactQueryDevtool
|
|
|
3
3
|
//#region src/index.d.ts
|
|
4
4
|
export declare const PreactQueryDevtools: (typeof PreactQueryDevtools_d_exports)['PreactQueryDevtools'];
|
|
5
5
|
export declare const PreactQueryDevtoolsPanel: (typeof PreactQueryDevtoolsPanel_d_exports)['PreactQueryDevtoolsPanel'];
|
|
6
|
+
/**
|
|
7
|
+
* The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
8
|
+
*/
|
|
6
9
|
export type DevtoolsPanelOptions = DevtoolsPanelOptions$1;
|
|
7
10
|
//#endregion
|
|
8
11
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAGa,6BAA6BA;qBAO7B,kCAAkCC
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAGa,6BAA6BA;qBAO7B,kCAAkCC;;;;YAUnC,uBAAuBC"}
|
package/build/modern/index.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { DevtoolsPanelOptions as DevtoolsPanelOptions$1, t as PreactQueryDevtool
|
|
|
3
3
|
//#region src/index.d.ts
|
|
4
4
|
export declare const PreactQueryDevtools: (typeof PreactQueryDevtools_d_exports)['PreactQueryDevtools'];
|
|
5
5
|
export declare const PreactQueryDevtoolsPanel: (typeof PreactQueryDevtoolsPanel_d_exports)['PreactQueryDevtoolsPanel'];
|
|
6
|
+
/**
|
|
7
|
+
* The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
8
|
+
*/
|
|
6
9
|
export type DevtoolsPanelOptions = DevtoolsPanelOptions$1;
|
|
7
10
|
//#endregion
|
|
8
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAGa,6BAA6BA;qBAO7B,kCAAkCC
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["Devtools","DevtoolsPanel","DevtoolsPanel.DevtoolsPanelOptions"],"sources":["../../src/index.ts"],"mappings":";;;qBAGa,6BAA6BA;qBAO7B,kCAAkCC;;;;YAUnC,uBAAuBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Devtools.PreactQueryDevtools","DevtoolsPanel.PreactQueryDevtoolsPanel"],"sources":["../../src/index.ts"],"sourcesContent":["import * as Devtools from './PreactQueryDevtools'\nimport * as DevtoolsPanel from './PreactQueryDevtoolsPanel'\n\nexport const PreactQueryDevtools: (typeof Devtools)['PreactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.PreactQueryDevtools\n\nexport const PreactQueryDevtoolsPanel: (typeof DevtoolsPanel)['PreactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.PreactQueryDevtoolsPanel\n\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;AAGA,MAAa,sBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAA;AAEN,MAAa,2BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Devtools.PreactQueryDevtools","DevtoolsPanel.PreactQueryDevtoolsPanel"],"sources":["../../src/index.ts"],"sourcesContent":["import * as Devtools from './PreactQueryDevtools'\nimport * as DevtoolsPanel from './PreactQueryDevtoolsPanel'\n\nexport const PreactQueryDevtools: (typeof Devtools)['PreactQueryDevtools'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : Devtools.PreactQueryDevtools\n\nexport const PreactQueryDevtoolsPanel: (typeof DevtoolsPanel)['PreactQueryDevtoolsPanel'] =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : DevtoolsPanel.PreactQueryDevtoolsPanel\n\n/**\n * The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions\n"],"mappings":";;;AAGA,MAAa,sBACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAA;AAEN,MAAa,2BACX,QAAQ,IAAI,aAAa,gBACrB,WAAY;CACV,OAAO;AACT,IACAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/preact-query-devtools",
|
|
3
|
-
"version": "5.104.
|
|
3
|
+
"version": "5.104.2",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack/preact-query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,33 +59,30 @@
|
|
|
59
59
|
"!src/__tests__"
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@tanstack/query-devtools": "5.104.
|
|
62
|
+
"@tanstack/query-devtools": "5.104.2"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@preact/preset-vite": "^2.10.6",
|
|
66
|
-
"@tanstack/preact-query": "5.104.
|
|
66
|
+
"@tanstack/preact-query": "5.104.2",
|
|
67
67
|
"@testing-library/preact": "^3.2.4",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"preact": "^10.29.8",
|
|
71
|
-
"typescript": "6.0.3",
|
|
72
|
-
"typescript-eslint": "^8.54.0"
|
|
68
|
+
"preact": "^11.0.1",
|
|
69
|
+
"typescript": "6.0.3"
|
|
73
70
|
},
|
|
74
71
|
"peerDependencies": {
|
|
75
|
-
"@tanstack/preact-query": "^5.104.
|
|
76
|
-
"preact": "^10.0.0"
|
|
72
|
+
"@tanstack/preact-query": "^5.104.2",
|
|
73
|
+
"preact": "^10.0.0 || ^11.0.0-0"
|
|
77
74
|
},
|
|
78
75
|
"scripts": {
|
|
79
76
|
"clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types",
|
|
80
77
|
"compile": "tsc --project tsconfig.json",
|
|
81
|
-
"test:
|
|
78
|
+
"test:oxlint": "oxlint ./src",
|
|
82
79
|
"test:types": "npm-run-all --serial test:types:*",
|
|
83
|
-
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo",
|
|
84
80
|
"test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo",
|
|
85
81
|
"test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts58 --tsBuildInfoFile .cache/test-types/ts58.tsbuildinfo",
|
|
86
82
|
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts59 --tsBuildInfoFile .cache/test-types/ts59.tsbuildinfo",
|
|
87
83
|
"test:types:tscurrent": "tsc --project tsconfig.json --outDir .cache/test-types/tscurrent --tsBuildInfoFile .cache/test-types/tscurrent.tsbuildinfo",
|
|
88
84
|
"test:types:ts70": "node ../../node_modules/typescript70/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts70 --tsBuildInfoFile .cache/test-types/ts70.tsbuildinfo",
|
|
85
|
+
"test:types:ts71": "node ../../node_modules/typescript71/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts71 --tsBuildInfoFile .cache/test-types/ts71.tsbuildinfo",
|
|
89
86
|
"test:lib": "vitest",
|
|
90
87
|
"test:lib:dev": "pnpm run test:lib --watch",
|
|
91
88
|
"test:build": "publint --strict && attw --pack",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRef, useState
|
|
1
|
+
import { useEffect, useRef, useState } from 'preact/hooks'
|
|
2
2
|
import { onlineManager, useQueryClient } from '@tanstack/preact-query'
|
|
3
3
|
import { TanstackQueryDevtools } from '@tanstack/query-devtools'
|
|
4
4
|
import type {
|
|
@@ -10,6 +10,10 @@ import type {
|
|
|
10
10
|
import type { QueryClient } from '@tanstack/preact-query'
|
|
11
11
|
import type { VNode } from 'preact'
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* The props of `PreactQueryDevtools`, which renders the devtools with a toggle button that opens
|
|
15
|
+
* them.
|
|
16
|
+
*/
|
|
13
17
|
export interface DevtoolsOptions {
|
|
14
18
|
/**
|
|
15
19
|
* Set this true if you want the dev tools to default to being open
|
|
@@ -18,14 +22,12 @@ export interface DevtoolsOptions {
|
|
|
18
22
|
/**
|
|
19
23
|
* The position of the TanStack logo to open and close the devtools panel.
|
|
20
24
|
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
21
|
-
*
|
|
22
25
|
* @defaultValue bottom-right
|
|
23
26
|
*/
|
|
24
27
|
buttonPosition?: DevtoolsButtonPosition
|
|
25
28
|
/**
|
|
26
29
|
* The position of the Preact Query devtools panel.
|
|
27
30
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
28
|
-
*
|
|
29
31
|
* @defaultValue bottom
|
|
30
32
|
*/
|
|
31
33
|
position?: DevtoolsPosition
|
|
@@ -45,7 +47,8 @@ export interface DevtoolsOptions {
|
|
|
45
47
|
*/
|
|
46
48
|
styleNonce?: string
|
|
47
49
|
/**
|
|
48
|
-
* Use this to
|
|
50
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
51
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
49
52
|
*/
|
|
50
53
|
shadowDOMTarget?: ShadowRoot
|
|
51
54
|
/**
|
|
@@ -54,12 +57,17 @@ export interface DevtoolsOptions {
|
|
|
54
57
|
hideDisabledQueries?: boolean
|
|
55
58
|
/**
|
|
56
59
|
* Use this to set the theme of the devtools panel.
|
|
57
|
-
*
|
|
58
60
|
* @defaultValue system
|
|
59
61
|
*/
|
|
60
62
|
theme?: Theme
|
|
61
63
|
}
|
|
62
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
67
|
+
* nearest `QueryClient`.
|
|
68
|
+
* @param props - The devtools options.
|
|
69
|
+
* @returns The element the devtools are mounted in.
|
|
70
|
+
*/
|
|
63
71
|
export function PreactQueryDevtools(props: DevtoolsOptions): VNode | null {
|
|
64
72
|
const queryClient = useQueryClient(props.client)
|
|
65
73
|
const ref = useRef<HTMLDivElement>(null)
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { useRef, useState
|
|
1
|
+
import { useEffect, useRef, useState } from 'preact/hooks'
|
|
2
2
|
import { onlineManager, useQueryClient } from '@tanstack/preact-query'
|
|
3
3
|
import { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'
|
|
4
4
|
import type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'
|
|
5
5
|
import type { QueryClient } from '@tanstack/preact-query'
|
|
6
6
|
import type { CSSProperties, VNode } from 'preact'
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
10
|
+
*/
|
|
8
11
|
export interface DevtoolsPanelOptions {
|
|
9
12
|
/**
|
|
10
13
|
* Use this to provide a custom QueryClient. Otherwise, the one from the
|
|
@@ -22,7 +25,8 @@ export interface DevtoolsPanelOptions {
|
|
|
22
25
|
*/
|
|
23
26
|
styleNonce?: string
|
|
24
27
|
/**
|
|
25
|
-
* Use this to
|
|
28
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
29
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
26
30
|
*/
|
|
27
31
|
shadowDOMTarget?: ShadowRoot
|
|
28
32
|
/**
|
|
@@ -39,12 +43,16 @@ export interface DevtoolsPanelOptions {
|
|
|
39
43
|
hideDisabledQueries?: boolean
|
|
40
44
|
/**
|
|
41
45
|
* Use this to set the theme of the devtools panel.
|
|
42
|
-
*
|
|
43
46
|
* @defaultValue system
|
|
44
47
|
*/
|
|
45
48
|
theme?: Theme
|
|
46
49
|
}
|
|
47
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
53
|
+
* @param props - The devtools panel options.
|
|
54
|
+
* @returns The element the devtools panel is mounted in.
|
|
55
|
+
*/
|
|
48
56
|
export function PreactQueryDevtoolsPanel(
|
|
49
57
|
props: DevtoolsPanelOptions,
|
|
50
58
|
): VNode | null {
|
package/src/index.ts
CHANGED
|
@@ -15,4 +15,7 @@ export const PreactQueryDevtoolsPanel: (typeof DevtoolsPanel)['PreactQueryDevtoo
|
|
|
15
15
|
}
|
|
16
16
|
: DevtoolsPanel.PreactQueryDevtoolsPanel
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* The props of `PreactQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
20
|
+
*/
|
|
18
21
|
export type DevtoolsPanelOptions = DevtoolsPanel.DevtoolsPanelOptions
|