@tanstack/query-devtools 5.23.0 → 5.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,7 @@ import {
11
11
  Switch,
12
12
  batch,
13
13
  children,
14
+ clearDelegatedEvents,
14
15
  convertRemToPixels,
15
16
  createComponent,
16
17
  createComputed,
@@ -49,7 +50,7 @@ import {
49
50
  use,
50
51
  useContext,
51
52
  useTransition
52
- } from "../chunk/PQZZ5Z2E.jsx";
53
+ } from "../chunk/HLOIZPIT.jsx";
53
54
 
54
55
  // ../../node_modules/.pnpm/@tanstack+match-sorter-utils@8.11.8/node_modules/@tanstack/match-sorter-utils/build/lib/index.mjs
55
56
  var characterMap = {
@@ -9979,7 +9980,8 @@ var QueryDevtoolsContext = createContext({
9979
9980
  client: void 0,
9980
9981
  onlineManager: void 0,
9981
9982
  queryFlavor: "",
9982
- version: ""
9983
+ version: "",
9984
+ shadowDOMTarget: void 0
9983
9985
  });
9984
9986
  function useQueryDevtoolsContext() {
9985
9987
  return useContext(QueryDevtoolsContext);
@@ -10467,15 +10469,23 @@ var PiPProvider = (props) => {
10467
10469
  if (pipWindow() != null) {
10468
10470
  return;
10469
10471
  }
10470
- const pip = window.open("", "", `width=${width},height=${height},popup`);
10472
+ const pip = window.open(
10473
+ "",
10474
+ "TSQD-Devtools-Panel",
10475
+ `width=${width},height=${height},popup`
10476
+ );
10471
10477
  if (!pip) {
10472
10478
  throw new Error(
10473
10479
  "Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode."
10474
10480
  );
10475
10481
  }
10482
+ pip.document.head.innerHTML = "";
10483
+ pip.document.body.innerHTML = "";
10484
+ clearDelegatedEvents(pip.document);
10476
10485
  pip.document.title = "TanStack Query Devtools";
10477
10486
  pip.document.body.style.margin = "0";
10478
10487
  pip.addEventListener("pagehide", () => {
10488
+ props.setLocalStore("pip_open", "false");
10479
10489
  setPipWindow(null);
10480
10490
  });
10481
10491
  [...document.styleSheets].forEach((styleSheet) => {
@@ -10518,23 +10528,24 @@ var PiPProvider = (props) => {
10518
10528
  ],
10519
10529
  pip.document
10520
10530
  );
10531
+ props.setLocalStore("pip_open", "true");
10521
10532
  setPipWindow(pip);
10522
10533
  };
10523
10534
  createEffect(() => {
10524
- const closePipWindowOnUnload = () => {
10525
- closePipWindow();
10526
- };
10527
- window.addEventListener("beforeunload", closePipWindowOnUnload);
10528
- onCleanup(() => {
10529
- window.removeEventListener("beforeunload", closePipWindowOnUnload);
10530
- });
10535
+ const pip_open = props.localStore.pip_open ?? "false";
10536
+ if (pip_open === "true") {
10537
+ requestPipWindow(
10538
+ Number(window.innerWidth),
10539
+ Number(props.localStore.height || DEFAULT_HEIGHT)
10540
+ );
10541
+ }
10531
10542
  });
10532
10543
  createEffect(() => {
10533
- const gooberStyles = document.getElementById("_goober");
10544
+ const gooberStyles = (useQueryDevtoolsContext().shadowDOMTarget || document).querySelector("#_goober");
10534
10545
  const w = pipWindow();
10535
10546
  if (gooberStyles && w) {
10536
10547
  const observer = new MutationObserver(() => {
10537
- const pip_style = w.document.getElementById("_goober");
10548
+ const pip_style = (useQueryDevtoolsContext().shadowDOMTarget || w.document).querySelector("#_goober");
10538
10549
  if (pip_style) {
10539
10550
  pip_style.textContent = gooberStyles.textContent;
10540
10551
  }
@@ -10580,13 +10591,14 @@ var DevtoolsComponent = (props) => {
10580
10591
  return preference;
10581
10592
  return colorScheme();
10582
10593
  });
10583
- return <QueryDevtoolsContext.Provider value={props}><PiPProvider><ThemeContext.Provider value={theme}><Devtools localStore={localStore} setLocalStore={setLocalStore} /></ThemeContext.Provider></PiPProvider></QueryDevtoolsContext.Provider>;
10594
+ return <QueryDevtoolsContext.Provider value={props}><PiPProvider localStore={localStore} setLocalStore={setLocalStore}><ThemeContext.Provider value={theme}><Devtools localStore={localStore} setLocalStore={setLocalStore} /></ThemeContext.Provider></PiPProvider></QueryDevtoolsContext.Provider>;
10584
10595
  };
10585
10596
  var Devtools_default = DevtoolsComponent;
10586
10597
  var Devtools = (props) => {
10587
10598
  const theme = useTheme();
10599
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
10588
10600
  const styles = createMemo(() => {
10589
- return theme() === "dark" ? darkStyles2 : lightStyles2;
10601
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
10590
10602
  });
10591
10603
  const pip = usePiPWindow();
10592
10604
  const buttonPosition = createMemo(() => {
@@ -10625,14 +10637,17 @@ var Devtools = (props) => {
10625
10637
  window.removeEventListener("focus", onFocus);
10626
10638
  });
10627
10639
  });
10640
+ const pip_open = createMemo(
10641
+ () => props.localStore.pip_open ?? "false"
10642
+ );
10628
10643
  return <>
10629
- <Show when={pip().pipWindow}><Portal mount={pip().pipWindow?.document.body}><PiPPanel><ContentView
10644
+ <Show when={pip().pipWindow && pip_open() == "true"}><Portal mount={pip().pipWindow?.document.body}><PiPPanel><ContentView
10630
10645
  localStore={props.localStore}
10631
10646
  setLocalStore={props.setLocalStore}
10632
10647
  /></PiPPanel></Portal></Show>
10633
10648
  <div
10634
10649
  class={clsx(
10635
- u`
10650
+ css`
10636
10651
  & .tsqd-panel-transition-exit-active,
10637
10652
  & .tsqd-panel-transition-enter-active {
10638
10653
  transition:
@@ -10663,7 +10678,7 @@ var Devtools = (props) => {
10663
10678
  )}
10664
10679
  ref={transitionsContainerRef}
10665
10680
  >
10666
- <TransitionGroup name="tsqd-panel-transition"><Show when={isOpen() && !pip().pipWindow}><DevtoolsPanel
10681
+ <TransitionGroup name="tsqd-panel-transition"><Show when={isOpen() && !pip().pipWindow && pip_open() == "false"}><DevtoolsPanel
10667
10682
  localStore={props.localStore}
10668
10683
  setLocalStore={props.setLocalStore}
10669
10684
  /></Show></TransitionGroup>
@@ -10687,19 +10702,20 @@ var Devtools = (props) => {
10687
10702
  var PiPPanel = (props) => {
10688
10703
  const pip = usePiPWindow();
10689
10704
  const theme = useTheme();
10705
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
10690
10706
  const styles = createMemo(() => {
10691
- return theme() === "dark" ? darkStyles2 : lightStyles2;
10707
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
10692
10708
  });
10693
10709
  const getPanelDynamicStyles = () => {
10694
10710
  const { colors } = tokens;
10695
10711
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
10696
10712
  if (panelWidth() < secondBreakpoint) {
10697
- return u`
10713
+ return css`
10698
10714
  flex-direction: column;
10699
10715
  background-color: ${t2(colors.gray[300], colors.gray[600])};
10700
10716
  `;
10701
10717
  }
10702
- return u`
10718
+ return css`
10703
10719
  flex-direction: row;
10704
10720
  background-color: ${t2(colors.gray[200], colors.darkGray[900])};
10705
10721
  `;
@@ -10713,6 +10729,7 @@ var PiPPanel = (props) => {
10713
10729
  };
10714
10730
  if (win) {
10715
10731
  win.addEventListener("resize", resizeCB);
10732
+ resizeCB();
10716
10733
  }
10717
10734
  onCleanup(() => {
10718
10735
  if (win) {
@@ -10731,7 +10748,7 @@ var PiPPanel = (props) => {
10731
10748
  styles().panel,
10732
10749
  getPanelDynamicStyles(),
10733
10750
  {
10734
- [u`
10751
+ [css`
10735
10752
  min-width: min-content;
10736
10753
  `]: panelWidth() < thirdBreakpoint
10737
10754
  },
@@ -10741,8 +10758,9 @@ var PiPPanel = (props) => {
10741
10758
  };
10742
10759
  var DevtoolsPanel = (props) => {
10743
10760
  const theme = useTheme();
10761
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
10744
10762
  const styles = createMemo(() => {
10745
- return theme() === "dark" ? darkStyles2 : lightStyles2;
10763
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
10746
10764
  });
10747
10765
  const [isResizing, setIsResizing] = createSignal(false);
10748
10766
  const position = createMemo(
@@ -10831,12 +10849,12 @@ var DevtoolsPanel = (props) => {
10831
10849
  const { colors } = tokens;
10832
10850
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
10833
10851
  if (panelWidth() < secondBreakpoint) {
10834
- return u`
10852
+ return css`
10835
10853
  flex-direction: column;
10836
10854
  background-color: ${t2(colors.gray[300], colors.gray[600])};
10837
10855
  `;
10838
10856
  }
10839
- return u`
10857
+ return css`
10840
10858
  flex-direction: row;
10841
10859
  background-color: ${t2(colors.gray[200], colors.darkGray[900])};
10842
10860
  `;
@@ -10847,7 +10865,7 @@ var DevtoolsPanel = (props) => {
10847
10865
  styles()[`panel-position-${position()}`],
10848
10866
  getPanelDynamicStyles(),
10849
10867
  {
10850
- [u`
10868
+ [css`
10851
10869
  min-width: min-content;
10852
10870
  `]: panelWidth() < thirdBreakpoint && (position() === "right" || position() === "left")
10853
10871
  },
@@ -10888,8 +10906,9 @@ var ContentView = (props) => {
10888
10906
  setupMutationCacheSubscription();
10889
10907
  let containerRef;
10890
10908
  const theme = useTheme();
10909
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
10891
10910
  const styles = createMemo(() => {
10892
- return theme() === "dark" ? darkStyles2 : lightStyles2;
10911
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
10893
10912
  });
10894
10913
  const pip = usePiPWindow();
10895
10914
  const [selectedView, setSelectedView] = createSignal(
@@ -10974,11 +10993,11 @@ var ContentView = (props) => {
10974
10993
  <div
10975
10994
  class={clsx(
10976
10995
  styles().queriesContainer,
10977
- panelWidth() < secondBreakpoint && (selectedQueryHash() || selectedMutationId()) && u`
10996
+ panelWidth() < secondBreakpoint && (selectedQueryHash() || selectedMutationId()) && css`
10978
10997
  height: 50%;
10979
10998
  max-height: 50%;
10980
10999
  `,
10981
- panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && u`
11000
+ panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && css`
10982
11001
  height: 100%;
10983
11002
  max-height: 100%;
10984
11003
  `,
@@ -11357,8 +11376,9 @@ var ContentView = (props) => {
11357
11376
  };
11358
11377
  var QueryRow = (props) => {
11359
11378
  const theme = useTheme();
11379
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
11360
11380
  const styles = createMemo(() => {
11361
- return theme() === "dark" ? darkStyles2 : lightStyles2;
11381
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
11362
11382
  });
11363
11383
  const { colors, alpha } = tokens;
11364
11384
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
@@ -11399,12 +11419,12 @@ var QueryRow = (props) => {
11399
11419
  );
11400
11420
  const getObserverCountColorStyles = () => {
11401
11421
  if (color() === "gray") {
11402
- return u`
11422
+ return css`
11403
11423
  background-color: ${t2(colors[color()][200], colors[color()][700])};
11404
11424
  color: ${t2(colors[color()][700], colors[color()][300])};
11405
11425
  `;
11406
11426
  }
11407
- return u`
11427
+ return css`
11408
11428
  background-color: ${t2(
11409
11429
  colors[color()][200] + alpha[80],
11410
11430
  colors[color()][900]
@@ -11432,8 +11452,9 @@ var QueryRow = (props) => {
11432
11452
  };
11433
11453
  var MutationRow = (props) => {
11434
11454
  const theme = useTheme();
11455
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
11435
11456
  const styles = createMemo(() => {
11436
- return theme() === "dark" ? darkStyles2 : lightStyles2;
11457
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
11437
11458
  });
11438
11459
  const { colors, alpha } = tokens;
11439
11460
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
@@ -11472,12 +11493,12 @@ var MutationRow = (props) => {
11472
11493
  );
11473
11494
  const getObserverCountColorStyles = () => {
11474
11495
  if (color() === "gray") {
11475
- return u`
11496
+ return css`
11476
11497
  background-color: ${t2(colors[color()][200], colors[color()][700])};
11477
11498
  color: ${t2(colors[color()][700], colors[color()][300])};
11478
11499
  `;
11479
11500
  }
11480
- return u`
11501
+ return css`
11481
11502
  background-color: ${t2(
11482
11503
  colors[color()][200] + alpha[80],
11483
11504
  colors[color()][900]
@@ -11535,8 +11556,9 @@ var QueryStatusCount = () => {
11535
11556
  (queryCache) => queryCache().getAll().filter((q) => getQueryStatusLabel(q) === "inactive").length
11536
11557
  );
11537
11558
  const theme = useTheme();
11559
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
11538
11560
  const styles = createMemo(() => {
11539
- return theme() === "dark" ? darkStyles2 : lightStyles2;
11561
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
11540
11562
  });
11541
11563
  return <div
11542
11564
  class={clsx(styles().queryStatusContainer, "tsqd-query-status-container")}
@@ -11582,8 +11604,9 @@ var MutationStatusCount = () => {
11582
11604
  ).length
11583
11605
  );
11584
11606
  const theme = useTheme();
11607
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
11585
11608
  const styles = createMemo(() => {
11586
- return theme() === "dark" ? darkStyles2 : lightStyles2;
11609
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
11587
11610
  });
11588
11611
  return <div
11589
11612
  class={clsx(styles().queryStatusContainer, "tsqd-query-status-container")}
@@ -11596,8 +11619,9 @@ var MutationStatusCount = () => {
11596
11619
  };
11597
11620
  var QueryStatus = (props) => {
11598
11621
  const theme = useTheme();
11622
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
11599
11623
  const styles = createMemo(() => {
11600
- return theme() === "dark" ? darkStyles2 : lightStyles2;
11624
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
11601
11625
  });
11602
11626
  const { colors, alpha } = tokens;
11603
11627
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
@@ -11627,7 +11651,7 @@ var QueryStatus = (props) => {
11627
11651
  ref={tagRef}
11628
11652
  class={clsx(
11629
11653
  styles().queryStatusTag,
11630
- !showLabel() && u`
11654
+ !showLabel() && css`
11631
11655
  cursor: pointer;
11632
11656
  &:hover {
11633
11657
  background: ${t2(colors.gray[200], colors.darkGray[400])}${alpha[80]};
@@ -11647,7 +11671,7 @@ var QueryStatus = (props) => {
11647
11671
  >{props.label}</div></Show>
11648
11672
  <span
11649
11673
  class={clsx(
11650
- u`
11674
+ css`
11651
11675
  width: ${tokens.size[1.5]};
11652
11676
  height: ${tokens.size[1.5]};
11653
11677
  border-radius: ${tokens.border.radius.full};
@@ -11665,7 +11689,7 @@ var QueryStatus = (props) => {
11665
11689
  <span
11666
11690
  class={clsx(
11667
11691
  styles().queryStatusCount,
11668
- props.count > 0 && props.color !== "gray" && u`
11692
+ props.count > 0 && props.color !== "gray" && css`
11669
11693
  background-color: ${t2(
11670
11694
  colors[props.color][100],
11671
11695
  colors[props.color][900]
@@ -11679,8 +11703,9 @@ var QueryStatus = (props) => {
11679
11703
  };
11680
11704
  var QueryDetails = () => {
11681
11705
  const theme = useTheme();
11706
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
11682
11707
  const styles = createMemo(() => {
11683
- return theme() === "dark" ? darkStyles2 : lightStyles2;
11708
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
11684
11709
  });
11685
11710
  const { colors } = tokens;
11686
11711
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
@@ -11755,13 +11780,13 @@ var QueryDetails = () => {
11755
11780
  });
11756
11781
  const getQueryStatusColors = () => {
11757
11782
  if (color() === "gray") {
11758
- return u`
11783
+ return css`
11759
11784
  background-color: ${t2(colors[color()][200], colors[color()][700])};
11760
11785
  color: ${t2(colors[color()][700], colors[color()][300])};
11761
11786
  border-color: ${t2(colors[color()][400], colors[color()][600])};
11762
11787
  `;
11763
11788
  }
11764
- return u`
11789
+ return css`
11765
11790
  background-color: ${t2(colors[color()][100], colors[color()][900])};
11766
11791
  color: ${t2(colors[color()][700], colors[color()][300])};
11767
11792
  border-color: ${t2(colors[color()][400], colors[color()][600])};
@@ -11801,7 +11826,7 @@ var QueryDetails = () => {
11801
11826
  >
11802
11827
  <button
11803
11828
  class={clsx(
11804
- u`
11829
+ css`
11805
11830
  color: ${t2(colors.blue[600], colors.blue[400])};
11806
11831
  `,
11807
11832
  "tsqd-query-details-actions-btn",
@@ -11811,7 +11836,7 @@ var QueryDetails = () => {
11811
11836
  disabled={statusLabel() === "fetching"}
11812
11837
  >
11813
11838
  <span
11814
- class={u`
11839
+ class={css`
11815
11840
  background-color: ${t2(colors.blue[600], colors.blue[400])};
11816
11841
  `}
11817
11842
  />
@@ -11819,7 +11844,7 @@ var QueryDetails = () => {
11819
11844
  </button>
11820
11845
  <button
11821
11846
  class={clsx(
11822
- u`
11847
+ css`
11823
11848
  color: ${t2(colors.yellow[600], colors.yellow[400])};
11824
11849
  `,
11825
11850
  "tsqd-query-details-actions-btn",
@@ -11829,7 +11854,7 @@ var QueryDetails = () => {
11829
11854
  disabled={queryStatus() === "pending"}
11830
11855
  >
11831
11856
  <span
11832
- class={u`
11857
+ class={css`
11833
11858
  background-color: ${t2(colors.yellow[600], colors.yellow[400])};
11834
11859
  `}
11835
11860
  />
@@ -11837,7 +11862,7 @@ var QueryDetails = () => {
11837
11862
  </button>
11838
11863
  <button
11839
11864
  class={clsx(
11840
- u`
11865
+ css`
11841
11866
  color: ${t2(colors.gray[600], colors.gray[300])};
11842
11867
  `,
11843
11868
  "tsqd-query-details-actions-btn",
@@ -11847,7 +11872,7 @@ var QueryDetails = () => {
11847
11872
  disabled={queryStatus() === "pending"}
11848
11873
  >
11849
11874
  <span
11850
- class={u`
11875
+ class={css`
11851
11876
  background-color: ${t2(colors.gray[600], colors.gray[400])};
11852
11877
  `}
11853
11878
  />
@@ -11855,7 +11880,7 @@ var QueryDetails = () => {
11855
11880
  </button>
11856
11881
  <button
11857
11882
  class={clsx(
11858
- u`
11883
+ css`
11859
11884
  color: ${t2(colors.pink[500], colors.pink[400])};
11860
11885
  `,
11861
11886
  "tsqd-query-details-actions-btn",
@@ -11868,7 +11893,7 @@ var QueryDetails = () => {
11868
11893
  disabled={statusLabel() === "fetching"}
11869
11894
  >
11870
11895
  <span
11871
- class={u`
11896
+ class={css`
11872
11897
  background-color: ${t2(colors.pink[500], colors.pink[400])};
11873
11898
  `}
11874
11899
  />
@@ -11876,7 +11901,7 @@ var QueryDetails = () => {
11876
11901
  </button>
11877
11902
  <button
11878
11903
  class={clsx(
11879
- u`
11904
+ css`
11880
11905
  color: ${t2(colors.cyan[500], colors.cyan[400])};
11881
11906
  `,
11882
11907
  "tsqd-query-details-actions-btn",
@@ -11912,7 +11937,7 @@ var QueryDetails = () => {
11912
11937
  }}
11913
11938
  >
11914
11939
  <span
11915
- class={u`
11940
+ class={css`
11916
11941
  background-color: ${t2(colors.cyan[500], colors.cyan[400])};
11917
11942
  `}
11918
11943
  />
@@ -11921,7 +11946,7 @@ var QueryDetails = () => {
11921
11946
  </button>
11922
11947
  <Show when={errorTypes().length === 0 || queryStatus() === "error"}><button
11923
11948
  class={clsx(
11924
- u`
11949
+ css`
11925
11950
  color: ${t2(colors.red[500], colors.red[400])};
11926
11951
  `,
11927
11952
  "tsqd-query-details-actions-btn",
@@ -11937,7 +11962,7 @@ var QueryDetails = () => {
11937
11962
  disabled={queryStatus() === "pending"}
11938
11963
  >
11939
11964
  <span
11940
- class={u`
11965
+ class={css`
11941
11966
  background-color: ${t2(colors.red[500], colors.red[400])};
11942
11967
  `}
11943
11968
  />
@@ -11954,7 +11979,7 @@ var QueryDetails = () => {
11954
11979
  )}
11955
11980
  >
11956
11981
  <span
11957
- class={u`
11982
+ class={css`
11958
11983
  background-color: ${tokens.colors.red[400]};
11959
11984
  `}
11960
11985
  />
@@ -12002,8 +12027,9 @@ var QueryDetails = () => {
12002
12027
  };
12003
12028
  var MutationDetails = () => {
12004
12029
  const theme = useTheme();
12030
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
12005
12031
  const styles = createMemo(() => {
12006
- return theme() === "dark" ? darkStyles2 : lightStyles2;
12032
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
12007
12033
  });
12008
12034
  const { colors } = tokens;
12009
12035
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
@@ -12037,13 +12063,13 @@ var MutationDetails = () => {
12037
12063
  );
12038
12064
  const getQueryStatusColors = () => {
12039
12065
  if (color() === "gray") {
12040
- return u`
12066
+ return css`
12041
12067
  background-color: ${t2(colors[color()][200], colors[color()][700])};
12042
12068
  color: ${t2(colors[color()][700], colors[color()][300])};
12043
12069
  border-color: ${t2(colors[color()][400], colors[color()][600])};
12044
12070
  `;
12045
12071
  }
12046
- return u`
12072
+ return css`
12047
12073
  background-color: ${t2(colors[color()][100], colors[color()][900])};
12048
12074
  color: ${t2(colors[color()][700], colors[color()][300])};
12049
12075
  border-color: ${t2(colors[color()][400], colors[color()][600])};
@@ -12203,11 +12229,11 @@ var createSubscribeToMutationCacheBatcher = (callback, equalityCheck = true) =>
12203
12229
  });
12204
12230
  return value;
12205
12231
  };
12206
- var stylesFactory2 = (theme) => {
12232
+ var stylesFactory2 = (theme, css) => {
12207
12233
  const { colors, font, size: size2, alpha, shadow, border } = tokens;
12208
12234
  const t2 = (light, dark) => theme === "light" ? light : dark;
12209
12235
  return {
12210
- devtoolsBtn: u`
12236
+ devtoolsBtn: css`
12211
12237
  z-index: 100000;
12212
12238
  position: fixed;
12213
12239
  padding: 4px;
@@ -12261,7 +12287,7 @@ var stylesFactory2 = (theme) => {
12261
12287
  }
12262
12288
  }
12263
12289
  `,
12264
- panel: u`
12290
+ panel: css`
12265
12291
  position: fixed;
12266
12292
  z-index: 9999;
12267
12293
  display: flex;
@@ -12287,26 +12313,26 @@ var stylesFactory2 = (theme) => {
12287
12313
  background: ${t2(colors.gray[400], colors.darkGray[300])};
12288
12314
  }
12289
12315
  `,
12290
- "devtoolsBtn-position-bottom-right": u`
12316
+ "devtoolsBtn-position-bottom-right": css`
12291
12317
  bottom: 12px;
12292
12318
  right: 12px;
12293
12319
  `,
12294
- "devtoolsBtn-position-bottom-left": u`
12320
+ "devtoolsBtn-position-bottom-left": css`
12295
12321
  bottom: 12px;
12296
12322
  left: 12px;
12297
12323
  `,
12298
- "devtoolsBtn-position-top-left": u`
12324
+ "devtoolsBtn-position-top-left": css`
12299
12325
  top: 12px;
12300
12326
  left: 12px;
12301
12327
  `,
12302
- "devtoolsBtn-position-top-right": u`
12328
+ "devtoolsBtn-position-top-right": css`
12303
12329
  top: 12px;
12304
12330
  right: 12px;
12305
12331
  `,
12306
- "devtoolsBtn-position-relative": u`
12332
+ "devtoolsBtn-position-relative": css`
12307
12333
  position: relative;
12308
12334
  `,
12309
- "panel-position-top": u`
12335
+ "panel-position-top": css`
12310
12336
  top: 0;
12311
12337
  right: 0;
12312
12338
  left: 0;
@@ -12314,7 +12340,7 @@ var stylesFactory2 = (theme) => {
12314
12340
  min-height: ${size2[14]};
12315
12341
  border-bottom: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
12316
12342
  `,
12317
- "panel-position-bottom": u`
12343
+ "panel-position-bottom": css`
12318
12344
  bottom: 0;
12319
12345
  right: 0;
12320
12346
  left: 0;
@@ -12322,21 +12348,21 @@ var stylesFactory2 = (theme) => {
12322
12348
  min-height: ${size2[14]};
12323
12349
  border-top: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
12324
12350
  `,
12325
- "panel-position-right": u`
12351
+ "panel-position-right": css`
12326
12352
  bottom: 0;
12327
12353
  right: 0;
12328
12354
  top: 0;
12329
12355
  border-left: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
12330
12356
  max-width: 90%;
12331
12357
  `,
12332
- "panel-position-left": u`
12358
+ "panel-position-left": css`
12333
12359
  bottom: 0;
12334
12360
  left: 0;
12335
12361
  top: 0;
12336
12362
  border-right: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
12337
12363
  max-width: 90%;
12338
12364
  `,
12339
- closeBtn: u`
12365
+ closeBtn: css`
12340
12366
  position: absolute;
12341
12367
  cursor: pointer;
12342
12368
  z-index: 5;
@@ -12357,7 +12383,7 @@ var stylesFactory2 = (theme) => {
12357
12383
  height: ${size2[2]};
12358
12384
  }
12359
12385
  `,
12360
- "closeBtn-position-top": u`
12386
+ "closeBtn-position-top": css`
12361
12387
  bottom: 0;
12362
12388
  right: ${size2[2]};
12363
12389
  transform: translate(0, 100%);
@@ -12381,7 +12407,7 @@ var stylesFactory2 = (theme) => {
12381
12407
  transform: rotate(180deg);
12382
12408
  }
12383
12409
  `,
12384
- "closeBtn-position-bottom": u`
12410
+ "closeBtn-position-bottom": css`
12385
12411
  top: 0;
12386
12412
  right: ${size2[2]};
12387
12413
  transform: translate(0, -100%);
@@ -12401,7 +12427,7 @@ var stylesFactory2 = (theme) => {
12401
12427
  width: calc(100% + ${size2[5]});
12402
12428
  }
12403
12429
  `,
12404
- "closeBtn-position-right": u`
12430
+ "closeBtn-position-right": css`
12405
12431
  bottom: ${size2[2]};
12406
12432
  left: 0;
12407
12433
  transform: translate(-100%, 0);
@@ -12424,7 +12450,7 @@ var stylesFactory2 = (theme) => {
12424
12450
  transform: rotate(-90deg);
12425
12451
  }
12426
12452
  `,
12427
- "closeBtn-position-left": u`
12453
+ "closeBtn-position-left": css`
12428
12454
  bottom: ${size2[2]};
12429
12455
  right: 0;
12430
12456
  transform: translate(100%, 0);
@@ -12447,7 +12473,7 @@ var stylesFactory2 = (theme) => {
12447
12473
  transform: rotate(90deg);
12448
12474
  }
12449
12475
  `,
12450
- queriesContainer: u`
12476
+ queriesContainer: css`
12451
12477
  flex: 1 1 700px;
12452
12478
  background-color: ${t2(colors.gray[50], colors.darkGray[700])};
12453
12479
  display: flex;
@@ -12456,7 +12482,7 @@ var stylesFactory2 = (theme) => {
12456
12482
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
12457
12483
  }
12458
12484
  `,
12459
- dragHandle: u`
12485
+ dragHandle: css`
12460
12486
  position: absolute;
12461
12487
  transition: background-color 0.125s ease;
12462
12488
  &:hover {
@@ -12464,31 +12490,31 @@ var stylesFactory2 = (theme) => {
12464
12490
  }
12465
12491
  z-index: 4;
12466
12492
  `,
12467
- "dragHandle-position-top": u`
12493
+ "dragHandle-position-top": css`
12468
12494
  bottom: 0;
12469
12495
  width: 100%;
12470
12496
  height: 3px;
12471
12497
  cursor: ns-resize;
12472
12498
  `,
12473
- "dragHandle-position-bottom": u`
12499
+ "dragHandle-position-bottom": css`
12474
12500
  top: 0;
12475
12501
  width: 100%;
12476
12502
  height: 3px;
12477
12503
  cursor: ns-resize;
12478
12504
  `,
12479
- "dragHandle-position-right": u`
12505
+ "dragHandle-position-right": css`
12480
12506
  left: 0;
12481
12507
  width: 3px;
12482
12508
  height: 100%;
12483
12509
  cursor: ew-resize;
12484
12510
  `,
12485
- "dragHandle-position-left": u`
12511
+ "dragHandle-position-left": css`
12486
12512
  right: 0;
12487
12513
  width: 3px;
12488
12514
  height: 100%;
12489
12515
  cursor: ew-resize;
12490
12516
  `,
12491
- row: u`
12517
+ row: css`
12492
12518
  display: flex;
12493
12519
  justify-content: space-between;
12494
12520
  align-items: center;
@@ -12505,12 +12531,12 @@ var stylesFactory2 = (theme) => {
12505
12531
  flex-direction: column;
12506
12532
  }
12507
12533
  `,
12508
- logoAndToggleContainer: u`
12534
+ logoAndToggleContainer: css`
12509
12535
  display: flex;
12510
12536
  gap: ${tokens.size[3]};
12511
12537
  align-items: center;
12512
12538
  `,
12513
- logo: u`
12539
+ logo: css`
12514
12540
  cursor: pointer;
12515
12541
  display: flex;
12516
12542
  flex-direction: column;
@@ -12527,14 +12553,14 @@ var stylesFactory2 = (theme) => {
12527
12553
  outline: 2px solid ${colors.blue[800]};
12528
12554
  }
12529
12555
  `,
12530
- tanstackLogo: u`
12556
+ tanstackLogo: css`
12531
12557
  font-size: ${font.size.md};
12532
12558
  font-weight: ${font.weight.bold};
12533
12559
  line-height: ${font.lineHeight.xs};
12534
12560
  white-space: nowrap;
12535
12561
  color: ${t2(colors.gray[600], colors.gray[300])};
12536
12562
  `,
12537
- queryFlavorLogo: u`
12563
+ queryFlavorLogo: css`
12538
12564
  font-weight: ${font.weight.semibold};
12539
12565
  font-size: ${font.size.xs};
12540
12566
  background: linear-gradient(
@@ -12547,12 +12573,12 @@ var stylesFactory2 = (theme) => {
12547
12573
  -webkit-text-fill-color: transparent;
12548
12574
  white-space: nowrap;
12549
12575
  `,
12550
- queryStatusContainer: u`
12576
+ queryStatusContainer: css`
12551
12577
  display: flex;
12552
12578
  gap: ${tokens.size[2]};
12553
12579
  height: min-content;
12554
12580
  `,
12555
- queryStatusTag: u`
12581
+ queryStatusTag: css`
12556
12582
  display: flex;
12557
12583
  gap: ${tokens.size[1.5]};
12558
12584
  box-sizing: border-box;
@@ -12573,10 +12599,10 @@ var stylesFactory2 = (theme) => {
12573
12599
  outline: 2px solid ${colors.blue[800]};
12574
12600
  }
12575
12601
  `,
12576
- queryStatusTagLabel: u`
12602
+ queryStatusTagLabel: css`
12577
12603
  font-size: ${font.size.xs};
12578
12604
  `,
12579
- queryStatusCount: u`
12605
+ queryStatusCount: css`
12580
12606
  font-size: ${font.size.xs};
12581
12607
  padding: 0 5px;
12582
12608
  display: flex;
@@ -12588,7 +12614,7 @@ var stylesFactory2 = (theme) => {
12588
12614
  font-variant-numeric: tabular-nums;
12589
12615
  height: ${tokens.size[4.5]};
12590
12616
  `,
12591
- statusTooltip: u`
12617
+ statusTooltip: css`
12592
12618
  position: absolute;
12593
12619
  z-index: 1;
12594
12620
  background-color: ${t2(colors.gray[50], colors.darkGray[500])};
@@ -12628,7 +12654,7 @@ var stylesFactory2 = (theme) => {
12628
12654
  border-width: 7px;
12629
12655
  }
12630
12656
  `,
12631
- filtersContainer: u`
12657
+ filtersContainer: css`
12632
12658
  display: flex;
12633
12659
  gap: ${tokens.size[2]};
12634
12660
  & > button {
@@ -12657,7 +12683,7 @@ var stylesFactory2 = (theme) => {
12657
12683
  }
12658
12684
  }
12659
12685
  `,
12660
- filterInput: u`
12686
+ filterInput: css`
12661
12687
  padding: ${size2[0.5]} ${size2[2]};
12662
12688
  border-radius: ${tokens.border.radius.sm};
12663
12689
  background-color: ${t2(colors.gray[100], colors.darkGray[400])};
@@ -12696,7 +12722,7 @@ var stylesFactory2 = (theme) => {
12696
12722
  outline: 2px solid ${colors.blue[800]};
12697
12723
  }
12698
12724
  `,
12699
- filterSelect: u`
12725
+ filterSelect: css`
12700
12726
  padding: ${tokens.size[0.5]} ${tokens.size[2]};
12701
12727
  border-radius: ${tokens.border.radius.sm};
12702
12728
  background-color: ${t2(colors.gray[100], colors.darkGray[400])};
@@ -12730,11 +12756,11 @@ var stylesFactory2 = (theme) => {
12730
12756
  outline: 2px solid ${colors.blue[800]};
12731
12757
  }
12732
12758
  `,
12733
- actionsContainer: u`
12759
+ actionsContainer: css`
12734
12760
  display: flex;
12735
12761
  gap: ${tokens.size[2]};
12736
12762
  `,
12737
- actionsBtn: u`
12763
+ actionsBtn: css`
12738
12764
  border-radius: ${tokens.border.radius.sm};
12739
12765
  background-color: ${t2(colors.gray[100], colors.darkGray[400])};
12740
12766
  border: 1px solid ${t2(colors.gray[300], colors.darkGray[200])};
@@ -12761,13 +12787,13 @@ var stylesFactory2 = (theme) => {
12761
12787
  outline: 2px solid ${colors.blue[800]};
12762
12788
  }
12763
12789
  `,
12764
- actionsBtnOffline: u`
12790
+ actionsBtnOffline: css`
12765
12791
  & svg {
12766
12792
  stroke: ${t2(colors.yellow[700], colors.yellow[500])};
12767
12793
  fill: ${t2(colors.yellow[700], colors.yellow[500])};
12768
12794
  }
12769
12795
  `,
12770
- overflowQueryContainer: u`
12796
+ overflowQueryContainer: css`
12771
12797
  flex: 1;
12772
12798
  overflow-y: auto;
12773
12799
  & > div {
@@ -12775,7 +12801,7 @@ var stylesFactory2 = (theme) => {
12775
12801
  flex-direction: column;
12776
12802
  }
12777
12803
  `,
12778
- queryRow: u`
12804
+ queryRow: css`
12779
12805
  display: flex;
12780
12806
  align-items: center;
12781
12807
  padding: 0;
@@ -12837,10 +12863,10 @@ var stylesFactory2 = (theme) => {
12837
12863
  font-size: ${font.size.xs};
12838
12864
  }
12839
12865
  `,
12840
- selectedQueryRow: u`
12866
+ selectedQueryRow: css`
12841
12867
  background-color: ${t2(colors.gray[200], colors.darkGray[500])};
12842
12868
  `,
12843
- detailsContainer: u`
12869
+ detailsContainer: css`
12844
12870
  flex: 1 1 700px;
12845
12871
  background-color: ${t2(colors.gray[50], colors.darkGray[700])};
12846
12872
  color: ${t2(colors.gray[700], colors.gray[300])};
@@ -12851,7 +12877,7 @@ var stylesFactory2 = (theme) => {
12851
12877
  display: flex;
12852
12878
  text-align: left;
12853
12879
  `,
12854
- detailsHeader: u`
12880
+ detailsHeader: css`
12855
12881
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
12856
12882
  position: sticky;
12857
12883
  top: 0;
@@ -12863,7 +12889,7 @@ var stylesFactory2 = (theme) => {
12863
12889
  line-height: ${font.lineHeight.xs};
12864
12890
  text-align: left;
12865
12891
  `,
12866
- detailsBody: u`
12892
+ detailsBody: css`
12867
12893
  margin: ${tokens.size[1.5]} 0px ${tokens.size[2]} 0px;
12868
12894
  & > div {
12869
12895
  display: flex;
@@ -12897,13 +12923,13 @@ var stylesFactory2 = (theme) => {
12897
12923
  align-items: center;
12898
12924
  }
12899
12925
  `,
12900
- queryDetailsStatus: u`
12926
+ queryDetailsStatus: css`
12901
12927
  border: 1px solid ${colors.darkGray[200]};
12902
12928
  border-radius: ${tokens.border.radius.sm};
12903
12929
  font-weight: ${font.weight.medium};
12904
12930
  padding: ${tokens.size[1]} ${tokens.size[2.5]};
12905
12931
  `,
12906
- actionsBody: u`
12932
+ actionsBody: css`
12907
12933
  flex-wrap: wrap;
12908
12934
  margin: ${tokens.size[2]} 0px ${tokens.size[2]} 0px;
12909
12935
  display: flex;
@@ -12943,7 +12969,7 @@ var stylesFactory2 = (theme) => {
12943
12969
  }
12944
12970
  }
12945
12971
  `,
12946
- actionsSelect: u`
12972
+ actionsSelect: css`
12947
12973
  font-size: ${font.size.xs};
12948
12974
  padding: ${tokens.size[0.5]} ${tokens.size[2]};
12949
12975
  display: flex;
@@ -12992,7 +13018,7 @@ var stylesFactory2 = (theme) => {
12992
13018
  height: ${tokens.size[2]};
12993
13019
  }
12994
13020
  `,
12995
- settingsMenu: u`
13021
+ settingsMenu: css`
12996
13022
  display: flex;
12997
13023
  & * {
12998
13024
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
@@ -13008,7 +13034,7 @@ var stylesFactory2 = (theme) => {
13008
13034
  min-width: 120px;
13009
13035
  padding: ${size2[0.5]};
13010
13036
  `,
13011
- settingsSubTrigger: u`
13037
+ settingsSubTrigger: css`
13012
13038
  display: flex;
13013
13039
  align-items: center;
13014
13040
  justify-content: space-between;
@@ -13036,14 +13062,14 @@ var stylesFactory2 = (theme) => {
13036
13062
  cursor: not-allowed;
13037
13063
  }
13038
13064
  `,
13039
- settingsMenuHeader: u`
13065
+ settingsMenuHeader: css`
13040
13066
  padding: ${tokens.size[1]} ${tokens.size[1]};
13041
13067
  font-weight: ${font.weight.medium};
13042
13068
  border-bottom: 1px solid ${t2(colors.gray[300], colors.darkGray[400])};
13043
13069
  color: ${t2(colors.gray[500], colors.gray[400])};
13044
13070
  font-size: ${font.size["xs"]};
13045
13071
  `,
13046
- settingsSubButton: u`
13072
+ settingsSubButton: css`
13047
13073
  display: flex;
13048
13074
  align-items: center;
13049
13075
  justify-content: space-between;
@@ -13065,7 +13091,7 @@ var stylesFactory2 = (theme) => {
13065
13091
  outline: 2px solid ${colors.blue[800]};
13066
13092
  }
13067
13093
  `,
13068
- themeSelectedButton: u`
13094
+ themeSelectedButton: css`
13069
13095
  background-color: ${t2(colors.purple[100], colors.purple[900])};
13070
13096
  color: ${t2(colors.purple[700], colors.purple[300])};
13071
13097
  & svg {
@@ -13075,7 +13101,7 @@ var stylesFactory2 = (theme) => {
13075
13101
  background-color: ${t2(colors.purple[100], colors.purple[900])};
13076
13102
  }
13077
13103
  `,
13078
- viewToggle: u`
13104
+ viewToggle: css`
13079
13105
  border-radius: ${tokens.border.radius.sm};
13080
13106
  background-color: ${t2(colors.gray[200], colors.darkGray[600])};
13081
13107
  border: 1px solid ${t2(colors.gray[300], colors.darkGray[200])};
@@ -13127,8 +13153,8 @@ var stylesFactory2 = (theme) => {
13127
13153
  `
13128
13154
  };
13129
13155
  };
13130
- var lightStyles2 = stylesFactory2("light");
13131
- var darkStyles2 = stylesFactory2("dark");
13156
+ var lightStyles2 = (css) => stylesFactory2("light", css);
13157
+ var darkStyles2 = (css) => stylesFactory2("dark", css);
13132
13158
  export {
13133
13159
  Devtools_default as default
13134
13160
  };