@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/dev.cjs CHANGED
@@ -1,35 +1,118 @@
1
1
  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
- // src/clientOnly.tsx
4
+ let _tanstack_solid_query = require("@tanstack/solid-query");
5
+ let _tanstack_query_devtools = require("@tanstack/query-devtools");
6
+ // src/devtools.tsx
7
+ var _tmpl$$1 = /*#__PURE__*/ (0, solid_js_web.template)(`<div class=tsqd-parent-container>`);
5
8
  /**
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.
9
+ * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
10
+ * nearest `QueryClient`.
11
+ * @param props - The devtools options.
12
+ * @returns The element the devtools are mounted in.
12
13
  */
13
- function clientOnly(fn) {
14
- if (solid_js_web.isServer) return (props) => props.fallback;
15
- const [comp, setComp] = (0, solid_js.createSignal)();
16
- fn().then((m) => setComp(() => m.default));
17
- return (props) => {
18
- let Comp;
19
- let m;
20
- const [, rest] = (0, solid_js.splitProps)(props, ["fallback"]);
21
- if ((Comp = comp()) && !solid_js.sharedConfig.context) return Comp(rest);
22
- const [mounted, setMounted] = (0, solid_js.createSignal)(!solid_js.sharedConfig.context);
23
- (0, solid_js.onMount)(() => setMounted(true));
24
- return (0, solid_js.createMemo)(() => (Comp = comp(), m = mounted(), (0, solid_js.untrack)(() => Comp && m ? Comp(rest) : props.fallback)));
25
- };
14
+ function SolidQueryDevtools$1(props) {
15
+ const queryClient = (0, _tanstack_solid_query.useQueryClient)(props.client);
16
+ const client = (0, solid_js.createMemo)(() => queryClient);
17
+ let ref;
18
+ const devtools = new _tanstack_query_devtools.TanstackQueryDevtools({
19
+ client: client(),
20
+ queryFlavor: "Solid Query",
21
+ version: "5",
22
+ onlineManager: _tanstack_solid_query.onlineManager,
23
+ buttonPosition: props.buttonPosition,
24
+ position: props.position,
25
+ initialIsOpen: props.initialIsOpen,
26
+ errorTypes: props.errorTypes,
27
+ styleNonce: props.styleNonce,
28
+ shadowDOMTarget: props.shadowDOMTarget,
29
+ hideDisabledQueries: props.hideDisabledQueries,
30
+ theme: props.theme
31
+ });
32
+ (0, solid_js.createEffect)(() => {
33
+ devtools.setClient(client());
34
+ });
35
+ (0, solid_js.createEffect)(() => {
36
+ const buttonPos = props.buttonPosition;
37
+ if (buttonPos) devtools.setButtonPosition(buttonPos);
38
+ });
39
+ (0, solid_js.createEffect)(() => {
40
+ const pos = props.position;
41
+ if (pos) devtools.setPosition(pos);
42
+ });
43
+ (0, solid_js.createEffect)(() => {
44
+ devtools.setInitialIsOpen(props.initialIsOpen || false);
45
+ });
46
+ (0, solid_js.createEffect)(() => {
47
+ devtools.setErrorTypes(props.errorTypes || []);
48
+ });
49
+ (0, solid_js.createEffect)(() => {
50
+ devtools.setTheme(props.theme);
51
+ });
52
+ (0, solid_js.onMount)(() => {
53
+ devtools.mount(ref);
54
+ (0, solid_js.onCleanup)(() => devtools.unmount());
55
+ });
56
+ return (() => {
57
+ var _el$ = _tmpl$$1();
58
+ var _ref$ = ref;
59
+ typeof _ref$ === "function" ? (0, solid_js_web.use)(_ref$, _el$) : ref = _el$;
60
+ return _el$;
61
+ })();
62
+ }
63
+ // src/devtoolsPanel.tsx
64
+ var _tmpl$ = /*#__PURE__*/ (0, solid_js_web.template)(`<div class=tsqd-parent-container style=height:100%;display:flex;flex-direction:column>`);
65
+ /**
66
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
67
+ * @param props - The devtools panel options.
68
+ * @returns The element the devtools panel is mounted in.
69
+ */
70
+ function SolidQueryDevtoolsPanel$1(props) {
71
+ const queryClient = (0, _tanstack_solid_query.useQueryClient)(props.client);
72
+ const client = (0, solid_js.createMemo)(() => queryClient);
73
+ let ref;
74
+ const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
75
+ const devtools = new _tanstack_query_devtools.TanstackQueryDevtoolsPanel({
76
+ client: client(),
77
+ queryFlavor: "Solid Query",
78
+ version: "5",
79
+ onlineManager: _tanstack_solid_query.onlineManager,
80
+ buttonPosition: "bottom-left",
81
+ position: "bottom",
82
+ initialIsOpen: true,
83
+ errorTypes,
84
+ styleNonce,
85
+ shadowDOMTarget,
86
+ onClose: props.onClose,
87
+ hideDisabledQueries,
88
+ theme: props.theme
89
+ });
90
+ (0, solid_js.createEffect)(() => {
91
+ devtools.setClient(client());
92
+ });
93
+ (0, solid_js.createEffect)(() => {
94
+ devtools.setOnClose(props.onClose ?? (() => {}));
95
+ });
96
+ (0, solid_js.createEffect)(() => {
97
+ devtools.setErrorTypes(props.errorTypes || []);
98
+ });
99
+ (0, solid_js.createEffect)(() => {
100
+ devtools.setTheme(props.theme);
101
+ });
102
+ (0, solid_js.onMount)(() => {
103
+ devtools.mount(ref);
104
+ (0, solid_js.onCleanup)(() => devtools.unmount());
105
+ });
106
+ return (() => {
107
+ var _el$ = _tmpl$();
108
+ var _ref$ = ref;
109
+ typeof _ref$ === "function" ? (0, solid_js_web.use)(_ref$, _el$) : ref = _el$;
110
+ (0, solid_js_web.effect)((_$p) => (0, solid_js_web.style)(_el$, { ...props.style }, _$p));
111
+ return _el$;
112
+ })();
26
113
  }
27
114
  // src/index.tsx
28
- const SolidQueryDevtools = solid_js_web.isDev ? clientOnly(() => Promise.resolve().then(() => require("./devtools-8au4JaTw.cjs"))) : function() {
29
- return null;
30
- };
31
- const SolidQueryDevtoolsPanel = solid_js_web.isDev ? clientOnly(() => Promise.resolve().then(() => require("./devtoolsPanel-C2Ayou8L.cjs"))) : function() {
32
- return null;
33
- };
115
+ const SolidQueryDevtools = SolidQueryDevtools$1;
116
+ const SolidQueryDevtoolsPanel = SolidQueryDevtoolsPanel$1;
34
117
  exports.SolidQueryDevtools = SolidQueryDevtools;
35
118
  exports.SolidQueryDevtoolsPanel = SolidQueryDevtoolsPanel;
package/build/dev.js CHANGED
@@ -1,33 +1,116 @@
1
- import { isDev, isServer } from "solid-js/web";
2
- import { createMemo, createSignal, onMount, sharedConfig, splitProps, untrack } from "solid-js";
3
- // src/clientOnly.tsx
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 { TanstackQueryDevtools, TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
5
+ // src/devtools.tsx
6
+ var _tmpl$$1 = /*#__PURE__*/ template(`<div class=tsqd-parent-container>`);
4
7
  /**
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.
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.
11
12
  */
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
- };
13
+ function SolidQueryDevtools$1(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$$1();
57
+ var _ref$ = ref;
58
+ typeof _ref$ === "function" ? use(_ref$, _el$) : ref = _el$;
59
+ return _el$;
60
+ })();
61
+ }
62
+ // src/devtoolsPanel.tsx
63
+ var _tmpl$ = /*#__PURE__*/ template(`<div class=tsqd-parent-container style=height:100%;display:flex;flex-direction:column>`);
64
+ /**
65
+ * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
66
+ * @param props - The devtools panel options.
67
+ * @returns The element the devtools panel is mounted in.
68
+ */
69
+ function SolidQueryDevtoolsPanel$1(props) {
70
+ const queryClient = useQueryClient(props.client);
71
+ const client = createMemo(() => queryClient);
72
+ let ref;
73
+ const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
74
+ const devtools = new TanstackQueryDevtoolsPanel({
75
+ client: client(),
76
+ queryFlavor: "Solid Query",
77
+ version: "5",
78
+ onlineManager,
79
+ buttonPosition: "bottom-left",
80
+ position: "bottom",
81
+ initialIsOpen: true,
82
+ errorTypes,
83
+ styleNonce,
84
+ shadowDOMTarget,
85
+ onClose: props.onClose,
86
+ hideDisabledQueries,
87
+ theme: props.theme
88
+ });
89
+ createEffect(() => {
90
+ devtools.setClient(client());
91
+ });
92
+ createEffect(() => {
93
+ devtools.setOnClose(props.onClose ?? (() => {}));
94
+ });
95
+ createEffect(() => {
96
+ devtools.setErrorTypes(props.errorTypes || []);
97
+ });
98
+ createEffect(() => {
99
+ devtools.setTheme(props.theme);
100
+ });
101
+ onMount(() => {
102
+ devtools.mount(ref);
103
+ onCleanup(() => devtools.unmount());
104
+ });
105
+ return (() => {
106
+ var _el$ = _tmpl$();
107
+ var _ref$ = ref;
108
+ typeof _ref$ === "function" ? use(_ref$, _el$) : ref = _el$;
109
+ effect((_$p) => style(_el$, { ...props.style }, _$p));
110
+ return _el$;
111
+ })();
25
112
  }
26
113
  // src/index.tsx
27
- const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-DS7Cagay.js")) : function() {
28
- return null;
29
- };
30
- const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-3eu1kojY.js")) : function() {
31
- return null;
32
- };
114
+ const SolidQueryDevtools = SolidQueryDevtools$1;
115
+ const SolidQueryDevtoolsPanel = SolidQueryDevtoolsPanel$1;
33
116
  export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
package/build/dev.jsx CHANGED
@@ -1,33 +1,107 @@
1
- import { isDev, isServer } from "solid-js/web";
2
- import { createMemo, createSignal, onMount, sharedConfig, splitProps, untrack } from "solid-js";
3
- // src/clientOnly.tsx
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
4
5
  /**
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.
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.
11
10
  */
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
- };
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} />;
25
103
  }
26
104
  // src/index.tsx
27
- const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-COkRtz4W.jsx")) : function() {
28
- return null;
29
- };
30
- const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-BnT0jwWW.jsx")) : function() {
31
- return null;
32
- };
105
+ const SolidQueryDevtools = SolidQueryDevtools$1;
106
+ const SolidQueryDevtoolsPanel = SolidQueryDevtoolsPanel$1;
33
107
  export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
@@ -0,0 +1,106 @@
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(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(props: DevtoolsPanelOptions): JSX$1.Element;
105
+ export { SolidQueryDevtoolsPanel as n, SolidQueryDevtools as r, DevtoolsPanelOptions as t };
106
+ //# sourceMappingURL=devtoolsPanel-BC3mLtW8.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtoolsPanel-BC3mLtW8.d.ts","names":["JSX"],"sources":["../src/devtools.tsx","../src/devtoolsPanel.tsx"],"mappings":";;;UAWU;;;;EAIR;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;;;;;;;iBASc,mBAAmB,OAAO,qCAAe,IAAA;;;;UCrDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQA,MAAI;;;;EAKZ;;;;EAIA;;;;;;EAMA,QAAQ;;;;;;;iBAQc,wBAAwB,OAAO,uBAAoBA,MAAA"}
@@ -0,0 +1,106 @@
1
+ import { DevtoolsButtonPosition, DevtoolsErrorType, DevtoolsPosition, Theme } from "@tanstack/query-devtools";
2
+ import { QueryClient } from "@tanstack/solid-query";
3
+ import { JSX as JSX$1 } from "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(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(props: DevtoolsPanelOptions): JSX$1.Element;
105
+ export { SolidQueryDevtoolsPanel as n, SolidQueryDevtools as r, DevtoolsPanelOptions as t };
106
+ //# sourceMappingURL=devtoolsPanel-iWIJVAfL.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtoolsPanel-iWIJVAfL.d.cts","names":["JSX"],"sources":["../src/devtools.tsx","../src/devtoolsPanel.tsx"],"mappings":";;;UAWU;;;;EAIR;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;;;;;;;iBASc,mBAAmB,OAAO,qCAAe,IAAA;;;;UCrDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQA,MAAI;;;;EAKZ;;;;EAIA;;;;;;EAMA,QAAQ;;;;;;;iBAQc,wBAAwB,OAAO,uBAAoBA,MAAA"}
package/build/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("solid-js/web"),t=require("solid-js");function n(n){if(e.isServer)return e=>e.fallback;let[r,i]=(0,t.createSignal)();return n().then(e=>i(()=>e.default)),e=>{let n,i,[,a]=(0,t.splitProps)(e,[`fallback`]);if((n=r())&&!t.sharedConfig.context)return n(a);let[o,s]=(0,t.createSignal)(!t.sharedConfig.context);return(0,t.onMount)(()=>s(!0)),(0,t.createMemo)(()=>(n=r(),i=o(),(0,t.untrack)(()=>n&&i?n(a):e.fallback)))}}const r=e.isDev?n(()=>Promise.resolve().then(()=>require("./devtools-CsBrM8Az.cjs"))):function(){return null},i=e.isDev?n(()=>Promise.resolve().then(()=>require("./devtoolsPanel-7jSpgkJK.cjs"))):function(){return null};exports.SolidQueryDevtools=r,exports.SolidQueryDevtoolsPanel=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=function(){return null},t=function(){return null};exports.SolidQueryDevtools=e,exports.SolidQueryDevtoolsPanel=t;