@tanstack/solid-query-devtools 6.0.0-rc.5 → 6.0.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/build/clientOnly-CEXX5Ps8.jsx +26 -0
  2. package/build/clientOnly-Cmw5kOEH.cjs +1 -0
  3. package/build/clientOnly-lrJ-FwVZ.js +2 -0
  4. package/build/clientOnly-lrJ-FwVZ.js.map +1 -0
  5. package/build/dev.cjs +29 -314
  6. package/build/dev.js +27 -23
  7. package/build/dev.jsx +27 -43
  8. package/build/devtools-BMem5cUa.jsx +62 -0
  9. package/build/devtools-DMwvwc4L.js +67 -0
  10. package/build/devtools-DPfipH2Y.js +2 -0
  11. package/build/devtools-DPfipH2Y.js.map +1 -0
  12. package/build/devtools-TPMm0sW8.cjs +1 -0
  13. package/build/devtools-m6r1o8lz.cjs +67 -0
  14. package/build/devtoolsPanel-BIXzHW6Y.cjs +1 -0
  15. package/build/devtoolsPanel-BbBQ7vKt.cjs +68 -0
  16. package/build/devtoolsPanel-CU_iFbJ3.jsx +62 -0
  17. package/build/devtoolsPanel-D71UlGwy.js +68 -0
  18. package/build/devtoolsPanel-DLEdindg.d.ts +106 -0
  19. package/build/devtoolsPanel-DLEdindg.d.ts.map +1 -0
  20. package/build/devtoolsPanel-Q67Cz4BM.d.cts +106 -0
  21. package/build/devtoolsPanel-Q67Cz4BM.d.cts.map +1 -0
  22. package/build/devtoolsPanel-hmH3gOTU.js +2 -0
  23. package/build/devtoolsPanel-hmH3gOTU.js.map +1 -0
  24. package/build/index.cjs +1 -288
  25. package/build/index.d.cts +5 -3
  26. package/build/index.d.cts.map +1 -0
  27. package/build/index.d.ts +5 -3
  28. package/build/index.d.ts.map +1 -0
  29. package/build/index.js +2 -29
  30. package/build/index.js.map +1 -0
  31. package/build/index.jsx +7 -46
  32. package/build/production.cjs +1 -0
  33. package/build/production.d.cts +5 -0
  34. package/build/production.d.cts.map +1 -0
  35. package/build/production.d.ts +5 -0
  36. package/build/production.d.ts.map +1 -0
  37. package/build/production.js +2 -0
  38. package/build/production.js.map +1 -0
  39. package/build/production.jsx +5 -0
  40. package/package.json +51 -40
  41. package/src/clientOnly.tsx +6 -5
  42. package/src/devtools.tsx +14 -6
  43. package/src/devtoolsPanel.tsx +20 -5
  44. package/src/production.tsx +12 -0
  45. package/build/_tsup-dts-rollup.d.cts +0 -109
  46. package/build/_tsup-dts-rollup.d.ts +0 -109
  47. package/build/chunk/L2WCKKHK.js +0 -94
  48. package/build/chunk/OQETK3NG.js +0 -123
  49. package/build/dev.d.cts +0 -3
  50. package/build/dev.d.ts +0 -3
  51. package/build/devtools/7WZM3IT7.jsx +0 -82
  52. package/build/devtools/V6WOBMVN.js +0 -68
  53. package/build/devtools/WQPACNKE.js +0 -68
  54. package/build/devtoolsPanel/6IZHMMFI.js +0 -71
  55. package/build/devtoolsPanel/FQC5JHFZ.jsx +0 -73
  56. package/build/devtoolsPanel/HZIEZL6U.js +0 -71
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools-DPfipH2Y.js","names":["createEffect","createMemo","onSettled","runWithOwner","onlineManager","useQueryClient","TanstackQueryDevtools","SolidQueryDevtools","props","queryClient","client","ref","devtools","queryFlavor","version","buttonPosition","position","initialIsOpen","errorTypes","styleNonce","shadowDOMTarget","hideDisabledQueries","theme","c","setClient","buttonPos","setButtonPosition","pos","setPosition","setInitialIsOpen","setErrorTypes","setTheme","mounted","disposed","queueMicrotask","mount","unmount","_el$","_tmpl$","_ref$","Array","isArray","_$ref","ref","_$ref","_tmpl$","SolidQueryDevtools","queryClient","useQueryClient","props","client","createMemo","ref$1","devtools","TanstackQueryDevtools","createEffect","c","buttonPos","pos","initialIsOpen","errorTypes","theme","mounted","disposed","onSettled","runWithOwner","_el$","_ref$","ref"],"sources":["../src/devtools.tsx"],"sourcesContent":["import { createEffect, createMemo, onSettled, runWithOwner } from 'solid-js'\nimport { onlineManager, useQueryClient } from '@tanstack/solid-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/solid-query'\n\ninterface 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 Solid Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * This overrides the theme selected in the devtools Settings menu. When omitted, the\n * selected theme is used, or `'system'` if none is selected.\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 default function SolidQueryDevtools(props: DevtoolsOptions) {\n const queryClient = useQueryClient(props.client)\n const client = createMemo(() => queryClient)\n let ref!: HTMLDivElement\n const devtools = new TanstackQueryDevtools({\n client: client(),\n queryFlavor: 'Solid Query',\n version: '5',\n onlineManager,\n buttonPosition: props.buttonPosition,\n position: props.position,\n initialIsOpen: props.initialIsOpen,\n errorTypes: props.errorTypes,\n styleNonce: props.styleNonce,\n shadowDOMTarget: props.shadowDOMTarget,\n hideDisabledQueries: props.hideDisabledQueries,\n theme: props.theme,\n })\n\n createEffect(\n () => client(),\n (c) => {\n devtools.setClient(c)\n },\n )\n\n createEffect(\n () => props.buttonPosition,\n (buttonPos) => {\n if (buttonPos) {\n devtools.setButtonPosition(buttonPos)\n }\n },\n )\n\n createEffect(\n () => props.position,\n (pos) => {\n if (pos) {\n devtools.setPosition(pos)\n }\n },\n )\n\n createEffect(\n () => props.initialIsOpen,\n (initialIsOpen) => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n },\n )\n\n createEffect(\n () => props.errorTypes,\n (errorTypes) => {\n devtools.setErrorTypes(errorTypes || [])\n },\n )\n\n createEffect(\n () => props.theme,\n (theme) => {\n devtools.setTheme(theme)\n },\n )\n\n // devtools.mount() calls render() from solid-js/web, which calls flush().\n // flush() is not reentrant inside onSettled, so defer the mount to a\n // microtask. runWithOwner(null) escapes the owned scope because\n // devtools.mount renders a nested Solid app (creating reactive primitives).\n let mounted = false\n let disposed = false\n onSettled(() => {\n queueMicrotask(() => {\n if (disposed) return\n runWithOwner(null, () => devtools.mount(ref))\n mounted = true\n })\n return () => {\n disposed = true\n if (mounted) {\n devtools.unmount()\n }\n }\n })\n\n return <div class=\"tsqd-parent-container\" ref={ref} />\n}\n"],"mappings":"A,gVA+DA,SAAwBO,EAAmBC,EAAwB,CACjE,IAAMC,EAAcJ,EAAeG,EAAME,MAAM,EACzCA,EAAST,MAAiBQ,CAAW,EACvCE,EACEC,EAAW,IAAIN,EAAsB,CACzCI,OAAQA,EAAO,EACfG,YAAa,cACbC,QAAS,IACTV,gBACAW,eAAgBP,EAAMO,eACtBC,SAAUR,EAAMQ,SAChBC,cAAeT,EAAMS,cACrBC,WAAYV,EAAMU,WAClBC,WAAYX,EAAMW,WAClBC,gBAAiBZ,EAAMY,gBACvBC,oBAAqBb,EAAMa,oBAC3BC,MAAOd,EAAMc,KACf,CAAC,EAEDtB,MACQU,EAAO,EACZa,GAAM,CACLX,EAASY,UAAUD,CAAC,CACtB,CACF,EAEAvB,MACQQ,EAAMO,eACXU,GAAc,CACTA,GACFb,EAASc,kBAAkBD,CAAS,CAExC,CACF,EAEAzB,MACQQ,EAAMQ,SACXW,GAAQ,CACHA,GACFf,EAASgB,YAAYD,CAAG,CAE5B,CACF,EAEA3B,MACQQ,EAAMS,cACXA,GAAkB,CACjBL,EAASiB,iBAAiBZ,GAAiB,EAAK,CAClD,CACF,EAEAjB,MACQQ,EAAMU,WACXA,GAAe,CACdN,EAASkB,cAAcZ,GAAc,CAAA,CAAE,CACzC,CACF,EAEAlB,MACQQ,EAAMc,MACXA,GAAU,CACTV,EAASmB,SAAST,CAAK,CACzB,CACF,EAMA,IAAIU,EAAU,GACVC,EAAW,GACf/B,OACEgC,mBAAqB,CACfD,IACJ9B,EAAa,SAAYS,EAASuB,MAAMxB,CAAG,CAAC,EAC5CqB,EAAU,GACZ,CAAC,MACY,CACXC,EAAW,GACPD,GACFpB,EAASwB,QAAQ,CAErB,EACD,EAAC,IAAAC,EAAAC,EAAA,EAAAC,EAE6C5B,EAA/C,OAAkD,OAAA4B,GAAA,YAAAC,MAAAC,QAAAF,CAAA,EAAAG,MAAAH,EAAAF,CAAA,EAAH1B,EAAG0B,EAAlDA,CACF,C"}
@@ -0,0 +1 @@
1
+ let e=require("@solidjs/web"),t=require("solid-js"),n=require("@tanstack/solid-query"),r=require("@tanstack/query-devtools");var i=/*#__PURE__*/ (0,e.template)(`<div class=tsqd-parent-container>`);function a(a){let o=(0,n.useQueryClient)(a.client),s=(0,t.createMemo)(()=>o),c,l=new r.TanstackQueryDevtools({client:s(),queryFlavor:`Solid Query`,version:`5`,onlineManager:n.onlineManager,buttonPosition:a.buttonPosition,position:a.position,initialIsOpen:a.initialIsOpen,errorTypes:a.errorTypes,styleNonce:a.styleNonce,shadowDOMTarget:a.shadowDOMTarget,hideDisabledQueries:a.hideDisabledQueries,theme:a.theme});(0,t.createEffect)(()=>s(),e=>{l.setClient(e)}),(0,t.createEffect)(()=>a.buttonPosition,e=>{e&&l.setButtonPosition(e)}),(0,t.createEffect)(()=>a.position,e=>{e&&l.setPosition(e)}),(0,t.createEffect)(()=>a.initialIsOpen,e=>{l.setInitialIsOpen(e||!1)}),(0,t.createEffect)(()=>a.errorTypes,e=>{l.setErrorTypes(e||[])}),(0,t.createEffect)(()=>a.theme,e=>{l.setTheme(e)});let u=!1,d=!1;(0,t.onSettled)(()=>(queueMicrotask(()=>{d||((0,t.runWithOwner)(null,()=>l.mount(c)),u=!0)}),()=>{d=!0,u&&l.unmount()}));var f=i(),p=c;return typeof p==`function`||Array.isArray(p)?(0,e.ref)(()=>p,f):c=f,f}exports.default=a;
@@ -0,0 +1,67 @@
1
+ let _solidjs_web = require("@solidjs/web");
2
+ let solid_js = require("solid-js");
3
+ let _tanstack_solid_query = require("@tanstack/solid-query");
4
+ let _tanstack_query_devtools = require("@tanstack/query-devtools");
5
+ // src/devtools.tsx
6
+ var _tmpl$ = /*#__PURE__*/ (0, _solidjs_web.template)(`<div class=tsqd-parent-container>`);
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
+ */
13
+ function SolidQueryDevtools(props) {
14
+ const queryClient = (0, _tanstack_solid_query.useQueryClient)(props.client);
15
+ const client = (0, solid_js.createMemo)(() => queryClient);
16
+ let ref;
17
+ const devtools = new _tanstack_query_devtools.TanstackQueryDevtools({
18
+ client: client(),
19
+ queryFlavor: "Solid Query",
20
+ version: "5",
21
+ onlineManager: _tanstack_solid_query.onlineManager,
22
+ buttonPosition: props.buttonPosition,
23
+ position: props.position,
24
+ initialIsOpen: props.initialIsOpen,
25
+ errorTypes: props.errorTypes,
26
+ styleNonce: props.styleNonce,
27
+ shadowDOMTarget: props.shadowDOMTarget,
28
+ hideDisabledQueries: props.hideDisabledQueries,
29
+ theme: props.theme
30
+ });
31
+ (0, solid_js.createEffect)(() => client(), (c) => {
32
+ devtools.setClient(c);
33
+ });
34
+ (0, solid_js.createEffect)(() => props.buttonPosition, (buttonPos) => {
35
+ if (buttonPos) devtools.setButtonPosition(buttonPos);
36
+ });
37
+ (0, solid_js.createEffect)(() => props.position, (pos) => {
38
+ if (pos) devtools.setPosition(pos);
39
+ });
40
+ (0, solid_js.createEffect)(() => props.initialIsOpen, (initialIsOpen) => {
41
+ devtools.setInitialIsOpen(initialIsOpen || false);
42
+ });
43
+ (0, solid_js.createEffect)(() => props.errorTypes, (errorTypes) => {
44
+ devtools.setErrorTypes(errorTypes || []);
45
+ });
46
+ (0, solid_js.createEffect)(() => props.theme, (theme) => {
47
+ devtools.setTheme(theme);
48
+ });
49
+ let mounted = false;
50
+ let disposed = false;
51
+ (0, solid_js.onSettled)(() => {
52
+ queueMicrotask(() => {
53
+ if (disposed) return;
54
+ (0, solid_js.runWithOwner)(null, () => devtools.mount(ref));
55
+ mounted = true;
56
+ });
57
+ return () => {
58
+ disposed = true;
59
+ if (mounted) devtools.unmount();
60
+ };
61
+ });
62
+ var _el$ = _tmpl$();
63
+ var _ref$ = ref;
64
+ typeof _ref$ === "function" || Array.isArray(_ref$) ? (0, _solidjs_web.ref)(() => _ref$, _el$) : ref = _el$;
65
+ return _el$;
66
+ }
67
+ exports.default = SolidQueryDevtools;
@@ -0,0 +1 @@
1
+ let e=require("@solidjs/web"),t=require("solid-js"),n=require("@tanstack/solid-query"),r=require("@tanstack/query-devtools");var i=/*#__PURE__*/ (0,e.template)(`<div class=tsqd-parent-container style=height:100%;display:flex;flex-direction:column>`);function a(a){let o=(0,n.useQueryClient)(a.client),s=(0,t.createMemo)(()=>o),c,{errorTypes:l,styleNonce:u,shadowDOMTarget:d,hideDisabledQueries:f}=a,p=new r.TanstackQueryDevtoolsPanel({client:s(),queryFlavor:`Solid Query`,version:`5`,onlineManager:n.onlineManager,buttonPosition:`bottom-left`,position:`bottom`,initialIsOpen:!0,errorTypes:l,styleNonce:u,shadowDOMTarget:d,onClose:a.onClose,hideDisabledQueries:f,theme:a.theme});(0,t.createEffect)(()=>s(),e=>{p.setClient(e)}),(0,t.createEffect)(()=>a.onClose,e=>{p.setOnClose(e??(()=>{}))}),(0,t.createEffect)(()=>a.errorTypes,e=>{p.setErrorTypes(e||[])}),(0,t.createEffect)(()=>a.theme,e=>{p.setTheme(e)});let m=!1,h=!1;(0,t.onSettled)(()=>(queueMicrotask(()=>{h||((0,t.runWithOwner)(null,()=>p.mount(c)),m=!0)}),()=>{h=!0,m&&p.unmount()}));var g=i(),_=c;return typeof _==`function`||Array.isArray(_)?(0,e.ref)(()=>_,g):c=g,(0,e.effect)(()=>({...a.style}),(t,n)=>{(0,e.style)(g,t,n)}),g}exports.default=a;
@@ -0,0 +1,68 @@
1
+ let _solidjs_web = require("@solidjs/web");
2
+ let solid_js = require("solid-js");
3
+ let _tanstack_solid_query = require("@tanstack/solid-query");
4
+ let _tanstack_query_devtools = require("@tanstack/query-devtools");
5
+ // src/devtoolsPanel.tsx
6
+ var _tmpl$ = /*#__PURE__*/ (0, _solidjs_web.template)(`<div class=tsqd-parent-container style=height:100%;display:flex;flex-direction:column>`);
7
+ /**
8
+ * The props of `SolidQueryDevtoolsPanel`, which renders the devtools panel inline.
9
+ */
10
+ /**
11
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
12
+ * @param props - The devtools panel options.
13
+ * @returns The element the devtools panel is mounted in.
14
+ */
15
+ function SolidQueryDevtoolsPanel(props) {
16
+ const queryClient = (0, _tanstack_solid_query.useQueryClient)(props.client);
17
+ const client = (0, solid_js.createMemo)(() => queryClient);
18
+ let ref;
19
+ const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
20
+ const devtools = new _tanstack_query_devtools.TanstackQueryDevtoolsPanel({
21
+ client: client(),
22
+ queryFlavor: "Solid Query",
23
+ version: "5",
24
+ onlineManager: _tanstack_solid_query.onlineManager,
25
+ buttonPosition: "bottom-left",
26
+ position: "bottom",
27
+ initialIsOpen: true,
28
+ errorTypes,
29
+ styleNonce,
30
+ shadowDOMTarget,
31
+ onClose: props.onClose,
32
+ hideDisabledQueries,
33
+ theme: props.theme
34
+ });
35
+ (0, solid_js.createEffect)(() => client(), (c) => {
36
+ devtools.setClient(c);
37
+ });
38
+ (0, solid_js.createEffect)(() => props.onClose, (onClose) => {
39
+ devtools.setOnClose(onClose ?? (() => {}));
40
+ });
41
+ (0, solid_js.createEffect)(() => props.errorTypes, (errorTypes2) => {
42
+ devtools.setErrorTypes(errorTypes2 || []);
43
+ });
44
+ (0, solid_js.createEffect)(() => props.theme, (theme) => {
45
+ devtools.setTheme(theme);
46
+ });
47
+ let mounted = false;
48
+ let disposed = false;
49
+ (0, solid_js.onSettled)(() => {
50
+ queueMicrotask(() => {
51
+ if (disposed) return;
52
+ (0, solid_js.runWithOwner)(null, () => devtools.mount(ref));
53
+ mounted = true;
54
+ });
55
+ return () => {
56
+ disposed = true;
57
+ if (mounted) devtools.unmount();
58
+ };
59
+ });
60
+ var _el$ = _tmpl$();
61
+ var _ref$ = ref;
62
+ typeof _ref$ === "function" || Array.isArray(_ref$) ? (0, _solidjs_web.ref)(() => _ref$, _el$) : ref = _el$;
63
+ (0, _solidjs_web.effect)(() => ({ ...props.style }), (_v$, _$p) => {
64
+ (0, _solidjs_web.style)(_el$, _v$, _$p);
65
+ });
66
+ return _el$;
67
+ }
68
+ exports.default = SolidQueryDevtoolsPanel;
@@ -0,0 +1,62 @@
1
+ import { createEffect, createMemo, onSettled, runWithOwner } from "solid-js";
2
+ import { onlineManager, useQueryClient } from "@tanstack/solid-query";
3
+ import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
4
+ // src/devtoolsPanel.tsx
5
+ /**
6
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
7
+ * @param props - The devtools panel options.
8
+ * @returns The element the devtools panel is mounted in.
9
+ */
10
+ function SolidQueryDevtoolsPanel(props) {
11
+ const queryClient = useQueryClient(props.client);
12
+ const client = createMemo(() => queryClient);
13
+ let ref;
14
+ const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
15
+ const devtools = new TanstackQueryDevtoolsPanel({
16
+ client: client(),
17
+ queryFlavor: "Solid Query",
18
+ version: "5",
19
+ onlineManager,
20
+ buttonPosition: "bottom-left",
21
+ position: "bottom",
22
+ initialIsOpen: true,
23
+ errorTypes,
24
+ styleNonce,
25
+ shadowDOMTarget,
26
+ onClose: props.onClose,
27
+ hideDisabledQueries,
28
+ theme: props.theme
29
+ });
30
+ createEffect(() => client(), (c) => {
31
+ devtools.setClient(c);
32
+ });
33
+ createEffect(() => props.onClose, (onClose) => {
34
+ devtools.setOnClose(onClose ?? (() => {}));
35
+ });
36
+ createEffect(() => props.errorTypes, (errorTypes2) => {
37
+ devtools.setErrorTypes(errorTypes2 || []);
38
+ });
39
+ createEffect(() => props.theme, (theme) => {
40
+ devtools.setTheme(theme);
41
+ });
42
+ let mounted = false;
43
+ let disposed = false;
44
+ onSettled(() => {
45
+ queueMicrotask(() => {
46
+ if (disposed) return;
47
+ runWithOwner(null, () => devtools.mount(ref));
48
+ mounted = true;
49
+ });
50
+ return () => {
51
+ disposed = true;
52
+ if (mounted) devtools.unmount();
53
+ };
54
+ });
55
+ return <div style={{
56
+ height: "100%",
57
+ display: "flex",
58
+ "flex-direction": "column",
59
+ ...props.style
60
+ }} class="tsqd-parent-container" ref={ref} />;
61
+ }
62
+ export { SolidQueryDevtoolsPanel as default };
@@ -0,0 +1,68 @@
1
+ import { effect, ref, style, template } from "@solidjs/web";
2
+ import { createEffect, createMemo, onSettled, runWithOwner } from "solid-js";
3
+ import { onlineManager, useQueryClient } from "@tanstack/solid-query";
4
+ import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
5
+ // src/devtoolsPanel.tsx
6
+ var _tmpl$ = /*#__PURE__*/ template(`<div class=tsqd-parent-container style=height:100%;display:flex;flex-direction:column>`);
7
+ /**
8
+ * The props of `SolidQueryDevtoolsPanel`, which renders the devtools panel inline.
9
+ */
10
+ /**
11
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
12
+ * @param props - The devtools panel options.
13
+ * @returns The element the devtools panel is mounted in.
14
+ */
15
+ function SolidQueryDevtoolsPanel(props) {
16
+ const queryClient = useQueryClient(props.client);
17
+ const client = createMemo(() => queryClient);
18
+ let ref$1;
19
+ const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
20
+ const devtools = new TanstackQueryDevtoolsPanel({
21
+ client: client(),
22
+ queryFlavor: "Solid Query",
23
+ version: "5",
24
+ onlineManager,
25
+ buttonPosition: "bottom-left",
26
+ position: "bottom",
27
+ initialIsOpen: true,
28
+ errorTypes,
29
+ styleNonce,
30
+ shadowDOMTarget,
31
+ onClose: props.onClose,
32
+ hideDisabledQueries,
33
+ theme: props.theme
34
+ });
35
+ createEffect(() => client(), (c) => {
36
+ devtools.setClient(c);
37
+ });
38
+ createEffect(() => props.onClose, (onClose) => {
39
+ devtools.setOnClose(onClose ?? (() => {}));
40
+ });
41
+ createEffect(() => props.errorTypes, (errorTypes2) => {
42
+ devtools.setErrorTypes(errorTypes2 || []);
43
+ });
44
+ createEffect(() => props.theme, (theme) => {
45
+ devtools.setTheme(theme);
46
+ });
47
+ let mounted = false;
48
+ let disposed = false;
49
+ onSettled(() => {
50
+ queueMicrotask(() => {
51
+ if (disposed) return;
52
+ runWithOwner(null, () => devtools.mount(ref$1));
53
+ mounted = true;
54
+ });
55
+ return () => {
56
+ disposed = true;
57
+ if (mounted) devtools.unmount();
58
+ };
59
+ });
60
+ var _el$ = _tmpl$();
61
+ var _ref$ = ref$1;
62
+ typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref$1 = _el$;
63
+ effect(() => ({ ...props.style }), (_v$, _$p) => {
64
+ style(_el$, _v$, _$p);
65
+ });
66
+ return _el$;
67
+ }
68
+ export { SolidQueryDevtoolsPanel as default };
@@ -0,0 +1,106 @@
1
+ import { JSX as JSX$1 } from "@solidjs/web";
2
+ import { QueryClient } from "@tanstack/solid-query";
3
+ import { DevtoolsButtonPosition, DevtoolsErrorType, DevtoolsPosition, Theme } from "@tanstack/query-devtools";
4
+ interface DevtoolsOptions {
5
+ /**
6
+ * Set this true if you want the dev tools to default to being open
7
+ */
8
+ initialIsOpen?: boolean;
9
+ /**
10
+ * The position of the TanStack logo to open and close the devtools panel.
11
+ * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
12
+ * @defaultValue bottom-right
13
+ */
14
+ buttonPosition?: DevtoolsButtonPosition;
15
+ /**
16
+ * The position of the Solid Query devtools panel.
17
+ * 'top' | 'bottom' | 'left' | 'right'
18
+ * @defaultValue bottom
19
+ */
20
+ position?: DevtoolsPosition;
21
+ /**
22
+ * Custom instance of QueryClient
23
+ */
24
+ client?: QueryClient;
25
+ /**
26
+ * Use this so you can define custom errors that can be shown in the devtools.
27
+ */
28
+ errorTypes?: Array<DevtoolsErrorType>;
29
+ /**
30
+ * 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.
31
+ */
32
+ styleNonce?: string;
33
+ /**
34
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
35
+ * within the shadow DOM instead of within the head tag in the light DOM.
36
+ */
37
+ shadowDOMTarget?: ShadowRoot;
38
+ /**
39
+ * Set this to true to hide disabled queries from the devtools panel.
40
+ */
41
+ hideDisabledQueries?: boolean;
42
+ /**
43
+ * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
44
+ * This overrides the theme selected in the devtools Settings menu. When omitted, the
45
+ * selected theme is used, or `'system'` if none is selected.
46
+ */
47
+ theme?: Theme;
48
+ }
49
+ /**
50
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
51
+ * nearest `QueryClient`.
52
+ * @param props - The devtools options.
53
+ * @returns The element the devtools are mounted in.
54
+ */
55
+ declare function SolidQueryDevtools(props: DevtoolsOptions): import("@solidjs/web").JSX.Element;
56
+ /**
57
+ * The props of `SolidQueryDevtoolsPanel`, which renders the devtools panel inline.
58
+ */
59
+ interface DevtoolsPanelOptions {
60
+ /**
61
+ * Custom instance of QueryClient
62
+ */
63
+ client?: QueryClient;
64
+ /**
65
+ * Use this so you can define custom errors that can be shown in the devtools.
66
+ */
67
+ errorTypes?: Array<DevtoolsErrorType>;
68
+ /**
69
+ * 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.
70
+ */
71
+ styleNonce?: string;
72
+ /**
73
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
74
+ * within the shadow DOM instead of within the head tag in the light DOM.
75
+ */
76
+ shadowDOMTarget?: ShadowRoot;
77
+ /**
78
+ * Custom styles for the devtools panel
79
+ * @default { height: '100%', display: 'flex', 'flex-direction': 'column' }
80
+ * @example { height: '100%' }
81
+ * @example { height: '100%', width: '100%' }
82
+ */
83
+ style?: JSX$1.CSSProperties;
84
+ /**
85
+ * Callback function that is called when the devtools panel is closed
86
+ */
87
+ onClose?: () => void;
88
+ /**
89
+ * Set this to true to hide disabled queries from the devtools panel.
90
+ */
91
+ hideDisabledQueries?: boolean;
92
+ /**
93
+ * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
94
+ * This overrides the theme selected in the devtools Settings menu. When omitted, the
95
+ * selected theme is used, or `'system'` if none is selected.
96
+ */
97
+ theme?: Theme;
98
+ }
99
+ /**
100
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
101
+ * @param props - The devtools panel options.
102
+ * @returns The element the devtools panel is mounted in.
103
+ */
104
+ declare function SolidQueryDevtoolsPanel(props: DevtoolsPanelOptions): JSX$1.Element;
105
+ export { SolidQueryDevtoolsPanel as n, SolidQueryDevtools as r, DevtoolsPanelOptions as t };
106
+ //# sourceMappingURL=devtoolsPanel-DLEdindg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtoolsPanel-DLEdindg.d.ts","names":["JSX"],"sources":["../src/devtools.tsx","../src/devtoolsPanel.tsx"],"mappings":";;;UAWU;;;;EAIR;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;;;;;;;iBASc,mBAAmB,OAAO,yCAAe,IAAA;;;;UCrDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQA,MAAI;;;;EAKZ;;;;EAIA;;;;;;EAMA,QAAQ;;;;;;;iBAQc,wBAAwB,OAAO,uBAAoBA,MAAA"}
@@ -0,0 +1,106 @@
1
+ import { DevtoolsButtonPosition, DevtoolsErrorType, DevtoolsPosition, Theme } from "@tanstack/query-devtools";
2
+ import { QueryClient } from "@tanstack/solid-query";
3
+ import { JSX as JSX$1 } from "@solidjs/web";
4
+ interface DevtoolsOptions {
5
+ /**
6
+ * Set this true if you want the dev tools to default to being open
7
+ */
8
+ initialIsOpen?: boolean;
9
+ /**
10
+ * The position of the TanStack logo to open and close the devtools panel.
11
+ * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
12
+ * @defaultValue bottom-right
13
+ */
14
+ buttonPosition?: DevtoolsButtonPosition;
15
+ /**
16
+ * The position of the Solid Query devtools panel.
17
+ * 'top' | 'bottom' | 'left' | 'right'
18
+ * @defaultValue bottom
19
+ */
20
+ position?: DevtoolsPosition;
21
+ /**
22
+ * Custom instance of QueryClient
23
+ */
24
+ client?: QueryClient;
25
+ /**
26
+ * Use this so you can define custom errors that can be shown in the devtools.
27
+ */
28
+ errorTypes?: Array<DevtoolsErrorType>;
29
+ /**
30
+ * 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.
31
+ */
32
+ styleNonce?: string;
33
+ /**
34
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
35
+ * within the shadow DOM instead of within the head tag in the light DOM.
36
+ */
37
+ shadowDOMTarget?: ShadowRoot;
38
+ /**
39
+ * Set this to true to hide disabled queries from the devtools panel.
40
+ */
41
+ hideDisabledQueries?: boolean;
42
+ /**
43
+ * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
44
+ * This overrides the theme selected in the devtools Settings menu. When omitted, the
45
+ * selected theme is used, or `'system'` if none is selected.
46
+ */
47
+ theme?: Theme;
48
+ }
49
+ /**
50
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
51
+ * nearest `QueryClient`.
52
+ * @param props - The devtools options.
53
+ * @returns The element the devtools are mounted in.
54
+ */
55
+ declare function SolidQueryDevtools(props: DevtoolsOptions): import("@solidjs/web").JSX.Element;
56
+ /**
57
+ * The props of `SolidQueryDevtoolsPanel`, which renders the devtools panel inline.
58
+ */
59
+ interface DevtoolsPanelOptions {
60
+ /**
61
+ * Custom instance of QueryClient
62
+ */
63
+ client?: QueryClient;
64
+ /**
65
+ * Use this so you can define custom errors that can be shown in the devtools.
66
+ */
67
+ errorTypes?: Array<DevtoolsErrorType>;
68
+ /**
69
+ * 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.
70
+ */
71
+ styleNonce?: string;
72
+ /**
73
+ * Use this to pass a shadow DOM target to the devtools so that the styles will be applied
74
+ * within the shadow DOM instead of within the head tag in the light DOM.
75
+ */
76
+ shadowDOMTarget?: ShadowRoot;
77
+ /**
78
+ * Custom styles for the devtools panel
79
+ * @default { height: '100%', display: 'flex', 'flex-direction': 'column' }
80
+ * @example { height: '100%' }
81
+ * @example { height: '100%', width: '100%' }
82
+ */
83
+ style?: JSX$1.CSSProperties;
84
+ /**
85
+ * Callback function that is called when the devtools panel is closed
86
+ */
87
+ onClose?: () => void;
88
+ /**
89
+ * Set this to true to hide disabled queries from the devtools panel.
90
+ */
91
+ hideDisabledQueries?: boolean;
92
+ /**
93
+ * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
94
+ * This overrides the theme selected in the devtools Settings menu. When omitted, the
95
+ * selected theme is used, or `'system'` if none is selected.
96
+ */
97
+ theme?: Theme;
98
+ }
99
+ /**
100
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
101
+ * @param props - The devtools panel options.
102
+ * @returns The element the devtools panel is mounted in.
103
+ */
104
+ declare function SolidQueryDevtoolsPanel(props: DevtoolsPanelOptions): JSX$1.Element;
105
+ export { SolidQueryDevtoolsPanel as n, SolidQueryDevtools as r, DevtoolsPanelOptions as t };
106
+ //# sourceMappingURL=devtoolsPanel-Q67Cz4BM.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtoolsPanel-Q67Cz4BM.d.cts","names":["JSX"],"sources":["../src/devtools.tsx","../src/devtoolsPanel.tsx"],"mappings":";;;UAWU;;;;EAIR;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;;;;;;;iBASc,mBAAmB,OAAO,yCAAe,IAAA;;;;UCrDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQA,MAAI;;;;EAKZ;;;;EAIA;;;;;;EAMA,QAAQ;;;;;;;iBAQc,wBAAwB,OAAO,uBAAoBA,MAAA"}
@@ -0,0 +1,2 @@
1
+ import{effect as e,ref as t,style as n,template as r}from"@solidjs/web";import{createEffect as i,createMemo as a,onSettled as o,runWithOwner as s}from"solid-js";import{onlineManager as c,useQueryClient as l}from"@tanstack/solid-query";import{TanstackQueryDevtoolsPanel as u}from"@tanstack/query-devtools";var d=/*#__PURE__*/ r(`<div class=tsqd-parent-container style=height:100%;display:flex;flex-direction:column>`);function f(r){let f=l(r.client),p=a(()=>f),m,{errorTypes:h,styleNonce:g,shadowDOMTarget:_,hideDisabledQueries:v}=r,y=new u({client:p(),queryFlavor:`Solid Query`,version:`5`,onlineManager:c,buttonPosition:`bottom-left`,position:`bottom`,initialIsOpen:!0,errorTypes:h,styleNonce:g,shadowDOMTarget:_,onClose:r.onClose,hideDisabledQueries:v,theme:r.theme});i(()=>p(),e=>{y.setClient(e)}),i(()=>r.onClose,e=>{y.setOnClose(e??(()=>{}))}),i(()=>r.errorTypes,e=>{y.setErrorTypes(e||[])}),i(()=>r.theme,e=>{y.setTheme(e)});let b=!1,x=!1;o(()=>(queueMicrotask(()=>{x||(s(null,()=>y.mount(m)),b=!0)}),()=>{x=!0,b&&y.unmount()}));var S=d(),C=m;return typeof C==`function`||Array.isArray(C)?t(()=>C,S):m=S,e(()=>({...r.style}),(e,t)=>{n(S,e,t)}),S}export{f as default};
2
+ //# sourceMappingURL=devtoolsPanel-hmH3gOTU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtoolsPanel-hmH3gOTU.js","names":["createEffect","createMemo","onSettled","runWithOwner","onlineManager","useQueryClient","TanstackQueryDevtoolsPanel","SolidQueryDevtoolsPanel","props","queryClient","client","ref","errorTypes","styleNonce","shadowDOMTarget","hideDisabledQueries","devtools","queryFlavor","version","buttonPosition","position","initialIsOpen","onClose","theme","c","setClient","setOnClose","errorTypes2","setErrorTypes","setTheme","mounted","disposed","queueMicrotask","mount","unmount","_el$","_tmpl$","_ref$","Array","isArray","_$ref","_$effect","style","_v$","_$p","_$style","ref","_$ref","_tmpl$","SolidQueryDevtoolsPanel","queryClient","useQueryClient","props","client","createMemo","ref$1","devtools","TanstackQueryDevtoolsPanel","createEffect","c","onClose","errorTypes2","theme","mounted","disposed","onSettled","runWithOwner","_el$","_ref$","ref","effect","style","_v$","_$p"],"sources":["../src/devtoolsPanel.tsx"],"sourcesContent":["import { createEffect, createMemo, onSettled, runWithOwner } from 'solid-js'\nimport { onlineManager, useQueryClient } from '@tanstack/solid-query'\nimport { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'\nimport type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/solid-query'\nimport type { JSX } from '@solidjs/web'\n\n/**\n * The props of `SolidQueryDevtoolsPanel`, which renders the devtools panel inline.\n */\nexport interface DevtoolsPanelOptions {\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n\n /**\n * Custom styles for the devtools panel\n * @default { height: '100%', display: 'flex', 'flex-direction': 'column' }\n * @example { height: '100%' }\n * @example { height: '100%', width: '100%' }\n */\n style?: JSX.CSSProperties\n\n /**\n * Callback function that is called when the devtools panel is closed\n */\n onClose?: () => void\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * This overrides the theme selected in the devtools Settings menu. When omitted, the\n * selected theme is used, or `'system'` if none is selected.\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 default function SolidQueryDevtoolsPanel(props: DevtoolsPanelOptions) {\n const queryClient = useQueryClient(props.client)\n const client = createMemo(() => queryClient)\n let ref!: HTMLDivElement\n const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props\n const devtools = new TanstackQueryDevtoolsPanel({\n client: client(),\n queryFlavor: 'Solid 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: props.theme,\n })\n createEffect(\n () => client(),\n (c) => {\n devtools.setClient(c)\n },\n )\n createEffect(\n () => props.onClose,\n (onClose) => {\n devtools.setOnClose(onClose ?? (() => {}))\n },\n )\n\n createEffect(\n () => props.errorTypes,\n (errorTypes2) => {\n devtools.setErrorTypes(errorTypes2 || [])\n },\n )\n\n createEffect(\n () => props.theme,\n (theme) => {\n devtools.setTheme(theme)\n },\n )\n\n // devtools.mount() calls render() from solid-js/web, which calls flush().\n // flush() is not reentrant inside onSettled, so defer the mount to a\n // microtask. runWithOwner(null) escapes the owned scope because\n // devtools.mount renders a nested Solid app (creating reactive primitives).\n let mounted = false\n let disposed = false\n onSettled(() => {\n queueMicrotask(() => {\n if (disposed) return\n runWithOwner(null, () => devtools.mount(ref))\n mounted = true\n })\n return () => {\n disposed = true\n if (mounted) {\n devtools.unmount()\n }\n }\n })\n\n return (\n <div\n style={{\n height: '100%',\n display: 'flex',\n 'flex-direction': 'column',\n ...props.style,\n }}\n class=\"tsqd-parent-container\"\n ref={ref}\n />\n )\n}\n"],"mappings":"A,iaA0DA,SAAwBO,EAAwBC,EAA6B,CAC3E,IAAMC,EAAcJ,EAAeG,EAAME,MAAM,EACzCA,EAAST,MAAiBQ,CAAW,EACvCE,EACE,CAAEC,aAAYC,aAAYC,kBAAiBC,uBAAwBP,EACnEQ,EAAW,IAAIV,EAA2B,CAC9CI,OAAQA,EAAO,EACfO,YAAa,cACbC,QAAS,IACTd,gBACAe,eAAgB,cAChBC,SAAU,SACVC,cAAe,GACfT,aACAC,aACAC,kBACAQ,QAASd,EAAMc,QACfP,sBACAQ,MAAOf,EAAMe,KACf,CAAC,EACDvB,MACQU,EAAO,EACZc,GAAM,CACLR,EAASS,UAAUD,CAAC,CACtB,CACF,EACAxB,MACQQ,EAAMc,QACXA,GAAY,CACXN,EAASU,WAAWJ,QAAkB,CAAC,EAAE,CAC3C,CACF,EAEAtB,MACQQ,EAAMI,WACXe,GAAgB,CACfX,EAASY,cAAcD,GAAe,CAAA,CAAE,CAC1C,CACF,EAEA3B,MACQQ,EAAMe,MACXA,GAAU,CACTP,EAASa,SAASN,CAAK,CACzB,CACF,EAMA,IAAIO,EAAU,GACVC,EAAW,GACf7B,OACE8B,mBAAqB,CACfD,IACJ5B,EAAa,SAAYa,EAASiB,MAAMtB,CAAG,CAAC,EAC5CmB,EAAU,GACZ,CAAC,MACY,CACXC,EAAW,GACPD,GACFd,EAASkB,QAAQ,CAErB,EACD,EAAC,IAAAC,EAAAC,EAAA,EAAAC,EAWO1B,EATT,OASY,OAAA0B,GAAA,YAAAC,MAAAC,QAAAF,CAAA,EAAAG,MAAAH,EAAAF,CAAA,EAAHxB,EAAGwB,EAAAM,OAPD,CAIL,GAAGjC,EAAMkC,KACX,IAACC,EAAAC,IAAA,CAAAC,EAAAV,EAAAQ,EAAAC,CAAA,CAAA,CAAA,EAPLT,CAYF,C"}