@tanstack/query-devtools 5.106.1 → 5.107.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/Devtools-B2jiIqEJ.js +1292 -0
- package/build/Devtools-B2jiIqEJ.js.map +1 -0
- package/build/Devtools-C6D0zIvx.cjs +1291 -0
- package/build/{Devtools-rtsOXx72.js → Devtools-CXcMqCPe.js} +470 -278
- package/build/{Devtools-v4_2Fgnd.cjs → Devtools-Dy8Npldt.cjs} +470 -278
- package/build/{DevtoolsComponent-DjX8H_OS.js → DevtoolsComponent-C7hVCcUy.js} +1 -1
- package/build/{DevtoolsComponent-D-GGWO6D.cjs → DevtoolsComponent-CfBgdmsl.cjs} +1 -1
- package/build/{DevtoolsComponent-BhxzD0Z_.cjs → DevtoolsComponent-D5toeyeh.cjs} +1 -1
- package/build/{DevtoolsComponent-Y_UD6BDS.js → DevtoolsComponent-DGRxtIwZ.js} +2 -2
- package/build/{DevtoolsComponent-Y_UD6BDS.js.map → DevtoolsComponent-DGRxtIwZ.js.map} +1 -1
- package/build/{DevtoolsPanelComponent-azgDvAlF.js → DevtoolsPanelComponent-CPGCRAPs.js} +2 -2
- package/build/{DevtoolsPanelComponent-azgDvAlF.js.map → DevtoolsPanelComponent-CPGCRAPs.js.map} +1 -1
- package/build/{DevtoolsPanelComponent-ecGfyOWI.cjs → DevtoolsPanelComponent-D_S99j7E.cjs} +1 -1
- package/build/{DevtoolsPanelComponent-BtyHS22R.cjs → DevtoolsPanelComponent-Dc49CXag.cjs} +1 -1
- package/build/{DevtoolsPanelComponent-BryTHuft.js → DevtoolsPanelComponent-XShN-s8X.js} +1 -1
- package/build/dev.cjs +2 -2
- package/build/dev.js +2 -2
- package/build/index.cjs +1 -1
- package/build/index.js +1 -1
- package/package.json +2 -2
- package/src/Devtools.tsx +235 -14
- package/src/Explorer.tsx +12 -5
- package/src/constants.ts +4 -0
- package/src/explorerSearch.ts +40 -0
- package/build/Devtools-75tXP6g3.cjs +0 -1269
- package/build/Devtools-DJ2H9xNC.js +0 -1270
- package/build/Devtools-DJ2H9xNC.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
2
|
import { B as createComponent, W as createMemo, a as getPreferredColorScheme } from "./utils-D7iZi04l.js";
|
|
3
|
-
import { a as PiPProvider, c as DevtoolsSubscriptionsProvider, d as I18nProvider, f as createLocalStorage, i as ThemeContext, l as DevtoolsOfflineProvider, n as Devtools, s as DevtoolsStateProvider, u as QueryDevtoolsContext } from "./Devtools-
|
|
3
|
+
import { a as PiPProvider, c as DevtoolsSubscriptionsProvider, d as I18nProvider, f as createLocalStorage, i as ThemeContext, l as DevtoolsOfflineProvider, n as Devtools, s as DevtoolsStateProvider, u as QueryDevtoolsContext } from "./Devtools-CXcMqCPe.js";
|
|
4
4
|
// src/DevtoolsComponent.tsx
|
|
5
5
|
const DevtoolsComponent = (props) => {
|
|
6
6
|
const [localStore, setLocalStore] = createLocalStorage({ prefix: "TanstackQueryDevtools" });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
2
|
const require_utils = require("./utils-CzP8C7c0.cjs");
|
|
3
|
-
const require_Devtools = require("./Devtools-
|
|
3
|
+
const require_Devtools = require("./Devtools-Dy8Npldt.cjs");
|
|
4
4
|
// src/DevtoolsComponent.tsx
|
|
5
5
|
const DevtoolsComponent = (props) => {
|
|
6
6
|
const [localStore, setLocalStore] = require_Devtools.createLocalStorage({ prefix: "TanstackQueryDevtools" });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
const e=require("./utils-DJl-N7L2.cjs"),t=require("./Devtools-
|
|
2
|
+
const e=require("./utils-DJl-N7L2.cjs"),t=require("./Devtools-C6D0zIvx.cjs"),n=n=>{let[r,i]=t.f({prefix:`TanstackQueryDevtools`}),a=e.a(),o=e.W(()=>{let e=n.theme||r.theme_preference||`system`;return e===`system`?a():e});return e.B(t.u.Provider,{value:n,get children(){return e.B(t.s,{get children(){return e.B(t.l,{get children(){return e.B(t.c,{get children(){return e.B(t.a,{localStore:r,setLocalStore:i,get children(){return e.B(t.i.Provider,{value:o,get children(){return e.B(t.d,{locale:`en-US`,get children(){return e.B(t.n,{localStore:r,setLocalStore:i})}})}})}})}})}})}})}})};exports.default=n;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
import{B as e,W as t,a as n}from"./utils-DC2pN79q.js";import{a as r,c as i,d as a,f as o,i as s,l as c,n as l,s as u,u as d}from"./Devtools-
|
|
3
|
-
//# sourceMappingURL=DevtoolsComponent-
|
|
2
|
+
import{B as e,W as t,a as n}from"./utils-DC2pN79q.js";import{a as r,c as i,d as a,f as o,i as s,l as c,n as l,s as u,u as d}from"./Devtools-B2jiIqEJ.js";const f=f=>{let[p,m]=o({prefix:`TanstackQueryDevtools`}),h=n(),g=t(()=>{let e=f.theme||p.theme_preference||`system`;return e===`system`?h():e});return e(d.Provider,{value:f,get children(){return e(u,{get children(){return e(c,{get children(){return e(i,{get children(){return e(r,{localStore:p,setLocalStore:m,get children(){return e(s.Provider,{value:g,get children(){return e(a,{locale:`en-US`,get children(){return e(l,{localStore:p,setLocalStore:m})}})}})}})}})}})}})}})};export{f as default};
|
|
3
|
+
//# sourceMappingURL=DevtoolsComponent-DGRxtIwZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevtoolsComponent-
|
|
1
|
+
{"version":3,"file":"DevtoolsComponent-DGRxtIwZ.js","names":["createLocalStorage","I18nProvider","createMemo","DevtoolsOfflineProvider","DevtoolsSubscriptionsProvider","DevtoolsStateProvider","Devtools","getPreferredColorScheme","THEME_PREFERENCE","PiPProvider","QueryDevtoolsContext","ThemeContext","Theme","DevtoolsComponentType","DevtoolsComponent","props","localStore","setLocalStore","prefix","colorScheme","theme","preference","theme_preference","_$createComponent","Provider","value","children","locale","_$createComponent","createComponent","createMemo","getPreferredColorScheme","PiPProvider","DevtoolsSubscriptionsProvider","I18nProvider","createLocalStorage","ThemeContext","DevtoolsOfflineProvider","Devtools","DevtoolsStateProvider","QueryDevtoolsContext","DevtoolsComponent","localStore","setLocalStore","colorScheme","theme","preference","props"],"sources":["../src/DevtoolsComponent.tsx"],"sourcesContent":["import { createLocalStorage } from '@solid-primitives/storage'\nimport { I18nProvider } from '@kobalte/core'\nimport { createMemo } from 'solid-js'\nimport { DevtoolsOfflineProvider } from './providers/DevtoolsOfflineProvider'\nimport { DevtoolsSubscriptionsProvider } from './providers/DevtoolsSubscriptionsProvider'\nimport { DevtoolsStateProvider } from './providers/DevtoolsStateProvider'\nimport { Devtools } from './Devtools'\nimport { getPreferredColorScheme } from './utils'\nimport { THEME_PREFERENCE } from './constants'\nimport { PiPProvider, QueryDevtoolsContext, ThemeContext } from './contexts'\nimport type { Theme } from './contexts'\nimport type { DevtoolsComponentType } from './Devtools'\n\nconst DevtoolsComponent: DevtoolsComponentType = (props) => {\n const [localStore, setLocalStore] = createLocalStorage({\n prefix: 'TanstackQueryDevtools',\n })\n\n const colorScheme = getPreferredColorScheme()\n\n const theme = createMemo(() => {\n const preference = (props.theme ||\n localStore.theme_preference ||\n THEME_PREFERENCE) as Theme\n if (preference !== 'system') return preference\n return colorScheme()\n })\n\n return (\n <QueryDevtoolsContext.Provider value={props}>\n <DevtoolsStateProvider>\n <DevtoolsOfflineProvider>\n <DevtoolsSubscriptionsProvider>\n <PiPProvider localStore={localStore} setLocalStore={setLocalStore}>\n <ThemeContext.Provider value={theme}>\n <I18nProvider locale=\"en-US\">\n <Devtools\n localStore={localStore}\n setLocalStore={setLocalStore}\n />\n </I18nProvider>\n </ThemeContext.Provider>\n </PiPProvider>\n </DevtoolsSubscriptionsProvider>\n </DevtoolsOfflineProvider>\n </DevtoolsStateProvider>\n </QueryDevtoolsContext.Provider>\n )\n}\n\nexport default DevtoolsComponent\n"],"mappings":";A,yJAaA,MAAMc,EAA4CC,GAAU,CAC1D,GAAM,CAACC,EAAYC,GAAiBjB,EAAmB,CACrDkB,OAAQ,uBACV,CAAC,EAEKC,EAAcZ,EAAwB,EAEtCa,EAAQlB,MAAiB,CAC7B,IAAMmB,EAAcN,EAAMK,OACxBJ,EAAWM,kBAAAA,SAGb,OADID,IAAe,SACZF,EAAY,EADiBE,CAEtC,CAAC,EAED,OAAAE,EACGb,EAAqBc,SAAQ,CAACC,MAAOV,EAAK,IAAAW,UAAA,CAAA,OAAAH,EACxClB,EAAqB,CAAA,IAAAqB,UAAA,CAAA,OAAAH,EACnBpB,EAAuB,CAAA,IAAAuB,UAAA,CAAA,OAAAH,EACrBnB,EAA6B,CAAA,IAAAsB,UAAA,CAAA,OAAAH,EAC3Bd,EAAW,CAAaO,aAA2BC,gBAAa,IAAAS,UAAA,CAAA,OAAAH,EAC9DZ,EAAaa,SAAQ,CAACC,MAAOL,EAAK,IAAAM,UAAA,CAAA,OAAAH,EAChCtB,EAAY,CAAC0B,OAAM,QAAA,IAAAD,UAAA,CAAA,OAAAH,EACjBjB,EAAQ,CACKU,aACGC,eAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAUhD,E"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
import{B as e,W as t,a as n}from"./utils-DC2pN79q.js";import{a as r,c as i,d as a,f as o,i as s,l as c,r as l,s as u,t as d,u as f}from"./Devtools-
|
|
3
|
-
//# sourceMappingURL=DevtoolsPanelComponent-
|
|
2
|
+
import{B as e,W as t,a as n}from"./utils-DC2pN79q.js";import{a as r,c as i,d as a,f as o,i as s,l as c,r as l,s as u,t as d,u as f}from"./Devtools-B2jiIqEJ.js";const p=p=>{let[m,h]=o({prefix:`TanstackQueryDevtools`}),g=n(),_=t(()=>{let e=p.theme||m.theme_preference||`system`;return e===`system`?g():e});return e(f.Provider,{value:p,get children(){return e(u,{get children(){return e(c,{get children(){return e(i,{get children(){return e(r,{disabled:!0,localStore:m,setLocalStore:h,get children(){return e(s.Provider,{value:_,get children(){return e(a,{locale:`en-US`,get children(){return e(l,{get children(){return e(d,{localStore:m,setLocalStore:h,get onClose(){return p.onClose},showPanelViewOnly:!0})}})}})}})}})}})}})}})}})};export{p as default};
|
|
3
|
+
//# sourceMappingURL=DevtoolsPanelComponent-CPGCRAPs.js.map
|
package/build/{DevtoolsPanelComponent-azgDvAlF.js.map → DevtoolsPanelComponent-CPGCRAPs.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevtoolsPanelComponent-
|
|
1
|
+
{"version":3,"file":"DevtoolsPanelComponent-CPGCRAPs.js","names":["createLocalStorage","I18nProvider","createMemo","DevtoolsOfflineProvider","DevtoolsSubscriptionsProvider","DevtoolsStateProvider","ContentView","ParentPanel","getPreferredColorScheme","THEME_PREFERENCE","PiPProvider","QueryDevtoolsContext","ThemeContext","Theme","DevtoolsComponentType","DevtoolsPanelComponent","props","localStore","setLocalStore","prefix","colorScheme","theme","preference","theme_preference","_$createComponent","Provider","value","children","disabled","locale","onClose","showPanelViewOnly","_$createComponent","createComponent","createMemo","getPreferredColorScheme","PiPProvider","DevtoolsSubscriptionsProvider","I18nProvider","createLocalStorage","ThemeContext","DevtoolsOfflineProvider","ParentPanel","DevtoolsStateProvider","ContentView","QueryDevtoolsContext","DevtoolsPanelComponent","localStore","setLocalStore","colorScheme","theme","preference","props"],"sources":["../src/DevtoolsPanelComponent.tsx"],"sourcesContent":["import { createLocalStorage } from '@solid-primitives/storage'\nimport { I18nProvider } from '@kobalte/core'\nimport { createMemo } from 'solid-js'\nimport { DevtoolsOfflineProvider } from './providers/DevtoolsOfflineProvider'\nimport { DevtoolsSubscriptionsProvider } from './providers/DevtoolsSubscriptionsProvider'\nimport { DevtoolsStateProvider } from './providers/DevtoolsStateProvider'\nimport { ContentView, ParentPanel } from './Devtools'\nimport { getPreferredColorScheme } from './utils'\nimport { THEME_PREFERENCE } from './constants'\nimport { PiPProvider, QueryDevtoolsContext, ThemeContext } from './contexts'\nimport type { Theme } from './contexts'\nimport type { DevtoolsComponentType } from './Devtools'\n\nconst DevtoolsPanelComponent: DevtoolsComponentType = (props) => {\n const [localStore, setLocalStore] = createLocalStorage({\n prefix: 'TanstackQueryDevtools',\n })\n\n const colorScheme = getPreferredColorScheme()\n\n const theme = createMemo(() => {\n const preference = (props.theme ||\n localStore.theme_preference ||\n THEME_PREFERENCE) as Theme\n if (preference !== 'system') return preference\n return colorScheme()\n })\n\n return (\n <QueryDevtoolsContext.Provider value={props}>\n <DevtoolsStateProvider>\n <DevtoolsOfflineProvider>\n <DevtoolsSubscriptionsProvider>\n <PiPProvider\n disabled\n localStore={localStore}\n setLocalStore={setLocalStore}\n >\n <ThemeContext.Provider value={theme}>\n <I18nProvider locale=\"en-US\">\n <ParentPanel>\n <ContentView\n localStore={localStore}\n setLocalStore={setLocalStore}\n onClose={props.onClose}\n showPanelViewOnly\n />\n </ParentPanel>\n </I18nProvider>\n </ThemeContext.Provider>\n </PiPProvider>\n </DevtoolsSubscriptionsProvider>\n </DevtoolsOfflineProvider>\n </DevtoolsStateProvider>\n </QueryDevtoolsContext.Provider>\n )\n}\n\nexport default DevtoolsPanelComponent\n"],"mappings":";A,gKAaA,MAAMe,EAAiDC,GAAU,CAC/D,GAAM,CAACC,EAAYC,GAAiBlB,EAAmB,CACrDmB,OAAQ,uBACV,CAAC,EAEKC,EAAcZ,EAAwB,EAEtCa,EAAQnB,MAAiB,CAC7B,IAAMoB,EAAcN,EAAMK,OACxBJ,EAAWM,kBAAAA,SAGb,OADID,IAAe,SACZF,EAAY,EADiBE,CAEtC,CAAC,EAED,OAAAE,EACGb,EAAqBc,SAAQ,CAACC,MAAOV,EAAK,IAAAW,UAAA,CAAA,OAAAH,EACxCnB,EAAqB,CAAA,IAAAsB,UAAA,CAAA,OAAAH,EACnBrB,EAAuB,CAAA,IAAAwB,UAAA,CAAA,OAAAH,EACrBpB,EAA6B,CAAA,IAAAuB,UAAA,CAAA,OAAAH,EAC3Bd,EAAW,CACVkB,SAAQ,GACIX,aACGC,gBAAa,IAAAS,UAAA,CAAA,OAAAH,EAE3BZ,EAAaa,SAAQ,CAACC,MAAOL,EAAK,IAAAM,UAAA,CAAA,OAAAH,EAChCvB,EAAY,CAAC4B,OAAM,QAAA,IAAAF,UAAA,CAAA,OAAAH,EACjBjB,EAAW,CAAA,IAAAoB,UAAA,CAAA,OAAAH,EACTlB,EAAW,CACEW,aACGC,gBAAa,IAC5BY,SAAO,CAAA,OAAEd,EAAMc,OAAO,EACtBC,kBAAiB,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAWvC,E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
const e=require("./utils-DJl-N7L2.cjs"),t=require("./Devtools-
|
|
2
|
+
const e=require("./utils-DJl-N7L2.cjs"),t=require("./Devtools-C6D0zIvx.cjs"),n=n=>{let[r,i]=t.f({prefix:`TanstackQueryDevtools`}),a=e.a(),o=e.W(()=>{let e=n.theme||r.theme_preference||`system`;return e===`system`?a():e});return e.B(t.u.Provider,{value:n,get children(){return e.B(t.s,{get children(){return e.B(t.l,{get children(){return e.B(t.c,{get children(){return e.B(t.a,{disabled:!0,localStore:r,setLocalStore:i,get children(){return e.B(t.i.Provider,{value:o,get children(){return e.B(t.d,{locale:`en-US`,get children(){return e.B(t.r,{get children(){return e.B(t.t,{localStore:r,setLocalStore:i,get onClose(){return n.onClose},showPanelViewOnly:!0})}})}})}})}})}})}})}})}})};exports.default=n;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
2
|
const require_utils = require("./utils-CzP8C7c0.cjs");
|
|
3
|
-
const require_Devtools = require("./Devtools-
|
|
3
|
+
const require_Devtools = require("./Devtools-Dy8Npldt.cjs");
|
|
4
4
|
// src/DevtoolsPanelComponent.tsx
|
|
5
5
|
const DevtoolsPanelComponent = (props) => {
|
|
6
6
|
const [localStore, setLocalStore] = require_Devtools.createLocalStorage({ prefix: "TanstackQueryDevtools" });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
2
|
import { B as createComponent, W as createMemo, a as getPreferredColorScheme } from "./utils-D7iZi04l.js";
|
|
3
|
-
import { a as PiPProvider, c as DevtoolsSubscriptionsProvider, d as I18nProvider, f as createLocalStorage, i as ThemeContext, l as DevtoolsOfflineProvider, r as ParentPanel, s as DevtoolsStateProvider, t as ContentView, u as QueryDevtoolsContext } from "./Devtools-
|
|
3
|
+
import { a as PiPProvider, c as DevtoolsSubscriptionsProvider, d as I18nProvider, f as createLocalStorage, i as ThemeContext, l as DevtoolsOfflineProvider, r as ParentPanel, s as DevtoolsStateProvider, t as ContentView, u as QueryDevtoolsContext } from "./Devtools-CXcMqCPe.js";
|
|
4
4
|
// src/DevtoolsPanelComponent.tsx
|
|
5
5
|
const DevtoolsPanelComponent = (props) => {
|
|
6
6
|
const [localStore, setLocalStore] = createLocalStorage({ prefix: "TanstackQueryDevtools" });
|
package/build/dev.cjs
CHANGED
|
@@ -65,7 +65,7 @@ var TanstackQueryDevtools = class {
|
|
|
65
65
|
let Devtools;
|
|
66
66
|
if (this.#Component) Devtools = this.#Component;
|
|
67
67
|
else {
|
|
68
|
-
Devtools = require_utils.lazy(() => Promise.resolve().then(() => require("./DevtoolsComponent-
|
|
68
|
+
Devtools = require_utils.lazy(() => Promise.resolve().then(() => require("./DevtoolsComponent-CfBgdmsl.cjs")));
|
|
69
69
|
this.#Component = Devtools;
|
|
70
70
|
}
|
|
71
71
|
require_utils.setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
|
|
@@ -185,7 +185,7 @@ var TanstackQueryDevtoolsPanel = class {
|
|
|
185
185
|
let Devtools;
|
|
186
186
|
if (this.#Component) Devtools = this.#Component;
|
|
187
187
|
else {
|
|
188
|
-
Devtools = require_utils.lazy(() => Promise.resolve().then(() => require("./DevtoolsPanelComponent-
|
|
188
|
+
Devtools = require_utils.lazy(() => Promise.resolve().then(() => require("./DevtoolsPanelComponent-Dc49CXag.cjs")));
|
|
189
189
|
this.#Component = Devtools;
|
|
190
190
|
}
|
|
191
191
|
require_utils.setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
|
package/build/dev.js
CHANGED
|
@@ -64,7 +64,7 @@ var TanstackQueryDevtools = class {
|
|
|
64
64
|
let Devtools;
|
|
65
65
|
if (this.#Component) Devtools = this.#Component;
|
|
66
66
|
else {
|
|
67
|
-
Devtools = lazy(() => import("./DevtoolsComponent-
|
|
67
|
+
Devtools = lazy(() => import("./DevtoolsComponent-C7hVCcUy.js"));
|
|
68
68
|
this.#Component = Devtools;
|
|
69
69
|
}
|
|
70
70
|
setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
|
|
@@ -184,7 +184,7 @@ var TanstackQueryDevtoolsPanel = class {
|
|
|
184
184
|
let Devtools;
|
|
185
185
|
if (this.#Component) Devtools = this.#Component;
|
|
186
186
|
else {
|
|
187
|
-
Devtools = lazy(() => import("./DevtoolsPanelComponent-
|
|
187
|
+
Devtools = lazy(() => import("./DevtoolsPanelComponent-XShN-s8X.js"));
|
|
188
188
|
this.#Component = Devtools;
|
|
189
189
|
}
|
|
190
190
|
setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
|
package/build/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-DJl-N7L2.cjs");var t=class{#e;#t;#n;#r;#i=!1;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;constructor(t){let{client:n,queryFlavor:r,version:i,onlineManager:a,buttonPosition:o,position:s,initialIsOpen:c,errorTypes:l,styleNonce:u,shadowDOMTarget:d,hideDisabledQueries:f,theme:p}=t;this.#e=e.q(n),this.#n=r,this.#r=i,this.#t=a,this.#a=u,this.#o=d,this.#s=e.q(o),this.#c=e.q(s),this.#l=e.q(c),this.#u=e.q(l),this.#d=e.q(f),this.#p=e.q(p)}setButtonPosition(e){this.#s[1](e)}setPosition(e){this.#c[1](e)}setInitialIsOpen(e){this.#l[1](e)}setErrorTypes(e){this.#u[1](e)}setClient(e){this.#e[1](e)}setTheme(e){this.#p[1](e)}mount(t){if(this.#i)throw Error(`Devtools is already mounted`);let n=e.E(()=>{let t=this,[n]=this.#s,[r]=this.#c,[i]=this.#l,[a]=this.#u,[o]=this.#d,[s]=this.#e,[c]=this.#p,l;return this.#f?l=this.#f:(l=e.Z(()=>Promise.resolve().then(()=>require("./DevtoolsComponent-
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-DJl-N7L2.cjs");var t=class{#e;#t;#n;#r;#i=!1;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;constructor(t){let{client:n,queryFlavor:r,version:i,onlineManager:a,buttonPosition:o,position:s,initialIsOpen:c,errorTypes:l,styleNonce:u,shadowDOMTarget:d,hideDisabledQueries:f,theme:p}=t;this.#e=e.q(n),this.#n=r,this.#r=i,this.#t=a,this.#a=u,this.#o=d,this.#s=e.q(o),this.#c=e.q(s),this.#l=e.q(c),this.#u=e.q(l),this.#d=e.q(f),this.#p=e.q(p)}setButtonPosition(e){this.#s[1](e)}setPosition(e){this.#c[1](e)}setInitialIsOpen(e){this.#l[1](e)}setErrorTypes(e){this.#u[1](e)}setClient(e){this.#e[1](e)}setTheme(e){this.#p[1](e)}mount(t){if(this.#i)throw Error(`Devtools is already mounted`);let n=e.E(()=>{let t=this,[n]=this.#s,[r]=this.#c,[i]=this.#l,[a]=this.#u,[o]=this.#d,[s]=this.#e,[c]=this.#p,l;return this.#f?l=this.#f:(l=e.Z(()=>Promise.resolve().then(()=>require("./DevtoolsComponent-D5toeyeh.cjs"))),this.#f=l),e.f(this.#a,this.#o),e.B(l,e.Q({get queryFlavor(){return t.#n},get version(){return t.#r},get onlineManager(){return t.#t},get shadowDOMTarget(){return t.#o}},{get client(){return s()},get buttonPosition(){return n()},get position(){return r()},get initialIsOpen(){return i()},get errorTypes(){return a()},get hideDisabledQueries(){return o()},get theme(){return c()}}))},t);this.#i=!0,this.#m=n}unmount(){if(!this.#i)throw Error(`Devtools is not mounted`);this.#m?.(),this.#i=!1}},n=class{#e;#t;#n;#r;#i=!1;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;constructor(t){let{client:n,queryFlavor:r,version:i,onlineManager:a,buttonPosition:o,position:s,initialIsOpen:c,errorTypes:l,styleNonce:u,shadowDOMTarget:d,onClose:f,hideDisabledQueries:p,theme:m}=t;this.#e=e.q(n),this.#n=r,this.#r=i,this.#t=a,this.#a=u,this.#o=d,this.#s=e.q(o),this.#c=e.q(s),this.#l=e.q(c),this.#u=e.q(l),this.#d=e.q(p),this.#f=e.q(f),this.#m=e.q(m)}setButtonPosition(e){this.#s[1](e)}setPosition(e){this.#c[1](e)}setInitialIsOpen(e){this.#l[1](e)}setErrorTypes(e){this.#u[1](e)}setClient(e){this.#e[1](e)}setOnClose(e){this.#f[1](()=>e)}setTheme(e){this.#m[1](e)}mount(t){if(this.#i)throw Error(`Devtools is already mounted`);let n=e.E(()=>{let t=this,[n]=this.#s,[r]=this.#c,[i]=this.#l,[a]=this.#u,[o]=this.#d,[s]=this.#e,[c]=this.#f,[l]=this.#m,u;return this.#p?u=this.#p:(u=e.Z(()=>Promise.resolve().then(()=>require("./DevtoolsPanelComponent-D_S99j7E.cjs"))),this.#p=u),e.f(this.#a,this.#o),e.B(u,e.Q({get queryFlavor(){return t.#n},get version(){return t.#r},get onlineManager(){return t.#t},get shadowDOMTarget(){return t.#o}},{get client(){return s()},get buttonPosition(){return n()},get position(){return r()},get initialIsOpen(){return i()},get errorTypes(){return a()},get hideDisabledQueries(){return o()},get onClose(){return c()},get theme(){return l()}}))},t);this.#i=!0,this.#h=n}unmount(){if(!this.#i)throw Error(`Devtools is not mounted`);this.#h?.(),this.#i=!1}};exports.TanstackQueryDevtools=t,exports.TanstackQueryDevtoolsPanel=n;
|
package/build/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
import{B as e,E as t,Q as n,Z as r,f as i,q as a}from"./utils-DC2pN79q.js";var o=class{#e;#t;#n;#r;#i=!1;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;constructor(e){let{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:o,position:s,initialIsOpen:c,errorTypes:l,styleNonce:u,shadowDOMTarget:d,hideDisabledQueries:f,theme:p}=e;this.#e=a(t),this.#n=n,this.#r=r,this.#t=i,this.#a=u,this.#o=d,this.#s=a(o),this.#c=a(s),this.#l=a(c),this.#u=a(l),this.#d=a(f),this.#p=a(p)}setButtonPosition(e){this.#s[1](e)}setPosition(e){this.#c[1](e)}setInitialIsOpen(e){this.#l[1](e)}setErrorTypes(e){this.#u[1](e)}setClient(e){this.#e[1](e)}setTheme(e){this.#p[1](e)}mount(a){if(this.#i)throw Error(`Devtools is already mounted`);let o=t(()=>{let t=this,[a]=this.#s,[o]=this.#c,[s]=this.#l,[c]=this.#u,[l]=this.#d,[u]=this.#e,[d]=this.#p,f;return this.#f?f=this.#f:(f=r(()=>import(`./DevtoolsComponent-
|
|
2
|
+
import{B as e,E as t,Q as n,Z as r,f as i,q as a}from"./utils-DC2pN79q.js";var o=class{#e;#t;#n;#r;#i=!1;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;constructor(e){let{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:o,position:s,initialIsOpen:c,errorTypes:l,styleNonce:u,shadowDOMTarget:d,hideDisabledQueries:f,theme:p}=e;this.#e=a(t),this.#n=n,this.#r=r,this.#t=i,this.#a=u,this.#o=d,this.#s=a(o),this.#c=a(s),this.#l=a(c),this.#u=a(l),this.#d=a(f),this.#p=a(p)}setButtonPosition(e){this.#s[1](e)}setPosition(e){this.#c[1](e)}setInitialIsOpen(e){this.#l[1](e)}setErrorTypes(e){this.#u[1](e)}setClient(e){this.#e[1](e)}setTheme(e){this.#p[1](e)}mount(a){if(this.#i)throw Error(`Devtools is already mounted`);let o=t(()=>{let t=this,[a]=this.#s,[o]=this.#c,[s]=this.#l,[c]=this.#u,[l]=this.#d,[u]=this.#e,[d]=this.#p,f;return this.#f?f=this.#f:(f=r(()=>import(`./DevtoolsComponent-DGRxtIwZ.js`)),this.#f=f),i(this.#a,this.#o),e(f,n({get queryFlavor(){return t.#n},get version(){return t.#r},get onlineManager(){return t.#t},get shadowDOMTarget(){return t.#o}},{get client(){return u()},get buttonPosition(){return a()},get position(){return o()},get initialIsOpen(){return s()},get errorTypes(){return c()},get hideDisabledQueries(){return l()},get theme(){return d()}}))},a);this.#i=!0,this.#m=o}unmount(){if(!this.#i)throw Error(`Devtools is not mounted`);this.#m?.(),this.#i=!1}},s=class{#e;#t;#n;#r;#i=!1;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;constructor(e){let{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:o,position:s,initialIsOpen:c,errorTypes:l,styleNonce:u,shadowDOMTarget:d,onClose:f,hideDisabledQueries:p,theme:m}=e;this.#e=a(t),this.#n=n,this.#r=r,this.#t=i,this.#a=u,this.#o=d,this.#s=a(o),this.#c=a(s),this.#l=a(c),this.#u=a(l),this.#d=a(p),this.#f=a(f),this.#m=a(m)}setButtonPosition(e){this.#s[1](e)}setPosition(e){this.#c[1](e)}setInitialIsOpen(e){this.#l[1](e)}setErrorTypes(e){this.#u[1](e)}setClient(e){this.#e[1](e)}setOnClose(e){this.#f[1](()=>e)}setTheme(e){this.#m[1](e)}mount(a){if(this.#i)throw Error(`Devtools is already mounted`);let o=t(()=>{let t=this,[a]=this.#s,[o]=this.#c,[s]=this.#l,[c]=this.#u,[l]=this.#d,[u]=this.#e,[d]=this.#f,[f]=this.#m,p;return this.#p?p=this.#p:(p=r(()=>import(`./DevtoolsPanelComponent-CPGCRAPs.js`)),this.#p=p),i(this.#a,this.#o),e(p,n({get queryFlavor(){return t.#n},get version(){return t.#r},get onlineManager(){return t.#t},get shadowDOMTarget(){return t.#o}},{get client(){return u()},get buttonPosition(){return a()},get position(){return o()},get initialIsOpen(){return s()},get errorTypes(){return c()},get hideDisabledQueries(){return l()},get onClose(){return d()},get theme(){return f()}}))},a);this.#i=!0,this.#h=o}unmount(){if(!this.#i)throw Error(`Devtools is not mounted`);this.#h?.(),this.#i=!1}};export{o as TanstackQueryDevtools,s as TanstackQueryDevtoolsPanel};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/query-devtools",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.107.1",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack Query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@solid-primitives/resize-observer": "^2.2.0",
|
|
50
50
|
"@solid-primitives/storage": "^1.3.11",
|
|
51
51
|
"@tanstack/match-sorter-utils": "^9.1.2",
|
|
52
|
-
"@tanstack/query-core": "5.
|
|
52
|
+
"@tanstack/query-core": "5.107.1",
|
|
53
53
|
"@tanstack/solid-virtual": "^3.13.52",
|
|
54
54
|
"clsx": "^2.1.1",
|
|
55
55
|
"goober": "^2.1.19",
|
package/src/Devtools.tsx
CHANGED
|
@@ -53,21 +53,25 @@ import {
|
|
|
53
53
|
XCircle,
|
|
54
54
|
} from './icons'
|
|
55
55
|
import Explorer, { SearchableExplorer } from './Explorer'
|
|
56
|
+
import { createSearchText } from './explorerSearch'
|
|
56
57
|
import { VirtualList } from './VirtualList'
|
|
57
58
|
import { usePiPWindow, useQueryDevtoolsContext, useTheme } from './contexts'
|
|
58
59
|
import {
|
|
59
60
|
BUTTON_POSITION,
|
|
61
|
+
DEFAULT_FILTER_SCOPE,
|
|
60
62
|
DEFAULT_HEIGHT,
|
|
61
63
|
DEFAULT_MUTATION_SORT_FN_NAME,
|
|
62
64
|
DEFAULT_SORT_FN_NAME,
|
|
63
65
|
DEFAULT_SORT_ORDER,
|
|
64
66
|
DEFAULT_WIDTH,
|
|
67
|
+
FILTER_SCOPES,
|
|
65
68
|
INITIAL_IS_OPEN,
|
|
66
69
|
POSITION,
|
|
67
70
|
firstBreakpoint,
|
|
68
71
|
secondBreakpoint,
|
|
69
72
|
thirdBreakpoint,
|
|
70
73
|
} from './constants'
|
|
74
|
+
import type { FilterScope } from './constants'
|
|
71
75
|
import type {
|
|
72
76
|
DevtoolsErrorType,
|
|
73
77
|
DevtoolsPosition,
|
|
@@ -76,6 +80,7 @@ import type {
|
|
|
76
80
|
import type {
|
|
77
81
|
Mutation,
|
|
78
82
|
MutationCache,
|
|
83
|
+
MutationCacheNotifyEvent,
|
|
79
84
|
Query,
|
|
80
85
|
QueryCache,
|
|
81
86
|
QueryCacheNotifyEvent,
|
|
@@ -83,6 +88,80 @@ import type {
|
|
|
83
88
|
import type { StorageObject, StorageSetter } from '@solid-primitives/storage'
|
|
84
89
|
import type { Accessor, Component, JSX } from 'solid-js'
|
|
85
90
|
|
|
91
|
+
const filterScopeLabels: Record<FilterScope, string> = {
|
|
92
|
+
key: 'Key',
|
|
93
|
+
data: 'Data',
|
|
94
|
+
all: 'All',
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const filterScopeAriaLabels: Record<
|
|
98
|
+
'queries' | 'mutations',
|
|
99
|
+
Record<FilterScope, string>
|
|
100
|
+
> = {
|
|
101
|
+
queries: {
|
|
102
|
+
key: 'Filter queries by query key',
|
|
103
|
+
data: 'Filter queries by query data',
|
|
104
|
+
all: 'Filter queries by query key or data',
|
|
105
|
+
},
|
|
106
|
+
mutations: {
|
|
107
|
+
key: 'Filter mutations by mutation key',
|
|
108
|
+
data: 'Filter mutations by variables or data',
|
|
109
|
+
all: 'Filter mutations by mutation key, variables or data',
|
|
110
|
+
},
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Query data is immutable. Cached mutation text is invalidated when mutation state changes.
|
|
114
|
+
const dataSearchTexts = new WeakMap<object, string>()
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Gets the cached search text of query or mutation data, building it if there is time left.
|
|
118
|
+
* @param data - The query data, or mutation variables or data.
|
|
119
|
+
* @param deadline - When to stop building search texts, compared to `performance.now()`.
|
|
120
|
+
* @returns The search text, or undefined if it isn't built and the deadline has passed.
|
|
121
|
+
*/
|
|
122
|
+
const getDataSearchText = (data: unknown, deadline = Infinity) => {
|
|
123
|
+
if (typeof data !== 'object' || data === null) return createSearchText(data)
|
|
124
|
+
let text = dataSearchTexts.get(data)
|
|
125
|
+
if (text === undefined && performance.now() < deadline) {
|
|
126
|
+
text = createSearchText(data)
|
|
127
|
+
dataSearchTexts.set(data, text)
|
|
128
|
+
}
|
|
129
|
+
return text
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Checks whether data contains the term. Missing data never matches.
|
|
134
|
+
* @param data - The query data, or mutation variables or data.
|
|
135
|
+
* @param term - The lowercased search term.
|
|
136
|
+
* @returns Whether the data matches.
|
|
137
|
+
*/
|
|
138
|
+
const matchesData = (data: unknown, term: string) =>
|
|
139
|
+
data !== undefined && getDataSearchText(data)!.includes(term)
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Builds data search texts for a few milliseconds per task, so filtering by data doesn't block
|
|
143
|
+
* the page.
|
|
144
|
+
* @returns `version`, which changes when building continued in a later task, and `prepare`,
|
|
145
|
+
* which returns whether the search texts of all the data are built.
|
|
146
|
+
*/
|
|
147
|
+
const createDataSearchTexts = () => {
|
|
148
|
+
const [version, setVersion] = createSignal(0)
|
|
149
|
+
let timeout: ReturnType<typeof setTimeout> | undefined
|
|
150
|
+
onCleanup(() => clearTimeout(timeout))
|
|
151
|
+
|
|
152
|
+
const prepare = (data: Array<unknown>) => {
|
|
153
|
+
clearTimeout(timeout)
|
|
154
|
+
const deadline = performance.now() + 8
|
|
155
|
+
if (data.every((item) => getDataSearchText(item, deadline) !== undefined)) {
|
|
156
|
+
return true
|
|
157
|
+
}
|
|
158
|
+
timeout = setTimeout(() => setVersion((current) => current + 1))
|
|
159
|
+
return false
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return { version, prepare }
|
|
163
|
+
}
|
|
164
|
+
|
|
86
165
|
interface DevtoolsPanelProps {
|
|
87
166
|
localStore: StorageObject<string>
|
|
88
167
|
setLocalStore: StorageSetter<string, unknown>
|
|
@@ -755,22 +834,64 @@ export const ContentView: Component<ContentViewProps> = (props) => {
|
|
|
755
834
|
: useQueryDevtoolsContext().hideDisabledQueries || false
|
|
756
835
|
})
|
|
757
836
|
|
|
837
|
+
const filterScope = createMemo<FilterScope>(() => {
|
|
838
|
+
const scope = props.localStore.filterScope as FilterScope
|
|
839
|
+
return FILTER_SCOPES.includes(scope) ? scope : DEFAULT_FILTER_SCOPE
|
|
840
|
+
})
|
|
841
|
+
|
|
842
|
+
const cycleFilterScope = () => {
|
|
843
|
+
const index = FILTER_SCOPES.indexOf(filterScope())
|
|
844
|
+
props.setLocalStore(
|
|
845
|
+
'filterScope',
|
|
846
|
+
FILTER_SCOPES[(index + 1) % FILTER_SCOPES.length]!,
|
|
847
|
+
)
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// Data changes don't change the query count, so data searches need their own trigger
|
|
851
|
+
const queryDataVersion = createSubscribeToQueryCacheBatcher(
|
|
852
|
+
() => ({}),
|
|
853
|
+
false,
|
|
854
|
+
(event) =>
|
|
855
|
+
filterScope() !== 'key' &&
|
|
856
|
+
!!props.localStore.filter &&
|
|
857
|
+
event.type === 'updated' &&
|
|
858
|
+
(event.action.type === 'success' || event.action.type === 'setState'),
|
|
859
|
+
)
|
|
860
|
+
|
|
861
|
+
const queryDataSearchTexts = createDataSearchTexts()
|
|
862
|
+
|
|
758
863
|
const queries = createMemo(
|
|
759
864
|
on(
|
|
760
865
|
() => [
|
|
761
866
|
queryCount(),
|
|
762
867
|
props.localStore.filter,
|
|
868
|
+
filterScope(),
|
|
869
|
+
queryDataVersion(),
|
|
870
|
+
queryDataSearchTexts.version(),
|
|
763
871
|
sort(),
|
|
764
872
|
sortOrder(),
|
|
765
873
|
hideDisabledQueries(),
|
|
766
874
|
],
|
|
767
|
-
() => {
|
|
875
|
+
(_input, _prevInput, prev: Array<Query> | undefined) => {
|
|
768
876
|
const curr = query_cache().getAll()
|
|
877
|
+
const filter = props.localStore.filter || ''
|
|
878
|
+
const scope = filterScope()
|
|
879
|
+
const dataTerm = filter.toLowerCase()
|
|
880
|
+
|
|
881
|
+
if (
|
|
882
|
+
filter &&
|
|
883
|
+
scope !== 'key' &&
|
|
884
|
+
!queryDataSearchTexts.prepare(curr.map((item) => item.state.data))
|
|
885
|
+
) {
|
|
886
|
+
// Keeps the previous results until all search texts are built
|
|
887
|
+
return prev ?? []
|
|
888
|
+
}
|
|
769
889
|
|
|
770
|
-
let filtered =
|
|
890
|
+
let filtered = filter
|
|
771
891
|
? curr.filter(
|
|
772
892
|
(item) =>
|
|
773
|
-
rankItem(item.queryHash,
|
|
893
|
+
(scope !== 'data' && rankItem(item.queryHash, filter).passed) ||
|
|
894
|
+
(scope !== 'key' && matchesData(item.state.data, dataTerm)),
|
|
774
895
|
)
|
|
775
896
|
: [...curr]
|
|
776
897
|
|
|
@@ -794,26 +915,68 @@ export const ContentView: Component<ContentViewProps> = (props) => {
|
|
|
794
915
|
false,
|
|
795
916
|
)
|
|
796
917
|
|
|
918
|
+
// Variables and data changes don't change the mutation count, so data searches need their own trigger
|
|
919
|
+
const mutationDataVersion = createSubscribeToMutationCacheBatcher(
|
|
920
|
+
() => ({}),
|
|
921
|
+
false,
|
|
922
|
+
(event) => {
|
|
923
|
+
if (event.type !== 'updated') return false
|
|
924
|
+
// Mutation functions can change variables in place, including when no data filter is active.
|
|
925
|
+
for (const value of [
|
|
926
|
+
event.mutation.state.variables,
|
|
927
|
+
event.mutation.state.data,
|
|
928
|
+
]) {
|
|
929
|
+
if (typeof value === 'object' && value !== null) {
|
|
930
|
+
dataSearchTexts.delete(value)
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
return filterScope() !== 'key' && !!props.localStore.mutationFilter
|
|
934
|
+
},
|
|
935
|
+
)
|
|
936
|
+
|
|
937
|
+
const mutationDataSearchTexts = createDataSearchTexts()
|
|
938
|
+
|
|
797
939
|
const mutations = createMemo(
|
|
798
940
|
on(
|
|
799
941
|
() => [
|
|
800
942
|
mutationCount(),
|
|
801
943
|
props.localStore.mutationFilter,
|
|
944
|
+
filterScope(),
|
|
945
|
+
mutationDataVersion(),
|
|
946
|
+
mutationDataSearchTexts.version(),
|
|
802
947
|
mutationSort(),
|
|
803
948
|
mutationSortOrder(),
|
|
804
949
|
],
|
|
805
|
-
() => {
|
|
950
|
+
(_input, _prevInput, prev: Array<Mutation> | undefined) => {
|
|
806
951
|
const curr = mutation_cache().getAll()
|
|
952
|
+
const filter = props.localStore.mutationFilter || ''
|
|
953
|
+
const scope = filterScope()
|
|
954
|
+
const dataTerm = filter.toLowerCase()
|
|
955
|
+
|
|
956
|
+
if (
|
|
957
|
+
filter &&
|
|
958
|
+
scope !== 'key' &&
|
|
959
|
+
!mutationDataSearchTexts.prepare(
|
|
960
|
+
curr.flatMap((item) => [item.state.variables, item.state.data]),
|
|
961
|
+
)
|
|
962
|
+
) {
|
|
963
|
+
// Keeps the previous results until all search texts are built
|
|
964
|
+
return prev ?? []
|
|
965
|
+
}
|
|
807
966
|
|
|
808
|
-
const filtered =
|
|
967
|
+
const filtered = filter
|
|
809
968
|
? curr.filter((item) => {
|
|
810
969
|
const value = `${
|
|
811
970
|
item.options.mutationKey
|
|
812
971
|
? JSON.stringify(item.options.mutationKey) + ' - '
|
|
813
972
|
: ''
|
|
814
973
|
}${new Date(item.state.submittedAt).toLocaleString()}`
|
|
815
|
-
return
|
|
816
|
-
.passed
|
|
974
|
+
return (
|
|
975
|
+
(scope !== 'data' && rankItem(value, filter).passed) ||
|
|
976
|
+
(scope !== 'key' &&
|
|
977
|
+
(matchesData(item.state.variables, dataTerm) ||
|
|
978
|
+
matchesData(item.state.data, dataTerm)))
|
|
979
|
+
)
|
|
817
980
|
})
|
|
818
981
|
: [...curr]
|
|
819
982
|
|
|
@@ -939,7 +1102,9 @@ export const ContentView: Component<ContentViewProps> = (props) => {
|
|
|
939
1102
|
>
|
|
940
1103
|
<Search />
|
|
941
1104
|
<input
|
|
942
|
-
aria-label=
|
|
1105
|
+
aria-label={
|
|
1106
|
+
filterScopeAriaLabels[selectedView()][filterScope()]
|
|
1107
|
+
}
|
|
943
1108
|
type="text"
|
|
944
1109
|
placeholder="Filter"
|
|
945
1110
|
onInput={(e) => {
|
|
@@ -957,6 +1122,19 @@ export const ContentView: Component<ContentViewProps> = (props) => {
|
|
|
957
1122
|
: props.localStore.mutationFilter || ''
|
|
958
1123
|
}
|
|
959
1124
|
/>
|
|
1125
|
+
<button
|
|
1126
|
+
type="button"
|
|
1127
|
+
onClick={cycleFilterScope}
|
|
1128
|
+
class={cx(
|
|
1129
|
+
styles().filterScopeBtn,
|
|
1130
|
+
'tsqd-query-filter-scope-btn',
|
|
1131
|
+
)}
|
|
1132
|
+
aria-label={`Filter scope: ${filterScopeLabels[filterScope()]}`}
|
|
1133
|
+
title={`${filterScopeAriaLabels[selectedView()][filterScope()]}. Click to switch between key, data, and both.`}
|
|
1134
|
+
data-scope={filterScope()}
|
|
1135
|
+
>
|
|
1136
|
+
{filterScopeLabels[filterScope()]}
|
|
1137
|
+
</button>
|
|
960
1138
|
</div>
|
|
961
1139
|
<div
|
|
962
1140
|
class={cx(
|
|
@@ -1394,11 +1572,21 @@ export const ContentView: Component<ContentViewProps> = (props) => {
|
|
|
1394
1572
|
</Show>
|
|
1395
1573
|
</div>
|
|
1396
1574
|
<Show when={selectedView() === 'queries' && selectedQueryHash()}>
|
|
1397
|
-
<QueryDetails
|
|
1575
|
+
<QueryDetails
|
|
1576
|
+
initialSearch={
|
|
1577
|
+
filterScope() !== 'key' ? props.localStore.filter : undefined
|
|
1578
|
+
}
|
|
1579
|
+
/>
|
|
1398
1580
|
</Show>
|
|
1399
1581
|
|
|
1400
1582
|
<Show when={selectedView() === 'mutations' && selectedMutationId()}>
|
|
1401
|
-
<MutationDetails
|
|
1583
|
+
<MutationDetails
|
|
1584
|
+
initialSearch={
|
|
1585
|
+
filterScope() !== 'key'
|
|
1586
|
+
? props.localStore.mutationFilter
|
|
1587
|
+
: undefined
|
|
1588
|
+
}
|
|
1589
|
+
/>
|
|
1402
1590
|
</Show>
|
|
1403
1591
|
</>
|
|
1404
1592
|
)
|
|
@@ -1788,7 +1976,7 @@ const QueryStatus: Component<QueryStatusProps> = (props) => {
|
|
|
1788
1976
|
)
|
|
1789
1977
|
}
|
|
1790
1978
|
|
|
1791
|
-
const QueryDetails = () => {
|
|
1979
|
+
const QueryDetails = (props: { initialSearch?: string }) => {
|
|
1792
1980
|
const { selectedQueryHash, setSelectedQueryHash } = useDevtoolsState()
|
|
1793
1981
|
|
|
1794
1982
|
const theme = useTheme()
|
|
@@ -2227,6 +2415,7 @@ const QueryDetails = () => {
|
|
|
2227
2415
|
>
|
|
2228
2416
|
<SearchableExplorer
|
|
2229
2417
|
searchKey={activeQuery()}
|
|
2418
|
+
initialSearch={props.initialSearch}
|
|
2230
2419
|
label="Data"
|
|
2231
2420
|
defaultExpanded={['Data']}
|
|
2232
2421
|
value={activeQueryStateData()}
|
|
@@ -2321,7 +2510,7 @@ const QueryDetails = () => {
|
|
|
2321
2510
|
)
|
|
2322
2511
|
}
|
|
2323
2512
|
|
|
2324
|
-
const MutationDetails = () => {
|
|
2513
|
+
const MutationDetails = (props: { initialSearch?: string }) => {
|
|
2325
2514
|
const { selectedMutationId } = useDevtoolsState()
|
|
2326
2515
|
|
|
2327
2516
|
const theme = useTheme()
|
|
@@ -2368,6 +2557,11 @@ const MutationDetails = () => {
|
|
|
2368
2557
|
false,
|
|
2369
2558
|
)
|
|
2370
2559
|
|
|
2560
|
+
const matchingSearch = (value: unknown) =>
|
|
2561
|
+
props.initialSearch && matchesData(value, props.initialSearch.toLowerCase())
|
|
2562
|
+
? props.initialSearch
|
|
2563
|
+
: undefined
|
|
2564
|
+
|
|
2371
2565
|
const getQueryStatusColors = () => {
|
|
2372
2566
|
if (color() === 'gray') {
|
|
2373
2567
|
return css`
|
|
@@ -2443,7 +2637,9 @@ const MutationDetails = () => {
|
|
|
2443
2637
|
}}
|
|
2444
2638
|
class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"
|
|
2445
2639
|
>
|
|
2446
|
-
<
|
|
2640
|
+
<SearchableExplorer
|
|
2641
|
+
searchKey={activeMutation()}
|
|
2642
|
+
initialSearch={matchingSearch(activeMutation()!.state.variables)}
|
|
2447
2643
|
label="Variables"
|
|
2448
2644
|
defaultExpanded={['Variables']}
|
|
2449
2645
|
value={activeMutation()!.state.variables}
|
|
@@ -2483,6 +2679,7 @@ const MutationDetails = () => {
|
|
|
2483
2679
|
>
|
|
2484
2680
|
<SearchableExplorer
|
|
2485
2681
|
searchKey={activeMutation()}
|
|
2682
|
+
initialSearch={matchingSearch(activeMutation()!.state.data)}
|
|
2486
2683
|
label="Data"
|
|
2487
2684
|
defaultExpanded={['Data']}
|
|
2488
2685
|
value={activeMutation()!.state.data}
|
|
@@ -2586,6 +2783,7 @@ const setupMutationCacheSubscription = () => {
|
|
|
2586
2783
|
const createSubscribeToMutationCacheBatcher = <T,>(
|
|
2587
2784
|
callback: (queryCache: Accessor<MutationCache>) => Exclude<T, Function>,
|
|
2588
2785
|
equalityCheck: boolean = true,
|
|
2786
|
+
shouldUpdate: (event: MutationCacheNotifyEvent) => boolean = () => true,
|
|
2589
2787
|
) => {
|
|
2590
2788
|
const { mutationCacheSubscriptions } = useDevtoolsSubscriptions()
|
|
2591
2789
|
const mutationCache = createMemo(() => {
|
|
@@ -2602,7 +2800,7 @@ const createSubscribeToMutationCacheBatcher = <T,>(
|
|
|
2602
2800
|
setValue(callback(mutationCache))
|
|
2603
2801
|
})
|
|
2604
2802
|
|
|
2605
|
-
mutationCacheSubscriptions.register(callback, setValue)
|
|
2803
|
+
mutationCacheSubscriptions.register(callback, setValue, shouldUpdate)
|
|
2606
2804
|
|
|
2607
2805
|
return value
|
|
2608
2806
|
}
|
|
@@ -3156,6 +3354,8 @@ const stylesFactory = (
|
|
|
3156
3354
|
& input {
|
|
3157
3355
|
font-size: ${font.size.xs};
|
|
3158
3356
|
width: 100%;
|
|
3357
|
+
min-width: 0;
|
|
3358
|
+
flex: 1;
|
|
3159
3359
|
background-color: ${t(colors.gray[100], colors.darkGray[400])};
|
|
3160
3360
|
border: none;
|
|
3161
3361
|
padding: 0;
|
|
@@ -3175,6 +3375,27 @@ const stylesFactory = (
|
|
|
3175
3375
|
outline: 2px solid ${colors.blue[800]};
|
|
3176
3376
|
}
|
|
3177
3377
|
`,
|
|
3378
|
+
filterScopeBtn: css`
|
|
3379
|
+
flex-shrink: 0;
|
|
3380
|
+
cursor: pointer;
|
|
3381
|
+
padding: 0 ${size[1]};
|
|
3382
|
+
border-radius: ${border.radius.xs};
|
|
3383
|
+
border: 1px solid ${t(colors.gray[300], colors.darkGray[200])};
|
|
3384
|
+
background-color: ${t(colors.gray[200], colors.darkGray[500])};
|
|
3385
|
+
color: ${t(colors.gray[700], colors.gray[300])};
|
|
3386
|
+
font-size: ${font.size.xs};
|
|
3387
|
+
line-height: ${font.lineHeight.xs};
|
|
3388
|
+
&[data-scope='data'],
|
|
3389
|
+
&[data-scope='all'] {
|
|
3390
|
+
border-color: ${t(colors.blue[300], colors.blue[700])};
|
|
3391
|
+
background-color: ${t(colors.blue[100], colors.blue[900])};
|
|
3392
|
+
color: ${t(colors.blue[700], colors.blue[300])};
|
|
3393
|
+
}
|
|
3394
|
+
&:focus-visible {
|
|
3395
|
+
outline-offset: 2px;
|
|
3396
|
+
outline: 2px solid ${colors.blue[800]};
|
|
3397
|
+
}
|
|
3398
|
+
`,
|
|
3178
3399
|
filterSelect: css`
|
|
3179
3400
|
padding: ${tokens.size[0.5]} ${tokens.size[2]};
|
|
3180
3401
|
border-radius: ${tokens.border.radius.sm};
|