@tanstack/solid-query-devtools 5.104.1 → 5.104.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dev.cjs +10 -2
- package/build/dev.js +10 -2
- package/build/dev.jsx +10 -2
- package/build/{devtools-CXrmuwV8.jsx → devtools-4DtrHfk8.jsx} +7 -1
- package/build/{devtools-BFGGY7dV.cjs → devtools-BMFPTjfX.cjs} +6 -0
- package/build/devtools-CEvVAp2X.js.map +1 -1
- package/build/{devtools-C2-vOvXZ.js → devtools-DW3ZHOYk.js} +6 -0
- package/build/{devtoolsPanel-CLvDG9kV.cjs → devtoolsPanel-B1uOvxz4.cjs} +5 -0
- package/build/{devtoolsPanel-CjUh_Osq.jsx → devtoolsPanel-CfOYIuMv.jsx} +5 -0
- package/build/{devtoolsPanel-Dk1_K0ko.js → devtoolsPanel-CozcJrqa.js} +5 -0
- package/build/devtoolsPanel-glpBZk1i.js.map +1 -1
- package/build/index.d.cts +18 -6
- package/build/index.d.cts.map +1 -1
- package/build/index.d.ts +18 -6
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/index.jsx +10 -2
- package/package.json +7 -6
- package/src/clientOnly.tsx +8 -5
- package/src/devtools.tsx +9 -5
- package/src/devtoolsPanel.tsx +10 -2
package/build/dev.cjs
CHANGED
|
@@ -2,6 +2,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let solid_js_web = require("solid-js/web");
|
|
3
3
|
let solid_js = require("solid-js");
|
|
4
4
|
//#region src/clientOnly.tsx
|
|
5
|
+
/**
|
|
6
|
+
* This function has been taken from solid-start's codebase:
|
|
7
|
+
* <https://github.com/solidjs/solid-start/blob/2967fc2db3f0df826f061020231dbdafdfa0746b/packages/start/islands/clientOnly.tsx>.
|
|
8
|
+
* This allows the devtools to be loaded only on the client and bypasses any server side rendering.
|
|
9
|
+
* @param fn - Imports the module whose default export is the component.
|
|
10
|
+
* @returns A component that renders `fallback` on the server and while the module loads on the
|
|
11
|
+
* client, then the imported component.
|
|
12
|
+
*/
|
|
5
13
|
function clientOnly(fn) {
|
|
6
14
|
if (solid_js_web.isServer) return (props) => props.fallback;
|
|
7
15
|
const [comp, setComp] = (0, solid_js.createSignal)();
|
|
@@ -18,10 +26,10 @@ function clientOnly(fn) {
|
|
|
18
26
|
}
|
|
19
27
|
//#endregion
|
|
20
28
|
//#region src/index.tsx
|
|
21
|
-
const SolidQueryDevtools = solid_js_web.isDev ? clientOnly(() => Promise.resolve().then(() => require("./devtools-
|
|
29
|
+
const SolidQueryDevtools = solid_js_web.isDev ? clientOnly(() => Promise.resolve().then(() => require("./devtools-BMFPTjfX.cjs"))) : function() {
|
|
22
30
|
return null;
|
|
23
31
|
};
|
|
24
|
-
const SolidQueryDevtoolsPanel = solid_js_web.isDev ? clientOnly(() => Promise.resolve().then(() => require("./devtoolsPanel-
|
|
32
|
+
const SolidQueryDevtoolsPanel = solid_js_web.isDev ? clientOnly(() => Promise.resolve().then(() => require("./devtoolsPanel-B1uOvxz4.cjs"))) : function() {
|
|
25
33
|
return null;
|
|
26
34
|
};
|
|
27
35
|
//#endregion
|
package/build/dev.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { isDev, isServer } from "solid-js/web";
|
|
2
2
|
import { createMemo, createSignal, onMount, sharedConfig, splitProps, untrack } from "solid-js";
|
|
3
3
|
//#region 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
|
+
*/
|
|
4
12
|
function clientOnly(fn) {
|
|
5
13
|
if (isServer) return (props) => props.fallback;
|
|
6
14
|
const [comp, setComp] = createSignal();
|
|
@@ -17,10 +25,10 @@ function clientOnly(fn) {
|
|
|
17
25
|
}
|
|
18
26
|
//#endregion
|
|
19
27
|
//#region src/index.tsx
|
|
20
|
-
const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-
|
|
28
|
+
const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-DW3ZHOYk.js")) : function() {
|
|
21
29
|
return null;
|
|
22
30
|
};
|
|
23
|
-
const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-
|
|
31
|
+
const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-CozcJrqa.js")) : function() {
|
|
24
32
|
return null;
|
|
25
33
|
};
|
|
26
34
|
//#endregion
|
package/build/dev.jsx
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { isDev, isServer } from "solid-js/web";
|
|
2
2
|
import { createMemo, createSignal, onMount, sharedConfig, splitProps, untrack } from "solid-js";
|
|
3
3
|
//#region 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
|
+
*/
|
|
4
12
|
function clientOnly(fn) {
|
|
5
13
|
if (isServer) return (props) => props.fallback;
|
|
6
14
|
const [comp, setComp] = createSignal();
|
|
@@ -17,10 +25,10 @@ function clientOnly(fn) {
|
|
|
17
25
|
}
|
|
18
26
|
//#endregion
|
|
19
27
|
//#region src/index.tsx
|
|
20
|
-
const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-
|
|
28
|
+
const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-4DtrHfk8.jsx")) : function() {
|
|
21
29
|
return null;
|
|
22
30
|
};
|
|
23
|
-
const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-
|
|
31
|
+
const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-CfOYIuMv.jsx")) : function() {
|
|
24
32
|
return null;
|
|
25
33
|
};
|
|
26
34
|
//#endregion
|
|
@@ -2,6 +2,12 @@ import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
|
|
|
2
2
|
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
3
3
|
import { TanstackQueryDevtools } from "@tanstack/query-devtools";
|
|
4
4
|
//#region 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
|
+
*/
|
|
5
11
|
function SolidQueryDevtools(props) {
|
|
6
12
|
const queryClient = useQueryClient(props.client);
|
|
7
13
|
const client = createMemo(() => queryClient);
|
|
@@ -44,7 +50,7 @@ function SolidQueryDevtools(props) {
|
|
|
44
50
|
devtools.mount(ref);
|
|
45
51
|
onCleanup(() => devtools.unmount());
|
|
46
52
|
});
|
|
47
|
-
return <div class="tsqd-parent-container" ref={ref}
|
|
53
|
+
return <div class="tsqd-parent-container" ref={ref} />;
|
|
48
54
|
}
|
|
49
55
|
//#endregion
|
|
50
56
|
export { SolidQueryDevtools as default };
|
|
@@ -4,6 +4,12 @@ let _tanstack_solid_query = require("@tanstack/solid-query");
|
|
|
4
4
|
let _tanstack_query_devtools = require("@tanstack/query-devtools");
|
|
5
5
|
//#region src/devtools.tsx
|
|
6
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
|
+
*/
|
|
7
13
|
function SolidQueryDevtools(props) {
|
|
8
14
|
const queryClient = (0, _tanstack_solid_query.useQueryClient)(props.client);
|
|
9
15
|
const client = (0, solid_js.createMemo)(() => queryClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools-CEvVAp2X.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
|
|
1
|
+
{"version":3,"file":"devtools-CEvVAp2X.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 * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or\n * nearest `QueryClient`.\n * @param props - The devtools options.\n * @returns The element the devtools are mounted in.\n */\nexport 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 || 'system')\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":"2UA8DA,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,OAAS,QAAQ,CAC3C,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"}
|
|
@@ -4,6 +4,12 @@ import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
|
4
4
|
import { TanstackQueryDevtools } from "@tanstack/query-devtools";
|
|
5
5
|
//#region src/devtools.tsx
|
|
6
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
|
+
*/
|
|
7
13
|
function SolidQueryDevtools(props) {
|
|
8
14
|
const queryClient = useQueryClient(props.client);
|
|
9
15
|
const client = createMemo(() => queryClient);
|
|
@@ -4,6 +4,11 @@ let _tanstack_solid_query = require("@tanstack/solid-query");
|
|
|
4
4
|
let _tanstack_query_devtools = require("@tanstack/query-devtools");
|
|
5
5
|
//#region src/devtoolsPanel.tsx
|
|
6
6
|
var _tmpl$ = /*#__PURE__*/ (0, solid_js_web.template)(`<div class=tsqd-parent-container style=height:500px>`);
|
|
7
|
+
/**
|
|
8
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
9
|
+
* @param props - The devtools panel options.
|
|
10
|
+
* @returns The element the devtools panel is mounted in.
|
|
11
|
+
*/
|
|
7
12
|
function SolidQueryDevtoolsPanel(props) {
|
|
8
13
|
const queryClient = (0, _tanstack_solid_query.useQueryClient)(props.client);
|
|
9
14
|
const client = (0, solid_js.createMemo)(() => queryClient);
|
|
@@ -2,6 +2,11 @@ import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
|
|
|
2
2
|
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
3
3
|
import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
|
|
4
4
|
//#region 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
|
+
*/
|
|
5
10
|
function SolidQueryDevtoolsPanel(props) {
|
|
6
11
|
const queryClient = useQueryClient(props.client);
|
|
7
12
|
const client = createMemo(() => queryClient);
|
|
@@ -4,6 +4,11 @@ import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
|
4
4
|
import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
|
|
5
5
|
//#region src/devtoolsPanel.tsx
|
|
6
6
|
var _tmpl$ = /*#__PURE__*/ template(`<div class=tsqd-parent-container style=height:500px>`);
|
|
7
|
+
/**
|
|
8
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
9
|
+
* @param props - The devtools panel options.
|
|
10
|
+
* @returns The element the devtools panel is mounted in.
|
|
11
|
+
*/
|
|
7
12
|
function SolidQueryDevtoolsPanel(props) {
|
|
8
13
|
const queryClient = useQueryClient(props.client);
|
|
9
14
|
const client = createMemo(() => queryClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtoolsPanel-glpBZk1i.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\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
|
|
1
|
+
{"version":3,"file":"devtoolsPanel-glpBZk1i.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: '500px' }\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 * @defaultValue system\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.\n * @param props - The devtools panel options.\n * @returns The element the devtools panel is mounted in.\n */\nexport 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 || 'system')\n })\n\n onMount(() => {\n devtools.mount(ref)\n onCleanup(() => devtools.unmount())\n })\n\n return (\n <div\n style={{ height: '500px', ...props.style }}\n class=\"tsqd-parent-container\"\n ref={ref}\n />\n )\n}\n"],"mappings":"0XAyDA,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,OAAS,QAAQ,CAC3C,CAAC,EAEDnB,MAAc,CACZyB,EAASU,MAAMZ,CAAG,EAClBxB,MAAgB0B,EAASW,QAAQ,CAAC,CACpC,CAAC,OAED,CAAA,IAAAC,EAAAC,EAAA,EAAAC,EAIShB,EAFqC,OAElC,OAAAgB,GAAA,WAAAC,EAAAD,EAAAF,CAAA,EAAHd,EAAGc,EAAAI,EAAAC,GAAAC,EAAAN,EAFD,CAAmB,GAAGhB,EAAMN,KAAM,EAAC2B,CAAA,CAAA,EAAAL,CAAA,EAAA,CAAA,CAKhD"}
|
package/build/index.d.cts
CHANGED
|
@@ -10,14 +10,12 @@ interface DevtoolsOptions {
|
|
|
10
10
|
/**
|
|
11
11
|
* The position of the TanStack logo to open and close the devtools panel.
|
|
12
12
|
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
13
|
-
*
|
|
14
13
|
* @defaultValue bottom-right
|
|
15
14
|
*/
|
|
16
15
|
buttonPosition?: DevtoolsButtonPosition;
|
|
17
16
|
/**
|
|
18
17
|
* The position of the Solid Query devtools panel.
|
|
19
18
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
20
|
-
*
|
|
21
19
|
* @defaultValue bottom
|
|
22
20
|
*/
|
|
23
21
|
position?: DevtoolsPosition;
|
|
@@ -34,7 +32,8 @@ interface DevtoolsOptions {
|
|
|
34
32
|
*/
|
|
35
33
|
styleNonce?: string;
|
|
36
34
|
/**
|
|
37
|
-
* Use this
|
|
35
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
36
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
38
37
|
*/
|
|
39
38
|
shadowDOMTarget?: ShadowRoot;
|
|
40
39
|
/**
|
|
@@ -43,14 +42,22 @@ interface DevtoolsOptions {
|
|
|
43
42
|
hideDisabledQueries?: boolean;
|
|
44
43
|
/**
|
|
45
44
|
* Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
|
|
46
|
-
*
|
|
47
45
|
* @defaultValue system
|
|
48
46
|
*/
|
|
49
47
|
theme?: Theme;
|
|
50
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
|
+
*/
|
|
51
55
|
declare function SolidQueryDevtools$1(props: DevtoolsOptions): import("solid-js").JSX.Element;
|
|
52
56
|
//#endregion
|
|
53
57
|
//#region src/devtoolsPanel.d.ts
|
|
58
|
+
/**
|
|
59
|
+
* The props of `SolidQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
60
|
+
*/
|
|
54
61
|
interface DevtoolsPanelOptions {
|
|
55
62
|
/**
|
|
56
63
|
* Custom instance of QueryClient
|
|
@@ -65,7 +72,8 @@ interface DevtoolsPanelOptions {
|
|
|
65
72
|
*/
|
|
66
73
|
styleNonce?: string;
|
|
67
74
|
/**
|
|
68
|
-
* Use this
|
|
75
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
76
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
69
77
|
*/
|
|
70
78
|
shadowDOMTarget?: ShadowRoot;
|
|
71
79
|
/**
|
|
@@ -85,11 +93,15 @@ interface DevtoolsPanelOptions {
|
|
|
85
93
|
hideDisabledQueries?: boolean;
|
|
86
94
|
/**
|
|
87
95
|
* Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
|
|
88
|
-
*
|
|
89
96
|
* @defaultValue system
|
|
90
97
|
*/
|
|
91
98
|
theme?: Theme;
|
|
92
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
102
|
+
* @param props - The devtools panel options.
|
|
103
|
+
* @returns The element the devtools panel is mounted in.
|
|
104
|
+
*/
|
|
93
105
|
declare function SolidQueryDevtoolsPanel$1(props: DevtoolsPanelOptions): JSX$1.Element;
|
|
94
106
|
//#endregion
|
|
95
107
|
//#region src/index.d.ts
|
package/build/index.d.cts.map
CHANGED
|
@@ -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
|
|
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;;;;;EAKA,QAAQ;;;;;;;;iBAScA,qBAAmB,OAAO,qCAAe,IAAA;;;;;;UCpDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQC,MAAI;;;;EAKZ;;;;EAIA;;;;;EAKA,QAAQ;;;;;;;iBAQcC,0BAAwB,OAAO,uBAAoBD,MAAA;;;qBCpD9D,2BAA2BE;qBAM3B,gCAAgCC"}
|
package/build/index.d.ts
CHANGED
|
@@ -10,14 +10,12 @@ interface DevtoolsOptions {
|
|
|
10
10
|
/**
|
|
11
11
|
* The position of the TanStack logo to open and close the devtools panel.
|
|
12
12
|
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
13
|
-
*
|
|
14
13
|
* @defaultValue bottom-right
|
|
15
14
|
*/
|
|
16
15
|
buttonPosition?: DevtoolsButtonPosition;
|
|
17
16
|
/**
|
|
18
17
|
* The position of the Solid Query devtools panel.
|
|
19
18
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
20
|
-
*
|
|
21
19
|
* @defaultValue bottom
|
|
22
20
|
*/
|
|
23
21
|
position?: DevtoolsPosition;
|
|
@@ -34,7 +32,8 @@ interface DevtoolsOptions {
|
|
|
34
32
|
*/
|
|
35
33
|
styleNonce?: string;
|
|
36
34
|
/**
|
|
37
|
-
* Use this
|
|
35
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
36
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
38
37
|
*/
|
|
39
38
|
shadowDOMTarget?: ShadowRoot;
|
|
40
39
|
/**
|
|
@@ -43,14 +42,22 @@ interface DevtoolsOptions {
|
|
|
43
42
|
hideDisabledQueries?: boolean;
|
|
44
43
|
/**
|
|
45
44
|
* Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
|
|
46
|
-
*
|
|
47
45
|
* @defaultValue system
|
|
48
46
|
*/
|
|
49
47
|
theme?: Theme;
|
|
50
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
|
+
*/
|
|
51
55
|
declare function SolidQueryDevtools$1(props: DevtoolsOptions): import("solid-js").JSX.Element;
|
|
52
56
|
//#endregion
|
|
53
57
|
//#region src/devtoolsPanel.d.ts
|
|
58
|
+
/**
|
|
59
|
+
* The props of `SolidQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
60
|
+
*/
|
|
54
61
|
interface DevtoolsPanelOptions {
|
|
55
62
|
/**
|
|
56
63
|
* Custom instance of QueryClient
|
|
@@ -65,7 +72,8 @@ interface DevtoolsPanelOptions {
|
|
|
65
72
|
*/
|
|
66
73
|
styleNonce?: string;
|
|
67
74
|
/**
|
|
68
|
-
* Use this
|
|
75
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
76
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
69
77
|
*/
|
|
70
78
|
shadowDOMTarget?: ShadowRoot;
|
|
71
79
|
/**
|
|
@@ -85,11 +93,15 @@ interface DevtoolsPanelOptions {
|
|
|
85
93
|
hideDisabledQueries?: boolean;
|
|
86
94
|
/**
|
|
87
95
|
* Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
|
|
88
|
-
*
|
|
89
96
|
* @defaultValue system
|
|
90
97
|
*/
|
|
91
98
|
theme?: Theme;
|
|
92
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
102
|
+
* @param props - The devtools panel options.
|
|
103
|
+
* @returns The element the devtools panel is mounted in.
|
|
104
|
+
*/
|
|
93
105
|
declare function SolidQueryDevtoolsPanel$1(props: DevtoolsPanelOptions): JSX$1.Element;
|
|
94
106
|
//#endregion
|
|
95
107
|
//#region src/index.d.ts
|
package/build/index.d.ts.map
CHANGED
|
@@ -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
|
|
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;;;;;EAKA,QAAQ;;;;;;;;iBAScA,qBAAmB,OAAO,qCAAe,IAAA;;;;;;UCpDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQC,MAAI;;;;EAKZ;;;;EAIA;;;;;EAKA,QAAQ;;;;;;;iBAQcC,0BAAwB,OAAO,uBAAoBD,MAAA;;;qBCpD9D,2BAA2BE;qBAM3B,gCAAgCC"}
|
package/build/index.js.map
CHANGED
|
@@ -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
|
|
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":"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"}
|
package/build/index.jsx
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { isDev, isServer } from "solid-js/web";
|
|
2
2
|
import { createMemo, createSignal, onMount, sharedConfig, splitProps, untrack } from "solid-js";
|
|
3
3
|
//#region 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
|
+
*/
|
|
4
12
|
function clientOnly(fn) {
|
|
5
13
|
if (isServer) return (props) => props.fallback;
|
|
6
14
|
const [comp, setComp] = createSignal();
|
|
@@ -17,10 +25,10 @@ function clientOnly(fn) {
|
|
|
17
25
|
}
|
|
18
26
|
//#endregion
|
|
19
27
|
//#region src/index.tsx
|
|
20
|
-
const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-
|
|
28
|
+
const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-4DtrHfk8.jsx")) : function() {
|
|
21
29
|
return null;
|
|
22
30
|
};
|
|
23
|
-
const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-
|
|
31
|
+
const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-CfOYIuMv.jsx")) : function() {
|
|
24
32
|
return null;
|
|
25
33
|
};
|
|
26
34
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query-devtools",
|
|
3
|
-
"version": "5.104.
|
|
3
|
+
"version": "5.104.2",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack/solid-query Query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,31 +44,32 @@
|
|
|
44
44
|
"!src/__tests__"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@tanstack/query-devtools": "5.104.
|
|
47
|
+
"@tanstack/query-devtools": "5.104.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@solidjs/testing-library": "^0.8.10",
|
|
51
|
-
"@tanstack/solid-query": "5.104.
|
|
51
|
+
"@tanstack/solid-query": "5.104.2",
|
|
52
|
+
"eslint-plugin-solid": "^0.18.1",
|
|
52
53
|
"solid-js": "^1.9.15",
|
|
53
54
|
"typescript": "6.0.3",
|
|
54
55
|
"unplugin-solid": "^2.0.0",
|
|
55
56
|
"vite-plugin-solid": "^2.11.14"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
|
-
"@tanstack/solid-query": "^5.104.
|
|
59
|
+
"@tanstack/solid-query": "^5.104.2",
|
|
59
60
|
"solid-js": "^1.6.0"
|
|
60
61
|
},
|
|
61
62
|
"scripts": {
|
|
62
63
|
"clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types",
|
|
63
64
|
"compile": "tsc --project tsconfig.json",
|
|
64
|
-
"test:
|
|
65
|
+
"test:oxlint": "oxlint ./src",
|
|
65
66
|
"test:types": "npm-run-all --serial test:types:*",
|
|
66
|
-
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo",
|
|
67
67
|
"test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo",
|
|
68
68
|
"test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts58 --tsBuildInfoFile .cache/test-types/ts58.tsbuildinfo",
|
|
69
69
|
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts59 --tsBuildInfoFile .cache/test-types/ts59.tsbuildinfo",
|
|
70
70
|
"test:types:tscurrent": "tsc --project tsconfig.json --outDir .cache/test-types/tscurrent --tsBuildInfoFile .cache/test-types/tscurrent.tsbuildinfo",
|
|
71
71
|
"test:types:ts70": "node ../../node_modules/typescript70/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts70 --tsBuildInfoFile .cache/test-types/ts70.tsbuildinfo",
|
|
72
|
+
"test:types:ts71": "node ../../node_modules/typescript71/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts71 --tsBuildInfoFile .cache/test-types/ts71.tsbuildinfo",
|
|
72
73
|
"test:build": "publint --strict && attw --pack",
|
|
73
74
|
"test:lib": "vitest --retry=3",
|
|
74
75
|
"test:lib:dev": "pnpm run test:lib --watch",
|
package/src/clientOnly.tsx
CHANGED
|
@@ -9,11 +9,14 @@ import {
|
|
|
9
9
|
import { isServer } from 'solid-js/web'
|
|
10
10
|
import type { Component, ComponentProps, JSX } from 'solid-js'
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
*/
|
|
17
20
|
export default function clientOnly<T extends Component<any>>(
|
|
18
21
|
fn: () => Promise<{
|
|
19
22
|
default: T
|
package/src/devtools.tsx
CHANGED
|
@@ -17,14 +17,12 @@ interface DevtoolsOptions {
|
|
|
17
17
|
/**
|
|
18
18
|
* The position of the TanStack logo to open and close the devtools panel.
|
|
19
19
|
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
20
|
-
*
|
|
21
20
|
* @defaultValue bottom-right
|
|
22
21
|
*/
|
|
23
22
|
buttonPosition?: DevtoolsButtonPosition
|
|
24
23
|
/**
|
|
25
24
|
* The position of the Solid Query devtools panel.
|
|
26
25
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
27
|
-
*
|
|
28
26
|
* @defaultValue bottom
|
|
29
27
|
*/
|
|
30
28
|
position?: DevtoolsPosition
|
|
@@ -41,7 +39,8 @@ interface DevtoolsOptions {
|
|
|
41
39
|
*/
|
|
42
40
|
styleNonce?: string
|
|
43
41
|
/**
|
|
44
|
-
* Use this
|
|
42
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
43
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
45
44
|
*/
|
|
46
45
|
shadowDOMTarget?: ShadowRoot
|
|
47
46
|
/**
|
|
@@ -50,12 +49,17 @@ interface DevtoolsOptions {
|
|
|
50
49
|
hideDisabledQueries?: boolean
|
|
51
50
|
/**
|
|
52
51
|
* Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
|
|
53
|
-
*
|
|
54
52
|
* @defaultValue system
|
|
55
53
|
*/
|
|
56
54
|
theme?: Theme
|
|
57
55
|
}
|
|
58
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
59
|
+
* nearest `QueryClient`.
|
|
60
|
+
* @param props - The devtools options.
|
|
61
|
+
* @returns The element the devtools are mounted in.
|
|
62
|
+
*/
|
|
59
63
|
export default function SolidQueryDevtools(props: DevtoolsOptions) {
|
|
60
64
|
const queryClient = useQueryClient(props.client)
|
|
61
65
|
const client = createMemo(() => queryClient)
|
|
@@ -110,5 +114,5 @@ export default function SolidQueryDevtools(props: DevtoolsOptions) {
|
|
|
110
114
|
onCleanup(() => devtools.unmount())
|
|
111
115
|
})
|
|
112
116
|
|
|
113
|
-
return <div class="tsqd-parent-container" ref={ref}
|
|
117
|
+
return <div class="tsqd-parent-container" ref={ref} />
|
|
114
118
|
}
|
package/src/devtoolsPanel.tsx
CHANGED
|
@@ -5,6 +5,9 @@ import type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'
|
|
|
5
5
|
import type { QueryClient } from '@tanstack/solid-query'
|
|
6
6
|
import type { JSX } from 'solid-js'
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* The props of `SolidQueryDevtoolsPanel`, which renders the devtools panel inline.
|
|
10
|
+
*/
|
|
8
11
|
export interface DevtoolsPanelOptions {
|
|
9
12
|
/**
|
|
10
13
|
* Custom instance of QueryClient
|
|
@@ -19,7 +22,8 @@ export interface DevtoolsPanelOptions {
|
|
|
19
22
|
*/
|
|
20
23
|
styleNonce?: string
|
|
21
24
|
/**
|
|
22
|
-
* Use this
|
|
25
|
+
* Use this to pass a shadow DOM target to the devtools so that the styles will be applied
|
|
26
|
+
* within the shadow DOM instead of within the head tag in the light DOM.
|
|
23
27
|
*/
|
|
24
28
|
shadowDOMTarget?: ShadowRoot
|
|
25
29
|
|
|
@@ -41,12 +45,16 @@ export interface DevtoolsPanelOptions {
|
|
|
41
45
|
hideDisabledQueries?: boolean
|
|
42
46
|
/**
|
|
43
47
|
* Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
|
|
44
|
-
*
|
|
45
48
|
* @defaultValue system
|
|
46
49
|
*/
|
|
47
50
|
theme?: Theme
|
|
48
51
|
}
|
|
49
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
55
|
+
* @param props - The devtools panel options.
|
|
56
|
+
* @returns The element the devtools panel is mounted in.
|
|
57
|
+
*/
|
|
50
58
|
export default function SolidQueryDevtoolsPanel(props: DevtoolsPanelOptions) {
|
|
51
59
|
const queryClient = useQueryClient(props.client)
|
|
52
60
|
const client = createMemo(() => queryClient)
|