@tanstack/solid-query-devtools 5.94.4 → 5.94.5

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.
@@ -0,0 +1,119 @@
1
+ import type { Component } from 'solid-js';
2
+ import type { ComponentProps } from 'solid-js';
3
+ import type { DevtoolsButtonPosition } from '@tanstack/query-devtools';
4
+ import type { DevtoolsErrorType } from '@tanstack/query-devtools';
5
+ import type { DevtoolsPosition } from '@tanstack/query-devtools';
6
+ import { JSX } from 'solid-js';
7
+ import { Options } from 'tsup';
8
+ import type { QueryClient } from '@tanstack/solid-query';
9
+ import type { Theme } from '@tanstack/query-devtools';
10
+ import { UserConfig } from 'vite';
11
+
12
+ export declare function default_alias<T extends Component<any>>(fn: () => Promise<{
13
+ default: T;
14
+ }>): (props: ComponentProps<T> & {
15
+ fallback?: JSX.Element;
16
+ }) => any;
17
+
18
+ export declare function default_alias_1(props: DevtoolsOptions): JSX;
19
+
20
+ export declare function default_alias_2(props: DevtoolsPanelOptions): JSX.Element;
21
+
22
+ export declare const default_alias_3: any[];
23
+
24
+ export declare const default_alias_4: any[];
25
+
26
+ export declare const default_alias_5: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
27
+
28
+ export declare const default_alias_6: UserConfig;
29
+
30
+ declare interface DevtoolsOptions {
31
+ /**
32
+ * Set this true if you want the dev tools to default to being open
33
+ */
34
+ initialIsOpen?: boolean;
35
+ /**
36
+ * The position of the React Query logo to open and close the devtools panel.
37
+ * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
38
+ * Defaults to 'bottom-right'.
39
+ */
40
+ buttonPosition?: DevtoolsButtonPosition;
41
+ /**
42
+ * The position of the React Query devtools panel.
43
+ * 'top' | 'bottom' | 'left' | 'right'
44
+ * Defaults to 'bottom'.
45
+ */
46
+ position?: DevtoolsPosition;
47
+ /**
48
+ * Custom instance of QueryClient
49
+ */
50
+ client?: QueryClient;
51
+ /**
52
+ * Use this so you can define custom errors that can be shown in the devtools.
53
+ */
54
+ errorTypes?: Array<DevtoolsErrorType>;
55
+ /**
56
+ * 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.
57
+ */
58
+ styleNonce?: string;
59
+ /**
60
+ * Use this so you can attach the devtool's styles to specific element in the DOM.
61
+ */
62
+ shadowDOMTarget?: ShadowRoot;
63
+ /**
64
+ * Set this to true to hide disabled queries from the devtools panel.
65
+ */
66
+ hideDisabledQueries?: boolean;
67
+ /**
68
+ * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
69
+ * Defaults to 'system'.
70
+ */
71
+ theme?: Theme;
72
+ }
73
+
74
+ declare interface DevtoolsPanelOptions {
75
+ /**
76
+ * Custom instance of QueryClient
77
+ */
78
+ client?: QueryClient;
79
+ /**
80
+ * Use this so you can define custom errors that can be shown in the devtools.
81
+ */
82
+ errorTypes?: Array<DevtoolsErrorType>;
83
+ /**
84
+ * 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.
85
+ */
86
+ styleNonce?: string;
87
+ /**
88
+ * Use this so you can attach the devtool's styles to specific element in the DOM.
89
+ */
90
+ shadowDOMTarget?: ShadowRoot;
91
+ /**
92
+ * Custom styles for the devtools panel
93
+ * @default { height: '500px' }
94
+ * @example { height: '100%' }
95
+ * @example { height: '100%', width: '100%' }
96
+ */
97
+ style?: JSX.CSSProperties;
98
+ /**
99
+ * Callback function that is called when the devtools panel is closed
100
+ */
101
+ onClose?: () => unknown;
102
+ /**
103
+ * Set this to true to hide disabled queries from the devtools panel.
104
+ */
105
+ hideDisabledQueries?: boolean;
106
+ /**
107
+ * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
108
+ * Defaults to 'system'.
109
+ */
110
+ theme?: Theme;
111
+ }
112
+ export { DevtoolsPanelOptions }
113
+ export { DevtoolsPanelOptions as DevtoolsPanelOptions_alias_1 }
114
+
115
+ export declare const SolidQueryDevtools: typeof default_alias_1;
116
+
117
+ export declare const SolidQueryDevtoolsPanel: typeof default_alias_2;
118
+
119
+ export { }
@@ -0,0 +1,119 @@
1
+ import type { Component } from 'solid-js';
2
+ import type { ComponentProps } from 'solid-js';
3
+ import type { DevtoolsButtonPosition } from '@tanstack/query-devtools';
4
+ import type { DevtoolsErrorType } from '@tanstack/query-devtools';
5
+ import type { DevtoolsPosition } from '@tanstack/query-devtools';
6
+ import { JSX } from 'solid-js';
7
+ import { Options } from 'tsup';
8
+ import type { QueryClient } from '@tanstack/solid-query';
9
+ import type { Theme } from '@tanstack/query-devtools';
10
+ import { UserConfig } from 'vite';
11
+
12
+ export declare function default_alias<T extends Component<any>>(fn: () => Promise<{
13
+ default: T;
14
+ }>): (props: ComponentProps<T> & {
15
+ fallback?: JSX.Element;
16
+ }) => any;
17
+
18
+ export declare function default_alias_1(props: DevtoolsOptions): JSX;
19
+
20
+ export declare function default_alias_2(props: DevtoolsPanelOptions): JSX.Element;
21
+
22
+ export declare const default_alias_3: any[];
23
+
24
+ export declare const default_alias_4: any[];
25
+
26
+ export declare const default_alias_5: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
27
+
28
+ export declare const default_alias_6: UserConfig;
29
+
30
+ declare interface DevtoolsOptions {
31
+ /**
32
+ * Set this true if you want the dev tools to default to being open
33
+ */
34
+ initialIsOpen?: boolean;
35
+ /**
36
+ * The position of the React Query logo to open and close the devtools panel.
37
+ * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
38
+ * Defaults to 'bottom-right'.
39
+ */
40
+ buttonPosition?: DevtoolsButtonPosition;
41
+ /**
42
+ * The position of the React Query devtools panel.
43
+ * 'top' | 'bottom' | 'left' | 'right'
44
+ * Defaults to 'bottom'.
45
+ */
46
+ position?: DevtoolsPosition;
47
+ /**
48
+ * Custom instance of QueryClient
49
+ */
50
+ client?: QueryClient;
51
+ /**
52
+ * Use this so you can define custom errors that can be shown in the devtools.
53
+ */
54
+ errorTypes?: Array<DevtoolsErrorType>;
55
+ /**
56
+ * 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.
57
+ */
58
+ styleNonce?: string;
59
+ /**
60
+ * Use this so you can attach the devtool's styles to specific element in the DOM.
61
+ */
62
+ shadowDOMTarget?: ShadowRoot;
63
+ /**
64
+ * Set this to true to hide disabled queries from the devtools panel.
65
+ */
66
+ hideDisabledQueries?: boolean;
67
+ /**
68
+ * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
69
+ * Defaults to 'system'.
70
+ */
71
+ theme?: Theme;
72
+ }
73
+
74
+ declare interface DevtoolsPanelOptions {
75
+ /**
76
+ * Custom instance of QueryClient
77
+ */
78
+ client?: QueryClient;
79
+ /**
80
+ * Use this so you can define custom errors that can be shown in the devtools.
81
+ */
82
+ errorTypes?: Array<DevtoolsErrorType>;
83
+ /**
84
+ * 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.
85
+ */
86
+ styleNonce?: string;
87
+ /**
88
+ * Use this so you can attach the devtool's styles to specific element in the DOM.
89
+ */
90
+ shadowDOMTarget?: ShadowRoot;
91
+ /**
92
+ * Custom styles for the devtools panel
93
+ * @default { height: '500px' }
94
+ * @example { height: '100%' }
95
+ * @example { height: '100%', width: '100%' }
96
+ */
97
+ style?: JSX.CSSProperties;
98
+ /**
99
+ * Callback function that is called when the devtools panel is closed
100
+ */
101
+ onClose?: () => unknown;
102
+ /**
103
+ * Set this to true to hide disabled queries from the devtools panel.
104
+ */
105
+ hideDisabledQueries?: boolean;
106
+ /**
107
+ * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
108
+ * Defaults to 'system'.
109
+ */
110
+ theme?: Theme;
111
+ }
112
+ export { DevtoolsPanelOptions }
113
+ export { DevtoolsPanelOptions as DevtoolsPanelOptions_alias_1 }
114
+
115
+ export declare const SolidQueryDevtools: typeof default_alias_1;
116
+
117
+ export declare const SolidQueryDevtoolsPanel: typeof default_alias_2;
118
+
119
+ export { }
package/build/dev.cjs ADDED
@@ -0,0 +1,167 @@
1
+ 'use strict';
2
+
3
+ var web = require('solid-js/web');
4
+ var solidJs = require('solid-js');
5
+ var solidQuery = require('@tanstack/solid-query');
6
+ var queryDevtools = require('@tanstack/query-devtools');
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __esm = (fn, res) => function __init() {
11
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
+ };
13
+ var __export = (target, all) => {
14
+ for (var name in all)
15
+ __defProp(target, name, { get: all[name], enumerable: true });
16
+ };
17
+
18
+ // src/devtools.tsx
19
+ var devtools_exports = {};
20
+ __export(devtools_exports, {
21
+ default: () => SolidQueryDevtools
22
+ });
23
+ function SolidQueryDevtools(props) {
24
+ const queryClient = solidQuery.useQueryClient(props.client);
25
+ const client = solidJs.createMemo(() => queryClient);
26
+ let ref;
27
+ const devtools = new queryDevtools.TanstackQueryDevtools({
28
+ client: client(),
29
+ queryFlavor: "Solid Query",
30
+ version: "5",
31
+ onlineManager: solidQuery.onlineManager,
32
+ buttonPosition: props.buttonPosition,
33
+ position: props.position,
34
+ initialIsOpen: props.initialIsOpen,
35
+ errorTypes: props.errorTypes,
36
+ styleNonce: props.styleNonce,
37
+ shadowDOMTarget: props.shadowDOMTarget,
38
+ hideDisabledQueries: props.hideDisabledQueries,
39
+ theme: props.theme
40
+ });
41
+ solidJs.createEffect(() => {
42
+ devtools.setClient(client());
43
+ });
44
+ solidJs.createEffect(() => {
45
+ const buttonPos = props.buttonPosition;
46
+ if (buttonPos) {
47
+ devtools.setButtonPosition(buttonPos);
48
+ }
49
+ });
50
+ solidJs.createEffect(() => {
51
+ const pos = props.position;
52
+ if (pos) {
53
+ devtools.setPosition(pos);
54
+ }
55
+ });
56
+ solidJs.createEffect(() => {
57
+ devtools.setInitialIsOpen(props.initialIsOpen || false);
58
+ });
59
+ solidJs.createEffect(() => {
60
+ devtools.setErrorTypes(props.errorTypes || []);
61
+ });
62
+ solidJs.createEffect(() => {
63
+ devtools.setTheme(props.theme || "system");
64
+ });
65
+ solidJs.onMount(() => {
66
+ devtools.mount(ref);
67
+ solidJs.onCleanup(() => devtools.unmount());
68
+ });
69
+ return (() => {
70
+ var _el$ = _tmpl$();
71
+ var _ref$ = ref;
72
+ typeof _ref$ === "function" ? web.use(_ref$, _el$) : ref = _el$;
73
+ return _el$;
74
+ })();
75
+ }
76
+ var _tmpl$;
77
+ var init_devtools = __esm({
78
+ "src/devtools.tsx"() {
79
+ _tmpl$ = /* @__PURE__ */ web.template(`<div class=tsqd-parent-container>`);
80
+ }
81
+ });
82
+
83
+ // src/devtoolsPanel.tsx
84
+ var devtoolsPanel_exports = {};
85
+ __export(devtoolsPanel_exports, {
86
+ default: () => SolidQueryDevtoolsPanel
87
+ });
88
+ function SolidQueryDevtoolsPanel(props) {
89
+ const queryClient = solidQuery.useQueryClient(props.client);
90
+ const client = solidJs.createMemo(() => queryClient);
91
+ let ref;
92
+ const {
93
+ errorTypes,
94
+ styleNonce,
95
+ shadowDOMTarget,
96
+ hideDisabledQueries
97
+ } = props;
98
+ const devtools = new queryDevtools.TanstackQueryDevtoolsPanel({
99
+ client: client(),
100
+ queryFlavor: "Solid Query",
101
+ version: "5",
102
+ onlineManager: solidQuery.onlineManager,
103
+ buttonPosition: "bottom-left",
104
+ position: "bottom",
105
+ initialIsOpen: true,
106
+ errorTypes,
107
+ styleNonce,
108
+ shadowDOMTarget,
109
+ onClose: props.onClose,
110
+ hideDisabledQueries,
111
+ theme: props.theme
112
+ });
113
+ solidJs.createEffect(() => {
114
+ devtools.setClient(client());
115
+ });
116
+ solidJs.createEffect(() => {
117
+ devtools.setOnClose(props.onClose ?? (() => {
118
+ }));
119
+ });
120
+ solidJs.createEffect(() => {
121
+ devtools.setErrorTypes(props.errorTypes || []);
122
+ });
123
+ solidJs.createEffect(() => {
124
+ devtools.setTheme(props.theme || "system");
125
+ });
126
+ solidJs.onMount(() => {
127
+ devtools.mount(ref);
128
+ solidJs.onCleanup(() => devtools.unmount());
129
+ });
130
+ return (() => {
131
+ var _el$ = _tmpl$2();
132
+ var _ref$ = ref;
133
+ typeof _ref$ === "function" ? web.use(_ref$, _el$) : ref = _el$;
134
+ web.effect((_$p) => web.style(_el$, {
135
+ ...props.style
136
+ }, _$p));
137
+ return _el$;
138
+ })();
139
+ }
140
+ var _tmpl$2;
141
+ var init_devtoolsPanel = __esm({
142
+ "src/devtoolsPanel.tsx"() {
143
+ _tmpl$2 = /* @__PURE__ */ web.template(`<div class=tsqd-parent-container style=height:500px>`);
144
+ }
145
+ });
146
+ function clientOnly(fn) {
147
+ if (web.isServer) return (props) => props.fallback;
148
+ const [comp, setComp] = solidJs.createSignal();
149
+ fn().then((m) => setComp(() => m.default));
150
+ return (props) => {
151
+ let Comp;
152
+ let m;
153
+ const [, rest] = solidJs.splitProps(props, ["fallback"]);
154
+ if ((Comp = comp()) && !solidJs.sharedConfig.context) return Comp(rest);
155
+ const [mounted, setMounted] = solidJs.createSignal(!solidJs.sharedConfig.context);
156
+ solidJs.onMount(() => setMounted(true));
157
+ return solidJs.createMemo(() => (Comp = comp(), m = mounted(), solidJs.untrack(() => Comp && m ? Comp(rest) : props.fallback)));
158
+ };
159
+ }
160
+
161
+ // src/index.tsx
162
+ exports.SolidQueryDevtools = web.isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtools(), devtools_exports))) : function() {
163
+ return null;
164
+ };
165
+ exports.SolidQueryDevtoolsPanel = web.isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtoolsPanel(), devtoolsPanel_exports))) : function() {
166
+ return null;
167
+ };
@@ -0,0 +1,3 @@
1
+ export { SolidQueryDevtools } from './_tsup-dts-rollup.cjs';
2
+ export { SolidQueryDevtoolsPanel } from './_tsup-dts-rollup.cjs';
3
+ export { DevtoolsPanelOptions_alias_1 as DevtoolsPanelOptions } from './_tsup-dts-rollup.cjs';
package/build/dev.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export { SolidQueryDevtools } from './_tsup-dts-rollup.js';
2
+ export { SolidQueryDevtoolsPanel } from './_tsup-dts-rollup.js';
3
+ export { DevtoolsPanelOptions_alias_1 as DevtoolsPanelOptions } from './_tsup-dts-rollup.js';
package/build/dev.js ADDED
@@ -0,0 +1,28 @@
1
+ import { isDev, isServer } from 'solid-js/web';
2
+ import { createSignal, splitProps, sharedConfig, onMount, createMemo, untrack } from 'solid-js';
3
+
4
+ // src/index.tsx
5
+ function clientOnly(fn) {
6
+ if (isServer) return (props) => props.fallback;
7
+ const [comp, setComp] = createSignal();
8
+ fn().then((m) => setComp(() => m.default));
9
+ return (props) => {
10
+ let Comp;
11
+ let m;
12
+ const [, rest] = splitProps(props, ["fallback"]);
13
+ if ((Comp = comp()) && !sharedConfig.context) return Comp(rest);
14
+ const [mounted, setMounted] = createSignal(!sharedConfig.context);
15
+ onMount(() => setMounted(true));
16
+ return createMemo(() => (Comp = comp(), m = mounted(), untrack(() => Comp && m ? Comp(rest) : props.fallback)));
17
+ };
18
+ }
19
+
20
+ // src/index.tsx
21
+ var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/BCD44V6M.js')) : function() {
22
+ return null;
23
+ };
24
+ var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/VOW4J2DZ.js')) : function() {
25
+ return null;
26
+ };
27
+
28
+ export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
package/build/dev.jsx ADDED
@@ -0,0 +1,42 @@
1
+ // src/index.tsx
2
+ import { isDev } from "solid-js/web";
3
+
4
+ // src/clientOnly.tsx
5
+ import {
6
+ createMemo,
7
+ createSignal,
8
+ onMount,
9
+ sharedConfig,
10
+ splitProps,
11
+ untrack
12
+ } from "solid-js";
13
+ import { isServer } from "solid-js/web";
14
+ function clientOnly(fn) {
15
+ if (isServer)
16
+ return (props) => props.fallback;
17
+ const [comp, setComp] = createSignal();
18
+ fn().then((m) => setComp(() => m.default));
19
+ return (props) => {
20
+ let Comp;
21
+ let m;
22
+ const [, rest] = splitProps(props, ["fallback"]);
23
+ if ((Comp = comp()) && !sharedConfig.context) return Comp(rest);
24
+ const [mounted, setMounted] = createSignal(!sharedConfig.context);
25
+ onMount(() => setMounted(true));
26
+ return createMemo(
27
+ () => (Comp = comp(), m = mounted(), untrack(() => Comp && m ? Comp(rest) : props.fallback))
28
+ );
29
+ };
30
+ }
31
+
32
+ // src/index.tsx
33
+ var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/32HRKFKI.jsx")) : function() {
34
+ return null;
35
+ };
36
+ var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/NDFIDQLQ.jsx")) : function() {
37
+ return null;
38
+ };
39
+ export {
40
+ SolidQueryDevtools,
41
+ SolidQueryDevtoolsPanel
42
+ };
@@ -0,0 +1,55 @@
1
+ // src/devtools.tsx
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
+ function SolidQueryDevtools(props) {
6
+ const queryClient = useQueryClient(props.client);
7
+ const client = createMemo(() => queryClient);
8
+ let ref;
9
+ const devtools = new TanstackQueryDevtools({
10
+ client: client(),
11
+ queryFlavor: "Solid Query",
12
+ version: "5",
13
+ onlineManager,
14
+ buttonPosition: props.buttonPosition,
15
+ position: props.position,
16
+ initialIsOpen: props.initialIsOpen,
17
+ errorTypes: props.errorTypes,
18
+ styleNonce: props.styleNonce,
19
+ shadowDOMTarget: props.shadowDOMTarget,
20
+ hideDisabledQueries: props.hideDisabledQueries,
21
+ theme: props.theme
22
+ });
23
+ createEffect(() => {
24
+ devtools.setClient(client());
25
+ });
26
+ createEffect(() => {
27
+ const buttonPos = props.buttonPosition;
28
+ if (buttonPos) {
29
+ devtools.setButtonPosition(buttonPos);
30
+ }
31
+ });
32
+ createEffect(() => {
33
+ const pos = props.position;
34
+ if (pos) {
35
+ devtools.setPosition(pos);
36
+ }
37
+ });
38
+ createEffect(() => {
39
+ devtools.setInitialIsOpen(props.initialIsOpen || false);
40
+ });
41
+ createEffect(() => {
42
+ devtools.setErrorTypes(props.errorTypes || []);
43
+ });
44
+ createEffect(() => {
45
+ devtools.setTheme(props.theme || "system");
46
+ });
47
+ onMount(() => {
48
+ devtools.mount(ref);
49
+ onCleanup(() => devtools.unmount());
50
+ });
51
+ return <div class="tsqd-parent-container" ref={ref} />;
52
+ }
53
+ export {
54
+ SolidQueryDevtools as default
55
+ };
@@ -0,0 +1,62 @@
1
+ import { use, template } from 'solid-js/web';
2
+ import { createMemo, createEffect, onMount, onCleanup } from 'solid-js';
3
+ import { useQueryClient, onlineManager } from '@tanstack/solid-query';
4
+ import { TanstackQueryDevtools } from '@tanstack/query-devtools';
5
+
6
+ // src/devtools.tsx
7
+ var _tmpl$ = /* @__PURE__ */ template(`<div class=tsqd-parent-container>`);
8
+ function SolidQueryDevtools(props) {
9
+ const queryClient = useQueryClient(props.client);
10
+ const client = createMemo(() => queryClient);
11
+ let ref;
12
+ const devtools = new TanstackQueryDevtools({
13
+ client: client(),
14
+ queryFlavor: "Solid Query",
15
+ version: "5",
16
+ onlineManager,
17
+ buttonPosition: props.buttonPosition,
18
+ position: props.position,
19
+ initialIsOpen: props.initialIsOpen,
20
+ errorTypes: props.errorTypes,
21
+ styleNonce: props.styleNonce,
22
+ shadowDOMTarget: props.shadowDOMTarget,
23
+ hideDisabledQueries: props.hideDisabledQueries,
24
+ theme: props.theme
25
+ });
26
+ createEffect(() => {
27
+ devtools.setClient(client());
28
+ });
29
+ createEffect(() => {
30
+ const buttonPos = props.buttonPosition;
31
+ if (buttonPos) {
32
+ devtools.setButtonPosition(buttonPos);
33
+ }
34
+ });
35
+ createEffect(() => {
36
+ const pos = props.position;
37
+ if (pos) {
38
+ devtools.setPosition(pos);
39
+ }
40
+ });
41
+ createEffect(() => {
42
+ devtools.setInitialIsOpen(props.initialIsOpen || false);
43
+ });
44
+ createEffect(() => {
45
+ devtools.setErrorTypes(props.errorTypes || []);
46
+ });
47
+ createEffect(() => {
48
+ devtools.setTheme(props.theme || "system");
49
+ });
50
+ onMount(() => {
51
+ devtools.mount(ref);
52
+ onCleanup(() => devtools.unmount());
53
+ });
54
+ return (() => {
55
+ var _el$ = _tmpl$();
56
+ var _ref$ = ref;
57
+ typeof _ref$ === "function" ? use(_ref$, _el$) : ref = _el$;
58
+ return _el$;
59
+ })();
60
+ }
61
+
62
+ export { SolidQueryDevtools as default };
@@ -0,0 +1,50 @@
1
+ // src/devtoolsPanel.tsx
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
+ function SolidQueryDevtoolsPanel(props) {
6
+ const queryClient = useQueryClient(props.client);
7
+ const client = createMemo(() => queryClient);
8
+ let ref;
9
+ const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
10
+ const devtools = new TanstackQueryDevtoolsPanel({
11
+ client: client(),
12
+ queryFlavor: "Solid Query",
13
+ version: "5",
14
+ onlineManager,
15
+ buttonPosition: "bottom-left",
16
+ position: "bottom",
17
+ initialIsOpen: true,
18
+ errorTypes,
19
+ styleNonce,
20
+ shadowDOMTarget,
21
+ onClose: props.onClose,
22
+ hideDisabledQueries,
23
+ theme: props.theme
24
+ });
25
+ createEffect(() => {
26
+ devtools.setClient(client());
27
+ });
28
+ createEffect(() => {
29
+ devtools.setOnClose(props.onClose ?? (() => {
30
+ }));
31
+ });
32
+ createEffect(() => {
33
+ devtools.setErrorTypes(props.errorTypes || []);
34
+ });
35
+ createEffect(() => {
36
+ devtools.setTheme(props.theme || "system");
37
+ });
38
+ onMount(() => {
39
+ devtools.mount(ref);
40
+ onCleanup(() => devtools.unmount());
41
+ });
42
+ return <div
43
+ style={{ height: "500px", ...props.style }}
44
+ class="tsqd-parent-container"
45
+ ref={ref}
46
+ />;
47
+ }
48
+ export {
49
+ SolidQueryDevtoolsPanel as default
50
+ };
@@ -0,0 +1,61 @@
1
+ import { use, effect, style, template } from 'solid-js/web';
2
+ import { createMemo, createEffect, onMount, onCleanup } from 'solid-js';
3
+ import { useQueryClient, onlineManager } from '@tanstack/solid-query';
4
+ import { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools';
5
+
6
+ // src/devtoolsPanel.tsx
7
+ var _tmpl$ = /* @__PURE__ */ template(`<div class=tsqd-parent-container style=height:500px>`);
8
+ function SolidQueryDevtoolsPanel(props) {
9
+ const queryClient = useQueryClient(props.client);
10
+ const client = createMemo(() => queryClient);
11
+ let ref;
12
+ const {
13
+ errorTypes,
14
+ styleNonce,
15
+ shadowDOMTarget,
16
+ hideDisabledQueries
17
+ } = props;
18
+ const devtools = new TanstackQueryDevtoolsPanel({
19
+ client: client(),
20
+ queryFlavor: "Solid Query",
21
+ version: "5",
22
+ onlineManager,
23
+ buttonPosition: "bottom-left",
24
+ position: "bottom",
25
+ initialIsOpen: true,
26
+ errorTypes,
27
+ styleNonce,
28
+ shadowDOMTarget,
29
+ onClose: props.onClose,
30
+ hideDisabledQueries,
31
+ theme: props.theme
32
+ });
33
+ createEffect(() => {
34
+ devtools.setClient(client());
35
+ });
36
+ createEffect(() => {
37
+ devtools.setOnClose(props.onClose ?? (() => {
38
+ }));
39
+ });
40
+ createEffect(() => {
41
+ devtools.setErrorTypes(props.errorTypes || []);
42
+ });
43
+ createEffect(() => {
44
+ devtools.setTheme(props.theme || "system");
45
+ });
46
+ onMount(() => {
47
+ devtools.mount(ref);
48
+ onCleanup(() => devtools.unmount());
49
+ });
50
+ return (() => {
51
+ var _el$ = _tmpl$();
52
+ var _ref$ = ref;
53
+ typeof _ref$ === "function" ? use(_ref$, _el$) : ref = _el$;
54
+ effect((_$p) => style(_el$, {
55
+ ...props.style
56
+ }, _$p));
57
+ return _el$;
58
+ })();
59
+ }
60
+
61
+ export { SolidQueryDevtoolsPanel as default };
@@ -0,0 +1,167 @@
1
+ 'use strict';
2
+
3
+ var web = require('solid-js/web');
4
+ var solidJs = require('solid-js');
5
+ var solidQuery = require('@tanstack/solid-query');
6
+ var queryDevtools = require('@tanstack/query-devtools');
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __esm = (fn, res) => function __init() {
11
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
+ };
13
+ var __export = (target, all) => {
14
+ for (var name in all)
15
+ __defProp(target, name, { get: all[name], enumerable: true });
16
+ };
17
+
18
+ // src/devtools.tsx
19
+ var devtools_exports = {};
20
+ __export(devtools_exports, {
21
+ default: () => SolidQueryDevtools
22
+ });
23
+ function SolidQueryDevtools(props) {
24
+ const queryClient = solidQuery.useQueryClient(props.client);
25
+ const client = solidJs.createMemo(() => queryClient);
26
+ let ref;
27
+ const devtools = new queryDevtools.TanstackQueryDevtools({
28
+ client: client(),
29
+ queryFlavor: "Solid Query",
30
+ version: "5",
31
+ onlineManager: solidQuery.onlineManager,
32
+ buttonPosition: props.buttonPosition,
33
+ position: props.position,
34
+ initialIsOpen: props.initialIsOpen,
35
+ errorTypes: props.errorTypes,
36
+ styleNonce: props.styleNonce,
37
+ shadowDOMTarget: props.shadowDOMTarget,
38
+ hideDisabledQueries: props.hideDisabledQueries,
39
+ theme: props.theme
40
+ });
41
+ solidJs.createEffect(() => {
42
+ devtools.setClient(client());
43
+ });
44
+ solidJs.createEffect(() => {
45
+ const buttonPos = props.buttonPosition;
46
+ if (buttonPos) {
47
+ devtools.setButtonPosition(buttonPos);
48
+ }
49
+ });
50
+ solidJs.createEffect(() => {
51
+ const pos = props.position;
52
+ if (pos) {
53
+ devtools.setPosition(pos);
54
+ }
55
+ });
56
+ solidJs.createEffect(() => {
57
+ devtools.setInitialIsOpen(props.initialIsOpen || false);
58
+ });
59
+ solidJs.createEffect(() => {
60
+ devtools.setErrorTypes(props.errorTypes || []);
61
+ });
62
+ solidJs.createEffect(() => {
63
+ devtools.setTheme(props.theme || "system");
64
+ });
65
+ solidJs.onMount(() => {
66
+ devtools.mount(ref);
67
+ solidJs.onCleanup(() => devtools.unmount());
68
+ });
69
+ return (() => {
70
+ var _el$ = _tmpl$();
71
+ var _ref$ = ref;
72
+ typeof _ref$ === "function" ? web.use(_ref$, _el$) : ref = _el$;
73
+ return _el$;
74
+ })();
75
+ }
76
+ var _tmpl$;
77
+ var init_devtools = __esm({
78
+ "src/devtools.tsx"() {
79
+ _tmpl$ = /* @__PURE__ */ web.template(`<div class=tsqd-parent-container>`);
80
+ }
81
+ });
82
+
83
+ // src/devtoolsPanel.tsx
84
+ var devtoolsPanel_exports = {};
85
+ __export(devtoolsPanel_exports, {
86
+ default: () => SolidQueryDevtoolsPanel
87
+ });
88
+ function SolidQueryDevtoolsPanel(props) {
89
+ const queryClient = solidQuery.useQueryClient(props.client);
90
+ const client = solidJs.createMemo(() => queryClient);
91
+ let ref;
92
+ const {
93
+ errorTypes,
94
+ styleNonce,
95
+ shadowDOMTarget,
96
+ hideDisabledQueries
97
+ } = props;
98
+ const devtools = new queryDevtools.TanstackQueryDevtoolsPanel({
99
+ client: client(),
100
+ queryFlavor: "Solid Query",
101
+ version: "5",
102
+ onlineManager: solidQuery.onlineManager,
103
+ buttonPosition: "bottom-left",
104
+ position: "bottom",
105
+ initialIsOpen: true,
106
+ errorTypes,
107
+ styleNonce,
108
+ shadowDOMTarget,
109
+ onClose: props.onClose,
110
+ hideDisabledQueries,
111
+ theme: props.theme
112
+ });
113
+ solidJs.createEffect(() => {
114
+ devtools.setClient(client());
115
+ });
116
+ solidJs.createEffect(() => {
117
+ devtools.setOnClose(props.onClose ?? (() => {
118
+ }));
119
+ });
120
+ solidJs.createEffect(() => {
121
+ devtools.setErrorTypes(props.errorTypes || []);
122
+ });
123
+ solidJs.createEffect(() => {
124
+ devtools.setTheme(props.theme || "system");
125
+ });
126
+ solidJs.onMount(() => {
127
+ devtools.mount(ref);
128
+ solidJs.onCleanup(() => devtools.unmount());
129
+ });
130
+ return (() => {
131
+ var _el$ = _tmpl$2();
132
+ var _ref$ = ref;
133
+ typeof _ref$ === "function" ? web.use(_ref$, _el$) : ref = _el$;
134
+ web.effect((_$p) => web.style(_el$, {
135
+ ...props.style
136
+ }, _$p));
137
+ return _el$;
138
+ })();
139
+ }
140
+ var _tmpl$2;
141
+ var init_devtoolsPanel = __esm({
142
+ "src/devtoolsPanel.tsx"() {
143
+ _tmpl$2 = /* @__PURE__ */ web.template(`<div class=tsqd-parent-container style=height:500px>`);
144
+ }
145
+ });
146
+ function clientOnly(fn) {
147
+ if (web.isServer) return (props) => props.fallback;
148
+ const [comp, setComp] = solidJs.createSignal();
149
+ fn().then((m) => setComp(() => m.default));
150
+ return (props) => {
151
+ let Comp;
152
+ let m;
153
+ const [, rest] = solidJs.splitProps(props, ["fallback"]);
154
+ if ((Comp = comp()) && !solidJs.sharedConfig.context) return Comp(rest);
155
+ const [mounted, setMounted] = solidJs.createSignal(!solidJs.sharedConfig.context);
156
+ solidJs.onMount(() => setMounted(true));
157
+ return solidJs.createMemo(() => (Comp = comp(), m = mounted(), solidJs.untrack(() => Comp && m ? Comp(rest) : props.fallback)));
158
+ };
159
+ }
160
+
161
+ // src/index.tsx
162
+ exports.SolidQueryDevtools = web.isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtools(), devtools_exports))) : function() {
163
+ return null;
164
+ };
165
+ exports.SolidQueryDevtoolsPanel = web.isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtoolsPanel(), devtoolsPanel_exports))) : function() {
166
+ return null;
167
+ };
@@ -0,0 +1,3 @@
1
+ export { SolidQueryDevtools } from './_tsup-dts-rollup.cjs';
2
+ export { SolidQueryDevtoolsPanel } from './_tsup-dts-rollup.cjs';
3
+ export { DevtoolsPanelOptions_alias_1 as DevtoolsPanelOptions } from './_tsup-dts-rollup.cjs';
@@ -0,0 +1,3 @@
1
+ export { SolidQueryDevtools } from './_tsup-dts-rollup.js';
2
+ export { SolidQueryDevtoolsPanel } from './_tsup-dts-rollup.js';
3
+ export { DevtoolsPanelOptions_alias_1 as DevtoolsPanelOptions } from './_tsup-dts-rollup.js';
package/build/index.js ADDED
@@ -0,0 +1,28 @@
1
+ import { isDev, isServer } from 'solid-js/web';
2
+ import { createSignal, splitProps, sharedConfig, onMount, createMemo, untrack } from 'solid-js';
3
+
4
+ // src/index.tsx
5
+ function clientOnly(fn) {
6
+ if (isServer) return (props) => props.fallback;
7
+ const [comp, setComp] = createSignal();
8
+ fn().then((m) => setComp(() => m.default));
9
+ return (props) => {
10
+ let Comp;
11
+ let m;
12
+ const [, rest] = splitProps(props, ["fallback"]);
13
+ if ((Comp = comp()) && !sharedConfig.context) return Comp(rest);
14
+ const [mounted, setMounted] = createSignal(!sharedConfig.context);
15
+ onMount(() => setMounted(true));
16
+ return createMemo(() => (Comp = comp(), m = mounted(), untrack(() => Comp && m ? Comp(rest) : props.fallback)));
17
+ };
18
+ }
19
+
20
+ // src/index.tsx
21
+ var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/BCD44V6M.js')) : function() {
22
+ return null;
23
+ };
24
+ var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/VOW4J2DZ.js')) : function() {
25
+ return null;
26
+ };
27
+
28
+ export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
@@ -0,0 +1,42 @@
1
+ // src/index.tsx
2
+ import { isDev } from "solid-js/web";
3
+
4
+ // src/clientOnly.tsx
5
+ import {
6
+ createMemo,
7
+ createSignal,
8
+ onMount,
9
+ sharedConfig,
10
+ splitProps,
11
+ untrack
12
+ } from "solid-js";
13
+ import { isServer } from "solid-js/web";
14
+ function clientOnly(fn) {
15
+ if (isServer)
16
+ return (props) => props.fallback;
17
+ const [comp, setComp] = createSignal();
18
+ fn().then((m) => setComp(() => m.default));
19
+ return (props) => {
20
+ let Comp;
21
+ let m;
22
+ const [, rest] = splitProps(props, ["fallback"]);
23
+ if ((Comp = comp()) && !sharedConfig.context) return Comp(rest);
24
+ const [mounted, setMounted] = createSignal(!sharedConfig.context);
25
+ onMount(() => setMounted(true));
26
+ return createMemo(
27
+ () => (Comp = comp(), m = mounted(), untrack(() => Comp && m ? Comp(rest) : props.fallback))
28
+ );
29
+ };
30
+ }
31
+
32
+ // src/index.tsx
33
+ var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/32HRKFKI.jsx")) : function() {
34
+ return null;
35
+ };
36
+ var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/NDFIDQLQ.jsx")) : function() {
37
+ return null;
38
+ };
39
+ export {
40
+ SolidQueryDevtools,
41
+ SolidQueryDevtoolsPanel
42
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-query-devtools",
3
- "version": "5.94.4",
3
+ "version": "5.94.5",
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,7 +44,7 @@
44
44
  "!src/__tests__"
45
45
  ],
46
46
  "dependencies": {
47
- "@tanstack/query-devtools": "5.94.4"
47
+ "@tanstack/query-devtools": "5.94.5"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@solidjs/testing-library": "^0.8.10",
@@ -52,11 +52,11 @@
52
52
  "solid-js": "^1.9.7",
53
53
  "tsup-preset-solid": "^2.2.0",
54
54
  "vite-plugin-solid": "^2.11.6",
55
- "@tanstack/solid-query": "5.94.4"
55
+ "@tanstack/solid-query": "5.94.5"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "solid-js": "^1.6.0",
59
- "@tanstack/solid-query": "^5.94.4"
59
+ "@tanstack/solid-query": "^5.94.5"
60
60
  },
61
61
  "scripts": {
62
62
  "clean": "premove ./build ./coverage ./dist-ts",