@tanstack/query-devtools 5.24.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.
package/build/index.cjs CHANGED
@@ -3222,10 +3222,10 @@ var init_utils = __esm({
3222
3222
  }
3223
3223
  return oldData;
3224
3224
  };
3225
- setupStyleSheet = (nonce) => {
3225
+ setupStyleSheet = (nonce, target) => {
3226
3226
  if (!nonce)
3227
3227
  return;
3228
- const styleExists = document.querySelector("#_goober");
3228
+ const styleExists = document.querySelector("#_goober") || target?.querySelector("#_goober");
3229
3229
  if (styleExists)
3230
3230
  return;
3231
3231
  const styleTag = document.createElement("style");
@@ -3233,7 +3233,11 @@ var init_utils = __esm({
3233
3233
  styleTag.appendChild(textNode);
3234
3234
  styleTag.id = "_goober";
3235
3235
  styleTag.setAttribute("nonce", nonce);
3236
- document.head.appendChild(styleTag);
3236
+ if (target) {
3237
+ target.appendChild(styleTag);
3238
+ } else {
3239
+ document.head.appendChild(styleTag);
3240
+ }
3237
3241
  };
3238
3242
  }
3239
3243
  });
@@ -12208,7 +12212,8 @@ var init_Context = __esm({
12208
12212
  client: void 0,
12209
12213
  onlineManager: void 0,
12210
12214
  queryFlavor: "",
12211
- version: ""
12215
+ version: "",
12216
+ shadowDOMTarget: void 0
12212
12217
  });
12213
12218
  ThemeContext = createContext(
12214
12219
  () => "dark"
@@ -13025,11 +13030,11 @@ var init_Devtools = __esm({
13025
13030
  }
13026
13031
  });
13027
13032
  createEffect(() => {
13028
- const gooberStyles = document.getElementById("_goober");
13033
+ const gooberStyles = (useQueryDevtoolsContext().shadowDOMTarget || document).querySelector("#_goober");
13029
13034
  const w = pipWindow();
13030
13035
  if (gooberStyles && w) {
13031
13036
  const observer = new MutationObserver(() => {
13032
- const pip_style = w.document.getElementById("_goober");
13037
+ const pip_style = (useQueryDevtoolsContext().shadowDOMTarget || w.document).querySelector("#_goober");
13033
13038
  if (pip_style) {
13034
13039
  pip_style.textContent = gooberStyles.textContent;
13035
13040
  }
@@ -13104,8 +13109,11 @@ var init_Devtools = __esm({
13104
13109
  Devtools_default = DevtoolsComponent;
13105
13110
  Devtools = (props) => {
13106
13111
  const theme = useTheme();
13112
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
13113
+ target: useQueryDevtoolsContext().shadowDOMTarget
13114
+ }) : u;
13107
13115
  const styles = createMemo(() => {
13108
- return theme() === "dark" ? darkStyles2 : lightStyles2;
13116
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
13109
13117
  });
13110
13118
  const pip = usePiPWindow();
13111
13119
  const buttonPosition = createMemo(() => {
@@ -13206,7 +13214,7 @@ var init_Devtools = __esm({
13206
13214
  });
13207
13215
  }
13208
13216
  }), null);
13209
- createRenderEffect(() => className(_el$, clsx(u`
13217
+ createRenderEffect(() => className(_el$, clsx(css`
13210
13218
  & .tsqd-panel-transition-exit-active,
13211
13219
  & .tsqd-panel-transition-enter-active {
13212
13220
  transition:
@@ -13239,8 +13247,11 @@ var init_Devtools = __esm({
13239
13247
  PiPPanel = (props) => {
13240
13248
  const pip = usePiPWindow();
13241
13249
  const theme = useTheme();
13250
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
13251
+ target: useQueryDevtoolsContext().shadowDOMTarget
13252
+ }) : u;
13242
13253
  const styles = createMemo(() => {
13243
- return theme() === "dark" ? darkStyles2 : lightStyles2;
13254
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
13244
13255
  });
13245
13256
  const getPanelDynamicStyles = () => {
13246
13257
  const {
@@ -13248,12 +13259,12 @@ var init_Devtools = __esm({
13248
13259
  } = tokens;
13249
13260
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
13250
13261
  if (panelWidth() < secondBreakpoint) {
13251
- return u`
13262
+ return css`
13252
13263
  flex-direction: column;
13253
13264
  background-color: ${t2(colors.gray[300], colors.gray[600])};
13254
13265
  `;
13255
13266
  }
13256
- return u`
13267
+ return css`
13257
13268
  flex-direction: row;
13258
13269
  background-color: ${t2(colors.gray[200], colors.darkGray[900])};
13259
13270
  `;
@@ -13283,7 +13294,7 @@ var init_Devtools = __esm({
13283
13294
  _el$5.style.setProperty("width", "100vw");
13284
13295
  insert(_el$5, () => props.children);
13285
13296
  createRenderEffect(() => className(_el$5, clsx(styles().panel, getPanelDynamicStyles(), {
13286
- [u`
13297
+ [css`
13287
13298
  min-width: min-content;
13288
13299
  `]: panelWidth() < thirdBreakpoint
13289
13300
  }, "tsqd-main-panel")));
@@ -13292,8 +13303,11 @@ var init_Devtools = __esm({
13292
13303
  };
13293
13304
  DevtoolsPanel = (props) => {
13294
13305
  const theme = useTheme();
13306
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
13307
+ target: useQueryDevtoolsContext().shadowDOMTarget
13308
+ }) : u;
13295
13309
  const styles = createMemo(() => {
13296
- return theme() === "dark" ? darkStyles2 : lightStyles2;
13310
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
13297
13311
  });
13298
13312
  const [isResizing, setIsResizing] = createSignal(false);
13299
13313
  const position = createMemo(() => props.localStore.position || useQueryDevtoolsContext().position || POSITION);
@@ -13387,12 +13401,12 @@ var init_Devtools = __esm({
13387
13401
  } = tokens;
13388
13402
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
13389
13403
  if (panelWidth() < secondBreakpoint) {
13390
- return u`
13404
+ return css`
13391
13405
  flex-direction: column;
13392
13406
  background-color: ${t2(colors.gray[300], colors.gray[600])};
13393
13407
  `;
13394
13408
  }
13395
- return u`
13409
+ return css`
13396
13410
  flex-direction: row;
13397
13411
  background-color: ${t2(colors.gray[200], colors.darkGray[900])};
13398
13412
  `;
@@ -13414,7 +13428,7 @@ var init_Devtools = __esm({
13414
13428
  }), null);
13415
13429
  createRenderEffect((_p$) => {
13416
13430
  const _v$ = clsx(styles().panel, styles()[`panel-position-${position()}`], getPanelDynamicStyles(), {
13417
- [u`
13431
+ [css`
13418
13432
  min-width: min-content;
13419
13433
  `]: panelWidth() < thirdBreakpoint && (position() === "right" || position() === "left")
13420
13434
  }, "tsqd-main-panel"), _v$2 = position() === "bottom" || position() === "top" ? `${props.localStore.height || DEFAULT_HEIGHT}px` : "auto", _v$3 = position() === "right" || position() === "left" ? `${props.localStore.width || DEFAULT_WIDTH}px` : "auto", _v$4 = clsx(styles().dragHandle, styles()[`dragHandle-position-${position()}`], "tsqd-drag-handle"), _v$5 = clsx(styles().closeBtn, styles()[`closeBtn-position-${position()}`], "tsqd-minimize-btn");
@@ -13439,8 +13453,11 @@ var init_Devtools = __esm({
13439
13453
  setupMutationCacheSubscription();
13440
13454
  let containerRef;
13441
13455
  const theme = useTheme();
13456
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
13457
+ target: useQueryDevtoolsContext().shadowDOMTarget
13458
+ }) : u;
13442
13459
  const styles = createMemo(() => {
13443
- return theme() === "dark" ? darkStyles2 : lightStyles2;
13460
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
13444
13461
  });
13445
13462
  const pip = usePiPWindow();
13446
13463
  const [selectedView, setSelectedView] = createSignal("queries");
@@ -13871,10 +13888,10 @@ var init_Devtools = __esm({
13871
13888
  }
13872
13889
  }), null);
13873
13890
  createRenderEffect((_p$) => {
13874
- const _v$6 = clsx(styles().queriesContainer, panelWidth() < secondBreakpoint && (selectedQueryHash() || selectedMutationId()) && u`
13891
+ const _v$6 = clsx(styles().queriesContainer, panelWidth() < secondBreakpoint && (selectedQueryHash() || selectedMutationId()) && css`
13875
13892
  height: 50%;
13876
13893
  max-height: 50%;
13877
- `, panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && u`
13894
+ `, panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && css`
13878
13895
  height: 100%;
13879
13896
  max-height: 100%;
13880
13897
  `, "tsqd-queries-container"), _v$7 = clsx(styles().row, "tsqd-header"), _v$8 = styles().logoAndToggleContainer, _v$9 = clsx(styles().logo, "tsqd-text-logo-container"), _v$10 = clsx(styles().tanstackLogo, "tsqd-text-logo-tanstack"), _v$11 = clsx(styles().queryFlavorLogo, "tsqd-text-logo-query-flavor"), _v$12 = clsx(styles().row, "tsqd-filters-actions-container"), _v$13 = clsx(styles().filtersContainer, "tsqd-filters-container"), _v$14 = clsx(styles().filterInput, "tsqd-query-filter-textfield-container"), _v$15 = clsx("tsqd-query-filter-textfield"), _v$16 = clsx(styles().filterSelect, "tsqd-query-filter-sort-container"), _v$17 = `Sort order ${(selectedView() === "queries" ? sortOrder() : mutationSortOrder()) === -1 ? "descending" : "ascending"}`, _v$18 = (selectedView() === "queries" ? sortOrder() : mutationSortOrder()) === -1, _v$19 = clsx(styles().actionsContainer, "tsqd-actions-container"), _v$20 = clsx(styles().actionsBtn, "tsqd-actions-btn", "tsqd-action-clear-cache"), _v$21 = `Clear ${selectedView()} cache`, _v$22 = clsx(styles().actionsBtn, offline() && styles().actionsBtnOffline, "tsqd-actions-btn", "tsqd-action-mock-offline-behavior"), _v$23 = `${offline() ? "Unset offline mocking behavior" : "Mock offline behavior"}`, _v$24 = offline(), _v$25 = `${offline() ? "Unset offline mocking behavior" : "Mock offline behavior"}`;
@@ -13941,8 +13958,11 @@ var init_Devtools = __esm({
13941
13958
  };
13942
13959
  QueryRow = (props) => {
13943
13960
  const theme = useTheme();
13961
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
13962
+ target: useQueryDevtoolsContext().shadowDOMTarget
13963
+ }) : u;
13944
13964
  const styles = createMemo(() => {
13945
- return theme() === "dark" ? darkStyles2 : lightStyles2;
13965
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
13946
13966
  });
13947
13967
  const {
13948
13968
  colors,
@@ -13968,12 +13988,12 @@ var init_Devtools = __esm({
13968
13988
  }));
13969
13989
  const getObserverCountColorStyles = () => {
13970
13990
  if (color() === "gray") {
13971
- return u`
13991
+ return css`
13972
13992
  background-color: ${t2(colors[color()][200], colors[color()][700])};
13973
13993
  color: ${t2(colors[color()][700], colors[color()][300])};
13974
13994
  `;
13975
13995
  }
13976
- return u`
13996
+ return css`
13977
13997
  background-color: ${t2(colors[color()][200] + alpha[80], colors[color()][900])};
13978
13998
  color: ${t2(colors[color()][800], colors[color()][300])};
13979
13999
  `;
@@ -14012,8 +14032,11 @@ var init_Devtools = __esm({
14012
14032
  };
14013
14033
  MutationRow = (props) => {
14014
14034
  const theme = useTheme();
14035
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14036
+ target: useQueryDevtoolsContext().shadowDOMTarget
14037
+ }) : u;
14015
14038
  const styles = createMemo(() => {
14016
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14039
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14017
14040
  });
14018
14041
  const {
14019
14042
  colors,
@@ -14045,12 +14068,12 @@ var init_Devtools = __esm({
14045
14068
  }));
14046
14069
  const getObserverCountColorStyles = () => {
14047
14070
  if (color() === "gray") {
14048
- return u`
14071
+ return css`
14049
14072
  background-color: ${t2(colors[color()][200], colors[color()][700])};
14050
14073
  color: ${t2(colors[color()][700], colors[color()][300])};
14051
14074
  `;
14052
14075
  }
14053
- return u`
14076
+ return css`
14054
14077
  background-color: ${t2(colors[color()][200] + alpha[80], colors[color()][900])};
14055
14078
  color: ${t2(colors[color()][800], colors[color()][300])};
14056
14079
  `;
@@ -14127,8 +14150,11 @@ var init_Devtools = __esm({
14127
14150
  const paused = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().getAll().filter((q) => getQueryStatusLabel(q) === "paused").length);
14128
14151
  const inactive = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().getAll().filter((q) => getQueryStatusLabel(q) === "inactive").length);
14129
14152
  const theme = useTheme();
14153
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14154
+ target: useQueryDevtoolsContext().shadowDOMTarget
14155
+ }) : u;
14130
14156
  const styles = createMemo(() => {
14131
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14157
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14132
14158
  });
14133
14159
  return (() => {
14134
14160
  const _el$55 = _tmpl$26();
@@ -14189,8 +14215,11 @@ var init_Devtools = __esm({
14189
14215
  status: m.state.status
14190
14216
  }) === "red").length);
14191
14217
  const theme = useTheme();
14218
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14219
+ target: useQueryDevtoolsContext().shadowDOMTarget
14220
+ }) : u;
14192
14221
  const styles = createMemo(() => {
14193
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14222
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14194
14223
  });
14195
14224
  return (() => {
14196
14225
  const _el$56 = _tmpl$26();
@@ -14228,8 +14257,11 @@ var init_Devtools = __esm({
14228
14257
  };
14229
14258
  QueryStatus = (props) => {
14230
14259
  const theme = useTheme();
14260
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14261
+ target: useQueryDevtoolsContext().shadowDOMTarget
14262
+ }) : u;
14231
14263
  const styles = createMemo(() => {
14232
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14264
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14233
14265
  });
14234
14266
  const {
14235
14267
  colors,
@@ -14266,7 +14298,7 @@ var init_Devtools = __esm({
14266
14298
  return showLabel();
14267
14299
  },
14268
14300
  get ["class"]() {
14269
- return clsx(styles().queryStatusTag, !showLabel() && u`
14301
+ return clsx(styles().queryStatusTag, !showLabel() && css`
14270
14302
  cursor: pointer;
14271
14303
  &:hover {
14272
14304
  background: ${t2(colors.gray[200], colors.darkGray[400])}${alpha[80]};
@@ -14300,12 +14332,12 @@ var init_Devtools = __esm({
14300
14332
  }), _el$61);
14301
14333
  insert(_el$61, () => props.count);
14302
14334
  createRenderEffect((_p$) => {
14303
- const _v$32 = clsx(u`
14335
+ const _v$32 = clsx(css`
14304
14336
  width: ${tokens.size[1.5]};
14305
14337
  height: ${tokens.size[1.5]};
14306
14338
  border-radius: ${tokens.border.radius.full};
14307
14339
  background-color: ${tokens.colors[props.color][500]};
14308
- `, "tsqd-query-status-tag-dot"), _v$33 = clsx(styles().queryStatusCount, props.count > 0 && props.color !== "gray" && u`
14340
+ `, "tsqd-query-status-tag-dot"), _v$33 = clsx(styles().queryStatusCount, props.count > 0 && props.color !== "gray" && css`
14309
14341
  background-color: ${t2(colors[props.color][100], colors[props.color][900])};
14310
14342
  color: ${t2(colors[props.color][700], colors[props.color][300])};
14311
14343
  `, "tsqd-query-status-tag-count");
@@ -14321,8 +14353,11 @@ var init_Devtools = __esm({
14321
14353
  };
14322
14354
  QueryDetails = () => {
14323
14355
  const theme = useTheme();
14356
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14357
+ target: useQueryDevtoolsContext().shadowDOMTarget
14358
+ }) : u;
14324
14359
  const styles = createMemo(() => {
14325
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14360
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14326
14361
  });
14327
14362
  const {
14328
14363
  colors
@@ -14385,13 +14420,13 @@ var init_Devtools = __esm({
14385
14420
  });
14386
14421
  const getQueryStatusColors = () => {
14387
14422
  if (color() === "gray") {
14388
- return u`
14423
+ return css`
14389
14424
  background-color: ${t2(colors[color()][200], colors[color()][700])};
14390
14425
  color: ${t2(colors[color()][700], colors[color()][300])};
14391
14426
  border-color: ${t2(colors[color()][400], colors[color()][600])};
14392
14427
  `;
14393
14428
  }
14394
- return u`
14429
+ return css`
14395
14430
  background-color: ${t2(colors[color()][100], colors[color()][900])};
14396
14431
  color: ${t2(colors[color()][700], colors[color()][300])};
14397
14432
  border-color: ${t2(colors[color()][400], colors[color()][600])};
@@ -14457,9 +14492,9 @@ var init_Devtools = __esm({
14457
14492
  };
14458
14493
  insert(_el$88, () => queryStatus() === "error" ? "Restore" : "Trigger", _el$90);
14459
14494
  createRenderEffect((_p$) => {
14460
- const _v$34 = clsx(u`
14495
+ const _v$34 = clsx(css`
14461
14496
  color: ${t2(colors.red[500], colors.red[400])};
14462
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-error"), _v$35 = queryStatus() === "pending", _v$36 = u`
14497
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-error"), _v$35 = queryStatus() === "pending", _v$36 = css`
14463
14498
  background-color: ${t2(colors.red[500], colors.red[400])};
14464
14499
  `;
14465
14500
  _v$34 !== _p$._v$34 && className(_el$88, _p$._v$34 = _v$34);
@@ -14497,7 +14532,7 @@ var init_Devtools = __esm({
14497
14532
  }), null);
14498
14533
  insert(_el$91, createComponent(ChevronDown, {}), null);
14499
14534
  createRenderEffect((_p$) => {
14500
- const _v$37 = clsx(styles().actionsSelect, "tsqd-query-details-actions-btn", "tsqd-query-details-action-error-multiple"), _v$38 = u`
14535
+ const _v$37 = clsx(styles().actionsSelect, "tsqd-query-details-actions-btn", "tsqd-query-details-action-error-multiple"), _v$38 = css`
14501
14536
  background-color: ${tokens.colors.red[400]};
14502
14537
  `, _v$39 = queryStatus() === "pending";
14503
14538
  _v$37 !== _p$._v$37 && className(_el$91, _p$._v$37 = _v$37);
@@ -14531,25 +14566,25 @@ var init_Devtools = __esm({
14531
14566
  }
14532
14567
  }));
14533
14568
  createRenderEffect((_p$) => {
14534
- const _v$40 = clsx(styles().detailsContainer, "tsqd-query-details-container"), _v$41 = clsx(styles().detailsHeader, "tsqd-query-details-header"), _v$42 = clsx(styles().detailsBody, "tsqd-query-details-summary-container"), _v$43 = clsx(styles().queryDetailsStatus, getQueryStatusColors()), _v$44 = clsx(styles().detailsHeader, "tsqd-query-details-header"), _v$45 = clsx(styles().actionsBody, "tsqd-query-details-actions-container"), _v$46 = clsx(u`
14569
+ const _v$40 = clsx(styles().detailsContainer, "tsqd-query-details-container"), _v$41 = clsx(styles().detailsHeader, "tsqd-query-details-header"), _v$42 = clsx(styles().detailsBody, "tsqd-query-details-summary-container"), _v$43 = clsx(styles().queryDetailsStatus, getQueryStatusColors()), _v$44 = clsx(styles().detailsHeader, "tsqd-query-details-header"), _v$45 = clsx(styles().actionsBody, "tsqd-query-details-actions-container"), _v$46 = clsx(css`
14535
14570
  color: ${t2(colors.blue[600], colors.blue[400])};
14536
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-refetch"), _v$47 = statusLabel() === "fetching", _v$48 = u`
14571
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-refetch"), _v$47 = statusLabel() === "fetching", _v$48 = css`
14537
14572
  background-color: ${t2(colors.blue[600], colors.blue[400])};
14538
- `, _v$49 = clsx(u`
14573
+ `, _v$49 = clsx(css`
14539
14574
  color: ${t2(colors.yellow[600], colors.yellow[400])};
14540
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-invalidate"), _v$50 = queryStatus() === "pending", _v$51 = u`
14575
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-invalidate"), _v$50 = queryStatus() === "pending", _v$51 = css`
14541
14576
  background-color: ${t2(colors.yellow[600], colors.yellow[400])};
14542
- `, _v$52 = clsx(u`
14577
+ `, _v$52 = clsx(css`
14543
14578
  color: ${t2(colors.gray[600], colors.gray[300])};
14544
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-reset"), _v$53 = queryStatus() === "pending", _v$54 = u`
14579
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-reset"), _v$53 = queryStatus() === "pending", _v$54 = css`
14545
14580
  background-color: ${t2(colors.gray[600], colors.gray[400])};
14546
- `, _v$55 = clsx(u`
14581
+ `, _v$55 = clsx(css`
14547
14582
  color: ${t2(colors.pink[500], colors.pink[400])};
14548
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-remove"), _v$56 = statusLabel() === "fetching", _v$57 = u`
14583
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-remove"), _v$56 = statusLabel() === "fetching", _v$57 = css`
14549
14584
  background-color: ${t2(colors.pink[500], colors.pink[400])};
14550
- `, _v$58 = clsx(u`
14585
+ `, _v$58 = clsx(css`
14551
14586
  color: ${t2(colors.cyan[500], colors.cyan[400])};
14552
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-loading"), _v$59 = restoringLoading(), _v$60 = u`
14587
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-loading"), _v$59 = restoringLoading(), _v$60 = css`
14553
14588
  background-color: ${t2(colors.cyan[500], colors.cyan[400])};
14554
14589
  `, _v$61 = clsx(styles().detailsHeader, "tsqd-query-details-header"), _v$62 = tokens.size[2], _v$63 = clsx(styles().detailsHeader, "tsqd-query-details-header"), _v$64 = tokens.size[2];
14555
14590
  _v$40 !== _p$._v$40 && className(_el$62, _p$._v$40 = _v$40);
@@ -14611,8 +14646,11 @@ var init_Devtools = __esm({
14611
14646
  };
14612
14647
  MutationDetails = () => {
14613
14648
  const theme = useTheme();
14649
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14650
+ target: useQueryDevtoolsContext().shadowDOMTarget
14651
+ }) : u;
14614
14652
  const styles = createMemo(() => {
14615
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14653
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14616
14654
  });
14617
14655
  const {
14618
14656
  colors
@@ -14639,13 +14677,13 @@ var init_Devtools = __esm({
14639
14677
  const activeMutation = createSubscribeToMutationCacheBatcher((mutationCache) => mutationCache().getAll().find((mutation) => mutation.mutationId === selectedMutationId()), false);
14640
14678
  const getQueryStatusColors = () => {
14641
14679
  if (color() === "gray") {
14642
- return u`
14680
+ return css`
14643
14681
  background-color: ${t2(colors[color()][200], colors[color()][700])};
14644
14682
  color: ${t2(colors[color()][700], colors[color()][300])};
14645
14683
  border-color: ${t2(colors[color()][400], colors[color()][600])};
14646
14684
  `;
14647
14685
  }
14648
- return u`
14686
+ return css`
14649
14687
  background-color: ${t2(colors[color()][100], colors[color()][900])};
14650
14688
  color: ${t2(colors[color()][700], colors[color()][300])};
14651
14689
  border-color: ${t2(colors[color()][400], colors[color()][600])};
@@ -14819,7 +14857,7 @@ var init_Devtools = __esm({
14819
14857
  });
14820
14858
  return value;
14821
14859
  };
14822
- stylesFactory2 = (theme) => {
14860
+ stylesFactory2 = (theme, css) => {
14823
14861
  const {
14824
14862
  colors,
14825
14863
  font,
@@ -14830,7 +14868,7 @@ var init_Devtools = __esm({
14830
14868
  } = tokens;
14831
14869
  const t2 = (light, dark) => theme === "light" ? light : dark;
14832
14870
  return {
14833
- devtoolsBtn: u`
14871
+ devtoolsBtn: css`
14834
14872
  z-index: 100000;
14835
14873
  position: fixed;
14836
14874
  padding: 4px;
@@ -14884,7 +14922,7 @@ var init_Devtools = __esm({
14884
14922
  }
14885
14923
  }
14886
14924
  `,
14887
- panel: u`
14925
+ panel: css`
14888
14926
  position: fixed;
14889
14927
  z-index: 9999;
14890
14928
  display: flex;
@@ -14910,26 +14948,26 @@ var init_Devtools = __esm({
14910
14948
  background: ${t2(colors.gray[400], colors.darkGray[300])};
14911
14949
  }
14912
14950
  `,
14913
- "devtoolsBtn-position-bottom-right": u`
14951
+ "devtoolsBtn-position-bottom-right": css`
14914
14952
  bottom: 12px;
14915
14953
  right: 12px;
14916
14954
  `,
14917
- "devtoolsBtn-position-bottom-left": u`
14955
+ "devtoolsBtn-position-bottom-left": css`
14918
14956
  bottom: 12px;
14919
14957
  left: 12px;
14920
14958
  `,
14921
- "devtoolsBtn-position-top-left": u`
14959
+ "devtoolsBtn-position-top-left": css`
14922
14960
  top: 12px;
14923
14961
  left: 12px;
14924
14962
  `,
14925
- "devtoolsBtn-position-top-right": u`
14963
+ "devtoolsBtn-position-top-right": css`
14926
14964
  top: 12px;
14927
14965
  right: 12px;
14928
14966
  `,
14929
- "devtoolsBtn-position-relative": u`
14967
+ "devtoolsBtn-position-relative": css`
14930
14968
  position: relative;
14931
14969
  `,
14932
- "panel-position-top": u`
14970
+ "panel-position-top": css`
14933
14971
  top: 0;
14934
14972
  right: 0;
14935
14973
  left: 0;
@@ -14937,7 +14975,7 @@ var init_Devtools = __esm({
14937
14975
  min-height: ${size2[14]};
14938
14976
  border-bottom: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
14939
14977
  `,
14940
- "panel-position-bottom": u`
14978
+ "panel-position-bottom": css`
14941
14979
  bottom: 0;
14942
14980
  right: 0;
14943
14981
  left: 0;
@@ -14945,21 +14983,21 @@ var init_Devtools = __esm({
14945
14983
  min-height: ${size2[14]};
14946
14984
  border-top: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
14947
14985
  `,
14948
- "panel-position-right": u`
14986
+ "panel-position-right": css`
14949
14987
  bottom: 0;
14950
14988
  right: 0;
14951
14989
  top: 0;
14952
14990
  border-left: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
14953
14991
  max-width: 90%;
14954
14992
  `,
14955
- "panel-position-left": u`
14993
+ "panel-position-left": css`
14956
14994
  bottom: 0;
14957
14995
  left: 0;
14958
14996
  top: 0;
14959
14997
  border-right: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
14960
14998
  max-width: 90%;
14961
14999
  `,
14962
- closeBtn: u`
15000
+ closeBtn: css`
14963
15001
  position: absolute;
14964
15002
  cursor: pointer;
14965
15003
  z-index: 5;
@@ -14980,7 +15018,7 @@ var init_Devtools = __esm({
14980
15018
  height: ${size2[2]};
14981
15019
  }
14982
15020
  `,
14983
- "closeBtn-position-top": u`
15021
+ "closeBtn-position-top": css`
14984
15022
  bottom: 0;
14985
15023
  right: ${size2[2]};
14986
15024
  transform: translate(0, 100%);
@@ -15004,7 +15042,7 @@ var init_Devtools = __esm({
15004
15042
  transform: rotate(180deg);
15005
15043
  }
15006
15044
  `,
15007
- "closeBtn-position-bottom": u`
15045
+ "closeBtn-position-bottom": css`
15008
15046
  top: 0;
15009
15047
  right: ${size2[2]};
15010
15048
  transform: translate(0, -100%);
@@ -15024,7 +15062,7 @@ var init_Devtools = __esm({
15024
15062
  width: calc(100% + ${size2[5]});
15025
15063
  }
15026
15064
  `,
15027
- "closeBtn-position-right": u`
15065
+ "closeBtn-position-right": css`
15028
15066
  bottom: ${size2[2]};
15029
15067
  left: 0;
15030
15068
  transform: translate(-100%, 0);
@@ -15047,7 +15085,7 @@ var init_Devtools = __esm({
15047
15085
  transform: rotate(-90deg);
15048
15086
  }
15049
15087
  `,
15050
- "closeBtn-position-left": u`
15088
+ "closeBtn-position-left": css`
15051
15089
  bottom: ${size2[2]};
15052
15090
  right: 0;
15053
15091
  transform: translate(100%, 0);
@@ -15070,7 +15108,7 @@ var init_Devtools = __esm({
15070
15108
  transform: rotate(90deg);
15071
15109
  }
15072
15110
  `,
15073
- queriesContainer: u`
15111
+ queriesContainer: css`
15074
15112
  flex: 1 1 700px;
15075
15113
  background-color: ${t2(colors.gray[50], colors.darkGray[700])};
15076
15114
  display: flex;
@@ -15079,7 +15117,7 @@ var init_Devtools = __esm({
15079
15117
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
15080
15118
  }
15081
15119
  `,
15082
- dragHandle: u`
15120
+ dragHandle: css`
15083
15121
  position: absolute;
15084
15122
  transition: background-color 0.125s ease;
15085
15123
  &:hover {
@@ -15087,31 +15125,31 @@ var init_Devtools = __esm({
15087
15125
  }
15088
15126
  z-index: 4;
15089
15127
  `,
15090
- "dragHandle-position-top": u`
15128
+ "dragHandle-position-top": css`
15091
15129
  bottom: 0;
15092
15130
  width: 100%;
15093
15131
  height: 3px;
15094
15132
  cursor: ns-resize;
15095
15133
  `,
15096
- "dragHandle-position-bottom": u`
15134
+ "dragHandle-position-bottom": css`
15097
15135
  top: 0;
15098
15136
  width: 100%;
15099
15137
  height: 3px;
15100
15138
  cursor: ns-resize;
15101
15139
  `,
15102
- "dragHandle-position-right": u`
15140
+ "dragHandle-position-right": css`
15103
15141
  left: 0;
15104
15142
  width: 3px;
15105
15143
  height: 100%;
15106
15144
  cursor: ew-resize;
15107
15145
  `,
15108
- "dragHandle-position-left": u`
15146
+ "dragHandle-position-left": css`
15109
15147
  right: 0;
15110
15148
  width: 3px;
15111
15149
  height: 100%;
15112
15150
  cursor: ew-resize;
15113
15151
  `,
15114
- row: u`
15152
+ row: css`
15115
15153
  display: flex;
15116
15154
  justify-content: space-between;
15117
15155
  align-items: center;
@@ -15128,12 +15166,12 @@ var init_Devtools = __esm({
15128
15166
  flex-direction: column;
15129
15167
  }
15130
15168
  `,
15131
- logoAndToggleContainer: u`
15169
+ logoAndToggleContainer: css`
15132
15170
  display: flex;
15133
15171
  gap: ${tokens.size[3]};
15134
15172
  align-items: center;
15135
15173
  `,
15136
- logo: u`
15174
+ logo: css`
15137
15175
  cursor: pointer;
15138
15176
  display: flex;
15139
15177
  flex-direction: column;
@@ -15150,14 +15188,14 @@ var init_Devtools = __esm({
15150
15188
  outline: 2px solid ${colors.blue[800]};
15151
15189
  }
15152
15190
  `,
15153
- tanstackLogo: u`
15191
+ tanstackLogo: css`
15154
15192
  font-size: ${font.size.md};
15155
15193
  font-weight: ${font.weight.bold};
15156
15194
  line-height: ${font.lineHeight.xs};
15157
15195
  white-space: nowrap;
15158
15196
  color: ${t2(colors.gray[600], colors.gray[300])};
15159
15197
  `,
15160
- queryFlavorLogo: u`
15198
+ queryFlavorLogo: css`
15161
15199
  font-weight: ${font.weight.semibold};
15162
15200
  font-size: ${font.size.xs};
15163
15201
  background: linear-gradient(
@@ -15170,12 +15208,12 @@ var init_Devtools = __esm({
15170
15208
  -webkit-text-fill-color: transparent;
15171
15209
  white-space: nowrap;
15172
15210
  `,
15173
- queryStatusContainer: u`
15211
+ queryStatusContainer: css`
15174
15212
  display: flex;
15175
15213
  gap: ${tokens.size[2]};
15176
15214
  height: min-content;
15177
15215
  `,
15178
- queryStatusTag: u`
15216
+ queryStatusTag: css`
15179
15217
  display: flex;
15180
15218
  gap: ${tokens.size[1.5]};
15181
15219
  box-sizing: border-box;
@@ -15196,10 +15234,10 @@ var init_Devtools = __esm({
15196
15234
  outline: 2px solid ${colors.blue[800]};
15197
15235
  }
15198
15236
  `,
15199
- queryStatusTagLabel: u`
15237
+ queryStatusTagLabel: css`
15200
15238
  font-size: ${font.size.xs};
15201
15239
  `,
15202
- queryStatusCount: u`
15240
+ queryStatusCount: css`
15203
15241
  font-size: ${font.size.xs};
15204
15242
  padding: 0 5px;
15205
15243
  display: flex;
@@ -15211,7 +15249,7 @@ var init_Devtools = __esm({
15211
15249
  font-variant-numeric: tabular-nums;
15212
15250
  height: ${tokens.size[4.5]};
15213
15251
  `,
15214
- statusTooltip: u`
15252
+ statusTooltip: css`
15215
15253
  position: absolute;
15216
15254
  z-index: 1;
15217
15255
  background-color: ${t2(colors.gray[50], colors.darkGray[500])};
@@ -15251,7 +15289,7 @@ var init_Devtools = __esm({
15251
15289
  border-width: 7px;
15252
15290
  }
15253
15291
  `,
15254
- filtersContainer: u`
15292
+ filtersContainer: css`
15255
15293
  display: flex;
15256
15294
  gap: ${tokens.size[2]};
15257
15295
  & > button {
@@ -15280,7 +15318,7 @@ var init_Devtools = __esm({
15280
15318
  }
15281
15319
  }
15282
15320
  `,
15283
- filterInput: u`
15321
+ filterInput: css`
15284
15322
  padding: ${size2[0.5]} ${size2[2]};
15285
15323
  border-radius: ${tokens.border.radius.sm};
15286
15324
  background-color: ${t2(colors.gray[100], colors.darkGray[400])};
@@ -15319,7 +15357,7 @@ var init_Devtools = __esm({
15319
15357
  outline: 2px solid ${colors.blue[800]};
15320
15358
  }
15321
15359
  `,
15322
- filterSelect: u`
15360
+ filterSelect: css`
15323
15361
  padding: ${tokens.size[0.5]} ${tokens.size[2]};
15324
15362
  border-radius: ${tokens.border.radius.sm};
15325
15363
  background-color: ${t2(colors.gray[100], colors.darkGray[400])};
@@ -15353,11 +15391,11 @@ var init_Devtools = __esm({
15353
15391
  outline: 2px solid ${colors.blue[800]};
15354
15392
  }
15355
15393
  `,
15356
- actionsContainer: u`
15394
+ actionsContainer: css`
15357
15395
  display: flex;
15358
15396
  gap: ${tokens.size[2]};
15359
15397
  `,
15360
- actionsBtn: u`
15398
+ actionsBtn: css`
15361
15399
  border-radius: ${tokens.border.radius.sm};
15362
15400
  background-color: ${t2(colors.gray[100], colors.darkGray[400])};
15363
15401
  border: 1px solid ${t2(colors.gray[300], colors.darkGray[200])};
@@ -15384,13 +15422,13 @@ var init_Devtools = __esm({
15384
15422
  outline: 2px solid ${colors.blue[800]};
15385
15423
  }
15386
15424
  `,
15387
- actionsBtnOffline: u`
15425
+ actionsBtnOffline: css`
15388
15426
  & svg {
15389
15427
  stroke: ${t2(colors.yellow[700], colors.yellow[500])};
15390
15428
  fill: ${t2(colors.yellow[700], colors.yellow[500])};
15391
15429
  }
15392
15430
  `,
15393
- overflowQueryContainer: u`
15431
+ overflowQueryContainer: css`
15394
15432
  flex: 1;
15395
15433
  overflow-y: auto;
15396
15434
  & > div {
@@ -15398,7 +15436,7 @@ var init_Devtools = __esm({
15398
15436
  flex-direction: column;
15399
15437
  }
15400
15438
  `,
15401
- queryRow: u`
15439
+ queryRow: css`
15402
15440
  display: flex;
15403
15441
  align-items: center;
15404
15442
  padding: 0;
@@ -15460,10 +15498,10 @@ var init_Devtools = __esm({
15460
15498
  font-size: ${font.size.xs};
15461
15499
  }
15462
15500
  `,
15463
- selectedQueryRow: u`
15501
+ selectedQueryRow: css`
15464
15502
  background-color: ${t2(colors.gray[200], colors.darkGray[500])};
15465
15503
  `,
15466
- detailsContainer: u`
15504
+ detailsContainer: css`
15467
15505
  flex: 1 1 700px;
15468
15506
  background-color: ${t2(colors.gray[50], colors.darkGray[700])};
15469
15507
  color: ${t2(colors.gray[700], colors.gray[300])};
@@ -15474,7 +15512,7 @@ var init_Devtools = __esm({
15474
15512
  display: flex;
15475
15513
  text-align: left;
15476
15514
  `,
15477
- detailsHeader: u`
15515
+ detailsHeader: css`
15478
15516
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
15479
15517
  position: sticky;
15480
15518
  top: 0;
@@ -15486,7 +15524,7 @@ var init_Devtools = __esm({
15486
15524
  line-height: ${font.lineHeight.xs};
15487
15525
  text-align: left;
15488
15526
  `,
15489
- detailsBody: u`
15527
+ detailsBody: css`
15490
15528
  margin: ${tokens.size[1.5]} 0px ${tokens.size[2]} 0px;
15491
15529
  & > div {
15492
15530
  display: flex;
@@ -15520,13 +15558,13 @@ var init_Devtools = __esm({
15520
15558
  align-items: center;
15521
15559
  }
15522
15560
  `,
15523
- queryDetailsStatus: u`
15561
+ queryDetailsStatus: css`
15524
15562
  border: 1px solid ${colors.darkGray[200]};
15525
15563
  border-radius: ${tokens.border.radius.sm};
15526
15564
  font-weight: ${font.weight.medium};
15527
15565
  padding: ${tokens.size[1]} ${tokens.size[2.5]};
15528
15566
  `,
15529
- actionsBody: u`
15567
+ actionsBody: css`
15530
15568
  flex-wrap: wrap;
15531
15569
  margin: ${tokens.size[2]} 0px ${tokens.size[2]} 0px;
15532
15570
  display: flex;
@@ -15566,7 +15604,7 @@ var init_Devtools = __esm({
15566
15604
  }
15567
15605
  }
15568
15606
  `,
15569
- actionsSelect: u`
15607
+ actionsSelect: css`
15570
15608
  font-size: ${font.size.xs};
15571
15609
  padding: ${tokens.size[0.5]} ${tokens.size[2]};
15572
15610
  display: flex;
@@ -15615,7 +15653,7 @@ var init_Devtools = __esm({
15615
15653
  height: ${tokens.size[2]};
15616
15654
  }
15617
15655
  `,
15618
- settingsMenu: u`
15656
+ settingsMenu: css`
15619
15657
  display: flex;
15620
15658
  & * {
15621
15659
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
@@ -15631,7 +15669,7 @@ var init_Devtools = __esm({
15631
15669
  min-width: 120px;
15632
15670
  padding: ${size2[0.5]};
15633
15671
  `,
15634
- settingsSubTrigger: u`
15672
+ settingsSubTrigger: css`
15635
15673
  display: flex;
15636
15674
  align-items: center;
15637
15675
  justify-content: space-between;
@@ -15659,14 +15697,14 @@ var init_Devtools = __esm({
15659
15697
  cursor: not-allowed;
15660
15698
  }
15661
15699
  `,
15662
- settingsMenuHeader: u`
15700
+ settingsMenuHeader: css`
15663
15701
  padding: ${tokens.size[1]} ${tokens.size[1]};
15664
15702
  font-weight: ${font.weight.medium};
15665
15703
  border-bottom: 1px solid ${t2(colors.gray[300], colors.darkGray[400])};
15666
15704
  color: ${t2(colors.gray[500], colors.gray[400])};
15667
15705
  font-size: ${font.size["xs"]};
15668
15706
  `,
15669
- settingsSubButton: u`
15707
+ settingsSubButton: css`
15670
15708
  display: flex;
15671
15709
  align-items: center;
15672
15710
  justify-content: space-between;
@@ -15688,7 +15726,7 @@ var init_Devtools = __esm({
15688
15726
  outline: 2px solid ${colors.blue[800]};
15689
15727
  }
15690
15728
  `,
15691
- themeSelectedButton: u`
15729
+ themeSelectedButton: css`
15692
15730
  background-color: ${t2(colors.purple[100], colors.purple[900])};
15693
15731
  color: ${t2(colors.purple[700], colors.purple[300])};
15694
15732
  & svg {
@@ -15698,7 +15736,7 @@ var init_Devtools = __esm({
15698
15736
  background-color: ${t2(colors.purple[100], colors.purple[900])};
15699
15737
  }
15700
15738
  `,
15701
- viewToggle: u`
15739
+ viewToggle: css`
15702
15740
  border-radius: ${tokens.border.radius.sm};
15703
15741
  background-color: ${t2(colors.gray[200], colors.darkGray[600])};
15704
15742
  border: 1px solid ${t2(colors.gray[300], colors.darkGray[200])};
@@ -15750,8 +15788,8 @@ var init_Devtools = __esm({
15750
15788
  `
15751
15789
  };
15752
15790
  };
15753
- lightStyles2 = stylesFactory2("light");
15754
- darkStyles2 = stylesFactory2("dark");
15791
+ lightStyles2 = (css) => stylesFactory2("light", css);
15792
+ darkStyles2 = (css) => stylesFactory2("dark", css);
15755
15793
  delegateEvents(["click", "mousedown", "input"]);
15756
15794
  }
15757
15795
  });
@@ -15769,6 +15807,7 @@ exports.TanstackQueryDevtools = class TanstackQueryDevtools {
15769
15807
  #version;
15770
15808
  #isMounted = false;
15771
15809
  #styleNonce;
15810
+ #shadowDOMTarget;
15772
15811
  #buttonPosition;
15773
15812
  #position;
15774
15813
  #initialIsOpen;
@@ -15785,13 +15824,15 @@ exports.TanstackQueryDevtools = class TanstackQueryDevtools {
15785
15824
  position,
15786
15825
  initialIsOpen,
15787
15826
  errorTypes,
15788
- styleNonce
15827
+ styleNonce,
15828
+ shadowDOMTarget
15789
15829
  } = config;
15790
15830
  this.#client = createSignal(client);
15791
15831
  this.#queryFlavor = queryFlavor;
15792
15832
  this.#version = version;
15793
15833
  this.#onlineManager = onlineManager;
15794
15834
  this.#styleNonce = styleNonce;
15835
+ this.#shadowDOMTarget = shadowDOMTarget;
15795
15836
  this.#buttonPosition = createSignal(buttonPosition);
15796
15837
  this.#position = createSignal(position);
15797
15838
  this.#initialIsOpen = createSignal(initialIsOpen);
@@ -15830,7 +15871,7 @@ exports.TanstackQueryDevtools = class TanstackQueryDevtools {
15830
15871
  Devtools2 = lazy(() => Promise.resolve().then(() => (init_Devtools(), Devtools_exports)));
15831
15872
  this.#Component = Devtools2;
15832
15873
  }
15833
- setupStyleSheet(this.#styleNonce);
15874
+ setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
15834
15875
  return createComponent(Devtools2, mergeProps({
15835
15876
  get queryFlavor() {
15836
15877
  return _self$.#queryFlavor;
@@ -15840,6 +15881,9 @@ exports.TanstackQueryDevtools = class TanstackQueryDevtools {
15840
15881
  },
15841
15882
  get onlineManager() {
15842
15883
  return _self$.#onlineManager;
15884
+ },
15885
+ get shadowDOMTarget() {
15886
+ return _self$.#shadowDOMTarget;
15843
15887
  }
15844
15888
  }, {
15845
15889
  get client() {