@tanstack/query-devtools 5.27.3 → 5.27.8

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/index.cjs CHANGED
@@ -12238,8 +12238,11 @@ function isIterable(x) {
12238
12238
  }
12239
12239
  function Explorer(props) {
12240
12240
  const theme = useTheme();
12241
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
12242
+ target: useQueryDevtoolsContext().shadowDOMTarget
12243
+ }) : u;
12241
12244
  const styles = createMemo(() => {
12242
- return theme() === "dark" ? darkStyles : lightStyles;
12245
+ return theme() === "dark" ? darkStyles(css) : lightStyles(css);
12243
12246
  });
12244
12247
  const queryClient = useQueryDevtoolsContext().client;
12245
12248
  const [expanded, setExpanded] = createSignal((props.defaultExpanded || []).includes(props.label));
@@ -12582,10 +12585,10 @@ var init_Explorer = __esm({
12582
12585
  init_web();
12583
12586
  init_web();
12584
12587
  init_esm();
12585
- init_goober_modern();
12586
12588
  init_clsx();
12587
12589
  init_solid();
12588
12590
  init_dist6();
12591
+ init_goober_modern();
12589
12592
  init_theme();
12590
12593
  init_utils();
12591
12594
  init_icons();
@@ -12603,14 +12606,17 @@ var init_Explorer = __esm({
12603
12606
  _tmpl$112 = /* @__PURE__ */ template(`<div><div><button> [<!>...<!>]`);
12604
12607
  Expander = (props) => {
12605
12608
  const theme = useTheme();
12609
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
12610
+ target: useQueryDevtoolsContext().shadowDOMTarget
12611
+ }) : u;
12606
12612
  const styles = createMemo(() => {
12607
- return theme() === "dark" ? darkStyles : lightStyles;
12613
+ return theme() === "dark" ? darkStyles(css) : lightStyles(css);
12608
12614
  });
12609
12615
  return (() => {
12610
12616
  const _el$ = _tmpl$23();
12611
- createRenderEffect(() => className(_el$, clsx(styles().expander, u`
12617
+ createRenderEffect(() => className(_el$, clsx(styles().expander, css`
12612
12618
  transform: rotate(${props.expanded ? 90 : 0}deg);
12613
- `, props.expanded && u`
12619
+ `, props.expanded && css`
12614
12620
  & svg {
12615
12621
  top: -1px;
12616
12622
  }
@@ -12620,8 +12626,11 @@ var init_Explorer = __esm({
12620
12626
  };
12621
12627
  CopyButton = (props) => {
12622
12628
  const theme = useTheme();
12629
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
12630
+ target: useQueryDevtoolsContext().shadowDOMTarget
12631
+ }) : u;
12623
12632
  const styles = createMemo(() => {
12624
- return theme() === "dark" ? darkStyles : lightStyles;
12633
+ return theme() === "dark" ? darkStyles(css) : lightStyles(css);
12625
12634
  });
12626
12635
  const [copyState, setCopyState] = createSignal("NoCopy");
12627
12636
  return (() => {
@@ -12683,8 +12692,11 @@ var init_Explorer = __esm({
12683
12692
  };
12684
12693
  ClearArrayButton = (props) => {
12685
12694
  const theme = useTheme();
12695
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
12696
+ target: useQueryDevtoolsContext().shadowDOMTarget
12697
+ }) : u;
12686
12698
  const styles = createMemo(() => {
12687
- return theme() === "dark" ? darkStyles : lightStyles;
12699
+ return theme() === "dark" ? darkStyles(css) : lightStyles(css);
12688
12700
  });
12689
12701
  const queryClient = useQueryDevtoolsContext().client;
12690
12702
  return (() => {
@@ -12701,8 +12713,11 @@ var init_Explorer = __esm({
12701
12713
  };
12702
12714
  DeleteItemButton = (props) => {
12703
12715
  const theme = useTheme();
12716
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
12717
+ target: useQueryDevtoolsContext().shadowDOMTarget
12718
+ }) : u;
12704
12719
  const styles = createMemo(() => {
12705
- return theme() === "dark" ? darkStyles : lightStyles;
12720
+ return theme() === "dark" ? darkStyles(css) : lightStyles(css);
12706
12721
  });
12707
12722
  const queryClient = useQueryDevtoolsContext().client;
12708
12723
  return (() => {
@@ -12719,8 +12734,11 @@ var init_Explorer = __esm({
12719
12734
  };
12720
12735
  ToggleValueButton = (props) => {
12721
12736
  const theme = useTheme();
12737
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
12738
+ target: useQueryDevtoolsContext().shadowDOMTarget
12739
+ }) : u;
12722
12740
  const styles = createMemo(() => {
12723
- return theme() === "dark" ? darkStyles : lightStyles;
12741
+ return theme() === "dark" ? darkStyles(css) : lightStyles(css);
12724
12742
  });
12725
12743
  const queryClient = useQueryDevtoolsContext().client;
12726
12744
  return (() => {
@@ -12738,14 +12756,14 @@ var init_Explorer = __esm({
12738
12756
  return props.value;
12739
12757
  }
12740
12758
  }));
12741
- createRenderEffect(() => className(_el$5, clsx(styles().actionButton, u`
12759
+ createRenderEffect(() => className(_el$5, clsx(styles().actionButton, css`
12742
12760
  width: ${tokens.size[3.5]};
12743
12761
  height: ${tokens.size[3.5]};
12744
12762
  `)));
12745
12763
  return _el$5;
12746
12764
  })();
12747
12765
  };
12748
- stylesFactory = (theme) => {
12766
+ stylesFactory = (theme, css) => {
12749
12767
  const {
12750
12768
  colors,
12751
12769
  font,
@@ -12754,7 +12772,7 @@ var init_Explorer = __esm({
12754
12772
  } = tokens;
12755
12773
  const t2 = (light, dark) => theme === "light" ? light : dark;
12756
12774
  return {
12757
- entry: u`
12775
+ entry: css`
12758
12776
  & * {
12759
12777
  font-size: ${font.size.xs};
12760
12778
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
@@ -12764,13 +12782,13 @@ var init_Explorer = __esm({
12764
12782
  outline: none;
12765
12783
  word-break: break-word;
12766
12784
  `,
12767
- subEntry: u`
12785
+ subEntry: css`
12768
12786
  margin: 0 0 0 0.5em;
12769
12787
  padding-left: 0.75em;
12770
12788
  border-left: 2px solid ${t2(colors.gray[300], colors.darkGray[400])};
12771
12789
  /* outline: 1px solid ${colors.teal[400]}; */
12772
12790
  `,
12773
- expander: u`
12791
+ expander: css`
12774
12792
  & path {
12775
12793
  stroke: ${colors.gray[400]};
12776
12794
  }
@@ -12783,14 +12801,14 @@ var init_Explorer = __esm({
12783
12801
  transition: all 0.1s ease;
12784
12802
  /* outline: 1px solid ${colors.blue[400]}; */
12785
12803
  `,
12786
- expanderButtonContainer: u`
12804
+ expanderButtonContainer: css`
12787
12805
  display: flex;
12788
12806
  align-items: center;
12789
12807
  line-height: ${size2[4]};
12790
12808
  min-height: ${size2[4]};
12791
12809
  gap: ${size2[2]};
12792
12810
  `,
12793
- expanderButton: u`
12811
+ expanderButton: css`
12794
12812
  cursor: pointer;
12795
12813
  color: inherit;
12796
12814
  font: inherit;
@@ -12815,26 +12833,26 @@ var init_Explorer = __esm({
12815
12833
  left: 1px;
12816
12834
  }
12817
12835
  `,
12818
- info: u`
12836
+ info: css`
12819
12837
  color: ${t2(colors.gray[500], colors.gray[500])};
12820
12838
  font-size: ${font.size.xs};
12821
12839
  margin-left: ${size2[1]};
12822
12840
  /* outline: 1px solid ${colors.yellow[400]}; */
12823
12841
  `,
12824
- label: u`
12842
+ label: css`
12825
12843
  color: ${t2(colors.gray[700], colors.gray[300])};
12826
12844
  white-space: nowrap;
12827
12845
  `,
12828
- value: u`
12846
+ value: css`
12829
12847
  color: ${t2(colors.purple[600], colors.purple[400])};
12830
12848
  flex-grow: 1;
12831
12849
  `,
12832
- actions: u`
12850
+ actions: css`
12833
12851
  display: inline-flex;
12834
12852
  gap: ${size2[2]};
12835
12853
  align-items: center;
12836
12854
  `,
12837
- row: u`
12855
+ row: css`
12838
12856
  display: inline-flex;
12839
12857
  gap: ${size2[2]};
12840
12858
  width: 100%;
@@ -12842,7 +12860,7 @@ var init_Explorer = __esm({
12842
12860
  line-height: ${size2[4.5]};
12843
12861
  align-items: center;
12844
12862
  `,
12845
- editableInput: u`
12863
+ editableInput: css`
12846
12864
  border: none;
12847
12865
  padding: ${size2[0.5]} ${size2[1]} ${size2[0.5]} ${size2[1.5]};
12848
12866
  flex-grow: 1;
@@ -12853,7 +12871,7 @@ var init_Explorer = __esm({
12853
12871
  background-color: ${t2(colors.gray[300], colors.darkGray[600])};
12854
12872
  }
12855
12873
  `,
12856
- actionButton: u`
12874
+ actionButton: css`
12857
12875
  background-color: transparent;
12858
12876
  color: ${t2(colors.gray[500], colors.gray[500])};
12859
12877
  border: none;
@@ -12879,8 +12897,8 @@ var init_Explorer = __esm({
12879
12897
  `
12880
12898
  };
12881
12899
  };
12882
- lightStyles = stylesFactory("light");
12883
- darkStyles = stylesFactory("dark");
12900
+ lightStyles = (css) => stylesFactory("light", css);
12901
+ darkStyles = (css) => stylesFactory("dark", css);
12884
12902
  delegateEvents(["click"]);
12885
12903
  }
12886
12904
  });
@@ -12890,7 +12908,7 @@ var Devtools_exports = {};
12890
12908
  __export(Devtools_exports, {
12891
12909
  default: () => Devtools_default
12892
12910
  });
12893
- var _tmpl$25, _tmpl$26, _tmpl$33, _tmpl$43, _tmpl$53, _tmpl$63, _tmpl$73, _tmpl$83, _tmpl$93, _tmpl$103, _tmpl$113, _tmpl$122, _tmpl$132, _tmpl$142, _tmpl$152, _tmpl$162, _tmpl$172, _tmpl$182, _tmpl$192, _tmpl$202, _tmpl$212, _tmpl$222, _tmpl$232, _tmpl$242, _tmpl$252, _tmpl$262, _tmpl$27, _tmpl$28, _tmpl$29, _tmpl$30, _tmpl$31, _tmpl$322, firstBreakpoint, secondBreakpoint, thirdBreakpoint, BUTTON_POSITION, POSITION, THEME_PREFERENCE, INITIAL_IS_OPEN, DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_SORT_FN_NAME, DEFAULT_SORT_ORDER, DEFAULT_MUTATION_SORT_FN_NAME, selectedQueryHash, setSelectedQueryHash, selectedMutationId, setSelectedMutationId, panelWidth, setPanelWidth, PiPContext, PiPProvider, usePiPWindow, DevtoolsComponent, Devtools_default, Devtools, PiPPanel, DevtoolsPanel, ContentView, QueryRow, MutationRow, QueryStatusCount, MutationStatusCount, QueryStatus, QueryDetails, MutationDetails, queryCacheMap, setupQueryCacheSubscription, createSubscribeToQueryCacheBatcher, mutationCacheMap, setupMutationCacheSubscription, createSubscribeToMutationCacheBatcher, stylesFactory2, lightStyles2, darkStyles2;
12911
+ var _tmpl$25, _tmpl$26, _tmpl$33, _tmpl$43, _tmpl$53, _tmpl$63, _tmpl$73, _tmpl$83, _tmpl$93, _tmpl$103, _tmpl$113, _tmpl$122, _tmpl$132, _tmpl$142, _tmpl$152, _tmpl$162, _tmpl$172, _tmpl$182, _tmpl$192, _tmpl$202, _tmpl$212, _tmpl$222, _tmpl$232, _tmpl$242, _tmpl$252, _tmpl$262, _tmpl$27, _tmpl$28, _tmpl$29, _tmpl$30, _tmpl$31, _tmpl$322, firstBreakpoint, secondBreakpoint, thirdBreakpoint, BUTTON_POSITION, POSITION, THEME_PREFERENCE, INITIAL_IS_OPEN, DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_SORT_FN_NAME, DEFAULT_SORT_ORDER, DEFAULT_MUTATION_SORT_FN_NAME, selectedQueryHash, setSelectedQueryHash, selectedMutationId, setSelectedMutationId, panelWidth, setPanelWidth, offline, setOffline, PiPContext, PiPProvider, usePiPWindow, DevtoolsComponent, Devtools_default, Devtools, PiPPanel, DevtoolsPanel, ContentView, QueryRow, MutationRow, QueryStatusCount, MutationStatusCount, QueryStatus, QueryDetails, MutationDetails, queryCacheMap, setupQueryCacheSubscription, createSubscribeToQueryCacheBatcher, mutationCacheMap, setupMutationCacheSubscription, createSubscribeToMutationCacheBatcher, stylesFactory2, lightStyles2, darkStyles2;
12894
12912
  var init_Devtools = __esm({
12895
12913
  "src/Devtools.tsx"() {
12896
12914
  init_web();
@@ -12966,6 +12984,7 @@ var init_Devtools = __esm({
12966
12984
  [selectedQueryHash, setSelectedQueryHash] = createSignal(null);
12967
12985
  [selectedMutationId, setSelectedMutationId] = createSignal(null);
12968
12986
  [panelWidth, setPanelWidth] = createSignal(0);
12987
+ [offline, setOffline] = createSignal(false);
12969
12988
  PiPContext = createContext(void 0);
12970
12989
  PiPProvider = (props) => {
12971
12990
  const [pipWindow, setPipWindow] = createSignal(null);
@@ -13465,7 +13484,6 @@ var init_Devtools = __esm({
13465
13484
  const sortOrder = createMemo(() => Number(props.localStore.sortOrder) || DEFAULT_SORT_ORDER);
13466
13485
  const mutationSort = createMemo(() => props.localStore.mutationSort || DEFAULT_MUTATION_SORT_FN_NAME);
13467
13486
  const mutationSortOrder = createMemo(() => Number(props.localStore.mutationSortOrder) || DEFAULT_SORT_ORDER);
13468
- const [offline, setOffline] = createSignal(false);
13469
13487
  const sortFn = createMemo(() => sortFns[sort()]);
13470
13488
  const mutationSortFn = createMemo(() => mutationSortFns[mutationSort()]);
13471
13489
  const onlineManager = createMemo(() => useQueryDevtoolsContext().onlineManager);
package/build/index.js CHANGED
@@ -69,7 +69,7 @@ var TanstackQueryDevtools = class {
69
69
  if (this.#Component) {
70
70
  Devtools = this.#Component;
71
71
  } else {
72
- Devtools = lazy(() => import('./Devtools/DBFR2OSQ.js'));
72
+ Devtools = lazy(() => import('./Devtools/NISTJ3CZ.js'));
73
73
  this.#Component = Devtools;
74
74
  }
75
75
  setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
package/build/index.jsx CHANGED
@@ -73,7 +73,7 @@ var TanstackQueryDevtools = class {
73
73
  if (this.#Component) {
74
74
  Devtools = this.#Component;
75
75
  } else {
76
- Devtools = lazy(() => import("./Devtools/ZI3HPF3S.jsx"));
76
+ Devtools = lazy(() => import("./Devtools/A63KNBMQ.jsx"));
77
77
  this.#Component = Devtools;
78
78
  }
79
79
  setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/query-devtools",
3
- "version": "5.27.3",
3
+ "version": "5.27.8",
4
4
  "description": "Developer tools to interact with and visualize the TanStack Query cache",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -50,7 +50,7 @@
50
50
  "superjson": "^1.13.3",
51
51
  "tsup-preset-solid": "^2.2.0",
52
52
  "vite-plugin-solid": "^2.9.1",
53
- "@tanstack/query-core": "5.27.3"
53
+ "@tanstack/query-core": "5.27.5"
54
54
  },
55
55
  "scripts": {
56
56
  "clean": "rimraf ./build && rimraf ./coverage",
package/src/Devtools.tsx CHANGED
@@ -110,6 +110,7 @@ const [selectedMutationId, setSelectedMutationId] = createSignal<number | null>(
110
110
  null,
111
111
  )
112
112
  const [panelWidth, setPanelWidth] = createSignal(0)
113
+ const [offline, setOffline] = createSignal(false)
113
114
 
114
115
  export type DevtoolsComponentType = Component<QueryDevtoolsProps> & {
115
116
  shadowDOMTarget?: ShadowRoot
@@ -776,8 +777,6 @@ const ContentView: Component<DevtoolsPanelProps> = (props) => {
776
777
  () => Number(props.localStore.mutationSortOrder) || DEFAULT_SORT_ORDER,
777
778
  ) as () => 1 | -1
778
779
 
779
- const [offline, setOffline] = createSignal(false)
780
-
781
780
  const sortFn = createMemo(() => sortFns[sort() as string])
782
781
  const mutationSortFn = createMemo(
783
782
  () => mutationSortFns[mutationSort() as string],
package/src/Explorer.tsx CHANGED
@@ -1,8 +1,8 @@
1
1
  import { stringify } from 'superjson'
2
- import { css } from 'goober'
3
2
  import { clsx as cx } from 'clsx'
4
3
  import { Index, Match, Show, Switch, createMemo, createSignal } from 'solid-js'
5
4
  import { Key } from '@solid-primitives/keyed'
5
+ import * as goober from 'goober'
6
6
  import { tokens } from './theme'
7
7
  import {
8
8
  deleteNestedDataByPath,
@@ -38,8 +38,11 @@ function chunkArray<T extends { label: string; value: unknown }>(
38
38
 
39
39
  const Expander = (props: { expanded: boolean }) => {
40
40
  const theme = useTheme()
41
+ const css = useQueryDevtoolsContext().shadowDOMTarget
42
+ ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
43
+ : goober.css
41
44
  const styles = createMemo(() => {
42
- return theme() === 'dark' ? darkStyles : lightStyles
45
+ return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
43
46
  })
44
47
 
45
48
  return (
@@ -78,8 +81,11 @@ const Expander = (props: { expanded: boolean }) => {
78
81
  type CopyState = 'NoCopy' | 'SuccessCopy' | 'ErrorCopy'
79
82
  const CopyButton = (props: { value: unknown }) => {
80
83
  const theme = useTheme()
84
+ const css = useQueryDevtoolsContext().shadowDOMTarget
85
+ ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
86
+ : goober.css
81
87
  const styles = createMemo(() => {
82
- return theme() === 'dark' ? darkStyles : lightStyles
88
+ return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
83
89
  })
84
90
  const [copyState, setCopyState] = createSignal<CopyState>('NoCopy')
85
91
 
@@ -136,8 +142,11 @@ const ClearArrayButton = (props: {
136
142
  activeQuery: Query
137
143
  }) => {
138
144
  const theme = useTheme()
145
+ const css = useQueryDevtoolsContext().shadowDOMTarget
146
+ ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
147
+ : goober.css
139
148
  const styles = createMemo(() => {
140
- return theme() === 'dark' ? darkStyles : lightStyles
149
+ return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
141
150
  })
142
151
  const queryClient = useQueryDevtoolsContext().client
143
152
 
@@ -162,8 +171,11 @@ const DeleteItemButton = (props: {
162
171
  activeQuery: Query
163
172
  }) => {
164
173
  const theme = useTheme()
174
+ const css = useQueryDevtoolsContext().shadowDOMTarget
175
+ ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
176
+ : goober.css
165
177
  const styles = createMemo(() => {
166
- return theme() === 'dark' ? darkStyles : lightStyles
178
+ return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
167
179
  })
168
180
  const queryClient = useQueryDevtoolsContext().client
169
181
 
@@ -189,8 +201,11 @@ const ToggleValueButton = (props: {
189
201
  value: boolean
190
202
  }) => {
191
203
  const theme = useTheme()
204
+ const css = useQueryDevtoolsContext().shadowDOMTarget
205
+ ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
206
+ : goober.css
192
207
  const styles = createMemo(() => {
193
- return theme() === 'dark' ? darkStyles : lightStyles
208
+ return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
194
209
  })
195
210
  const queryClient = useQueryDevtoolsContext().client
196
211
 
@@ -236,8 +251,11 @@ function isIterable(x: any): x is Iterable<unknown> {
236
251
 
237
252
  export default function Explorer(props: ExplorerProps) {
238
253
  const theme = useTheme()
254
+ const css = useQueryDevtoolsContext().shadowDOMTarget
255
+ ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
256
+ : goober.css
239
257
  const styles = createMemo(() => {
240
- return theme() === 'dark' ? darkStyles : lightStyles
258
+ return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
241
259
  })
242
260
  const queryClient = useQueryDevtoolsContext().client
243
261
 
@@ -482,7 +500,10 @@ export default function Explorer(props: ExplorerProps) {
482
500
  )
483
501
  }
484
502
 
485
- const stylesFactory = (theme: 'light' | 'dark') => {
503
+ const stylesFactory = (
504
+ theme: 'light' | 'dark',
505
+ css: (typeof goober)['css'],
506
+ ) => {
486
507
  const { colors, font, size, border } = tokens
487
508
  const t = (light: string, dark: string) => (theme === 'light' ? light : dark)
488
509
  return {
@@ -612,5 +633,5 @@ const stylesFactory = (theme: 'light' | 'dark') => {
612
633
  }
613
634
  }
614
635
 
615
- const lightStyles = stylesFactory('light')
616
- const darkStyles = stylesFactory('dark')
636
+ const lightStyles = (css: (typeof goober)['css']) => stylesFactory('light', css)
637
+ const darkStyles = (css: (typeof goober)['css']) => stylesFactory('dark', css)