@tanstack/solid-query-devtools 6.0.0-rc.5 → 6.0.0-rc.6
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/clientOnly-CEXX5Ps8.jsx +26 -0
- package/build/clientOnly-Cmw5kOEH.cjs +1 -0
- package/build/clientOnly-lrJ-FwVZ.js +2 -0
- package/build/clientOnly-lrJ-FwVZ.js.map +1 -0
- package/build/dev.cjs +29 -314
- package/build/dev.js +27 -23
- package/build/dev.jsx +27 -43
- package/build/devtools-BMem5cUa.jsx +62 -0
- package/build/devtools-DMwvwc4L.js +67 -0
- package/build/devtools-DPfipH2Y.js +2 -0
- package/build/devtools-DPfipH2Y.js.map +1 -0
- package/build/devtools-TPMm0sW8.cjs +1 -0
- package/build/devtools-m6r1o8lz.cjs +67 -0
- package/build/devtoolsPanel-BIXzHW6Y.cjs +1 -0
- package/build/devtoolsPanel-BbBQ7vKt.cjs +68 -0
- package/build/devtoolsPanel-CU_iFbJ3.jsx +62 -0
- package/build/devtoolsPanel-D71UlGwy.js +68 -0
- package/build/devtoolsPanel-DLEdindg.d.ts +106 -0
- package/build/devtoolsPanel-DLEdindg.d.ts.map +1 -0
- package/build/devtoolsPanel-Q67Cz4BM.d.cts +106 -0
- package/build/devtoolsPanel-Q67Cz4BM.d.cts.map +1 -0
- package/build/devtoolsPanel-hmH3gOTU.js +2 -0
- package/build/devtoolsPanel-hmH3gOTU.js.map +1 -0
- package/build/index.cjs +1 -288
- package/build/index.d.cts +5 -3
- package/build/index.d.cts.map +1 -0
- package/build/index.d.ts +5 -3
- package/build/index.d.ts.map +1 -0
- package/build/index.js +2 -29
- package/build/index.js.map +1 -0
- package/build/index.jsx +7 -46
- package/build/production.cjs +1 -0
- package/build/production.d.cts +5 -0
- package/build/production.d.cts.map +1 -0
- package/build/production.d.ts +5 -0
- package/build/production.d.ts.map +1 -0
- package/build/production.js +2 -0
- package/build/production.js.map +1 -0
- package/build/production.jsx +5 -0
- package/package.json +51 -40
- package/src/clientOnly.tsx +6 -5
- package/src/devtools.tsx +14 -6
- package/src/devtoolsPanel.tsx +20 -5
- package/src/production.tsx +12 -0
- package/build/_tsup-dts-rollup.d.cts +0 -109
- package/build/_tsup-dts-rollup.d.ts +0 -109
- package/build/chunk/L2WCKKHK.js +0 -94
- package/build/chunk/OQETK3NG.js +0 -123
- package/build/dev.d.cts +0 -3
- package/build/dev.d.ts +0 -3
- package/build/devtools/7WZM3IT7.jsx +0 -82
- package/build/devtools/V6WOBMVN.js +0 -68
- package/build/devtools/WQPACNKE.js +0 -68
- package/build/devtoolsPanel/6IZHMMFI.js +0 -71
- package/build/devtoolsPanel/FQC5JHFZ.jsx +0 -73
- package/build/devtoolsPanel/HZIEZL6U.js +0 -71
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { isServer } from "@solidjs/web";
|
|
2
|
+
import { createMemo, createSignal, isHydrating, omit, onSettled, untrack } from "solid-js";
|
|
3
|
+
// src/clientOnly.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Loads the devtools only on the client, so that they bypass any server side rendering. Taken from
|
|
6
|
+
* [solid-start's codebase](https://github.com/solidjs/solid-start/blob/2967fc2db3f0df826f061020231dbdafdfa0746b/packages/start/islands/clientOnly.tsx).
|
|
7
|
+
* @param fn - Dynamically imports the module whose default export is the component.
|
|
8
|
+
* @returns A component that renders `props.fallback` on the server and until the import resolves.
|
|
9
|
+
*/
|
|
10
|
+
function clientOnly(fn) {
|
|
11
|
+
if (isServer) return (props) => props.fallback;
|
|
12
|
+
const [comp, setComp] = createSignal();
|
|
13
|
+
fn().then((m) => setComp(() => m.default));
|
|
14
|
+
return (props) => {
|
|
15
|
+
let Comp;
|
|
16
|
+
let m;
|
|
17
|
+
const rest = omit(props, "fallback");
|
|
18
|
+
if ((Comp = comp()) && !isHydrating()) return Comp(rest);
|
|
19
|
+
const [mounted, setMounted] = createSignal(!isHydrating());
|
|
20
|
+
onSettled(() => {
|
|
21
|
+
setMounted(true);
|
|
22
|
+
});
|
|
23
|
+
return createMemo(() => (Comp = comp(), m = mounted(), untrack(() => Comp && m ? Comp(rest) : props.fallback)));
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export { clientOnly as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("@solidjs/web"),t=require("solid-js");function n(n){if(e.isServer)return e=>e.fallback;let[r,i]=(0,t.createSignal)();return n().then(e=>i(()=>e.default)),e=>{let n,i,a=(0,t.omit)(e,`fallback`);if((n=r())&&!(0,t.isHydrating)())return n(a);let[o,s]=(0,t.createSignal)(!(0,t.isHydrating)());return(0,t.onSettled)(()=>{s(!0)}),(0,t.createMemo)(()=>(n=r(),i=o(),(0,t.untrack)(()=>n&&i?n(a):e.fallback)))}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isServer as e}from"@solidjs/web";import{createMemo as t,createSignal as n,isHydrating as r,omit as i,onSettled as a,untrack as o}from"solid-js";function s(s){if(e)return e=>e.fallback;let[c,l]=n();return s().then(e=>l(()=>e.default)),e=>{let s,l,u=i(e,`fallback`);if((s=c())&&!r())return s(u);let[d,f]=n(!r());return a(()=>{f(!0)}),t(()=>(s=c(),l=d(),o(()=>s&&l?s(u):e.fallback)))}}export{s as t};
|
|
2
|
+
//# sourceMappingURL=clientOnly-lrJ-FwVZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientOnly-lrJ-FwVZ.js","names":["createMemo","createSignal","isHydrating","omit","onSettled","untrack","isServer","clientOnly","fn","props","fallback","comp","setComp","then","m","default","Comp","rest","mounted","setMounted","clientOnly","isServer","props","comp","setComp","createSignal","fn","m","Comp","rest","omit","isHydrating","mounted","setMounted","onSettled","createMemo","untrack"],"sources":["../src/clientOnly.tsx"],"sourcesContent":["import {\n createMemo,\n createSignal,\n isHydrating,\n omit,\n onSettled,\n untrack,\n} from 'solid-js'\nimport { isServer } from '@solidjs/web'\nimport type { Component, ComponentProps } from 'solid-js'\nimport type { JSX } from '@solidjs/web'\n\n/**\n * Loads the devtools only on the client, so that they bypass any server side rendering. Taken from\n * [solid-start's codebase](https://github.com/solidjs/solid-start/blob/2967fc2db3f0df826f061020231dbdafdfa0746b/packages/start/islands/clientOnly.tsx).\n * @param fn - Dynamically imports the module whose default export is the component.\n * @returns A component that renders `props.fallback` on the server and until the import resolves.\n */\nexport default function clientOnly<T extends Component<any>>(\n fn: () => Promise<{\n default: T\n }>,\n) {\n if (isServer)\n return (props: ComponentProps<T> & { fallback?: JSX.Element }) =>\n props.fallback\n\n const [comp, setComp] = createSignal<T>()\n fn().then((m) => setComp(() => m.default))\n return (props: ComponentProps<T>) => {\n let Comp: T | undefined\n let m: boolean\n const rest = omit(props, 'fallback')\n if ((Comp = comp()) && !isHydrating()) return Comp(rest)\n const [mounted, setMounted] = createSignal(!isHydrating())\n onSettled(() => {\n setMounted(true)\n })\n return createMemo(\n () => (\n (Comp = comp()),\n (m = mounted()),\n untrack(() => (Comp && m ? Comp(rest) : props.fallback))\n ),\n )\n }\n}\n"],"mappings":"A,uJAkBA,SAAwBO,EACtBC,EAGA,CACA,GAAIF,EACF,MAAQG,IACNA,EAAMC,SAEV,GAAM,CAACC,EAAMC,GAAWX,EAAgB,EAExC,OADAO,EAAG,CAAC,CAACK,KAAMC,GAAMF,MAAcE,EAAEC,OAAO,CAAC,EACjCN,GAA6B,CACnC,IAAIO,EACAF,EACEG,EAAOd,EAAKM,EAAO,UAAU,EACnC,IAAKO,EAAOL,EAAK,IAAM,CAACT,EAAY,EAAG,OAAOc,EAAKC,CAAI,EACvD,GAAM,CAACC,EAASC,GAAclB,EAAa,CAACC,EAAY,CAAC,EAIzD,OAHAE,MAAgB,CACde,EAAW,EAAI,CACjB,CAAC,EACMnB,OAEFgB,EAAOL,EAAK,EACZG,EAAII,EAAQ,EACbb,MAAeW,GAAQF,EAAIE,EAAKC,CAAI,EAAIR,EAAMC,QAAS,EAE3D,CACF,CACF,C"}
|
package/build/dev.cjs
CHANGED
|
@@ -1,320 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var internal = require('solid-js/internal');
|
|
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
|
-
function tagElement(node) {
|
|
18
|
-
if (bindingEffect !== null && bindingEffect._devElement === void 0) bindingEffect._devElement = node;
|
|
19
|
-
}
|
|
20
|
-
function effect(fn, effectFn, options) {
|
|
21
|
-
if (spreadName !== void 0 && (options === void 0 || options.name === void 0)) options = {
|
|
22
|
-
...options,
|
|
23
|
-
name: spreadName + ".spread"
|
|
24
|
-
};
|
|
25
|
-
const nodeOptions = options ? {
|
|
26
|
-
sync: true,
|
|
27
|
-
...options,
|
|
28
|
-
transparent: !options.scope
|
|
29
|
-
} : transparentOptions;
|
|
30
|
-
{
|
|
31
|
-
let node = null;
|
|
32
|
-
solidJs.createRenderEffect((prev) => {
|
|
33
|
-
node = solidJs.getOwner();
|
|
34
|
-
return fn(prev);
|
|
35
|
-
}, (value, prev) => {
|
|
36
|
-
const outer = bindingEffect;
|
|
37
|
-
bindingEffect = node;
|
|
38
|
-
try {
|
|
39
|
-
return effectFn(value, prev);
|
|
40
|
-
} finally {
|
|
41
|
-
bindingEffect = outer;
|
|
42
|
-
}
|
|
43
|
-
}, nodeOptions);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function create(html, bypassGuard, flag) {
|
|
48
|
-
if (isHydrating() && !bypassGuard) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
|
|
49
|
-
if (/^<(html|head|body)[\s>]/i.test(html)) throw new Error("Document shell templates (<html>, <head>, <body>) cannot be client-created: a <template> parse strips those tags. Render this component through hydrate(), where the document shell already exists.");
|
|
50
|
-
const t = document.createElement("template");
|
|
51
|
-
t.innerHTML = html;
|
|
52
|
-
return flag === 2 ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
53
|
-
}
|
|
54
|
-
function template(html, flag) {
|
|
55
|
-
let node;
|
|
56
|
-
const fn = flag === 1 ? (bypassGuard) => document.importNode(node || (node = create(html, bypassGuard, flag)), true) : (bypassGuard) => (node || (node = create(html, bypassGuard, flag))).cloneNode(true);
|
|
57
|
-
fn._html = html;
|
|
58
|
-
return fn;
|
|
59
|
-
}
|
|
60
|
-
function setAttribute(node, name, value) {
|
|
61
|
-
tagElement(node);
|
|
62
|
-
if (isHydrating(node)) return;
|
|
63
|
-
node.removeAttribute(name);
|
|
64
|
-
}
|
|
65
|
-
function style(node, value, prev) {
|
|
66
|
-
tagElement(node);
|
|
67
|
-
if (isHydrating(node)) return;
|
|
68
|
-
if (!value) {
|
|
69
|
-
if (prev || node._$styles) {
|
|
70
|
-
setAttribute(node, "style");
|
|
71
|
-
node._$styles = void 0;
|
|
72
|
-
}
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const nodeStyle = node.style;
|
|
76
|
-
if (typeof value === "string") {
|
|
77
|
-
node._$styles = void 0;
|
|
78
|
-
return nodeStyle.cssText = value;
|
|
79
|
-
}
|
|
80
|
-
if (typeof prev === "string") {
|
|
81
|
-
nodeStyle.cssText = "";
|
|
82
|
-
prev = void 0;
|
|
83
|
-
}
|
|
84
|
-
let applied = node._$styles;
|
|
85
|
-
if (!applied) {
|
|
86
|
-
applied = node._$styles = prev ? {
|
|
87
|
-
...prev
|
|
88
|
-
} : {};
|
|
89
|
-
}
|
|
90
|
-
let v, s;
|
|
91
|
-
for (s in applied) {
|
|
92
|
-
if (!hasOwn.call(value, s) || value[s] == null) {
|
|
93
|
-
nodeStyle.removeProperty(s);
|
|
94
|
-
delete applied[s];
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
for (s in value) {
|
|
98
|
-
if (!hasOwn.call(value, s)) continue;
|
|
99
|
-
v = value[s];
|
|
100
|
-
if (v != null && v !== applied[s]) {
|
|
101
|
-
nodeStyle.setProperty(s, v);
|
|
102
|
-
applied[s] = v;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function applyRef(r, element) {
|
|
107
|
-
Array.isArray(r) ? r.flat(Infinity).forEach((f) => f && f(element)) : r(element);
|
|
108
|
-
}
|
|
109
|
-
function ref(fn, element) {
|
|
110
|
-
const resolved = solidJs.untrack(fn);
|
|
111
|
-
solidJs.runWithOwner(null, () => applyRef(resolved, element));
|
|
112
|
-
}
|
|
113
|
-
function isHydrating(node) {
|
|
114
|
-
if (!internal.sharedConfig.hydrating) return false;
|
|
115
|
-
if (internal.sharedConfig.isClaiming && !internal.sharedConfig.isClaiming()) return false;
|
|
116
|
-
if (!node || node.isConnected) return true;
|
|
117
|
-
const roots = internal.sharedConfig.claimRoots;
|
|
118
|
-
if (roots) {
|
|
119
|
-
for (let i = 0; i < roots.length; i++) {
|
|
120
|
-
if (roots[i].contains(node)) return true;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
var transparentOptions, spreadName, bindingEffect, hasOwn, isServer, isDev;
|
|
126
|
-
var init_web_dev = __esm({
|
|
127
|
-
"../../node_modules/.pnpm/@solidjs+web@2.0.0-rc.13_solid-js@2.0.0-rc.13/node_modules/@solidjs/web/dist/web.dev.js"() {
|
|
128
|
-
transparentOptions = {
|
|
129
|
-
transparent: true,
|
|
130
|
-
sync: true
|
|
131
|
-
};
|
|
132
|
-
bindingEffect = null;
|
|
133
|
-
hasOwn = Object.prototype.hasOwnProperty;
|
|
134
|
-
isServer = false;
|
|
135
|
-
isDev = true;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
// src/devtools.tsx
|
|
140
|
-
var devtools_exports = {};
|
|
141
|
-
__export(devtools_exports, {
|
|
142
|
-
default: () => SolidQueryDevtools
|
|
143
|
-
});
|
|
144
|
-
function SolidQueryDevtools(props) {
|
|
145
|
-
const queryClient = solidQuery.useQueryClient(props.client);
|
|
146
|
-
const client = solidJs.createMemo(() => queryClient);
|
|
147
|
-
let ref2;
|
|
148
|
-
const devtools = new queryDevtools.TanstackQueryDevtools({
|
|
149
|
-
client: client(),
|
|
150
|
-
queryFlavor: "Solid Query",
|
|
151
|
-
version: "5",
|
|
152
|
-
onlineManager: solidQuery.onlineManager,
|
|
153
|
-
buttonPosition: props.buttonPosition,
|
|
154
|
-
position: props.position,
|
|
155
|
-
initialIsOpen: props.initialIsOpen,
|
|
156
|
-
errorTypes: props.errorTypes,
|
|
157
|
-
styleNonce: props.styleNonce,
|
|
158
|
-
shadowDOMTarget: props.shadowDOMTarget,
|
|
159
|
-
hideDisabledQueries: props.hideDisabledQueries,
|
|
160
|
-
theme: props.theme
|
|
161
|
-
});
|
|
162
|
-
solidJs.createEffect(() => client(), (c) => {
|
|
163
|
-
devtools.setClient(c);
|
|
164
|
-
});
|
|
165
|
-
solidJs.createEffect(() => props.buttonPosition, (buttonPos) => {
|
|
166
|
-
if (buttonPos) {
|
|
167
|
-
devtools.setButtonPosition(buttonPos);
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
solidJs.createEffect(() => props.position, (pos) => {
|
|
171
|
-
if (pos) {
|
|
172
|
-
devtools.setPosition(pos);
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
solidJs.createEffect(() => props.initialIsOpen, (initialIsOpen) => {
|
|
176
|
-
devtools.setInitialIsOpen(initialIsOpen || false);
|
|
177
|
-
});
|
|
178
|
-
solidJs.createEffect(() => props.errorTypes, (errorTypes) => {
|
|
179
|
-
devtools.setErrorTypes(errorTypes || []);
|
|
180
|
-
});
|
|
181
|
-
solidJs.createEffect(() => props.theme, (theme) => {
|
|
182
|
-
devtools.setTheme(theme || "system");
|
|
183
|
-
});
|
|
184
|
-
let mounted = false;
|
|
185
|
-
let disposed = false;
|
|
186
|
-
solidJs.onSettled(() => {
|
|
187
|
-
queueMicrotask(() => {
|
|
188
|
-
if (disposed) return;
|
|
189
|
-
solidJs.runWithOwner(null, () => devtools.mount(ref2));
|
|
190
|
-
mounted = true;
|
|
191
|
-
});
|
|
192
|
-
return () => {
|
|
193
|
-
disposed = true;
|
|
194
|
-
if (mounted) {
|
|
195
|
-
devtools.unmount();
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
});
|
|
199
|
-
var _el$ = _tmpl$();
|
|
200
|
-
var _ref$ = ref2;
|
|
201
|
-
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
202
|
-
return _el$;
|
|
203
|
-
}
|
|
204
|
-
var _tmpl$;
|
|
205
|
-
var init_devtools = __esm({
|
|
206
|
-
"src/devtools.tsx"() {
|
|
207
|
-
init_web_dev();
|
|
208
|
-
init_web_dev();
|
|
209
|
-
_tmpl$ = /* @__PURE__ */ template(`<div class=tsqd-parent-container>`);
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
// src/devtoolsPanel.tsx
|
|
214
|
-
var devtoolsPanel_exports = {};
|
|
215
|
-
__export(devtoolsPanel_exports, {
|
|
216
|
-
default: () => SolidQueryDevtoolsPanel
|
|
217
|
-
});
|
|
218
|
-
function SolidQueryDevtoolsPanel(props) {
|
|
219
|
-
const queryClient = solidQuery.useQueryClient(props.client);
|
|
220
|
-
const client = solidJs.createMemo(() => queryClient);
|
|
221
|
-
let ref2;
|
|
222
|
-
const {
|
|
223
|
-
errorTypes,
|
|
224
|
-
styleNonce,
|
|
225
|
-
shadowDOMTarget,
|
|
226
|
-
hideDisabledQueries
|
|
227
|
-
} = props;
|
|
228
|
-
const devtools = new queryDevtools.TanstackQueryDevtoolsPanel({
|
|
229
|
-
client: client(),
|
|
230
|
-
queryFlavor: "Solid Query",
|
|
231
|
-
version: "5",
|
|
232
|
-
onlineManager: solidQuery.onlineManager,
|
|
233
|
-
buttonPosition: "bottom-left",
|
|
234
|
-
position: "bottom",
|
|
235
|
-
initialIsOpen: true,
|
|
236
|
-
errorTypes,
|
|
237
|
-
styleNonce,
|
|
238
|
-
shadowDOMTarget,
|
|
239
|
-
onClose: props.onClose,
|
|
240
|
-
hideDisabledQueries,
|
|
241
|
-
theme: props.theme
|
|
242
|
-
});
|
|
243
|
-
solidJs.createEffect(() => client(), (c) => {
|
|
244
|
-
devtools.setClient(c);
|
|
245
|
-
});
|
|
246
|
-
solidJs.createEffect(() => props.onClose, (onClose) => {
|
|
247
|
-
devtools.setOnClose(onClose ?? (() => {
|
|
248
|
-
}));
|
|
249
|
-
});
|
|
250
|
-
solidJs.createEffect(() => props.errorTypes, (errorTypes2) => {
|
|
251
|
-
devtools.setErrorTypes(errorTypes2 || []);
|
|
252
|
-
});
|
|
253
|
-
solidJs.createEffect(() => props.theme, (theme) => {
|
|
254
|
-
devtools.setTheme(theme || "system");
|
|
255
|
-
});
|
|
256
|
-
let mounted = false;
|
|
257
|
-
let disposed = false;
|
|
258
|
-
solidJs.onSettled(() => {
|
|
259
|
-
queueMicrotask(() => {
|
|
260
|
-
if (disposed) return;
|
|
261
|
-
solidJs.runWithOwner(null, () => devtools.mount(ref2));
|
|
262
|
-
mounted = true;
|
|
263
|
-
});
|
|
264
|
-
return () => {
|
|
265
|
-
disposed = true;
|
|
266
|
-
if (mounted) {
|
|
267
|
-
devtools.unmount();
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
});
|
|
271
|
-
var _el$ = _tmpl$2();
|
|
272
|
-
var _ref$ = ref2;
|
|
273
|
-
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
274
|
-
effect(() => ({
|
|
275
|
-
...props.style
|
|
276
|
-
}), (_v$, _$p) => {
|
|
277
|
-
style(_el$, _v$, _$p);
|
|
278
|
-
});
|
|
279
|
-
return _el$;
|
|
280
|
-
}
|
|
281
|
-
var _tmpl$2;
|
|
282
|
-
var init_devtoolsPanel = __esm({
|
|
283
|
-
"src/devtoolsPanel.tsx"() {
|
|
284
|
-
init_web_dev();
|
|
285
|
-
init_web_dev();
|
|
286
|
-
init_web_dev();
|
|
287
|
-
init_web_dev();
|
|
288
|
-
_tmpl$2 = /* @__PURE__ */ template(`<div class=tsqd-parent-container style=height:500px>`);
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
// src/index.tsx
|
|
293
|
-
init_web_dev();
|
|
294
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _solidjs_web = require("@solidjs/web");
|
|
3
|
+
let solid_js = require("solid-js");
|
|
295
4
|
// src/clientOnly.tsx
|
|
296
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Loads the devtools only on the client, so that they bypass any server side rendering. Taken from
|
|
7
|
+
* [solid-start's codebase](https://github.com/solidjs/solid-start/blob/2967fc2db3f0df826f061020231dbdafdfa0746b/packages/start/islands/clientOnly.tsx).
|
|
8
|
+
* @param fn - Dynamically imports the module whose default export is the component.
|
|
9
|
+
* @returns A component that renders `props.fallback` on the server and until the import resolves.
|
|
10
|
+
*/
|
|
297
11
|
function clientOnly(fn) {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
12
|
+
if (_solidjs_web.isServer) return (props) => props.fallback;
|
|
13
|
+
const [comp, setComp] = (0, solid_js.createSignal)();
|
|
14
|
+
fn().then((m) => setComp(() => m.default));
|
|
15
|
+
return (props) => {
|
|
16
|
+
let Comp;
|
|
17
|
+
let m;
|
|
18
|
+
const rest = (0, solid_js.omit)(props, "fallback");
|
|
19
|
+
if ((Comp = comp()) && !(0, solid_js.isHydrating)()) return Comp(rest);
|
|
20
|
+
const [mounted, setMounted] = (0, solid_js.createSignal)(!(0, solid_js.isHydrating)());
|
|
21
|
+
(0, solid_js.onSettled)(() => {
|
|
22
|
+
setMounted(true);
|
|
23
|
+
});
|
|
24
|
+
return (0, solid_js.createMemo)(() => (Comp = comp(), m = mounted(), (0, solid_js.untrack)(() => Comp && m ? Comp(rest) : props.fallback)));
|
|
25
|
+
};
|
|
312
26
|
}
|
|
313
|
-
|
|
314
27
|
// src/index.tsx
|
|
315
|
-
|
|
316
|
-
|
|
28
|
+
const SolidQueryDevtools = _solidjs_web.isDev ? clientOnly(() => Promise.resolve().then(() => require("./devtools-m6r1o8lz.cjs"))) : function() {
|
|
29
|
+
return null;
|
|
317
30
|
};
|
|
318
|
-
|
|
319
|
-
|
|
31
|
+
const SolidQueryDevtoolsPanel = _solidjs_web.isDev ? clientOnly(() => Promise.resolve().then(() => require("./devtoolsPanel-BbBQ7vKt.cjs"))) : function() {
|
|
32
|
+
return null;
|
|
320
33
|
};
|
|
34
|
+
exports.SolidQueryDevtools = SolidQueryDevtools;
|
|
35
|
+
exports.SolidQueryDevtoolsPanel = SolidQueryDevtoolsPanel;
|
package/build/dev.js
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import { isDev, isServer } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { isDev, isServer } from "@solidjs/web";
|
|
2
|
+
import { createMemo, createSignal, isHydrating, omit, onSettled, untrack } from "solid-js";
|
|
3
|
+
// src/clientOnly.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Loads the devtools only on the client, so that they bypass any server side rendering. Taken from
|
|
6
|
+
* [solid-start's codebase](https://github.com/solidjs/solid-start/blob/2967fc2db3f0df826f061020231dbdafdfa0746b/packages/start/islands/clientOnly.tsx).
|
|
7
|
+
* @param fn - Dynamically imports the module whose default export is the component.
|
|
8
|
+
* @returns A component that renders `props.fallback` on the server and until the import resolves.
|
|
9
|
+
*/
|
|
4
10
|
function clientOnly(fn) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
if (isServer) return (props) => props.fallback;
|
|
12
|
+
const [comp, setComp] = createSignal();
|
|
13
|
+
fn().then((m) => setComp(() => m.default));
|
|
14
|
+
return (props) => {
|
|
15
|
+
let Comp;
|
|
16
|
+
let m;
|
|
17
|
+
const rest = omit(props, "fallback");
|
|
18
|
+
if ((Comp = comp()) && !isHydrating()) return Comp(rest);
|
|
19
|
+
const [mounted, setMounted] = createSignal(!isHydrating());
|
|
20
|
+
onSettled(() => {
|
|
21
|
+
setMounted(true);
|
|
22
|
+
});
|
|
23
|
+
return createMemo(() => (Comp = comp(), m = mounted(), untrack(() => Comp && m ? Comp(rest) : props.fallback)));
|
|
24
|
+
};
|
|
19
25
|
}
|
|
20
|
-
|
|
21
26
|
// src/index.tsx
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-DMwvwc4L.js")) : function() {
|
|
28
|
+
return null;
|
|
24
29
|
};
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-D71UlGwy.js")) : function() {
|
|
31
|
+
return null;
|
|
27
32
|
};
|
|
28
|
-
|
|
29
33
|
export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
|
package/build/dev.jsx
CHANGED
|
@@ -1,49 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent as createComponent2, getOwner as getOwner2, merge, untrack as untrack2 } from "solid-js";
|
|
4
|
-
import { sharedConfig, sourceKeys, SOURCE_PROXY, hasStaticKeys, resolvedTable, viewOf, OmitView, sourceHas, SOURCE_OMIT, sourceGet, SOURCE_MEMO, SOURCE_PLAIN, $DEVCOMP } from "solid-js/internal";
|
|
5
|
-
var FLASH_COOKIE = "flash";
|
|
6
|
-
var FLASH_MATCHER = new RegExp(`(?:^|;\\s*)${FLASH_COOKIE}=([^;]+)`);
|
|
7
|
-
var isServer = false;
|
|
8
|
-
var isDev = true;
|
|
9
|
-
|
|
1
|
+
import { isDev, isServer } from "@solidjs/web";
|
|
2
|
+
import { createMemo, createSignal, isHydrating, omit, onSettled, untrack } from "solid-js";
|
|
10
3
|
// src/clientOnly.tsx
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
untrack as untrack3
|
|
18
|
-
} from "solid-js";
|
|
4
|
+
/**
|
|
5
|
+
* Loads the devtools only on the client, so that they bypass any server side rendering. Taken from
|
|
6
|
+
* [solid-start's codebase](https://github.com/solidjs/solid-start/blob/2967fc2db3f0df826f061020231dbdafdfa0746b/packages/start/islands/clientOnly.tsx).
|
|
7
|
+
* @param fn - Dynamically imports the module whose default export is the component.
|
|
8
|
+
* @returns A component that renders `props.fallback` on the server and until the import resolves.
|
|
9
|
+
*/
|
|
19
10
|
function clientOnly(fn) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
() => (Comp = comp(), m = mounted(), untrack3(() => Comp && m ? Comp(rest) : props.fallback))
|
|
35
|
-
);
|
|
36
|
-
};
|
|
11
|
+
if (isServer) return (props) => props.fallback;
|
|
12
|
+
const [comp, setComp] = createSignal();
|
|
13
|
+
fn().then((m) => setComp(() => m.default));
|
|
14
|
+
return (props) => {
|
|
15
|
+
let Comp;
|
|
16
|
+
let m;
|
|
17
|
+
const rest = omit(props, "fallback");
|
|
18
|
+
if ((Comp = comp()) && !isHydrating()) return Comp(rest);
|
|
19
|
+
const [mounted, setMounted] = createSignal(!isHydrating());
|
|
20
|
+
onSettled(() => {
|
|
21
|
+
setMounted(true);
|
|
22
|
+
});
|
|
23
|
+
return createMemo(() => (Comp = comp(), m = mounted(), untrack(() => Comp && m ? Comp(rest) : props.fallback)));
|
|
24
|
+
};
|
|
37
25
|
}
|
|
38
|
-
|
|
39
26
|
// src/index.tsx
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
const SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools-BMem5cUa.jsx")) : function() {
|
|
28
|
+
return null;
|
|
42
29
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
SolidQueryDevtools,
|
|
48
|
-
SolidQueryDevtoolsPanel
|
|
30
|
+
const SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel-CU_iFbJ3.jsx")) : function() {
|
|
31
|
+
return null;
|
|
49
32
|
};
|
|
33
|
+
export { SolidQueryDevtools, SolidQueryDevtoolsPanel };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createEffect, createMemo, onSettled, runWithOwner } 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(() => client(), (c) => {
|
|
30
|
+
devtools.setClient(c);
|
|
31
|
+
});
|
|
32
|
+
createEffect(() => props.buttonPosition, (buttonPos) => {
|
|
33
|
+
if (buttonPos) devtools.setButtonPosition(buttonPos);
|
|
34
|
+
});
|
|
35
|
+
createEffect(() => props.position, (pos) => {
|
|
36
|
+
if (pos) devtools.setPosition(pos);
|
|
37
|
+
});
|
|
38
|
+
createEffect(() => props.initialIsOpen, (initialIsOpen) => {
|
|
39
|
+
devtools.setInitialIsOpen(initialIsOpen || false);
|
|
40
|
+
});
|
|
41
|
+
createEffect(() => props.errorTypes, (errorTypes) => {
|
|
42
|
+
devtools.setErrorTypes(errorTypes || []);
|
|
43
|
+
});
|
|
44
|
+
createEffect(() => props.theme, (theme) => {
|
|
45
|
+
devtools.setTheme(theme);
|
|
46
|
+
});
|
|
47
|
+
let mounted = false;
|
|
48
|
+
let disposed = false;
|
|
49
|
+
onSettled(() => {
|
|
50
|
+
queueMicrotask(() => {
|
|
51
|
+
if (disposed) return;
|
|
52
|
+
runWithOwner(null, () => devtools.mount(ref));
|
|
53
|
+
mounted = true;
|
|
54
|
+
});
|
|
55
|
+
return () => {
|
|
56
|
+
disposed = true;
|
|
57
|
+
if (mounted) devtools.unmount();
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
return <div class="tsqd-parent-container" ref={ref} />;
|
|
61
|
+
}
|
|
62
|
+
export { SolidQueryDevtools as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ref, template } from "@solidjs/web";
|
|
2
|
+
import { createEffect, createMemo, onSettled, runWithOwner } 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$1;
|
|
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(() => client(), (c) => {
|
|
32
|
+
devtools.setClient(c);
|
|
33
|
+
});
|
|
34
|
+
createEffect(() => props.buttonPosition, (buttonPos) => {
|
|
35
|
+
if (buttonPos) devtools.setButtonPosition(buttonPos);
|
|
36
|
+
});
|
|
37
|
+
createEffect(() => props.position, (pos) => {
|
|
38
|
+
if (pos) devtools.setPosition(pos);
|
|
39
|
+
});
|
|
40
|
+
createEffect(() => props.initialIsOpen, (initialIsOpen) => {
|
|
41
|
+
devtools.setInitialIsOpen(initialIsOpen || false);
|
|
42
|
+
});
|
|
43
|
+
createEffect(() => props.errorTypes, (errorTypes) => {
|
|
44
|
+
devtools.setErrorTypes(errorTypes || []);
|
|
45
|
+
});
|
|
46
|
+
createEffect(() => props.theme, (theme) => {
|
|
47
|
+
devtools.setTheme(theme);
|
|
48
|
+
});
|
|
49
|
+
let mounted = false;
|
|
50
|
+
let disposed = false;
|
|
51
|
+
onSettled(() => {
|
|
52
|
+
queueMicrotask(() => {
|
|
53
|
+
if (disposed) return;
|
|
54
|
+
runWithOwner(null, () => devtools.mount(ref$1));
|
|
55
|
+
mounted = true;
|
|
56
|
+
});
|
|
57
|
+
return () => {
|
|
58
|
+
disposed = true;
|
|
59
|
+
if (mounted) devtools.unmount();
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
var _el$ = _tmpl$();
|
|
63
|
+
var _ref$ = ref$1;
|
|
64
|
+
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref$1 = _el$;
|
|
65
|
+
return _el$;
|
|
66
|
+
}
|
|
67
|
+
export { SolidQueryDevtools as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ref as e,template as t}from"@solidjs/web";import{createEffect as n,createMemo as r,onSettled as i,runWithOwner 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__*/ t(`<div class=tsqd-parent-container>`);function u(t){let u=s(t.client),d=r(()=>u),f,p=new c({client:d(),queryFlavor:`Solid Query`,version:`5`,onlineManager:o,buttonPosition:t.buttonPosition,position:t.position,initialIsOpen:t.initialIsOpen,errorTypes:t.errorTypes,styleNonce:t.styleNonce,shadowDOMTarget:t.shadowDOMTarget,hideDisabledQueries:t.hideDisabledQueries,theme:t.theme});n(()=>d(),e=>{p.setClient(e)}),n(()=>t.buttonPosition,e=>{e&&p.setButtonPosition(e)}),n(()=>t.position,e=>{e&&p.setPosition(e)}),n(()=>t.initialIsOpen,e=>{p.setInitialIsOpen(e||!1)}),n(()=>t.errorTypes,e=>{p.setErrorTypes(e||[])}),n(()=>t.theme,e=>{p.setTheme(e)});let m=!1,h=!1;i(()=>(queueMicrotask(()=>{h||(a(null,()=>p.mount(f)),m=!0)}),()=>{h=!0,m&&p.unmount()}));var g=l(),_=f;return typeof _==`function`||Array.isArray(_)?e(()=>_,g):f=g,g}export{u as default};
|
|
2
|
+
//# sourceMappingURL=devtools-DPfipH2Y.js.map
|