@tanstack/solid-query-devtools 5.83.1 → 5.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dev.cjs +66 -1
- package/build/dev.js +5 -2
- package/build/dev.jsx +6 -2
- package/build/devtools/{O4DODHQV.jsx → 4LKOWRT2.jsx} +2 -1
- package/build/devtools/{LBUQ2A5B.js → DFW22NEL.js} +2 -1
- package/build/devtoolsPanel/QH7X6ZDM.js +58 -0
- package/build/devtoolsPanel/YI6MKFAH.jsx +46 -0
- package/build/index.cjs +66 -1
- package/build/index.d.cts +41 -1
- package/build/index.d.ts +41 -1
- package/build/index.js +5 -2
- package/build/index.jsx +6 -2
- package/package.json +2 -2
- package/src/devtools.tsx +5 -0
- package/src/devtoolsPanel.tsx +85 -0
- package/src/index.tsx +9 -0
package/build/dev.cjs
CHANGED
|
@@ -34,7 +34,8 @@ function SolidQueryDevtools(props) {
|
|
|
34
34
|
initialIsOpen: props.initialIsOpen,
|
|
35
35
|
errorTypes: props.errorTypes,
|
|
36
36
|
styleNonce: props.styleNonce,
|
|
37
|
-
shadowDOMTarget: props.shadowDOMTarget
|
|
37
|
+
shadowDOMTarget: props.shadowDOMTarget,
|
|
38
|
+
hideDisabledQueries: props.hideDisabledQueries
|
|
38
39
|
});
|
|
39
40
|
solidJs.createEffect(() => {
|
|
40
41
|
devtools.setClient(client());
|
|
@@ -74,6 +75,67 @@ var init_devtools = __esm({
|
|
|
74
75
|
_tmpl$ = /* @__PURE__ */ web.template(`<div class=tsqd-parent-container>`);
|
|
75
76
|
}
|
|
76
77
|
});
|
|
78
|
+
|
|
79
|
+
// src/devtoolsPanel.tsx
|
|
80
|
+
var devtoolsPanel_exports = {};
|
|
81
|
+
__export(devtoolsPanel_exports, {
|
|
82
|
+
default: () => SolidQueryDevtoolsPanel
|
|
83
|
+
});
|
|
84
|
+
function SolidQueryDevtoolsPanel(props) {
|
|
85
|
+
const queryClient = solidQuery.useQueryClient();
|
|
86
|
+
const client = solidJs.createMemo(() => props.client || queryClient);
|
|
87
|
+
let ref;
|
|
88
|
+
const {
|
|
89
|
+
errorTypes,
|
|
90
|
+
styleNonce,
|
|
91
|
+
shadowDOMTarget,
|
|
92
|
+
hideDisabledQueries
|
|
93
|
+
} = props;
|
|
94
|
+
const devtools = new queryDevtools.TanstackQueryDevtoolsPanel({
|
|
95
|
+
client: client(),
|
|
96
|
+
queryFlavor: "Solid Query",
|
|
97
|
+
version: "5",
|
|
98
|
+
onlineManager: solidQuery.onlineManager,
|
|
99
|
+
buttonPosition: "bottom-left",
|
|
100
|
+
position: "bottom",
|
|
101
|
+
initialIsOpen: true,
|
|
102
|
+
errorTypes,
|
|
103
|
+
styleNonce,
|
|
104
|
+
shadowDOMTarget,
|
|
105
|
+
onClose: props.onClose,
|
|
106
|
+
hideDisabledQueries
|
|
107
|
+
});
|
|
108
|
+
solidJs.createEffect(() => {
|
|
109
|
+
devtools.setClient(client());
|
|
110
|
+
});
|
|
111
|
+
solidJs.createEffect(() => {
|
|
112
|
+
devtools.setOnClose(props.onClose ?? (() => {
|
|
113
|
+
}));
|
|
114
|
+
});
|
|
115
|
+
solidJs.createEffect(() => {
|
|
116
|
+
devtools.setErrorTypes(props.errorTypes || []);
|
|
117
|
+
});
|
|
118
|
+
solidJs.onMount(() => {
|
|
119
|
+
devtools.mount(ref);
|
|
120
|
+
solidJs.onCleanup(() => devtools.unmount());
|
|
121
|
+
});
|
|
122
|
+
return (() => {
|
|
123
|
+
var _el$ = _tmpl$2();
|
|
124
|
+
var _ref$ = ref;
|
|
125
|
+
typeof _ref$ === "function" ? web.use(_ref$, _el$) : ref = _el$;
|
|
126
|
+
web.effect((_$p) => web.style(_el$, {
|
|
127
|
+
height: "500px",
|
|
128
|
+
...props.style
|
|
129
|
+
}, _$p));
|
|
130
|
+
return _el$;
|
|
131
|
+
})();
|
|
132
|
+
}
|
|
133
|
+
var _tmpl$2;
|
|
134
|
+
var init_devtoolsPanel = __esm({
|
|
135
|
+
"src/devtoolsPanel.tsx"() {
|
|
136
|
+
_tmpl$2 = /* @__PURE__ */ web.template(`<div class=tsqd-parent-container>`);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
77
139
|
function clientOnly(fn) {
|
|
78
140
|
if (web.isServer) return (props) => props.fallback;
|
|
79
141
|
const [comp, setComp] = solidJs.createSignal();
|
|
@@ -93,3 +155,6 @@ function clientOnly(fn) {
|
|
|
93
155
|
exports.SolidQueryDevtools = web.isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtools(), devtools_exports))) : function() {
|
|
94
156
|
return null;
|
|
95
157
|
};
|
|
158
|
+
exports.SolidQueryDevtoolsPanel = web.isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtoolsPanel(), devtoolsPanel_exports))) : function() {
|
|
159
|
+
return null;
|
|
160
|
+
};
|
package/build/dev.js
CHANGED
|
@@ -18,8 +18,11 @@ function clientOnly(fn) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
// src/index.tsx
|
|
21
|
-
var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/
|
|
21
|
+
var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/DFW22NEL.js')) : function() {
|
|
22
|
+
return null;
|
|
23
|
+
};
|
|
24
|
+
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/QH7X6ZDM.js')) : function() {
|
|
22
25
|
return null;
|
|
23
26
|
};
|
|
24
27
|
|
|
25
|
-
export { SolidQueryDevtools };
|
|
28
|
+
export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
|
package/build/dev.jsx
CHANGED
|
@@ -30,9 +30,13 @@ function clientOnly(fn) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// src/index.tsx
|
|
33
|
-
var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/
|
|
33
|
+
var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/4LKOWRT2.jsx")) : function() {
|
|
34
|
+
return null;
|
|
35
|
+
};
|
|
36
|
+
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/YI6MKFAH.jsx")) : function() {
|
|
34
37
|
return null;
|
|
35
38
|
};
|
|
36
39
|
export {
|
|
37
|
-
SolidQueryDevtools
|
|
40
|
+
SolidQueryDevtools,
|
|
41
|
+
SolidQueryDevtoolsPanel
|
|
38
42
|
};
|
|
@@ -16,7 +16,8 @@ function SolidQueryDevtools(props) {
|
|
|
16
16
|
initialIsOpen: props.initialIsOpen,
|
|
17
17
|
errorTypes: props.errorTypes,
|
|
18
18
|
styleNonce: props.styleNonce,
|
|
19
|
-
shadowDOMTarget: props.shadowDOMTarget
|
|
19
|
+
shadowDOMTarget: props.shadowDOMTarget,
|
|
20
|
+
hideDisabledQueries: props.hideDisabledQueries
|
|
20
21
|
});
|
|
21
22
|
createEffect(() => {
|
|
22
23
|
devtools.setClient(client());
|
|
@@ -19,7 +19,8 @@ function SolidQueryDevtools(props) {
|
|
|
19
19
|
initialIsOpen: props.initialIsOpen,
|
|
20
20
|
errorTypes: props.errorTypes,
|
|
21
21
|
styleNonce: props.styleNonce,
|
|
22
|
-
shadowDOMTarget: props.shadowDOMTarget
|
|
22
|
+
shadowDOMTarget: props.shadowDOMTarget,
|
|
23
|
+
hideDisabledQueries: props.hideDisabledQueries
|
|
23
24
|
});
|
|
24
25
|
createEffect(() => {
|
|
25
26
|
devtools.setClient(client());
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { template, use, effect, style } 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>`);
|
|
8
|
+
function SolidQueryDevtoolsPanel(props) {
|
|
9
|
+
const queryClient = useQueryClient();
|
|
10
|
+
const client = createMemo(() => props.client || 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
|
+
});
|
|
32
|
+
createEffect(() => {
|
|
33
|
+
devtools.setClient(client());
|
|
34
|
+
});
|
|
35
|
+
createEffect(() => {
|
|
36
|
+
devtools.setOnClose(props.onClose ?? (() => {
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
39
|
+
createEffect(() => {
|
|
40
|
+
devtools.setErrorTypes(props.errorTypes || []);
|
|
41
|
+
});
|
|
42
|
+
onMount(() => {
|
|
43
|
+
devtools.mount(ref);
|
|
44
|
+
onCleanup(() => devtools.unmount());
|
|
45
|
+
});
|
|
46
|
+
return (() => {
|
|
47
|
+
var _el$ = _tmpl$();
|
|
48
|
+
var _ref$ = ref;
|
|
49
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : ref = _el$;
|
|
50
|
+
effect((_$p) => style(_el$, {
|
|
51
|
+
height: "500px",
|
|
52
|
+
...props.style
|
|
53
|
+
}, _$p));
|
|
54
|
+
return _el$;
|
|
55
|
+
})();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { SolidQueryDevtoolsPanel as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
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();
|
|
7
|
+
const client = createMemo(() => props.client || 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
|
+
});
|
|
24
|
+
createEffect(() => {
|
|
25
|
+
devtools.setClient(client());
|
|
26
|
+
});
|
|
27
|
+
createEffect(() => {
|
|
28
|
+
devtools.setOnClose(props.onClose ?? (() => {
|
|
29
|
+
}));
|
|
30
|
+
});
|
|
31
|
+
createEffect(() => {
|
|
32
|
+
devtools.setErrorTypes(props.errorTypes || []);
|
|
33
|
+
});
|
|
34
|
+
onMount(() => {
|
|
35
|
+
devtools.mount(ref);
|
|
36
|
+
onCleanup(() => devtools.unmount());
|
|
37
|
+
});
|
|
38
|
+
return <div
|
|
39
|
+
style={{ height: "500px", ...props.style }}
|
|
40
|
+
class="tsqd-parent-container"
|
|
41
|
+
ref={ref}
|
|
42
|
+
/>;
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
SolidQueryDevtoolsPanel as default
|
|
46
|
+
};
|
package/build/index.cjs
CHANGED
|
@@ -34,7 +34,8 @@ function SolidQueryDevtools(props) {
|
|
|
34
34
|
initialIsOpen: props.initialIsOpen,
|
|
35
35
|
errorTypes: props.errorTypes,
|
|
36
36
|
styleNonce: props.styleNonce,
|
|
37
|
-
shadowDOMTarget: props.shadowDOMTarget
|
|
37
|
+
shadowDOMTarget: props.shadowDOMTarget,
|
|
38
|
+
hideDisabledQueries: props.hideDisabledQueries
|
|
38
39
|
});
|
|
39
40
|
solidJs.createEffect(() => {
|
|
40
41
|
devtools.setClient(client());
|
|
@@ -74,6 +75,67 @@ var init_devtools = __esm({
|
|
|
74
75
|
_tmpl$ = /* @__PURE__ */ web.template(`<div class=tsqd-parent-container>`);
|
|
75
76
|
}
|
|
76
77
|
});
|
|
78
|
+
|
|
79
|
+
// src/devtoolsPanel.tsx
|
|
80
|
+
var devtoolsPanel_exports = {};
|
|
81
|
+
__export(devtoolsPanel_exports, {
|
|
82
|
+
default: () => SolidQueryDevtoolsPanel
|
|
83
|
+
});
|
|
84
|
+
function SolidQueryDevtoolsPanel(props) {
|
|
85
|
+
const queryClient = solidQuery.useQueryClient();
|
|
86
|
+
const client = solidJs.createMemo(() => props.client || queryClient);
|
|
87
|
+
let ref;
|
|
88
|
+
const {
|
|
89
|
+
errorTypes,
|
|
90
|
+
styleNonce,
|
|
91
|
+
shadowDOMTarget,
|
|
92
|
+
hideDisabledQueries
|
|
93
|
+
} = props;
|
|
94
|
+
const devtools = new queryDevtools.TanstackQueryDevtoolsPanel({
|
|
95
|
+
client: client(),
|
|
96
|
+
queryFlavor: "Solid Query",
|
|
97
|
+
version: "5",
|
|
98
|
+
onlineManager: solidQuery.onlineManager,
|
|
99
|
+
buttonPosition: "bottom-left",
|
|
100
|
+
position: "bottom",
|
|
101
|
+
initialIsOpen: true,
|
|
102
|
+
errorTypes,
|
|
103
|
+
styleNonce,
|
|
104
|
+
shadowDOMTarget,
|
|
105
|
+
onClose: props.onClose,
|
|
106
|
+
hideDisabledQueries
|
|
107
|
+
});
|
|
108
|
+
solidJs.createEffect(() => {
|
|
109
|
+
devtools.setClient(client());
|
|
110
|
+
});
|
|
111
|
+
solidJs.createEffect(() => {
|
|
112
|
+
devtools.setOnClose(props.onClose ?? (() => {
|
|
113
|
+
}));
|
|
114
|
+
});
|
|
115
|
+
solidJs.createEffect(() => {
|
|
116
|
+
devtools.setErrorTypes(props.errorTypes || []);
|
|
117
|
+
});
|
|
118
|
+
solidJs.onMount(() => {
|
|
119
|
+
devtools.mount(ref);
|
|
120
|
+
solidJs.onCleanup(() => devtools.unmount());
|
|
121
|
+
});
|
|
122
|
+
return (() => {
|
|
123
|
+
var _el$ = _tmpl$2();
|
|
124
|
+
var _ref$ = ref;
|
|
125
|
+
typeof _ref$ === "function" ? web.use(_ref$, _el$) : ref = _el$;
|
|
126
|
+
web.effect((_$p) => web.style(_el$, {
|
|
127
|
+
height: "500px",
|
|
128
|
+
...props.style
|
|
129
|
+
}, _$p));
|
|
130
|
+
return _el$;
|
|
131
|
+
})();
|
|
132
|
+
}
|
|
133
|
+
var _tmpl$2;
|
|
134
|
+
var init_devtoolsPanel = __esm({
|
|
135
|
+
"src/devtoolsPanel.tsx"() {
|
|
136
|
+
_tmpl$2 = /* @__PURE__ */ web.template(`<div class=tsqd-parent-container>`);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
77
139
|
function clientOnly(fn) {
|
|
78
140
|
if (web.isServer) return (props) => props.fallback;
|
|
79
141
|
const [comp, setComp] = solidJs.createSignal();
|
|
@@ -93,3 +155,6 @@ function clientOnly(fn) {
|
|
|
93
155
|
exports.SolidQueryDevtools = web.isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtools(), devtools_exports))) : function() {
|
|
94
156
|
return null;
|
|
95
157
|
};
|
|
158
|
+
exports.SolidQueryDevtoolsPanel = web.isDev ? clientOnly(() => Promise.resolve().then(() => (init_devtoolsPanel(), devtoolsPanel_exports))) : function() {
|
|
159
|
+
return null;
|
|
160
|
+
};
|
package/build/index.d.cts
CHANGED
|
@@ -35,9 +35,49 @@ interface DevtoolsOptions {
|
|
|
35
35
|
* Use this so you can attach the devtool's styles to specific element in the DOM.
|
|
36
36
|
*/
|
|
37
37
|
shadowDOMTarget?: ShadowRoot;
|
|
38
|
+
/**
|
|
39
|
+
* Set this to true to hide disabled queries from the devtools panel.
|
|
40
|
+
*/
|
|
41
|
+
hideDisabledQueries?: boolean;
|
|
38
42
|
}
|
|
39
43
|
declare function SolidQueryDevtools$1(props: DevtoolsOptions): solid_js.JSX.Element;
|
|
40
44
|
|
|
45
|
+
interface DevtoolsPanelOptions {
|
|
46
|
+
/**
|
|
47
|
+
* Custom instance of QueryClient
|
|
48
|
+
*/
|
|
49
|
+
client?: QueryClient;
|
|
50
|
+
/**
|
|
51
|
+
* Use this so you can define custom errors that can be shown in the devtools.
|
|
52
|
+
*/
|
|
53
|
+
errorTypes?: Array<DevtoolsErrorType>;
|
|
54
|
+
/**
|
|
55
|
+
* 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.
|
|
56
|
+
*/
|
|
57
|
+
styleNonce?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Use this so you can attach the devtool's styles to specific element in the DOM.
|
|
60
|
+
*/
|
|
61
|
+
shadowDOMTarget?: ShadowRoot;
|
|
62
|
+
/**
|
|
63
|
+
* Custom styles for the devtools panel
|
|
64
|
+
* @default { height: '500px' }
|
|
65
|
+
* @example { height: '100%' }
|
|
66
|
+
* @example { height: '100%', width: '100%' }
|
|
67
|
+
*/
|
|
68
|
+
style?: CSSStyleValue;
|
|
69
|
+
/**
|
|
70
|
+
* Callback function that is called when the devtools panel is closed
|
|
71
|
+
*/
|
|
72
|
+
onClose?: () => unknown;
|
|
73
|
+
/**
|
|
74
|
+
* Set this to true to hide disabled queries from the devtools panel.
|
|
75
|
+
*/
|
|
76
|
+
hideDisabledQueries?: boolean;
|
|
77
|
+
}
|
|
78
|
+
declare function SolidQueryDevtoolsPanel$1(props: DevtoolsPanelOptions): solid_js.JSX.Element;
|
|
79
|
+
|
|
41
80
|
declare const SolidQueryDevtools: typeof SolidQueryDevtools$1;
|
|
81
|
+
declare const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsPanel$1;
|
|
42
82
|
|
|
43
|
-
export { SolidQueryDevtools };
|
|
83
|
+
export { type DevtoolsPanelOptions, SolidQueryDevtools, SolidQueryDevtoolsPanel };
|
package/build/index.d.ts
CHANGED
|
@@ -35,9 +35,49 @@ interface DevtoolsOptions {
|
|
|
35
35
|
* Use this so you can attach the devtool's styles to specific element in the DOM.
|
|
36
36
|
*/
|
|
37
37
|
shadowDOMTarget?: ShadowRoot;
|
|
38
|
+
/**
|
|
39
|
+
* Set this to true to hide disabled queries from the devtools panel.
|
|
40
|
+
*/
|
|
41
|
+
hideDisabledQueries?: boolean;
|
|
38
42
|
}
|
|
39
43
|
declare function SolidQueryDevtools$1(props: DevtoolsOptions): solid_js.JSX.Element;
|
|
40
44
|
|
|
45
|
+
interface DevtoolsPanelOptions {
|
|
46
|
+
/**
|
|
47
|
+
* Custom instance of QueryClient
|
|
48
|
+
*/
|
|
49
|
+
client?: QueryClient;
|
|
50
|
+
/**
|
|
51
|
+
* Use this so you can define custom errors that can be shown in the devtools.
|
|
52
|
+
*/
|
|
53
|
+
errorTypes?: Array<DevtoolsErrorType>;
|
|
54
|
+
/**
|
|
55
|
+
* 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.
|
|
56
|
+
*/
|
|
57
|
+
styleNonce?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Use this so you can attach the devtool's styles to specific element in the DOM.
|
|
60
|
+
*/
|
|
61
|
+
shadowDOMTarget?: ShadowRoot;
|
|
62
|
+
/**
|
|
63
|
+
* Custom styles for the devtools panel
|
|
64
|
+
* @default { height: '500px' }
|
|
65
|
+
* @example { height: '100%' }
|
|
66
|
+
* @example { height: '100%', width: '100%' }
|
|
67
|
+
*/
|
|
68
|
+
style?: CSSStyleValue;
|
|
69
|
+
/**
|
|
70
|
+
* Callback function that is called when the devtools panel is closed
|
|
71
|
+
*/
|
|
72
|
+
onClose?: () => unknown;
|
|
73
|
+
/**
|
|
74
|
+
* Set this to true to hide disabled queries from the devtools panel.
|
|
75
|
+
*/
|
|
76
|
+
hideDisabledQueries?: boolean;
|
|
77
|
+
}
|
|
78
|
+
declare function SolidQueryDevtoolsPanel$1(props: DevtoolsPanelOptions): solid_js.JSX.Element;
|
|
79
|
+
|
|
41
80
|
declare const SolidQueryDevtools: typeof SolidQueryDevtools$1;
|
|
81
|
+
declare const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsPanel$1;
|
|
42
82
|
|
|
43
|
-
export { SolidQueryDevtools };
|
|
83
|
+
export { type DevtoolsPanelOptions, SolidQueryDevtools, SolidQueryDevtoolsPanel };
|
package/build/index.js
CHANGED
|
@@ -18,8 +18,11 @@ function clientOnly(fn) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
// src/index.tsx
|
|
21
|
-
var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/
|
|
21
|
+
var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/DFW22NEL.js')) : function() {
|
|
22
|
+
return null;
|
|
23
|
+
};
|
|
24
|
+
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/QH7X6ZDM.js')) : function() {
|
|
22
25
|
return null;
|
|
23
26
|
};
|
|
24
27
|
|
|
25
|
-
export { SolidQueryDevtools };
|
|
28
|
+
export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
|
package/build/index.jsx
CHANGED
|
@@ -30,9 +30,13 @@ function clientOnly(fn) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// src/index.tsx
|
|
33
|
-
var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/
|
|
33
|
+
var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/4LKOWRT2.jsx")) : function() {
|
|
34
|
+
return null;
|
|
35
|
+
};
|
|
36
|
+
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/YI6MKFAH.jsx")) : function() {
|
|
34
37
|
return null;
|
|
35
38
|
};
|
|
36
39
|
export {
|
|
37
|
-
SolidQueryDevtools
|
|
40
|
+
SolidQueryDevtools,
|
|
41
|
+
SolidQueryDevtoolsPanel
|
|
38
42
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query-devtools",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.85.0",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack/solid-query Query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"!src/__tests__"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@tanstack/query-devtools": "5.
|
|
47
|
+
"@tanstack/query-devtools": "5.84.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"npm-run-all2": "^5.0.0",
|
package/src/devtools.tsx
CHANGED
|
@@ -41,6 +41,10 @@ interface DevtoolsOptions {
|
|
|
41
41
|
* Use this so you can attach the devtool's styles to specific element in the DOM.
|
|
42
42
|
*/
|
|
43
43
|
shadowDOMTarget?: ShadowRoot
|
|
44
|
+
/**
|
|
45
|
+
* Set this to true to hide disabled queries from the devtools panel.
|
|
46
|
+
*/
|
|
47
|
+
hideDisabledQueries?: boolean
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
export default function SolidQueryDevtools(props: DevtoolsOptions) {
|
|
@@ -58,6 +62,7 @@ export default function SolidQueryDevtools(props: DevtoolsOptions) {
|
|
|
58
62
|
errorTypes: props.errorTypes,
|
|
59
63
|
styleNonce: props.styleNonce,
|
|
60
64
|
shadowDOMTarget: props.shadowDOMTarget,
|
|
65
|
+
hideDisabledQueries: props.hideDisabledQueries,
|
|
61
66
|
})
|
|
62
67
|
|
|
63
68
|
createEffect(() => {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createEffect, createMemo, onCleanup, onMount } from 'solid-js'
|
|
2
|
+
import { onlineManager, useQueryClient } from '@tanstack/solid-query'
|
|
3
|
+
import { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'
|
|
4
|
+
import type { DevtoolsErrorType } from '@tanstack/query-devtools'
|
|
5
|
+
import type { QueryClient } from '@tanstack/solid-query'
|
|
6
|
+
|
|
7
|
+
export interface DevtoolsPanelOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Custom instance of QueryClient
|
|
10
|
+
*/
|
|
11
|
+
client?: QueryClient
|
|
12
|
+
/**
|
|
13
|
+
* Use this so you can define custom errors that can be shown in the devtools.
|
|
14
|
+
*/
|
|
15
|
+
errorTypes?: Array<DevtoolsErrorType>
|
|
16
|
+
/**
|
|
17
|
+
* 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.
|
|
18
|
+
*/
|
|
19
|
+
styleNonce?: string
|
|
20
|
+
/**
|
|
21
|
+
* Use this so you can attach the devtool's styles to specific element in the DOM.
|
|
22
|
+
*/
|
|
23
|
+
shadowDOMTarget?: ShadowRoot
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Custom styles for the devtools panel
|
|
27
|
+
* @default { height: '500px' }
|
|
28
|
+
* @example { height: '100%' }
|
|
29
|
+
* @example { height: '100%', width: '100%' }
|
|
30
|
+
*/
|
|
31
|
+
style?: CSSStyleValue
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Callback function that is called when the devtools panel is closed
|
|
35
|
+
*/
|
|
36
|
+
onClose?: () => unknown
|
|
37
|
+
/**
|
|
38
|
+
* Set this to true to hide disabled queries from the devtools panel.
|
|
39
|
+
*/
|
|
40
|
+
hideDisabledQueries?: boolean
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default function SolidQueryDevtoolsPanel(props: DevtoolsPanelOptions) {
|
|
44
|
+
const queryClient = useQueryClient()
|
|
45
|
+
const client = createMemo(() => props.client || queryClient)
|
|
46
|
+
let ref!: HTMLDivElement
|
|
47
|
+
const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props
|
|
48
|
+
const devtools = new TanstackQueryDevtoolsPanel({
|
|
49
|
+
client: client(),
|
|
50
|
+
queryFlavor: 'Solid Query',
|
|
51
|
+
version: '5',
|
|
52
|
+
onlineManager,
|
|
53
|
+
buttonPosition: 'bottom-left',
|
|
54
|
+
position: 'bottom',
|
|
55
|
+
initialIsOpen: true,
|
|
56
|
+
errorTypes,
|
|
57
|
+
styleNonce,
|
|
58
|
+
shadowDOMTarget,
|
|
59
|
+
onClose: props.onClose,
|
|
60
|
+
hideDisabledQueries,
|
|
61
|
+
})
|
|
62
|
+
createEffect(() => {
|
|
63
|
+
devtools.setClient(client())
|
|
64
|
+
})
|
|
65
|
+
createEffect(() => {
|
|
66
|
+
devtools.setOnClose(props.onClose ?? (() => {}))
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
createEffect(() => {
|
|
70
|
+
devtools.setErrorTypes(props.errorTypes || [])
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
onMount(() => {
|
|
74
|
+
devtools.mount(ref)
|
|
75
|
+
onCleanup(() => devtools.unmount())
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<div
|
|
80
|
+
style={{ height: '500px', ...props.style }}
|
|
81
|
+
class="tsqd-parent-container"
|
|
82
|
+
ref={ref}
|
|
83
|
+
/>
|
|
84
|
+
)
|
|
85
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { isDev } from 'solid-js/web'
|
|
2
2
|
import clientOnly from './clientOnly'
|
|
3
3
|
import type SolidQueryDevtoolsComp from './devtools'
|
|
4
|
+
import type SolidQueryDevtoolsCompPanel from './devtoolsPanel'
|
|
4
5
|
|
|
5
6
|
export const SolidQueryDevtools: typeof SolidQueryDevtoolsComp = isDev
|
|
6
7
|
? clientOnly(() => import('./devtools'))
|
|
7
8
|
: function () {
|
|
8
9
|
return null
|
|
9
10
|
}
|
|
11
|
+
|
|
12
|
+
export const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsCompPanel = isDev
|
|
13
|
+
? clientOnly(() => import('./devtoolsPanel'))
|
|
14
|
+
: function () {
|
|
15
|
+
return null
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type { DevtoolsPanelOptions } from './devtoolsPanel'
|