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