@tanstack/solid-query-devtools 5.105.3 → 5.106.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dev.cjs +109 -26
- package/build/dev.js +111 -28
- package/build/dev.jsx +102 -28
- package/build/index.cjs +1 -1
- package/build/index.d.cts +1 -1
- package/build/index.d.cts.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/index.jsx +2 -27
- package/package.json +7 -6
- package/src/devtoolsPanel.tsx +7 -2
- package/src/index.tsx +14 -14
- package/build/devtools-8au4JaTw.cjs +0 -62
- package/build/devtools-COkRtz4W.jsx +0 -55
- package/build/devtools-CsBrM8Az.cjs +0 -1
- package/build/devtools-DS7Cagay.js +0 -62
- package/build/devtools-DWG-IwnT.js +0 -2
- package/build/devtools-DWG-IwnT.js.map +0 -1
- package/build/devtoolsPanel-B_UgyNNb.js +0 -2
- package/build/devtoolsPanel-B_UgyNNb.js.map +0 -1
- package/build/devtoolsPanel-DOI1y30E.cjs +0 -56
- package/build/devtoolsPanel-JO2aJWEm.js +0 -56
- package/build/devtoolsPanel-LS1BLA67.cjs +0 -1
- package/build/devtoolsPanel-lDJwLIyQ.jsx +0 -51
- 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
|
-
|
|
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
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
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
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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 =
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
const SolidQueryDevtoolsPanel = solid_js_web.isDev ? clientOnly(() => Promise.resolve().then(() => require("./devtoolsPanel-DOI1y30E.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 {
|
|
2
|
-
import { createMemo,
|
|
3
|
-
|
|
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
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
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
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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 =
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-JO2aJWEm.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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
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
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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 =
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-lDJwLIyQ.jsx")) : function() {
|
|
31
|
-
return null;
|
|
32
|
-
};
|
|
105
|
+
const SolidQueryDevtools = SolidQueryDevtools$1;
|
|
106
|
+
const SolidQueryDevtoolsPanel = SolidQueryDevtoolsPanel$1;
|
|
33
107
|
export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
|
package/build/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=function(){return null},t=function(){return null};exports.SolidQueryDevtools=e,exports.SolidQueryDevtoolsPanel=t;
|
package/build/index.d.cts
CHANGED
|
@@ -76,7 +76,7 @@ interface DevtoolsPanelOptions {
|
|
|
76
76
|
shadowDOMTarget?: ShadowRoot;
|
|
77
77
|
/**
|
|
78
78
|
* Custom styles for the devtools panel
|
|
79
|
-
* @default { height: '
|
|
79
|
+
* @default { height: '100%', display: 'flex', 'flex-direction': 'column' }
|
|
80
80
|
* @example { height: '100%' }
|
|
81
81
|
* @example { height: '100%', width: '100%' }
|
|
82
82
|
*/
|
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;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;;;;;;;iBAScA,qBAAmB,OAAO,qCAAe,IAAA;;;;UCrDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQC,MAAI;;;;EAKZ;;;;EAIA;;;;;;EAMA,QAAQ;;;;;;;iBAQcC,0BAAwB,OAAO,uBAAoBD,MAAA;
|
|
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;;;;;;EAMA,QAAQ;;;;;;;;iBAScA,qBAAmB,OAAO,qCAAe,IAAA;;;;UCrDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQC,MAAI;;;;EAKZ;;;;EAIA;;;;;;EAMA,QAAQ;;;;;;;iBAQcC,0BAAwB,OAAO,uBAAoBD,MAAA;qBCvD9D,2BAA2BE;qBAO3B,gCAAgCC"}
|
package/build/index.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ interface DevtoolsPanelOptions {
|
|
|
76
76
|
shadowDOMTarget?: ShadowRoot;
|
|
77
77
|
/**
|
|
78
78
|
* Custom styles for the devtools panel
|
|
79
|
-
* @default { height: '
|
|
79
|
+
* @default { height: '100%', display: 'flex', 'flex-direction': 'column' }
|
|
80
80
|
* @example { height: '100%' }
|
|
81
81
|
* @example { height: '100%', width: '100%' }
|
|
82
82
|
*/
|
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;;;;;;EAMA,iBAAiB;;;;;;EAMjB,WAAW;;;;EAIX,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;;EAMA,QAAQ;;;;;;;;iBAScA,qBAAmB,OAAO,qCAAe,IAAA;;;;UCrDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQC,MAAI;;;;EAKZ;;;;EAIA;;;;;;EAMA,QAAQ;;;;;;;iBAQcC,0BAAwB,OAAO,uBAAoBD,MAAA;
|
|
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;;;;;;EAMA,QAAQ;;;;;;;;iBAScA,qBAAmB,OAAO,qCAAe,IAAA;;;;UCrDhD;;;;EAIf,SAAS;;;;EAIT,aAAa,MAAM;;;;EAInB;;;;;EAKA,kBAAkB;;;;;;;EAQlB,QAAQC,MAAI;;;;EAKZ;;;;EAIA;;;;;;EAMA,QAAQ;;;;;;;iBAQcC,0BAAwB,OAAO,uBAAoBD,MAAA;qBCvD9D,2BAA2BE;qBAO3B,gCAAgCC"}
|
package/build/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e=function(){return null},t=function(){return null};export{e as SolidQueryDevtools,t as SolidQueryDevtoolsPanel};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["SolidQueryDevtoolsComp","SolidQueryDevtoolsCompPanel","SolidQueryDevtools","process","env","NODE_ENV","SolidQueryDevtoolsPanel","DevtoolsPanelOptions","SolidQueryDevtools","SolidQueryDevtoolsPanel"],"sources":["../src/index.tsx"],"sourcesContent":["import SolidQueryDevtoolsComp from './devtools'\nimport SolidQueryDevtoolsCompPanel from './devtoolsPanel'\n\nexport const SolidQueryDevtools: typeof SolidQueryDevtoolsComp =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : SolidQueryDevtoolsComp\n\nexport const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsCompPanel =\n process.env.NODE_ENV !== 'development'\n ? function () {\n return null\n }\n : SolidQueryDevtoolsCompPanel\n\nexport type { DevtoolsPanelOptions } from './devtoolsPanel'\n"],"mappings":"AAGA,MAAaE,EAEP,UAAY,CACV,OAAO,IACT,EAGOI,EAEP,UAAY,CACV,OAAO,IACT,E"}
|
package/build/index.jsx
CHANGED
|
@@ -1,33 +1,8 @@
|
|
|
1
|
-
import { isDev, isServer } from "solid-js/web";
|
|
2
|
-
import { createMemo, createSignal, onMount, sharedConfig, splitProps, untrack } from "solid-js";
|
|
3
|
-
// 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
|
-
*/
|
|
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
|
-
};
|
|
25
|
-
}
|
|
26
1
|
// src/index.tsx
|
|
27
|
-
const SolidQueryDevtools =
|
|
2
|
+
const SolidQueryDevtools = function() {
|
|
28
3
|
return null;
|
|
29
4
|
};
|
|
30
|
-
const SolidQueryDevtoolsPanel =
|
|
5
|
+
const SolidQueryDevtoolsPanel = function() {
|
|
31
6
|
return null;
|
|
32
7
|
};
|
|
33
8
|
export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query-devtools",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.106.1",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack/solid-query Query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,25 +38,26 @@
|
|
|
38
38
|
},
|
|
39
39
|
"require": "./build/index.cjs"
|
|
40
40
|
},
|
|
41
|
+
"sideEffects": false,
|
|
41
42
|
"files": [
|
|
42
43
|
"build",
|
|
43
44
|
"src",
|
|
44
45
|
"!src/__tests__"
|
|
45
46
|
],
|
|
46
47
|
"dependencies": {
|
|
47
|
-
"@tanstack/query-devtools": "5.
|
|
48
|
+
"@tanstack/query-devtools": "5.106.1"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@solidjs/testing-library": "^0.8.10",
|
|
51
|
-
"@tanstack/solid-query": "5.
|
|
52
|
+
"@tanstack/solid-query": "5.106.1",
|
|
52
53
|
"eslint-plugin-solid": "^0.18.1",
|
|
53
|
-
"solid-js": "^1.9.
|
|
54
|
+
"solid-js": "^1.9.18",
|
|
54
55
|
"typescript": "6.0.3",
|
|
55
56
|
"unplugin-solid": "^2.0.0",
|
|
56
|
-
"vite-plugin-solid": "^2.11.
|
|
57
|
+
"vite-plugin-solid": "^2.11.15"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
|
-
"@tanstack/solid-query": "^5.
|
|
60
|
+
"@tanstack/solid-query": "^5.106.1",
|
|
60
61
|
"solid-js": "^1.6.0"
|
|
61
62
|
},
|
|
62
63
|
"scripts": {
|
package/src/devtoolsPanel.tsx
CHANGED
|
@@ -29,7 +29,7 @@ export interface DevtoolsPanelOptions {
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Custom styles for the devtools panel
|
|
32
|
-
* @default { height: '
|
|
32
|
+
* @default { height: '100%', display: 'flex', 'flex-direction': 'column' }
|
|
33
33
|
* @example { height: '100%' }
|
|
34
34
|
* @example { height: '100%', width: '100%' }
|
|
35
35
|
*/
|
|
@@ -98,7 +98,12 @@ export default function SolidQueryDevtoolsPanel(props: DevtoolsPanelOptions) {
|
|
|
98
98
|
|
|
99
99
|
return (
|
|
100
100
|
<div
|
|
101
|
-
style={{
|
|
101
|
+
style={{
|
|
102
|
+
height: '100%',
|
|
103
|
+
display: 'flex',
|
|
104
|
+
'flex-direction': 'column',
|
|
105
|
+
...props.style,
|
|
106
|
+
}}
|
|
102
107
|
class="tsqd-parent-container"
|
|
103
108
|
ref={ref}
|
|
104
109
|
/>
|
package/src/index.tsx
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import type SolidQueryDevtoolsComp from './devtools'
|
|
4
|
-
import type SolidQueryDevtoolsCompPanel from './devtoolsPanel'
|
|
1
|
+
import SolidQueryDevtoolsComp from './devtools'
|
|
2
|
+
import SolidQueryDevtoolsCompPanel from './devtoolsPanel'
|
|
5
3
|
|
|
6
|
-
export const SolidQueryDevtools: typeof SolidQueryDevtoolsComp =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
export const SolidQueryDevtools: typeof SolidQueryDevtoolsComp =
|
|
5
|
+
process.env.NODE_ENV !== 'development'
|
|
6
|
+
? function () {
|
|
7
|
+
return null
|
|
8
|
+
}
|
|
9
|
+
: SolidQueryDevtoolsComp
|
|
11
10
|
|
|
12
|
-
export const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsCompPanel =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
export const SolidQueryDevtoolsPanel: typeof SolidQueryDevtoolsCompPanel =
|
|
12
|
+
process.env.NODE_ENV !== 'development'
|
|
13
|
+
? function () {
|
|
14
|
+
return null
|
|
15
|
+
}
|
|
16
|
+
: SolidQueryDevtoolsCompPanel
|
|
17
17
|
|
|
18
18
|
export type { DevtoolsPanelOptions } from './devtoolsPanel'
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
let solid_js_web = require("solid-js/web");
|
|
2
|
-
let solid_js = require("solid-js");
|
|
3
|
-
let _tanstack_solid_query = require("@tanstack/solid-query");
|
|
4
|
-
let _tanstack_query_devtools = require("@tanstack/query-devtools");
|
|
5
|
-
// src/devtools.tsx
|
|
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
|
-
*/
|
|
13
|
-
function SolidQueryDevtools(props) {
|
|
14
|
-
const queryClient = (0, _tanstack_solid_query.useQueryClient)(props.client);
|
|
15
|
-
const client = (0, solid_js.createMemo)(() => queryClient);
|
|
16
|
-
let ref;
|
|
17
|
-
const devtools = new _tanstack_query_devtools.TanstackQueryDevtools({
|
|
18
|
-
client: client(),
|
|
19
|
-
queryFlavor: "Solid Query",
|
|
20
|
-
version: "5",
|
|
21
|
-
onlineManager: _tanstack_solid_query.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
|
-
(0, solid_js.createEffect)(() => {
|
|
32
|
-
devtools.setClient(client());
|
|
33
|
-
});
|
|
34
|
-
(0, solid_js.createEffect)(() => {
|
|
35
|
-
const buttonPos = props.buttonPosition;
|
|
36
|
-
if (buttonPos) devtools.setButtonPosition(buttonPos);
|
|
37
|
-
});
|
|
38
|
-
(0, solid_js.createEffect)(() => {
|
|
39
|
-
const pos = props.position;
|
|
40
|
-
if (pos) devtools.setPosition(pos);
|
|
41
|
-
});
|
|
42
|
-
(0, solid_js.createEffect)(() => {
|
|
43
|
-
devtools.setInitialIsOpen(props.initialIsOpen || false);
|
|
44
|
-
});
|
|
45
|
-
(0, solid_js.createEffect)(() => {
|
|
46
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
47
|
-
});
|
|
48
|
-
(0, solid_js.createEffect)(() => {
|
|
49
|
-
devtools.setTheme(props.theme);
|
|
50
|
-
});
|
|
51
|
-
(0, solid_js.onMount)(() => {
|
|
52
|
-
devtools.mount(ref);
|
|
53
|
-
(0, solid_js.onCleanup)(() => devtools.unmount());
|
|
54
|
-
});
|
|
55
|
-
return (() => {
|
|
56
|
-
var _el$ = _tmpl$();
|
|
57
|
-
var _ref$ = ref;
|
|
58
|
-
typeof _ref$ === "function" ? (0, solid_js_web.use)(_ref$, _el$) : ref = _el$;
|
|
59
|
-
return _el$;
|
|
60
|
-
})();
|
|
61
|
-
}
|
|
62
|
-
exports.default = SolidQueryDevtools;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
|
|
2
|
-
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
3
|
-
import { TanstackQueryDevtools } from "@tanstack/query-devtools";
|
|
4
|
-
// src/devtools.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
7
|
-
* nearest `QueryClient`.
|
|
8
|
-
* @param props - The devtools options.
|
|
9
|
-
* @returns The element the devtools are mounted in.
|
|
10
|
-
*/
|
|
11
|
-
function SolidQueryDevtools(props) {
|
|
12
|
-
const queryClient = useQueryClient(props.client);
|
|
13
|
-
const client = createMemo(() => queryClient);
|
|
14
|
-
let ref;
|
|
15
|
-
const devtools = new TanstackQueryDevtools({
|
|
16
|
-
client: client(),
|
|
17
|
-
queryFlavor: "Solid Query",
|
|
18
|
-
version: "5",
|
|
19
|
-
onlineManager,
|
|
20
|
-
buttonPosition: props.buttonPosition,
|
|
21
|
-
position: props.position,
|
|
22
|
-
initialIsOpen: props.initialIsOpen,
|
|
23
|
-
errorTypes: props.errorTypes,
|
|
24
|
-
styleNonce: props.styleNonce,
|
|
25
|
-
shadowDOMTarget: props.shadowDOMTarget,
|
|
26
|
-
hideDisabledQueries: props.hideDisabledQueries,
|
|
27
|
-
theme: props.theme
|
|
28
|
-
});
|
|
29
|
-
createEffect(() => {
|
|
30
|
-
devtools.setClient(client());
|
|
31
|
-
});
|
|
32
|
-
createEffect(() => {
|
|
33
|
-
const buttonPos = props.buttonPosition;
|
|
34
|
-
if (buttonPos) devtools.setButtonPosition(buttonPos);
|
|
35
|
-
});
|
|
36
|
-
createEffect(() => {
|
|
37
|
-
const pos = props.position;
|
|
38
|
-
if (pos) devtools.setPosition(pos);
|
|
39
|
-
});
|
|
40
|
-
createEffect(() => {
|
|
41
|
-
devtools.setInitialIsOpen(props.initialIsOpen || false);
|
|
42
|
-
});
|
|
43
|
-
createEffect(() => {
|
|
44
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
45
|
-
});
|
|
46
|
-
createEffect(() => {
|
|
47
|
-
devtools.setTheme(props.theme);
|
|
48
|
-
});
|
|
49
|
-
onMount(() => {
|
|
50
|
-
devtools.mount(ref);
|
|
51
|
-
onCleanup(() => devtools.unmount());
|
|
52
|
-
});
|
|
53
|
-
return <div class="tsqd-parent-container" ref={ref} />;
|
|
54
|
-
}
|
|
55
|
-
export { SolidQueryDevtools as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require("solid-js/web"),t=require("solid-js"),n=require("@tanstack/solid-query"),r=require("@tanstack/query-devtools");var i=/*#__PURE__*/ (0,e.template)(`<div class=tsqd-parent-container>`);function a(a){let o=(0,n.useQueryClient)(a.client),s=(0,t.createMemo)(()=>o),c,l=new r.TanstackQueryDevtools({client:s(),queryFlavor:`Solid Query`,version:`5`,onlineManager:n.onlineManager,buttonPosition:a.buttonPosition,position:a.position,initialIsOpen:a.initialIsOpen,errorTypes:a.errorTypes,styleNonce:a.styleNonce,shadowDOMTarget:a.shadowDOMTarget,hideDisabledQueries:a.hideDisabledQueries,theme:a.theme});return(0,t.createEffect)(()=>{l.setClient(s())}),(0,t.createEffect)(()=>{let e=a.buttonPosition;e&&l.setButtonPosition(e)}),(0,t.createEffect)(()=>{let e=a.position;e&&l.setPosition(e)}),(0,t.createEffect)(()=>{l.setInitialIsOpen(a.initialIsOpen||!1)}),(0,t.createEffect)(()=>{l.setErrorTypes(a.errorTypes||[])}),(0,t.createEffect)(()=>{l.setTheme(a.theme)}),(0,t.onMount)(()=>{l.mount(c),(0,t.onCleanup)(()=>l.unmount())}),(()=>{var t=i(),n=c;return typeof n==`function`?(0,e.use)(n,t):c=t,t})()}exports.default=a;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { template, use } from "solid-js/web";
|
|
2
|
-
import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
|
|
3
|
-
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
4
|
-
import { TanstackQueryDevtools } from "@tanstack/query-devtools";
|
|
5
|
-
// src/devtools.tsx
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/ template(`<div class=tsqd-parent-container>`);
|
|
7
|
-
/**
|
|
8
|
-
* Renders the TanStack Query devtools, with a toggle button that opens them, for the given or
|
|
9
|
-
* nearest `QueryClient`.
|
|
10
|
-
* @param props - The devtools options.
|
|
11
|
-
* @returns The element the devtools are mounted in.
|
|
12
|
-
*/
|
|
13
|
-
function SolidQueryDevtools(props) {
|
|
14
|
-
const queryClient = useQueryClient(props.client);
|
|
15
|
-
const client = createMemo(() => queryClient);
|
|
16
|
-
let ref;
|
|
17
|
-
const devtools = new TanstackQueryDevtools({
|
|
18
|
-
client: client(),
|
|
19
|
-
queryFlavor: "Solid Query",
|
|
20
|
-
version: "5",
|
|
21
|
-
onlineManager,
|
|
22
|
-
buttonPosition: props.buttonPosition,
|
|
23
|
-
position: props.position,
|
|
24
|
-
initialIsOpen: props.initialIsOpen,
|
|
25
|
-
errorTypes: props.errorTypes,
|
|
26
|
-
styleNonce: props.styleNonce,
|
|
27
|
-
shadowDOMTarget: props.shadowDOMTarget,
|
|
28
|
-
hideDisabledQueries: props.hideDisabledQueries,
|
|
29
|
-
theme: props.theme
|
|
30
|
-
});
|
|
31
|
-
createEffect(() => {
|
|
32
|
-
devtools.setClient(client());
|
|
33
|
-
});
|
|
34
|
-
createEffect(() => {
|
|
35
|
-
const buttonPos = props.buttonPosition;
|
|
36
|
-
if (buttonPos) devtools.setButtonPosition(buttonPos);
|
|
37
|
-
});
|
|
38
|
-
createEffect(() => {
|
|
39
|
-
const pos = props.position;
|
|
40
|
-
if (pos) devtools.setPosition(pos);
|
|
41
|
-
});
|
|
42
|
-
createEffect(() => {
|
|
43
|
-
devtools.setInitialIsOpen(props.initialIsOpen || false);
|
|
44
|
-
});
|
|
45
|
-
createEffect(() => {
|
|
46
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
47
|
-
});
|
|
48
|
-
createEffect(() => {
|
|
49
|
-
devtools.setTheme(props.theme);
|
|
50
|
-
});
|
|
51
|
-
onMount(() => {
|
|
52
|
-
devtools.mount(ref);
|
|
53
|
-
onCleanup(() => devtools.unmount());
|
|
54
|
-
});
|
|
55
|
-
return (() => {
|
|
56
|
-
var _el$ = _tmpl$();
|
|
57
|
-
var _ref$ = ref;
|
|
58
|
-
typeof _ref$ === "function" ? use(_ref$, _el$) : ref = _el$;
|
|
59
|
-
return _el$;
|
|
60
|
-
})();
|
|
61
|
-
}
|
|
62
|
-
export { SolidQueryDevtools as default };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{template as e,use as t}from"solid-js/web";import{createEffect as n,createMemo as r,onCleanup as i,onMount as a}from"solid-js";import{onlineManager as o,useQueryClient as s}from"@tanstack/solid-query";import{TanstackQueryDevtools as c}from"@tanstack/query-devtools";var l=/*#__PURE__*/ e(`<div class=tsqd-parent-container>`);function u(e){let u=s(e.client),d=r(()=>u),f,p=new c({client:d(),queryFlavor:`Solid Query`,version:`5`,onlineManager:o,buttonPosition:e.buttonPosition,position:e.position,initialIsOpen:e.initialIsOpen,errorTypes:e.errorTypes,styleNonce:e.styleNonce,shadowDOMTarget:e.shadowDOMTarget,hideDisabledQueries:e.hideDisabledQueries,theme:e.theme});return n(()=>{p.setClient(d())}),n(()=>{let t=e.buttonPosition;t&&p.setButtonPosition(t)}),n(()=>{let t=e.position;t&&p.setPosition(t)}),n(()=>{p.setInitialIsOpen(e.initialIsOpen||!1)}),n(()=>{p.setErrorTypes(e.errorTypes||[])}),n(()=>{p.setTheme(e.theme)}),a(()=>{p.mount(f),i(()=>p.unmount())}),(()=>{var e=l(),n=f;return typeof n==`function`?t(n,e):f=e,e})()}export{u as default};
|
|
2
|
-
//# sourceMappingURL=devtools-DWG-IwnT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devtools-DWG-IwnT.js","names":["createEffect","createMemo","onCleanup","onMount","onlineManager","useQueryClient","TanstackQueryDevtools","DevtoolsButtonPosition","DevtoolsErrorType","DevtoolsPosition","Theme","QueryClient","DevtoolsOptions","initialIsOpen","buttonPosition","position","client","errorTypes","Array","styleNonce","shadowDOMTarget","ShadowRoot","hideDisabledQueries","theme","SolidQueryDevtools","props","queryClient","ref","HTMLDivElement","devtools","queryFlavor","version","setClient","buttonPos","setButtonPosition","pos","setPosition","setInitialIsOpen","setErrorTypes","setTheme","mount","unmount","_el$","_tmpl$","_ref$","_$use","_$use","_tmpl$","SolidQueryDevtools","queryClient","useQueryClient","props","client","createMemo","ref","devtools","TanstackQueryDevtools","createEffect","buttonPos","pos","onMount","onCleanup","_el$","_ref$","use"],"sources":["../src/devtools.tsx"],"sourcesContent":["import { createEffect, createMemo, onCleanup, onMount } from 'solid-js'\nimport { onlineManager, useQueryClient } from '@tanstack/solid-query'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsErrorType,\n DevtoolsPosition,\n Theme,\n} from '@tanstack/query-devtools'\nimport type { QueryClient } from '@tanstack/solid-query'\n\ninterface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the TanStack logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'\n * @defaultValue bottom-right\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the Solid Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * @defaultValue bottom\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: Array<DevtoolsErrorType>\n /**\n * Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.\n */\n styleNonce?: string\n /**\n * Use this to pass a shadow DOM target to the devtools so that the styles will be applied\n * within the shadow DOM instead of within the head tag in the light DOM.\n */\n shadowDOMTarget?: ShadowRoot\n /**\n * Set this to true to hide disabled queries from the devtools panel.\n */\n hideDisabledQueries?: boolean\n /**\n * Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.\n * This overrides the theme selected in the devtools Settings menu. When omitted, the\n * selected theme is used, or `'system'` if none is selected.\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools, with a toggle button that opens them, for the given or\n * nearest `QueryClient`.\n * @param props - The devtools options.\n * @returns The element the devtools are mounted in.\n */\nexport default function SolidQueryDevtools(props: DevtoolsOptions) {\n const queryClient = useQueryClient(props.client)\n const client = createMemo(() => queryClient)\n let ref!: HTMLDivElement\n const devtools = new TanstackQueryDevtools({\n client: client(),\n queryFlavor: 'Solid Query',\n version: '5',\n onlineManager,\n buttonPosition: props.buttonPosition,\n position: props.position,\n initialIsOpen: props.initialIsOpen,\n errorTypes: props.errorTypes,\n styleNonce: props.styleNonce,\n shadowDOMTarget: props.shadowDOMTarget,\n hideDisabledQueries: props.hideDisabledQueries,\n theme: props.theme,\n })\n\n createEffect(() => {\n devtools.setClient(client())\n })\n\n createEffect(() => {\n const buttonPos = props.buttonPosition\n if (buttonPos) {\n devtools.setButtonPosition(buttonPos)\n }\n })\n\n createEffect(() => {\n const pos = props.position\n if (pos) {\n devtools.setPosition(pos)\n }\n })\n\n createEffect(() => {\n devtools.setInitialIsOpen(props.initialIsOpen || false)\n })\n\n createEffect(() => {\n devtools.setErrorTypes(props.errorTypes || [])\n })\n\n createEffect(() => {\n devtools.setTheme(props.theme)\n })\n\n onMount(() => {\n devtools.mount(ref)\n onCleanup(() => devtools.unmount())\n })\n\n return <div class=\"tsqd-parent-container\" ref={ref} />\n}\n"],"mappings":"A,2UA+DA,SAAwBwB,EAAmBC,EAAwB,CACjE,IAAMC,EAAcrB,EAAeoB,EAAMT,MAAM,EACzCA,EAASf,MAAiByB,CAAW,EACvCC,EACEE,EAAW,IAAIvB,EAAsB,CACzCU,OAAQA,EAAO,EACfc,YAAa,cACbC,QAAS,IACT3B,gBACAU,eAAgBW,EAAMX,eACtBC,SAAUU,EAAMV,SAChBF,cAAeY,EAAMZ,cACrBI,WAAYQ,EAAMR,WAClBE,WAAYM,EAAMN,WAClBC,gBAAiBK,EAAML,gBACvBE,oBAAqBG,EAAMH,oBAC3BC,MAAOE,EAAMF,KACf,CAAC,EAqCD,OAnCAvB,MAAmB,CACjB6B,EAASG,UAAUhB,EAAO,CAAC,CAC7B,CAAC,EAEDhB,MAAmB,CACjB,IAAMiC,EAAYR,EAAMX,eACpBmB,GACFJ,EAASK,kBAAkBD,CAAS,CAExC,CAAC,EAEDjC,MAAmB,CACjB,IAAMmC,EAAMV,EAAMV,SACdoB,GACFN,EAASO,YAAYD,CAAG,CAE5B,CAAC,EAEDnC,MAAmB,CACjB6B,EAASQ,iBAAiBZ,EAAMZ,eAAiB,EAAK,CACxD,CAAC,EAEDb,MAAmB,CACjB6B,EAASS,cAAcb,EAAMR,YAAc,CAAA,CAAE,CAC/C,CAAC,EAEDjB,MAAmB,CACjB6B,EAASU,SAASd,EAAMF,KAAK,CAC/B,CAAC,EAEDpB,MAAc,CACZ0B,EAASW,MAAMb,CAAG,EAClBzB,MAAgB2B,EAASY,QAAQ,CAAC,CACpC,CAAC,OAED,CAAA,IAAAC,EAAAC,EAAA,EAAAC,EAA+CjB,EAAG,OAAA,OAAAiB,GAAA,WAAAC,EAAAD,EAAAF,CAAA,EAAHf,EAAGe,EAAAA,CAAA,EAAA,CAAA,CACpD,C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{effect as e,style as t,template as n,use as r}from"solid-js/web";import{createEffect as i,createMemo as a,onCleanup as o,onMount as s}from"solid-js";import{onlineManager as c,useQueryClient as l}from"@tanstack/solid-query";import{TanstackQueryDevtoolsPanel as u}from"@tanstack/query-devtools";var d=/*#__PURE__*/ n(`<div class=tsqd-parent-container style=height:500px>`);function f(n){let f=l(n.client),p=a(()=>f),m,{errorTypes:h,styleNonce:g,shadowDOMTarget:_,hideDisabledQueries:v}=n,y=new u({client:p(),queryFlavor:`Solid Query`,version:`5`,onlineManager:c,buttonPosition:`bottom-left`,position:`bottom`,initialIsOpen:!0,errorTypes:h,styleNonce:g,shadowDOMTarget:_,onClose:n.onClose,hideDisabledQueries:v,theme:n.theme});return i(()=>{y.setClient(p())}),i(()=>{y.setOnClose(n.onClose??(()=>{}))}),i(()=>{y.setErrorTypes(n.errorTypes||[])}),i(()=>{y.setTheme(n.theme)}),s(()=>{y.mount(m),o(()=>y.unmount())}),(()=>{var i=d(),a=m;return typeof a==`function`?r(a,i):m=i,e(e=>t(i,{...n.style},e)),i})()}export{f as default};
|
|
2
|
-
//# sourceMappingURL=devtoolsPanel-B_UgyNNb.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devtoolsPanel-B_UgyNNb.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 * This overrides the theme selected in the devtools Settings menu. When omitted, the\n * selected theme is used, or `'system'` if none is selected.\n */\n theme?: Theme\n}\n\n/**\n * Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.\n * @param props - The devtools panel options.\n * @returns The element the devtools panel is mounted in.\n */\nexport default function SolidQueryDevtoolsPanel(props: DevtoolsPanelOptions) {\n const queryClient = useQueryClient(props.client)\n const client = createMemo(() => queryClient)\n let ref!: HTMLDivElement\n const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props\n const devtools = new TanstackQueryDevtoolsPanel({\n client: client(),\n queryFlavor: 'Solid Query',\n version: '5',\n onlineManager,\n buttonPosition: 'bottom-left',\n position: 'bottom',\n initialIsOpen: true,\n errorTypes,\n styleNonce,\n shadowDOMTarget,\n onClose: props.onClose,\n hideDisabledQueries,\n theme: props.theme,\n })\n createEffect(() => {\n devtools.setClient(client())\n })\n createEffect(() => {\n devtools.setOnClose(props.onClose ?? (() => {}))\n })\n\n createEffect(() => {\n devtools.setErrorTypes(props.errorTypes || [])\n })\n\n createEffect(() => {\n devtools.setTheme(props.theme)\n })\n\n onMount(() => {\n devtools.mount(ref)\n onCleanup(() => devtools.unmount())\n })\n\n return (\n <div\n style={{ height: '500px', ...props.style }}\n class=\"tsqd-parent-container\"\n ref={ref}\n />\n )\n}\n"],"mappings":"A,0XA0DA,SAAwBuB,EAAwBC,EAA6B,CAC3E,IAAMC,EAAcpB,EAAemB,EAAMZ,MAAM,EACzCA,EAASX,MAAiBwB,CAAW,EACvCC,EACE,CAAEb,aAAYE,aAAYC,kBAAiBK,uBAAwBG,EACnEI,EAAW,IAAItB,EAA2B,CAC9CM,OAAQA,EAAO,EACfiB,YAAa,cACbC,QAAS,IACT1B,gBACA2B,eAAgB,cAChBC,SAAU,SACVC,cAAe,GACfpB,aACAE,aACAC,kBACAI,QAASI,EAAMJ,QACfC,sBACAC,MAAOE,EAAMF,KACf,CAAC,EAqBD,OApBAtB,MAAmB,CACjB4B,EAASM,UAAUtB,EAAO,CAAC,CAC7B,CAAC,EACDZ,MAAmB,CACjB4B,EAASO,WAAWX,EAAMJ,cAAkB,CAAC,EAAE,CACjD,CAAC,EAEDpB,MAAmB,CACjB4B,EAASQ,cAAcZ,EAAMX,YAAc,CAAA,CAAE,CAC/C,CAAC,EAEDb,MAAmB,CACjB4B,EAASS,SAASb,EAAMF,KAAK,CAC/B,CAAC,EAEDnB,MAAc,CACZyB,EAASU,MAAMZ,CAAG,EAClBxB,MAAgB0B,EAASW,QAAQ,CAAC,CACpC,CAAC,OAED,CAAA,IAAAC,EAAAC,EAAA,EAAAC,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,C"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
let solid_js_web = require("solid-js/web");
|
|
2
|
-
let solid_js = require("solid-js");
|
|
3
|
-
let _tanstack_solid_query = require("@tanstack/solid-query");
|
|
4
|
-
let _tanstack_query_devtools = require("@tanstack/query-devtools");
|
|
5
|
-
// src/devtoolsPanel.tsx
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/ (0, solid_js_web.template)(`<div class=tsqd-parent-container style=height: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
|
-
*/
|
|
12
|
-
function SolidQueryDevtoolsPanel(props) {
|
|
13
|
-
const queryClient = (0, _tanstack_solid_query.useQueryClient)(props.client);
|
|
14
|
-
const client = (0, solid_js.createMemo)(() => queryClient);
|
|
15
|
-
let ref;
|
|
16
|
-
const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
|
|
17
|
-
const devtools = new _tanstack_query_devtools.TanstackQueryDevtoolsPanel({
|
|
18
|
-
client: client(),
|
|
19
|
-
queryFlavor: "Solid Query",
|
|
20
|
-
version: "5",
|
|
21
|
-
onlineManager: _tanstack_solid_query.onlineManager,
|
|
22
|
-
buttonPosition: "bottom-left",
|
|
23
|
-
position: "bottom",
|
|
24
|
-
initialIsOpen: true,
|
|
25
|
-
errorTypes,
|
|
26
|
-
styleNonce,
|
|
27
|
-
shadowDOMTarget,
|
|
28
|
-
onClose: props.onClose,
|
|
29
|
-
hideDisabledQueries,
|
|
30
|
-
theme: props.theme
|
|
31
|
-
});
|
|
32
|
-
(0, solid_js.createEffect)(() => {
|
|
33
|
-
devtools.setClient(client());
|
|
34
|
-
});
|
|
35
|
-
(0, solid_js.createEffect)(() => {
|
|
36
|
-
devtools.setOnClose(props.onClose ?? (() => {}));
|
|
37
|
-
});
|
|
38
|
-
(0, solid_js.createEffect)(() => {
|
|
39
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
40
|
-
});
|
|
41
|
-
(0, solid_js.createEffect)(() => {
|
|
42
|
-
devtools.setTheme(props.theme);
|
|
43
|
-
});
|
|
44
|
-
(0, solid_js.onMount)(() => {
|
|
45
|
-
devtools.mount(ref);
|
|
46
|
-
(0, solid_js.onCleanup)(() => devtools.unmount());
|
|
47
|
-
});
|
|
48
|
-
return (() => {
|
|
49
|
-
var _el$ = _tmpl$();
|
|
50
|
-
var _ref$ = ref;
|
|
51
|
-
typeof _ref$ === "function" ? (0, solid_js_web.use)(_ref$, _el$) : ref = _el$;
|
|
52
|
-
(0, solid_js_web.effect)((_$p) => (0, solid_js_web.style)(_el$, { ...props.style }, _$p));
|
|
53
|
-
return _el$;
|
|
54
|
-
})();
|
|
55
|
-
}
|
|
56
|
-
exports.default = SolidQueryDevtoolsPanel;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { effect, style, template, use } from "solid-js/web";
|
|
2
|
-
import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
|
|
3
|
-
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
4
|
-
import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
|
|
5
|
-
// src/devtoolsPanel.tsx
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/ template(`<div class=tsqd-parent-container style=height: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
|
-
*/
|
|
12
|
-
function SolidQueryDevtoolsPanel(props) {
|
|
13
|
-
const queryClient = useQueryClient(props.client);
|
|
14
|
-
const client = createMemo(() => queryClient);
|
|
15
|
-
let ref;
|
|
16
|
-
const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
|
|
17
|
-
const devtools = new TanstackQueryDevtoolsPanel({
|
|
18
|
-
client: client(),
|
|
19
|
-
queryFlavor: "Solid Query",
|
|
20
|
-
version: "5",
|
|
21
|
-
onlineManager,
|
|
22
|
-
buttonPosition: "bottom-left",
|
|
23
|
-
position: "bottom",
|
|
24
|
-
initialIsOpen: true,
|
|
25
|
-
errorTypes,
|
|
26
|
-
styleNonce,
|
|
27
|
-
shadowDOMTarget,
|
|
28
|
-
onClose: props.onClose,
|
|
29
|
-
hideDisabledQueries,
|
|
30
|
-
theme: props.theme
|
|
31
|
-
});
|
|
32
|
-
createEffect(() => {
|
|
33
|
-
devtools.setClient(client());
|
|
34
|
-
});
|
|
35
|
-
createEffect(() => {
|
|
36
|
-
devtools.setOnClose(props.onClose ?? (() => {}));
|
|
37
|
-
});
|
|
38
|
-
createEffect(() => {
|
|
39
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
40
|
-
});
|
|
41
|
-
createEffect(() => {
|
|
42
|
-
devtools.setTheme(props.theme);
|
|
43
|
-
});
|
|
44
|
-
onMount(() => {
|
|
45
|
-
devtools.mount(ref);
|
|
46
|
-
onCleanup(() => devtools.unmount());
|
|
47
|
-
});
|
|
48
|
-
return (() => {
|
|
49
|
-
var _el$ = _tmpl$();
|
|
50
|
-
var _ref$ = ref;
|
|
51
|
-
typeof _ref$ === "function" ? use(_ref$, _el$) : ref = _el$;
|
|
52
|
-
effect((_$p) => style(_el$, { ...props.style }, _$p));
|
|
53
|
-
return _el$;
|
|
54
|
-
})();
|
|
55
|
-
}
|
|
56
|
-
export { SolidQueryDevtoolsPanel as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require("solid-js/web"),t=require("solid-js"),n=require("@tanstack/solid-query"),r=require("@tanstack/query-devtools");var i=/*#__PURE__*/ (0,e.template)(`<div class=tsqd-parent-container style=height:500px>`);function a(a){let o=(0,n.useQueryClient)(a.client),s=(0,t.createMemo)(()=>o),c,{errorTypes:l,styleNonce:u,shadowDOMTarget:d,hideDisabledQueries:f}=a,p=new r.TanstackQueryDevtoolsPanel({client:s(),queryFlavor:`Solid Query`,version:`5`,onlineManager:n.onlineManager,buttonPosition:`bottom-left`,position:`bottom`,initialIsOpen:!0,errorTypes:l,styleNonce:u,shadowDOMTarget:d,onClose:a.onClose,hideDisabledQueries:f,theme:a.theme});return(0,t.createEffect)(()=>{p.setClient(s())}),(0,t.createEffect)(()=>{p.setOnClose(a.onClose??(()=>{}))}),(0,t.createEffect)(()=>{p.setErrorTypes(a.errorTypes||[])}),(0,t.createEffect)(()=>{p.setTheme(a.theme)}),(0,t.onMount)(()=>{p.mount(c),(0,t.onCleanup)(()=>p.unmount())}),(()=>{var t=i(),n=c;return typeof n==`function`?(0,e.use)(n,t):c=t,(0,e.effect)(n=>(0,e.style)(t,{...a.style},n)),t})()}exports.default=a;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
|
|
2
|
-
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
3
|
-
import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
|
|
4
|
-
// src/devtoolsPanel.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Renders the TanStack Query devtools panel inline, for the given or nearest `QueryClient`.
|
|
7
|
-
* @param props - The devtools panel options.
|
|
8
|
-
* @returns The element the devtools panel is mounted in.
|
|
9
|
-
*/
|
|
10
|
-
function SolidQueryDevtoolsPanel(props) {
|
|
11
|
-
const queryClient = useQueryClient(props.client);
|
|
12
|
-
const client = createMemo(() => queryClient);
|
|
13
|
-
let ref;
|
|
14
|
-
const { errorTypes, styleNonce, shadowDOMTarget, hideDisabledQueries } = props;
|
|
15
|
-
const devtools = new TanstackQueryDevtoolsPanel({
|
|
16
|
-
client: client(),
|
|
17
|
-
queryFlavor: "Solid Query",
|
|
18
|
-
version: "5",
|
|
19
|
-
onlineManager,
|
|
20
|
-
buttonPosition: "bottom-left",
|
|
21
|
-
position: "bottom",
|
|
22
|
-
initialIsOpen: true,
|
|
23
|
-
errorTypes,
|
|
24
|
-
styleNonce,
|
|
25
|
-
shadowDOMTarget,
|
|
26
|
-
onClose: props.onClose,
|
|
27
|
-
hideDisabledQueries,
|
|
28
|
-
theme: props.theme
|
|
29
|
-
});
|
|
30
|
-
createEffect(() => {
|
|
31
|
-
devtools.setClient(client());
|
|
32
|
-
});
|
|
33
|
-
createEffect(() => {
|
|
34
|
-
devtools.setOnClose(props.onClose ?? (() => {}));
|
|
35
|
-
});
|
|
36
|
-
createEffect(() => {
|
|
37
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
38
|
-
});
|
|
39
|
-
createEffect(() => {
|
|
40
|
-
devtools.setTheme(props.theme);
|
|
41
|
-
});
|
|
42
|
-
onMount(() => {
|
|
43
|
-
devtools.mount(ref);
|
|
44
|
-
onCleanup(() => devtools.unmount());
|
|
45
|
-
});
|
|
46
|
-
return <div style={{
|
|
47
|
-
height: "500px",
|
|
48
|
-
...props.style
|
|
49
|
-
}} class="tsqd-parent-container" ref={ref} />;
|
|
50
|
-
}
|
|
51
|
-
export { SolidQueryDevtoolsPanel as default };
|
package/src/clientOnly.tsx
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createMemo,
|
|
3
|
-
createSignal,
|
|
4
|
-
onMount,
|
|
5
|
-
sharedConfig,
|
|
6
|
-
splitProps,
|
|
7
|
-
untrack,
|
|
8
|
-
} from 'solid-js'
|
|
9
|
-
import { isServer } from 'solid-js/web'
|
|
10
|
-
import type { Component, ComponentProps, JSX } from 'solid-js'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This function has been taken from solid-start's codebase:
|
|
14
|
-
* <https://github.com/solidjs/solid-start/blob/2967fc2db3f0df826f061020231dbdafdfa0746b/packages/start/islands/clientOnly.tsx>.
|
|
15
|
-
* This allows the devtools to be loaded only on the client and bypasses any server side rendering.
|
|
16
|
-
* @param fn - Imports the module whose default export is the component.
|
|
17
|
-
* @returns A component that renders `fallback` on the server and while the module loads on the
|
|
18
|
-
* client, then the imported component.
|
|
19
|
-
*/
|
|
20
|
-
export default function clientOnly<T extends Component<any>>(
|
|
21
|
-
fn: () => Promise<{
|
|
22
|
-
default: T
|
|
23
|
-
}>,
|
|
24
|
-
) {
|
|
25
|
-
if (isServer)
|
|
26
|
-
return (props: ComponentProps<T> & { fallback?: JSX.Element }) =>
|
|
27
|
-
props.fallback
|
|
28
|
-
|
|
29
|
-
const [comp, setComp] = createSignal<T>()
|
|
30
|
-
fn().then((m) => setComp(() => m.default))
|
|
31
|
-
return (props: ComponentProps<T>) => {
|
|
32
|
-
let Comp: T | undefined
|
|
33
|
-
let m: boolean
|
|
34
|
-
const [, rest] = splitProps(props, ['fallback'])
|
|
35
|
-
if ((Comp = comp()) && !sharedConfig.context) return Comp(rest)
|
|
36
|
-
const [mounted, setMounted] = createSignal(!sharedConfig.context)
|
|
37
|
-
onMount(() => setMounted(true))
|
|
38
|
-
return createMemo(
|
|
39
|
-
() => (
|
|
40
|
-
(Comp = comp()),
|
|
41
|
-
(m = mounted()),
|
|
42
|
-
untrack(() => (Comp && m ? Comp(rest) : props.fallback))
|
|
43
|
-
),
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
}
|