@tanstack/solid-query-devtools 5.106.0 → 5.107.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/build/dev.cjs +109 -26
  2. package/build/dev.js +111 -28
  3. package/build/dev.jsx +102 -28
  4. package/build/devtoolsPanel-BC3mLtW8.d.ts +106 -0
  5. package/build/devtoolsPanel-BC3mLtW8.d.ts.map +1 -0
  6. package/build/devtoolsPanel-iWIJVAfL.d.cts +106 -0
  7. package/build/devtoolsPanel-iWIJVAfL.d.cts.map +1 -0
  8. package/build/index.cjs +1 -1
  9. package/build/index.d.cts +1 -104
  10. package/build/index.d.cts.map +1 -1
  11. package/build/index.d.ts +1 -104
  12. package/build/index.d.ts.map +1 -1
  13. package/build/index.js +1 -1
  14. package/build/index.js.map +1 -1
  15. package/build/index.jsx +2 -27
  16. package/build/production.cjs +1 -0
  17. package/build/production.d.cts +5 -0
  18. package/build/production.d.cts.map +1 -0
  19. package/build/production.d.ts +5 -0
  20. package/build/production.d.ts.map +1 -0
  21. package/build/production.js +2 -0
  22. package/build/production.js.map +1 -0
  23. package/build/production.jsx +107 -0
  24. package/package.json +29 -16
  25. package/src/index.tsx +14 -14
  26. package/src/production.tsx +7 -0
  27. package/build/devtools-8au4JaTw.cjs +0 -62
  28. package/build/devtools-COkRtz4W.jsx +0 -55
  29. package/build/devtools-CsBrM8Az.cjs +0 -1
  30. package/build/devtools-DS7Cagay.js +0 -62
  31. package/build/devtools-DWG-IwnT.js +0 -2
  32. package/build/devtools-DWG-IwnT.js.map +0 -1
  33. package/build/devtoolsPanel-3eu1kojY.js +0 -56
  34. package/build/devtoolsPanel-7jSpgkJK.cjs +0 -1
  35. package/build/devtoolsPanel-BnT0jwWW.jsx +0 -53
  36. package/build/devtoolsPanel-C2Ayou8L.cjs +0 -56
  37. package/build/devtoolsPanel-CCK9Gxsx.js +0 -2
  38. package/build/devtoolsPanel-CCK9Gxsx.js.map +0 -1
  39. package/src/clientOnly.tsx +0 -46
package/build/index.d.cts CHANGED
@@ -1,107 +1,4 @@
1
- import { DevtoolsButtonPosition, DevtoolsErrorType, DevtoolsPosition, Theme } from "@tanstack/query-devtools";
2
- import { QueryClient } from "@tanstack/solid-query";
3
- import { JSX as JSX$1 } from "solid-js";
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$1(props: DevtoolsOptions): import("solid-js").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$1(props: DevtoolsPanelOptions): JSX$1.Element;
1
+ import { n as SolidQueryDevtoolsPanel$1, r as SolidQueryDevtools$1, t as DevtoolsPanelOptions } from "./devtoolsPanel-iWIJVAfL.cjs";
105
2
  export declare const SolidQueryDevtools: typeof SolidQueryDevtools$1;
106
3
  export declare const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsPanel$1;
107
4
  export type { DevtoolsPanelOptions };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["SolidQueryDevtools","JSX","SolidQueryDevtoolsPanel","SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel"],"sources":["../src/devtools.tsx","../src/devtoolsPanel.tsx","../src/index.tsx"],"mappings":";;;UAWU;;;;EAIR;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;;;;;;;iBAScA,qBAAmB,OAAO,qCAAe,IAAA;;;;UCrDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQC,MAAI;;;;EAKZ;;;;EAIA;;;;;;EAMA,QAAQ;;;;;;;iBAQcC,0BAAwB,OAAO,uBAAoBD,MAAA;qBCrD9D,2BAA2BE;qBAM3B,gCAAgCC"}
1
+ {"version":3,"file":"index.d.cts","names":["SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel"],"sources":["../src/index.tsx"],"mappings":";qBAGa,2BAA2BA;qBAO3B,gCAAgCC"}
package/build/index.d.ts CHANGED
@@ -1,107 +1,4 @@
1
- import { JSX as JSX$1 } from "solid-js";
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$1(props: DevtoolsOptions): import("solid-js").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$1(props: DevtoolsPanelOptions): JSX$1.Element;
1
+ import { n as SolidQueryDevtoolsPanel$1, r as SolidQueryDevtools$1, t as DevtoolsPanelOptions } from "./devtoolsPanel-BC3mLtW8.js";
105
2
  export declare const SolidQueryDevtools: typeof SolidQueryDevtools$1;
106
3
  export declare const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsPanel$1;
107
4
  export type { DevtoolsPanelOptions };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["SolidQueryDevtools","JSX","SolidQueryDevtoolsPanel","SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel"],"sources":["../src/devtools.tsx","../src/devtoolsPanel.tsx","../src/index.tsx"],"mappings":";;;UAWU;;;;EAIR;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;;;;;;;iBAScA,qBAAmB,OAAO,qCAAe,IAAA;;;;UCrDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQC,MAAI;;;;EAKZ;;;;EAIA;;;;;;EAMA,QAAQ;;;;;;;iBAQcC,0BAAwB,OAAO,uBAAoBD,MAAA;qBCrD9D,2BAA2BE;qBAM3B,gCAAgCC"}
1
+ {"version":3,"file":"index.d.ts","names":["SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel"],"sources":["../src/index.tsx"],"mappings":";qBAGa,2BAA2BA;qBAO3B,gCAAgCC"}
package/build/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{isDev as e,isServer as t}from"solid-js/web";import{createMemo as n,createSignal as r,onMount as i,sharedConfig as a,splitProps as o,untrack as s}from"solid-js";function c(e){if(t)return e=>e.fallback;let[c,l]=r();return e().then(e=>l(()=>e.default)),e=>{let t,l,[,u]=o(e,[`fallback`]);if((t=c())&&!a.context)return t(u);let[d,f]=r(!a.context);return i(()=>f(!0)),n(()=>(t=c(),l=d(),s(()=>t&&l?t(u):e.fallback)))}}const l=e?c(()=>import(`./devtools-DWG-IwnT.js`)):function(){return null},u=e?c(()=>import(`./devtoolsPanel-CCK9Gxsx.js`)):function(){return null};export{l as SolidQueryDevtools,u as SolidQueryDevtoolsPanel};
1
+ const e=function(){return null},t=function(){return null};export{e as SolidQueryDevtools,t as SolidQueryDevtoolsPanel};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["createMemo","createSignal","onMount","sharedConfig","splitProps","untrack","isServer","Component","ComponentProps","JSX","clientOnly","fn","Promise","default","T","props","fallback","Element","comp","setComp","then","m","Comp","rest","context","mounted","setMounted","isDev","clientOnly","SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel","SolidQueryDevtools","SolidQueryDevtoolsPanel","DevtoolsPanelOptions","clientOnly","isServer","props","comp","setComp","createSignal","fn","m","Comp","rest","splitProps","sharedConfig","mounted","setMounted","onMount","createMemo","untrack","SolidQueryDevtools","isDev","SolidQueryDevtoolsPanel"],"sources":["../src/clientOnly.tsx","../src/index.tsx"],"sourcesContent":["import {\n createMemo,\n createSignal,\n onMount,\n sharedConfig,\n splitProps,\n untrack,\n} from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport type { Component, ComponentProps, JSX } from 'solid-js'\n\n/**\n * This function has been taken from solid-start's codebase:\n * <https://github.com/solidjs/solid-start/blob/2967fc2db3f0df826f061020231dbdafdfa0746b/packages/start/islands/clientOnly.tsx>.\n * This allows the devtools to be loaded only on the client and bypasses any server side rendering.\n * @param fn - Imports the module whose default export is the component.\n * @returns A component that renders `fallback` on the server and while the module loads on the\n * client, then the imported component.\n */\nexport default function clientOnly<T extends Component<any>>(\n fn: () => Promise<{\n default: T\n }>,\n) {\n if (isServer)\n return (props: ComponentProps<T> & { fallback?: JSX.Element }) =>\n props.fallback\n\n const [comp, setComp] = createSignal<T>()\n fn().then((m) => setComp(() => m.default))\n return (props: ComponentProps<T>) => {\n let Comp: T | undefined\n let m: boolean\n const [, rest] = splitProps(props, ['fallback'])\n if ((Comp = comp()) && !sharedConfig.context) return Comp(rest)\n const [mounted, setMounted] = createSignal(!sharedConfig.context)\n onMount(() => setMounted(true))\n return createMemo(\n () => (\n (Comp = comp()),\n (m = mounted()),\n untrack(() => (Comp && m ? Comp(rest) : props.fallback))\n ),\n )\n }\n}\n","import { isDev } from 'solid-js/web'\nimport clientOnly from './clientOnly'\nimport type SolidQueryDevtoolsComp from './devtools'\nimport type SolidQueryDevtoolsCompPanel from './devtoolsPanel'\n\nexport const SolidQueryDevtools: typeof SolidQueryDevtoolsComp = isDev\n ? clientOnly(() => import('./devtools'))\n : function () {\n return null\n }\n\nexport const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsCompPanel = isDev\n ? clientOnly(() => import('./devtoolsPanel'))\n : function () {\n return null\n }\n\nexport type { DevtoolsPanelOptions } from './devtoolsPanel'\n"],"mappings":"A,uKAmBA,SAAwBU,EACtBC,EAGA,CACA,GAAIL,EACF,MAAQS,IACNA,EAAMC,SAEV,GAAM,CAACE,EAAMC,GAAWlB,EAAgB,EAExC,OADAU,EAAG,CAAC,CAACS,KAAMC,GAAMF,MAAcE,EAAER,OAAO,CAAC,EACjCE,GAA6B,CACnC,IAAIO,EACAD,EACE,EAAGE,GAAQnB,EAAWW,EAAO,CAAC,UAAU,CAAC,EAC/C,IAAKO,EAAOJ,EAAK,IAAM,CAACf,EAAaqB,QAAS,OAAOF,EAAKC,CAAI,EAC9D,GAAM,CAACE,EAASC,GAAczB,EAAa,CAACE,EAAaqB,OAAO,EAEhE,OADAtB,MAAcwB,EAAW,EAAI,CAAC,EACvB1B,OAEFsB,EAAOJ,EAAK,EACZG,EAAII,EAAQ,EACbpB,MAAeiB,GAAQD,EAAIC,EAAKC,CAAI,EAAIR,EAAMC,QAAS,EAE3D,CACF,CACF,CCxCA,MAAae,EAAoDJ,EAC7DC,MAAiB,OAAO,yBAAa,EACrC,UAAY,CACV,OAAO,IACT,EAESI,EAA8DL,EACvEC,MAAiB,OAAO,8BAAkB,EAC1C,UAAY,CACV,OAAO,IACT,E"}
1
+ {"version":3,"file":"index.js","names":["SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel","SolidQueryDevtools","process","env","NODE_ENV","SolidQueryDevtoolsPanel","DevtoolsPanelOptions","SolidQueryDevtools","SolidQueryDevtoolsPanel"],"sources":["../src/index.tsx"],"sourcesContent":["import SolidQueryDevtoolsComp from './devtools'\nimport SolidQueryDevtoolsCompPanel from './devtoolsPanel'\n\nexport const SolidQueryDevtools: typeof SolidQueryDevtoolsComp =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : SolidQueryDevtoolsComp\n\nexport const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsCompPanel =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : SolidQueryDevtoolsCompPanel\n\nexport type { DevtoolsPanelOptions } from './devtoolsPanel'\n"],"mappings":"AAGA,MAAaE,EAEP,UAAY,CACV,OAAO,IACT,EAGOI,EAEP,UAAY,CACV,OAAO,IACT,E"}
package/build/index.jsx CHANGED
@@ -1,33 +1,8 @@
1
- import { isDev, isServer } from "solid-js/web";
2
- import { createMemo, createSignal, onMount, sharedConfig, splitProps, untrack } from "solid-js";
3
- // src/clientOnly.tsx
4
- /**
5
- * This function has been taken from solid-start's codebase:
6
- * <https://github.com/solidjs/solid-start/blob/2967fc2db3f0df826f061020231dbdafdfa0746b/packages/start/islands/clientOnly.tsx>.
7
- * This allows the devtools to be loaded only on the client and bypasses any server side rendering.
8
- * @param fn - Imports the module whose default export is the component.
9
- * @returns A component that renders `fallback` on the server and while the module loads on the
10
- * client, then the imported component.
11
- */
12
- function clientOnly(fn) {
13
- if (isServer) return (props) => props.fallback;
14
- const [comp, setComp] = createSignal();
15
- fn().then((m) => setComp(() => m.default));
16
- return (props) => {
17
- let Comp;
18
- let m;
19
- const [, rest] = splitProps(props, ["fallback"]);
20
- if ((Comp = comp()) && !sharedConfig.context) return Comp(rest);
21
- const [mounted, setMounted] = createSignal(!sharedConfig.context);
22
- onMount(() => setMounted(true));
23
- return createMemo(() => (Comp = comp(), m = mounted(), untrack(() => Comp && m ? Comp(rest) : props.fallback)));
24
- };
25
- }
26
1
  // src/index.tsx
27
- const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-COkRtz4W.jsx")) : function() {
2
+ const SolidQueryDevtools = function() {
28
3
  return null;
29
4
  };
30
- const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-BnT0jwWW.jsx")) : function() {
5
+ const SolidQueryDevtoolsPanel = function() {
31
6
  return null;
32
7
  };
33
8
  export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("solid-js/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});return(0,t.createEffect)(()=>{l.setClient(s())}),(0,t.createEffect)(()=>{let e=a.buttonPosition;e&&l.setButtonPosition(e)}),(0,t.createEffect)(()=>{let e=a.position;e&&l.setPosition(e)}),(0,t.createEffect)(()=>{l.setInitialIsOpen(a.initialIsOpen||!1)}),(0,t.createEffect)(()=>{l.setErrorTypes(a.errorTypes||[])}),(0,t.createEffect)(()=>{l.setTheme(a.theme)}),(0,t.onMount)(()=>{l.mount(c),(0,t.onCleanup)(()=>l.unmount())}),(()=>{var t=i(),n=c;return typeof n==`function`?(0,e.use)(n,t):c=t,t})()}var o=/*#__PURE__*/ (0,e.template)(`<div class=tsqd-parent-container style=height:100%;display:flex;flex-direction:column>`);function s(i){let a=(0,n.useQueryClient)(i.client),s=(0,t.createMemo)(()=>a),c,{errorTypes:l,styleNonce:u,shadowDOMTarget:d,hideDisabledQueries:f}=i,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:i.onClose,hideDisabledQueries:f,theme:i.theme});return(0,t.createEffect)(()=>{p.setClient(s())}),(0,t.createEffect)(()=>{p.setOnClose(i.onClose??(()=>{}))}),(0,t.createEffect)(()=>{p.setErrorTypes(i.errorTypes||[])}),(0,t.createEffect)(()=>{p.setTheme(i.theme)}),(0,t.onMount)(()=>{p.mount(c),(0,t.onCleanup)(()=>p.unmount())}),(()=>{var t=o(),n=c;return typeof n==`function`?(0,e.use)(n,t):c=t,(0,e.effect)(n=>(0,e.style)(t,{...i.style},n)),t})()}const c=a,l=s;exports.SolidQueryDevtools=c,exports.SolidQueryDevtoolsPanel=l;
@@ -0,0 +1,5 @@
1
+ import { n as SolidQueryDevtoolsPanel$1, r as SolidQueryDevtools$1, t as DevtoolsPanelOptions } from "./devtoolsPanel-iWIJVAfL.cjs";
2
+ export declare const SolidQueryDevtools: typeof SolidQueryDevtools$1;
3
+ export declare const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsPanel$1;
4
+ export type { DevtoolsPanelOptions };
5
+ //# sourceMappingURL=production.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"production.d.cts","names":["SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel"],"sources":["../src/production.tsx"],"mappings":";qBAGa,2BAAkBA;qBAClB,gCAAuBC"}
@@ -0,0 +1,5 @@
1
+ import { n as SolidQueryDevtoolsPanel$1, r as SolidQueryDevtools$1, t as DevtoolsPanelOptions } from "./devtoolsPanel-BC3mLtW8.js";
2
+ export declare const SolidQueryDevtools: typeof SolidQueryDevtools$1;
3
+ export declare const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsPanel$1;
4
+ export type { DevtoolsPanelOptions };
5
+ //# sourceMappingURL=production.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"production.d.ts","names":["SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel"],"sources":["../src/production.tsx"],"mappings":";qBAGa,2BAAkBA;qBAClB,gCAAuBC"}
@@ -0,0 +1,2 @@
1
+ import{effect as e,style as t,template as n,use as r}from"solid-js/web";import{createEffect as i,createMemo as a,onCleanup as o,onMount as s}from"solid-js";import{onlineManager as c,useQueryClient as l}from"@tanstack/solid-query";import{TanstackQueryDevtools as u,TanstackQueryDevtoolsPanel as d}from"@tanstack/query-devtools";var f=/*#__PURE__*/ n(`<div class=tsqd-parent-container>`);function p(e){let t=l(e.client),n=a(()=>t),d,p=new u({client:n(),queryFlavor:`Solid Query`,version:`5`,onlineManager:c,buttonPosition:e.buttonPosition,position:e.position,initialIsOpen:e.initialIsOpen,errorTypes:e.errorTypes,styleNonce:e.styleNonce,shadowDOMTarget:e.shadowDOMTarget,hideDisabledQueries:e.hideDisabledQueries,theme:e.theme});return i(()=>{p.setClient(n())}),i(()=>{let t=e.buttonPosition;t&&p.setButtonPosition(t)}),i(()=>{let t=e.position;t&&p.setPosition(t)}),i(()=>{p.setInitialIsOpen(e.initialIsOpen||!1)}),i(()=>{p.setErrorTypes(e.errorTypes||[])}),i(()=>{p.setTheme(e.theme)}),s(()=>{p.mount(d),o(()=>p.unmount())}),(()=>{var e=f(),t=d;return typeof t==`function`?r(t,e):d=e,e})()}var m=/*#__PURE__*/ n(`<div class=tsqd-parent-container style=height:100%;display:flex;flex-direction:column>`);function h(n){let u=l(n.client),f=a(()=>u),p,{errorTypes:h,styleNonce:g,shadowDOMTarget:_,hideDisabledQueries:v}=n,y=new d({client:f(),queryFlavor:`Solid Query`,version:`5`,onlineManager:c,buttonPosition:`bottom-left`,position:`bottom`,initialIsOpen:!0,errorTypes:h,styleNonce:g,shadowDOMTarget:_,onClose:n.onClose,hideDisabledQueries:v,theme:n.theme});return i(()=>{y.setClient(f())}),i(()=>{y.setOnClose(n.onClose??(()=>{}))}),i(()=>{y.setErrorTypes(n.errorTypes||[])}),i(()=>{y.setTheme(n.theme)}),s(()=>{y.mount(p),o(()=>y.unmount())}),(()=>{var i=m(),a=p;return typeof a==`function`?r(a,i):p=i,e(e=>t(i,{...n.style},e)),i})()}const g=p,_=h;export{g as SolidQueryDevtools,_ as SolidQueryDevtoolsPanel};
2
+ //# sourceMappingURL=production.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"production.js","names":["createEffect","createMemo","onCleanup","onMount","onlineManager","useQueryClient","TanstackQueryDevtools","DevtoolsButtonPosition","DevtoolsErrorType","DevtoolsPosition","Theme","QueryClient","DevtoolsOptions","initialIsOpen","buttonPosition","position","client","errorTypes","Array","styleNonce","shadowDOMTarget","ShadowRoot","hideDisabledQueries","theme","SolidQueryDevtools","props","queryClient","ref","HTMLDivElement","devtools","queryFlavor","version","setClient","buttonPos","setButtonPosition","pos","setPosition","setInitialIsOpen","setErrorTypes","setTheme","mount","unmount","_el$","_tmpl$","_ref$","_$use","_tmpl$","SolidQueryDevtools","_$use","createEffect","createMemo","onCleanup","onMount","onlineManager","useQueryClient","TanstackQueryDevtoolsPanel","DevtoolsErrorType","Theme","QueryClient","JSX","DevtoolsPanelOptions","client","errorTypes","Array","styleNonce","shadowDOMTarget","ShadowRoot","style","CSSProperties","onClose","hideDisabledQueries","theme","SolidQueryDevtoolsPanel","props","queryClient","ref","HTMLDivElement","devtools","queryFlavor","version","buttonPosition","position","initialIsOpen","setClient","setOnClose","setErrorTypes","setTheme","mount","unmount","_el$","_tmpl$","_ref$","_$use","_$effect","_$p","_$style","SolidQueryDevtoolsPanel","_$use","_$style","SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel","SolidQueryDevtools","SolidQueryDevtoolsPanel","DevtoolsPanelOptions","SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel","_tmpl$$1","SolidQueryDevtools$1","queryClient","useQueryClient","props","client","createMemo","ref","devtools","TanstackQueryDevtools","createEffect","buttonPos","pos","onMount","onCleanup","_el$","_ref$","use","_tmpl$","SolidQueryDevtoolsPanel$1","TanstackQueryDevtoolsPanel","effect","style","_$p","SolidQueryDevtools","SolidQueryDevtoolsPanel"],"sources":["../src/devtools.tsx","../src/devtoolsPanel.tsx","../src/production.tsx"],"sourcesContent":["import { createEffect, createMemo, onCleanup, onMount } 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 devtools.setClient(client())\n })\n\n createEffect(() => {\n const buttonPos = props.buttonPosition\n if (buttonPos) {\n devtools.setButtonPosition(buttonPos)\n }\n })\n\n createEffect(() => {\n const pos = props.position\n if (pos) {\n devtools.setPosition(pos)\n }\n })\n\n createEffect(() => {\n devtools.setInitialIsOpen(props.initialIsOpen || false)\n })\n\n createEffect(() => {\n devtools.setErrorTypes(props.errorTypes || [])\n })\n\n createEffect(() => {\n devtools.setTheme(props.theme)\n })\n\n onMount(() => {\n devtools.mount(ref)\n onCleanup(() => devtools.unmount())\n })\n\n return <div class=\"tsqd-parent-container\" ref={ref} />\n}\n","import { createEffect, createMemo, onCleanup, onMount } 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 'solid-js'\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 devtools.setClient(client())\n })\n createEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n })\n\n createEffect(() => {\n devtools.setErrorTypes(props.errorTypes || [])\n })\n\n createEffect(() => {\n devtools.setTheme(props.theme)\n })\n\n onMount(() => {\n devtools.mount(ref)\n onCleanup(() => devtools.unmount())\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","import SolidQueryDevtoolsComp from './devtools'\nimport SolidQueryDevtoolsCompPanel from './devtoolsPanel'\n\nexport const SolidQueryDevtools = SolidQueryDevtoolsComp\nexport const SolidQueryDevtoolsPanel = SolidQueryDevtoolsCompPanel\n\nexport type { DevtoolsPanelOptions } from './devtoolsPanel'\n"],"mappings":"A,kYA+DA,SAAwBwB,EAAmBC,EAAwB,CACjE,IAAMC,EAAcrB,EAAeoB,EAAMT,MAAM,EACzCA,EAASf,MAAiByB,CAAW,EACvCC,EACEE,EAAW,IAAIvB,EAAsB,CACzCU,OAAQA,EAAO,EACfc,YAAa,cACbC,QAAS,IACT3B,gBACAU,eAAgBW,EAAMX,eACtBC,SAAUU,EAAMV,SAChBF,cAAeY,EAAMZ,cACrBI,WAAYQ,EAAMR,WAClBE,WAAYM,EAAMN,WAClBC,gBAAiBK,EAAML,gBACvBE,oBAAqBG,EAAMH,oBAC3BC,MAAOE,EAAMF,KACf,CAAC,EAqCD,OAnCAvB,MAAmB,CACjB6B,EAASG,UAAUhB,EAAO,CAAC,CAC7B,CAAC,EAEDhB,MAAmB,CACjB,IAAMiC,EAAYR,EAAMX,eACpBmB,GACFJ,EAASK,kBAAkBD,CAAS,CAExC,CAAC,EAEDjC,MAAmB,CACjB,IAAMmC,EAAMV,EAAMV,SACdoB,GACFN,EAASO,YAAYD,CAAG,CAE5B,CAAC,EAEDnC,MAAmB,CACjB6B,EAASQ,iBAAiBZ,EAAMZ,eAAiB,EAAK,CACxD,CAAC,EAEDb,MAAmB,CACjB6B,EAASS,cAAcb,EAAMR,YAAc,CAAA,CAAE,CAC/C,CAAC,EAEDjB,MAAmB,CACjB6B,EAASU,SAASd,EAAMF,KAAK,CAC/B,CAAC,EAEDpB,MAAc,CACZ0B,EAASW,MAAMb,CAAG,EAClBzB,MAAgB2B,EAASY,QAAQ,CAAC,CACpC,CAAC,OAED,CAAA,IAAAC,EAAAC,EAAA,EAAAC,EAA+CjB,EAAG,OAAA,OAAAiB,GAAA,WAAAC,EAAAD,EAAAF,CAAA,EAAHf,EAAGe,EAAAA,CAAA,EAAA,CAAA,CACpD,C,gHC5DA,SAAwB8B,EAAwBC,EAA6B,CAC3E,IAAMC,EAAcpB,EAAemB,EAAMZ,MAAM,EACzCA,EAASX,MAAiBwB,CAAW,EACvCC,EACE,CAAEb,aAAYE,aAAYC,kBAAiBK,uBAAwBG,EACnEI,EAAW,IAAItB,EAA2B,CAC9CM,OAAQA,EAAO,EACfiB,YAAa,cACbC,QAAS,IACT1B,gBACA2B,eAAgB,cAChBC,SAAU,SACVC,cAAe,GACfpB,aACAE,aACAC,kBACAI,QAASI,EAAMJ,QACfC,sBACAC,MAAOE,EAAMF,KACf,CAAC,EAqBD,OApBAtB,MAAmB,CACjB4B,EAASM,UAAUtB,EAAO,CAAC,CAC7B,CAAC,EACDZ,MAAmB,CACjB4B,EAASO,WAAWX,EAAMJ,cAAkB,CAAC,EAAE,CACjD,CAAC,EAEDpB,MAAmB,CACjB4B,EAASQ,cAAcZ,EAAMX,YAAc,CAAA,CAAE,CAC/C,CAAC,EAEDb,MAAmB,CACjB4B,EAASS,SAASb,EAAMF,KAAK,CAC/B,CAAC,EAEDnB,MAAc,CACZyB,EAASU,MAAMZ,CAAG,EAClBxB,MAAgB0B,EAASW,QAAQ,CAAC,CACpC,CAAC,OAED,CAAA,IAAAC,EAAAC,EAAA,EAAAC,EASShB,EAFJ,OAEO,OAAAgB,GAAA,WAAAC,EAAAD,EAAAF,CAAA,EAAHd,EAAGc,EAAAI,EAAAC,GAAAC,EAAAN,EAPD,CAIL,GAAGhB,EAAMN,KACX,EAAC2B,CAAA,CAAA,EAAAL,CAAA,EAAA,CAAA,CAKP,CC3GA,MAAaY,EAAqBF,EACrBG,EAA0BF,E"}
@@ -0,0 +1,107 @@
1
+ import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
2
+ import { onlineManager, useQueryClient } from "@tanstack/solid-query";
3
+ import { TanstackQueryDevtools, TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
4
+ // src/devtools.tsx
5
+ /**
6
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
7
+ * nearest `QueryClient`.
8
+ * @param props - The devtools options.
9
+ * @returns The element the devtools are mounted in.
10
+ */
11
+ function SolidQueryDevtools$1(props) {
12
+ const queryClient = useQueryClient(props.client);
13
+ const client = createMemo(() => queryClient);
14
+ let ref;
15
+ const devtools = new TanstackQueryDevtools({
16
+ client: client(),
17
+ queryFlavor: "Solid Query",
18
+ version: "5",
19
+ onlineManager,
20
+ buttonPosition: props.buttonPosition,
21
+ position: props.position,
22
+ initialIsOpen: props.initialIsOpen,
23
+ errorTypes: props.errorTypes,
24
+ styleNonce: props.styleNonce,
25
+ shadowDOMTarget: props.shadowDOMTarget,
26
+ hideDisabledQueries: props.hideDisabledQueries,
27
+ theme: props.theme
28
+ });
29
+ createEffect(() => {
30
+ devtools.setClient(client());
31
+ });
32
+ createEffect(() => {
33
+ const buttonPos = props.buttonPosition;
34
+ if (buttonPos) devtools.setButtonPosition(buttonPos);
35
+ });
36
+ createEffect(() => {
37
+ const pos = props.position;
38
+ if (pos) devtools.setPosition(pos);
39
+ });
40
+ createEffect(() => {
41
+ devtools.setInitialIsOpen(props.initialIsOpen || false);
42
+ });
43
+ createEffect(() => {
44
+ devtools.setErrorTypes(props.errorTypes || []);
45
+ });
46
+ createEffect(() => {
47
+ devtools.setTheme(props.theme);
48
+ });
49
+ onMount(() => {
50
+ devtools.mount(ref);
51
+ onCleanup(() => devtools.unmount());
52
+ });
53
+ return <div class="tsqd-parent-container" ref={ref} />;
54
+ }
55
+ // src/devtoolsPanel.tsx
56
+ /**
57
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
58
+ * @param props - The devtools panel options.
59
+ * @returns The element the devtools panel is mounted in.
60
+ */
61
+ function SolidQueryDevtoolsPanel$1(props) {
62
+ const queryClient = useQueryClient(props.client);
63
+ const client = createMemo(() => queryClient);
64
+ let ref;
65
+ const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
66
+ const devtools = new TanstackQueryDevtoolsPanel({
67
+ client: client(),
68
+ queryFlavor: "Solid Query",
69
+ version: "5",
70
+ onlineManager,
71
+ buttonPosition: "bottom-left",
72
+ position: "bottom",
73
+ initialIsOpen: true,
74
+ errorTypes,
75
+ styleNonce,
76
+ shadowDOMTarget,
77
+ onClose: props.onClose,
78
+ hideDisabledQueries,
79
+ theme: props.theme
80
+ });
81
+ createEffect(() => {
82
+ devtools.setClient(client());
83
+ });
84
+ createEffect(() => {
85
+ devtools.setOnClose(props.onClose ?? (() => {}));
86
+ });
87
+ createEffect(() => {
88
+ devtools.setErrorTypes(props.errorTypes || []);
89
+ });
90
+ createEffect(() => {
91
+ devtools.setTheme(props.theme);
92
+ });
93
+ onMount(() => {
94
+ devtools.mount(ref);
95
+ onCleanup(() => devtools.unmount());
96
+ });
97
+ return <div style={{
98
+ height: "100%",
99
+ display: "flex",
100
+ "flex-direction": "column",
101
+ ...props.style
102
+ }} class="tsqd-parent-container" ref={ref} />;
103
+ }
104
+ // src/production.tsx
105
+ const SolidQueryDevtools = SolidQueryDevtools$1;
106
+ const SolidQueryDevtoolsPanel = SolidQueryDevtoolsPanel$1;
107
+ export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-query-devtools",
3
- "version": "5.106.0",
3
+ "version": "5.107.0",
4
4
  "description": "Developer tools to interact with and visualize the TanStack/solid-query Query cache",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -20,35 +20,48 @@
20
20
  "types": "./build/index.d.ts",
21
21
  "browser": {},
22
22
  "exports": {
23
- "@tanstack/custom-condition": "./src/index.tsx",
24
- "solid": {
25
- "development": "./build/dev.jsx",
26
- "import": "./build/index.jsx"
27
- },
28
- "development": {
23
+ ".": {
24
+ "@tanstack/custom-condition": "./src/index.tsx",
25
+ "solid": {
26
+ "development": "./build/dev.jsx",
27
+ "import": "./build/index.jsx"
28
+ },
29
+ "development": {
30
+ "import": {
31
+ "types": "./build/index.d.ts",
32
+ "default": "./build/dev.js"
33
+ },
34
+ "require": "./build/dev.cjs"
35
+ },
29
36
  "import": {
30
37
  "types": "./build/index.d.ts",
31
- "default": "./build/dev.js"
38
+ "default": "./build/index.js"
32
39
  },
33
- "require": "./build/dev.cjs"
40
+ "require": "./build/index.cjs"
34
41
  },
35
- "import": {
36
- "types": "./build/index.d.ts",
37
- "default": "./build/index.js"
42
+ "./production": {
43
+ "@tanstack/custom-condition": "./src/production.tsx",
44
+ "solid": "./build/production.jsx",
45
+ "import": {
46
+ "types": "./build/production.d.ts",
47
+ "default": "./build/production.js"
48
+ },
49
+ "require": "./build/production.cjs"
38
50
  },
39
- "require": "./build/index.cjs"
51
+ "./package.json": "./package.json"
40
52
  },
53
+ "sideEffects": false,
41
54
  "files": [
42
55
  "build",
43
56
  "src",
44
57
  "!src/__tests__"
45
58
  ],
46
59
  "dependencies": {
47
- "@tanstack/query-devtools": "5.106.0"
60
+ "@tanstack/query-devtools": "5.107.0"
48
61
  },
49
62
  "devDependencies": {
50
63
  "@solidjs/testing-library": "^0.8.10",
51
- "@tanstack/solid-query": "5.106.0",
64
+ "@tanstack/solid-query": "5.107.0",
52
65
  "eslint-plugin-solid": "^0.18.1",
53
66
  "solid-js": "^1.9.18",
54
67
  "typescript": "6.0.3",
@@ -56,7 +69,7 @@
56
69
  "vite-plugin-solid": "^2.11.15"
57
70
  },
58
71
  "peerDependencies": {
59
- "@tanstack/solid-query": "^5.106.0",
72
+ "@tanstack/solid-query": "^5.107.0",
60
73
  "solid-js": "^1.6.0"
61
74
  },
62
75
  "scripts": {
package/src/index.tsx CHANGED
@@ -1,18 +1,18 @@
1
- import { isDev } from 'solid-js/web'
2
- import clientOnly from './clientOnly'
3
- import type SolidQueryDevtoolsComp from './devtools'
4
- import type SolidQueryDevtoolsCompPanel from './devtoolsPanel'
1
+ import SolidQueryDevtoolsComp from './devtools'
2
+ import SolidQueryDevtoolsCompPanel from './devtoolsPanel'
5
3
 
6
- export const SolidQueryDevtools: typeof SolidQueryDevtoolsComp = isDev
7
- ? clientOnly(() => import('./devtools'))
8
- : function () {
9
- return null
10
- }
4
+ export const SolidQueryDevtools: typeof SolidQueryDevtoolsComp =
5
+ process.env.NODE_ENV !== 'development'
6
+ ? function () {
7
+ return null
8
+ }
9
+ : SolidQueryDevtoolsComp
11
10
 
12
- export const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsCompPanel = isDev
13
- ? clientOnly(() => import('./devtoolsPanel'))
14
- : function () {
15
- return null
16
- }
11
+ export const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsCompPanel =
12
+ process.env.NODE_ENV !== 'development'
13
+ ? function () {
14
+ return null
15
+ }
16
+ : SolidQueryDevtoolsCompPanel
17
17
 
18
18
  export type { DevtoolsPanelOptions } from './devtoolsPanel'
@@ -0,0 +1,7 @@
1
+ import SolidQueryDevtoolsComp from './devtools'
2
+ import SolidQueryDevtoolsCompPanel from './devtoolsPanel'
3
+
4
+ export const SolidQueryDevtools = SolidQueryDevtoolsComp
5
+ export const SolidQueryDevtoolsPanel = SolidQueryDevtoolsCompPanel
6
+
7
+ export type { DevtoolsPanelOptions } from './devtoolsPanel'
@@ -1,62 +0,0 @@
1
- let solid_js_web = require("solid-js/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, solid_js_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)(() => {
32
- devtools.setClient(client());
33
- });
34
- (0, solid_js.createEffect)(() => {
35
- const buttonPos = props.buttonPosition;
36
- if (buttonPos) devtools.setButtonPosition(buttonPos);
37
- });
38
- (0, solid_js.createEffect)(() => {
39
- const pos = props.position;
40
- if (pos) devtools.setPosition(pos);
41
- });
42
- (0, solid_js.createEffect)(() => {
43
- devtools.setInitialIsOpen(props.initialIsOpen || false);
44
- });
45
- (0, solid_js.createEffect)(() => {
46
- devtools.setErrorTypes(props.errorTypes || []);
47
- });
48
- (0, solid_js.createEffect)(() => {
49
- devtools.setTheme(props.theme);
50
- });
51
- (0, solid_js.onMount)(() => {
52
- devtools.mount(ref);
53
- (0, solid_js.onCleanup)(() => devtools.unmount());
54
- });
55
- return (() => {
56
- var _el$ = _tmpl$();
57
- var _ref$ = ref;
58
- typeof _ref$ === "function" ? (0, solid_js_web.use)(_ref$, _el$) : ref = _el$;
59
- return _el$;
60
- })();
61
- }
62
- exports.default = SolidQueryDevtools;