@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.
- package/build/dev.cjs +109 -26
- package/build/dev.js +111 -28
- package/build/dev.jsx +102 -28
- package/build/devtoolsPanel-BC3mLtW8.d.ts +106 -0
- package/build/devtoolsPanel-BC3mLtW8.d.ts.map +1 -0
- package/build/devtoolsPanel-iWIJVAfL.d.cts +106 -0
- package/build/devtoolsPanel-iWIJVAfL.d.cts.map +1 -0
- package/build/index.cjs +1 -1
- package/build/index.d.cts +1 -104
- package/build/index.d.cts.map +1 -1
- package/build/index.d.ts +1 -104
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/index.jsx +2 -27
- package/build/production.cjs +1 -0
- package/build/production.d.cts +5 -0
- package/build/production.d.cts.map +1 -0
- package/build/production.d.ts +5 -0
- package/build/production.d.ts.map +1 -0
- package/build/production.js +2 -0
- package/build/production.js.map +1 -0
- package/build/production.jsx +107 -0
- package/package.json +29 -16
- package/src/index.tsx +14 -14
- package/src/production.tsx +7 -0
- package/build/devtools-8au4JaTw.cjs +0 -62
- package/build/devtools-COkRtz4W.jsx +0 -55
- package/build/devtools-CsBrM8Az.cjs +0 -1
- package/build/devtools-DS7Cagay.js +0 -62
- package/build/devtools-DWG-IwnT.js +0 -2
- package/build/devtools-DWG-IwnT.js.map +0 -1
- package/build/devtoolsPanel-3eu1kojY.js +0 -56
- package/build/devtoolsPanel-7jSpgkJK.cjs +0 -1
- package/build/devtoolsPanel-BnT0jwWW.jsx +0 -53
- package/build/devtoolsPanel-C2Ayou8L.cjs +0 -56
- package/build/devtoolsPanel-CCK9Gxsx.js +0 -2
- package/build/devtoolsPanel-CCK9Gxsx.js.map +0 -1
- package/src/clientOnly.tsx +0 -46
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
|
|
2
|
-
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
3
|
-
import { TanstackQueryDevtools } 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(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
|
-
export { SolidQueryDevtools as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
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})()}exports.default=a;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { template, use } from "solid-js/web";
|
|
2
|
-
import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
|
|
3
|
-
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
4
|
-
import { TanstackQueryDevtools } from "@tanstack/query-devtools";
|
|
5
|
-
// src/devtools.tsx
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/ 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 = useQueryClient(props.client);
|
|
15
|
-
const client = createMemo(() => queryClient);
|
|
16
|
-
let ref;
|
|
17
|
-
const devtools = new TanstackQueryDevtools({
|
|
18
|
-
client: client(),
|
|
19
|
-
queryFlavor: "Solid Query",
|
|
20
|
-
version: "5",
|
|
21
|
-
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
|
-
createEffect(() => {
|
|
32
|
-
devtools.setClient(client());
|
|
33
|
-
});
|
|
34
|
-
createEffect(() => {
|
|
35
|
-
const buttonPos = props.buttonPosition;
|
|
36
|
-
if (buttonPos) devtools.setButtonPosition(buttonPos);
|
|
37
|
-
});
|
|
38
|
-
createEffect(() => {
|
|
39
|
-
const pos = props.position;
|
|
40
|
-
if (pos) devtools.setPosition(pos);
|
|
41
|
-
});
|
|
42
|
-
createEffect(() => {
|
|
43
|
-
devtools.setInitialIsOpen(props.initialIsOpen || false);
|
|
44
|
-
});
|
|
45
|
-
createEffect(() => {
|
|
46
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
47
|
-
});
|
|
48
|
-
createEffect(() => {
|
|
49
|
-
devtools.setTheme(props.theme);
|
|
50
|
-
});
|
|
51
|
-
onMount(() => {
|
|
52
|
-
devtools.mount(ref);
|
|
53
|
-
onCleanup(() => devtools.unmount());
|
|
54
|
-
});
|
|
55
|
-
return (() => {
|
|
56
|
-
var _el$ = _tmpl$();
|
|
57
|
-
var _ref$ = ref;
|
|
58
|
-
typeof _ref$ === "function" ? use(_ref$, _el$) : ref = _el$;
|
|
59
|
-
return _el$;
|
|
60
|
-
})();
|
|
61
|
-
}
|
|
62
|
-
export { SolidQueryDevtools as default };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{template as e,use as t}from"solid-js/web";import{createEffect as n,createMemo as r,onCleanup as i,onMount as a}from"solid-js";import{onlineManager as o,useQueryClient as s}from"@tanstack/solid-query";import{TanstackQueryDevtools as c}from"@tanstack/query-devtools";var l=/*#__PURE__*/ e(`<div class=tsqd-parent-container>`);function u(e){let u=s(e.client),d=r(()=>u),f,p=new c({client:d(),queryFlavor:`Solid Query`,version:`5`,onlineManager:o,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 n(()=>{p.setClient(d())}),n(()=>{let t=e.buttonPosition;t&&p.setButtonPosition(t)}),n(()=>{let t=e.position;t&&p.setPosition(t)}),n(()=>{p.setInitialIsOpen(e.initialIsOpen||!1)}),n(()=>{p.setErrorTypes(e.errorTypes||[])}),n(()=>{p.setTheme(e.theme)}),a(()=>{p.mount(f),i(()=>p.unmount())}),(()=>{var e=l(),n=f;return typeof n==`function`?t(n,e):f=e,e})()}export{u as default};
|
|
2
|
-
//# sourceMappingURL=devtools-DWG-IwnT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devtools-DWG-IwnT.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","_$use","_tmpl$","SolidQueryDevtools","queryClient","useQueryClient","props","client","createMemo","ref","devtools","TanstackQueryDevtools","createEffect","buttonPos","pos","onMount","onCleanup","_el$","_ref$","use"],"sources":["../src/devtools.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"],"mappings":"A,2UA+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"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { effect, style, template, use } from "solid-js/web";
|
|
2
|
-
import { createEffect, createMemo, onCleanup, onMount } 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
|
-
* 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
|
-
*/
|
|
12
|
-
function SolidQueryDevtoolsPanel(props) {
|
|
13
|
-
const queryClient = useQueryClient(props.client);
|
|
14
|
-
const client = createMemo(() => queryClient);
|
|
15
|
-
let ref;
|
|
16
|
-
const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
|
|
17
|
-
const devtools = new TanstackQueryDevtoolsPanel({
|
|
18
|
-
client: client(),
|
|
19
|
-
queryFlavor: "Solid Query",
|
|
20
|
-
version: "5",
|
|
21
|
-
onlineManager,
|
|
22
|
-
buttonPosition: "bottom-left",
|
|
23
|
-
position: "bottom",
|
|
24
|
-
initialIsOpen: true,
|
|
25
|
-
errorTypes,
|
|
26
|
-
styleNonce,
|
|
27
|
-
shadowDOMTarget,
|
|
28
|
-
onClose: props.onClose,
|
|
29
|
-
hideDisabledQueries,
|
|
30
|
-
theme: props.theme
|
|
31
|
-
});
|
|
32
|
-
createEffect(() => {
|
|
33
|
-
devtools.setClient(client());
|
|
34
|
-
});
|
|
35
|
-
createEffect(() => {
|
|
36
|
-
devtools.setOnClose(props.onClose ?? (() => {}));
|
|
37
|
-
});
|
|
38
|
-
createEffect(() => {
|
|
39
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
40
|
-
});
|
|
41
|
-
createEffect(() => {
|
|
42
|
-
devtools.setTheme(props.theme);
|
|
43
|
-
});
|
|
44
|
-
onMount(() => {
|
|
45
|
-
devtools.mount(ref);
|
|
46
|
-
onCleanup(() => devtools.unmount());
|
|
47
|
-
});
|
|
48
|
-
return (() => {
|
|
49
|
-
var _el$ = _tmpl$();
|
|
50
|
-
var _ref$ = ref;
|
|
51
|
-
typeof _ref$ === "function" ? use(_ref$, _el$) : ref = _el$;
|
|
52
|
-
effect((_$p) => style(_el$, { ...props.style }, _$p));
|
|
53
|
-
return _el$;
|
|
54
|
-
})();
|
|
55
|
-
}
|
|
56
|
-
export { SolidQueryDevtoolsPanel as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
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 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});return(0,t.createEffect)(()=>{p.setClient(s())}),(0,t.createEffect)(()=>{p.setOnClose(a.onClose??(()=>{}))}),(0,t.createEffect)(()=>{p.setErrorTypes(a.errorTypes||[])}),(0,t.createEffect)(()=>{p.setTheme(a.theme)}),(0,t.onMount)(()=>{p.mount(c),(0,t.onCleanup)(()=>p.unmount())}),(()=>{var t=i(),n=c;return typeof n==`function`?(0,e.use)(n,t):c=t,(0,e.effect)(n=>(0,e.style)(t,{...a.style},n)),t})()}exports.default=a;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { createEffect, createMemo, onCleanup, onMount } 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(() => {
|
|
31
|
-
devtools.setClient(client());
|
|
32
|
-
});
|
|
33
|
-
createEffect(() => {
|
|
34
|
-
devtools.setOnClose(props.onClose ?? (() => {}));
|
|
35
|
-
});
|
|
36
|
-
createEffect(() => {
|
|
37
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
38
|
-
});
|
|
39
|
-
createEffect(() => {
|
|
40
|
-
devtools.setTheme(props.theme);
|
|
41
|
-
});
|
|
42
|
-
onMount(() => {
|
|
43
|
-
devtools.mount(ref);
|
|
44
|
-
onCleanup(() => devtools.unmount());
|
|
45
|
-
});
|
|
46
|
-
return <div style={{
|
|
47
|
-
height: "100%",
|
|
48
|
-
display: "flex",
|
|
49
|
-
"flex-direction": "column",
|
|
50
|
-
...props.style
|
|
51
|
-
}} class="tsqd-parent-container" ref={ref} />;
|
|
52
|
-
}
|
|
53
|
-
export { SolidQueryDevtoolsPanel as default };
|
|
@@ -1,56 +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/devtoolsPanel.tsx
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/ (0, solid_js_web.template)(`<div class=tsqd-parent-container style=height:100%;display:flex;flex-direction:column>`);
|
|
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
|
-
*/
|
|
12
|
-
function SolidQueryDevtoolsPanel(props) {
|
|
13
|
-
const queryClient = (0, _tanstack_solid_query.useQueryClient)(props.client);
|
|
14
|
-
const client = (0, solid_js.createMemo)(() => queryClient);
|
|
15
|
-
let ref;
|
|
16
|
-
const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
|
|
17
|
-
const devtools = new _tanstack_query_devtools.TanstackQueryDevtoolsPanel({
|
|
18
|
-
client: client(),
|
|
19
|
-
queryFlavor: "Solid Query",
|
|
20
|
-
version: "5",
|
|
21
|
-
onlineManager: _tanstack_solid_query.onlineManager,
|
|
22
|
-
buttonPosition: "bottom-left",
|
|
23
|
-
position: "bottom",
|
|
24
|
-
initialIsOpen: true,
|
|
25
|
-
errorTypes,
|
|
26
|
-
styleNonce,
|
|
27
|
-
shadowDOMTarget,
|
|
28
|
-
onClose: props.onClose,
|
|
29
|
-
hideDisabledQueries,
|
|
30
|
-
theme: props.theme
|
|
31
|
-
});
|
|
32
|
-
(0, solid_js.createEffect)(() => {
|
|
33
|
-
devtools.setClient(client());
|
|
34
|
-
});
|
|
35
|
-
(0, solid_js.createEffect)(() => {
|
|
36
|
-
devtools.setOnClose(props.onClose ?? (() => {}));
|
|
37
|
-
});
|
|
38
|
-
(0, solid_js.createEffect)(() => {
|
|
39
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
40
|
-
});
|
|
41
|
-
(0, solid_js.createEffect)(() => {
|
|
42
|
-
devtools.setTheme(props.theme);
|
|
43
|
-
});
|
|
44
|
-
(0, solid_js.onMount)(() => {
|
|
45
|
-
devtools.mount(ref);
|
|
46
|
-
(0, solid_js.onCleanup)(() => devtools.unmount());
|
|
47
|
-
});
|
|
48
|
-
return (() => {
|
|
49
|
-
var _el$ = _tmpl$();
|
|
50
|
-
var _ref$ = ref;
|
|
51
|
-
typeof _ref$ === "function" ? (0, solid_js_web.use)(_ref$, _el$) : ref = _el$;
|
|
52
|
-
(0, solid_js_web.effect)((_$p) => (0, solid_js_web.style)(_el$, { ...props.style }, _$p));
|
|
53
|
-
return _el$;
|
|
54
|
-
})();
|
|
55
|
-
}
|
|
56
|
-
exports.default = SolidQueryDevtoolsPanel;
|
|
@@ -1,2 +0,0 @@
|
|
|
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{TanstackQueryDevtoolsPanel as u}from"@tanstack/query-devtools";var d=/*#__PURE__*/ n(`<div class=tsqd-parent-container style=height:100%;display:flex;flex-direction:column>`);function f(n){let f=l(n.client),p=a(()=>f),m,{errorTypes:h,styleNonce:g,shadowDOMTarget:_,hideDisabledQueries:v}=n,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:n.onClose,hideDisabledQueries:v,theme:n.theme});return i(()=>{y.setClient(p())}),i(()=>{y.setOnClose(n.onClose??(()=>{}))}),i(()=>{y.setErrorTypes(n.errorTypes||[])}),i(()=>{y.setTheme(n.theme)}),s(()=>{y.mount(m),o(()=>y.unmount())}),(()=>{var i=d(),a=m;return typeof a==`function`?r(a,i):m=i,e(e=>t(i,{...n.style},e)),i})()}export{f as default};
|
|
2
|
-
//# sourceMappingURL=devtoolsPanel-CCK9Gxsx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devtoolsPanel-CCK9Gxsx.js","names":["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","_$use","_$style","_tmpl$","SolidQueryDevtoolsPanel","queryClient","useQueryClient","props","client","createMemo","ref","devtools","TanstackQueryDevtoolsPanel","createEffect","onMount","onCleanup","_el$","_ref$","use","effect","style","_$p"],"sources":["../src/devtoolsPanel.tsx"],"sourcesContent":["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"],"mappings":"A,4ZA0DA,SAAwBuB,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,C"}
|
package/src/clientOnly.tsx
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createMemo,
|
|
3
|
-
createSignal,
|
|
4
|
-
onMount,
|
|
5
|
-
sharedConfig,
|
|
6
|
-
splitProps,
|
|
7
|
-
untrack,
|
|
8
|
-
} from 'solid-js'
|
|
9
|
-
import { isServer } from 'solid-js/web'
|
|
10
|
-
import type { Component, ComponentProps, JSX } from 'solid-js'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This function has been taken from solid-start's codebase:
|
|
14
|
-
* <https://github.com/solidjs/solid-start/blob/2967fc2db3f0df826f061020231dbdafdfa0746b/packages/start/islands/clientOnly.tsx>.
|
|
15
|
-
* This allows the devtools to be loaded only on the client and bypasses any server side rendering.
|
|
16
|
-
* @param fn - Imports the module whose default export is the component.
|
|
17
|
-
* @returns A component that renders `fallback` on the server and while the module loads on the
|
|
18
|
-
* client, then the imported component.
|
|
19
|
-
*/
|
|
20
|
-
export default function clientOnly<T extends Component<any>>(
|
|
21
|
-
fn: () => Promise<{
|
|
22
|
-
default: T
|
|
23
|
-
}>,
|
|
24
|
-
) {
|
|
25
|
-
if (isServer)
|
|
26
|
-
return (props: ComponentProps<T> & { fallback?: JSX.Element }) =>
|
|
27
|
-
props.fallback
|
|
28
|
-
|
|
29
|
-
const [comp, setComp] = createSignal<T>()
|
|
30
|
-
fn().then((m) => setComp(() => m.default))
|
|
31
|
-
return (props: ComponentProps<T>) => {
|
|
32
|
-
let Comp: T | undefined
|
|
33
|
-
let m: boolean
|
|
34
|
-
const [, rest] = splitProps(props, ['fallback'])
|
|
35
|
-
if ((Comp = comp()) && !sharedConfig.context) return Comp(rest)
|
|
36
|
-
const [mounted, setMounted] = createSignal(!sharedConfig.context)
|
|
37
|
-
onMount(() => setMounted(true))
|
|
38
|
-
return createMemo(
|
|
39
|
-
() => (
|
|
40
|
-
(Comp = comp()),
|
|
41
|
-
(m = mounted()),
|
|
42
|
-
untrack(() => (Comp && m ? Comp(rest) : props.fallback))
|
|
43
|
-
),
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
}
|