@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/dev.cjs CHANGED
@@ -3223,10 +3223,10 @@ var init_utils = __esm({
3223
3223
  }
3224
3224
  return oldData;
3225
3225
  };
3226
- setupStyleSheet = (nonce) => {
3226
+ setupStyleSheet = (nonce, target) => {
3227
3227
  if (!nonce)
3228
3228
  return;
3229
- const styleExists = document.querySelector("#_goober");
3229
+ const styleExists = document.querySelector("#_goober") || target?.querySelector("#_goober");
3230
3230
  if (styleExists)
3231
3231
  return;
3232
3232
  const styleTag = document.createElement("style");
@@ -3234,7 +3234,11 @@ var init_utils = __esm({
3234
3234
  styleTag.appendChild(textNode);
3235
3235
  styleTag.id = "_goober";
3236
3236
  styleTag.setAttribute("nonce", nonce);
3237
- document.head.appendChild(styleTag);
3237
+ if (target) {
3238
+ target.appendChild(styleTag);
3239
+ } else {
3240
+ document.head.appendChild(styleTag);
3241
+ }
3238
3242
  };
3239
3243
  }
3240
3244
  });
@@ -12209,7 +12213,8 @@ var init_Context = __esm({
12209
12213
  client: void 0,
12210
12214
  onlineManager: void 0,
12211
12215
  queryFlavor: "",
12212
- version: ""
12216
+ version: "",
12217
+ shadowDOMTarget: void 0
12213
12218
  });
12214
12219
  ThemeContext = createContext(
12215
12220
  () => "dark"
@@ -13027,11 +13032,11 @@ var init_Devtools = __esm({
13027
13032
  }
13028
13033
  });
13029
13034
  createEffect(() => {
13030
- const gooberStyles = document.getElementById("_goober");
13035
+ const gooberStyles = (useQueryDevtoolsContext().shadowDOMTarget || document).querySelector("#_goober");
13031
13036
  const w = pipWindow();
13032
13037
  if (gooberStyles && w) {
13033
13038
  const observer = new MutationObserver(() => {
13034
- const pip_style = w.document.getElementById("_goober");
13039
+ const pip_style = (useQueryDevtoolsContext().shadowDOMTarget || w.document).querySelector("#_goober");
13035
13040
  if (pip_style) {
13036
13041
  pip_style.textContent = gooberStyles.textContent;
13037
13042
  }
@@ -13106,8 +13111,11 @@ var init_Devtools = __esm({
13106
13111
  Devtools_default = DevtoolsComponent;
13107
13112
  Devtools = (props) => {
13108
13113
  const theme = useTheme();
13114
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
13115
+ target: useQueryDevtoolsContext().shadowDOMTarget
13116
+ }) : u;
13109
13117
  const styles = createMemo(() => {
13110
- return theme() === "dark" ? darkStyles2 : lightStyles2;
13118
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
13111
13119
  });
13112
13120
  const pip = usePiPWindow();
13113
13121
  const buttonPosition = createMemo(() => {
@@ -13208,7 +13216,7 @@ var init_Devtools = __esm({
13208
13216
  });
13209
13217
  }
13210
13218
  }), null);
13211
- createRenderEffect(() => className(_el$, clsx(u`
13219
+ createRenderEffect(() => className(_el$, clsx(css`
13212
13220
  & .tsqd-panel-transition-exit-active,
13213
13221
  & .tsqd-panel-transition-enter-active {
13214
13222
  transition:
@@ -13241,8 +13249,11 @@ var init_Devtools = __esm({
13241
13249
  PiPPanel = (props) => {
13242
13250
  const pip = usePiPWindow();
13243
13251
  const theme = useTheme();
13252
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
13253
+ target: useQueryDevtoolsContext().shadowDOMTarget
13254
+ }) : u;
13244
13255
  const styles = createMemo(() => {
13245
- return theme() === "dark" ? darkStyles2 : lightStyles2;
13256
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
13246
13257
  });
13247
13258
  const getPanelDynamicStyles = () => {
13248
13259
  const {
@@ -13250,12 +13261,12 @@ var init_Devtools = __esm({
13250
13261
  } = tokens;
13251
13262
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
13252
13263
  if (panelWidth() < secondBreakpoint) {
13253
- return u`
13264
+ return css`
13254
13265
  flex-direction: column;
13255
13266
  background-color: ${t2(colors.gray[300], colors.gray[600])};
13256
13267
  `;
13257
13268
  }
13258
- return u`
13269
+ return css`
13259
13270
  flex-direction: row;
13260
13271
  background-color: ${t2(colors.gray[200], colors.darkGray[900])};
13261
13272
  `;
@@ -13285,7 +13296,7 @@ var init_Devtools = __esm({
13285
13296
  _el$5.style.setProperty("width", "100vw");
13286
13297
  insert(_el$5, () => props.children);
13287
13298
  createRenderEffect(() => className(_el$5, clsx(styles().panel, getPanelDynamicStyles(), {
13288
- [u`
13299
+ [css`
13289
13300
  min-width: min-content;
13290
13301
  `]: panelWidth() < thirdBreakpoint
13291
13302
  }, "tsqd-main-panel")));
@@ -13294,8 +13305,11 @@ var init_Devtools = __esm({
13294
13305
  };
13295
13306
  DevtoolsPanel = (props) => {
13296
13307
  const theme = useTheme();
13308
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
13309
+ target: useQueryDevtoolsContext().shadowDOMTarget
13310
+ }) : u;
13297
13311
  const styles = createMemo(() => {
13298
- return theme() === "dark" ? darkStyles2 : lightStyles2;
13312
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
13299
13313
  });
13300
13314
  const [isResizing, setIsResizing] = createSignal(false);
13301
13315
  const position = createMemo(() => props.localStore.position || useQueryDevtoolsContext().position || POSITION);
@@ -13389,12 +13403,12 @@ var init_Devtools = __esm({
13389
13403
  } = tokens;
13390
13404
  const t2 = (light, dark) => theme() === "dark" ? dark : light;
13391
13405
  if (panelWidth() < secondBreakpoint) {
13392
- return u`
13406
+ return css`
13393
13407
  flex-direction: column;
13394
13408
  background-color: ${t2(colors.gray[300], colors.gray[600])};
13395
13409
  `;
13396
13410
  }
13397
- return u`
13411
+ return css`
13398
13412
  flex-direction: row;
13399
13413
  background-color: ${t2(colors.gray[200], colors.darkGray[900])};
13400
13414
  `;
@@ -13416,7 +13430,7 @@ var init_Devtools = __esm({
13416
13430
  }), null);
13417
13431
  createRenderEffect((_p$) => {
13418
13432
  const _v$ = clsx(styles().panel, styles()[`panel-position-${position()}`], getPanelDynamicStyles(), {
13419
- [u`
13433
+ [css`
13420
13434
  min-width: min-content;
13421
13435
  `]: panelWidth() < thirdBreakpoint && (position() === "right" || position() === "left")
13422
13436
  }, "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");
@@ -13441,8 +13455,11 @@ var init_Devtools = __esm({
13441
13455
  setupMutationCacheSubscription();
13442
13456
  let containerRef;
13443
13457
  const theme = useTheme();
13458
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
13459
+ target: useQueryDevtoolsContext().shadowDOMTarget
13460
+ }) : u;
13444
13461
  const styles = createMemo(() => {
13445
- return theme() === "dark" ? darkStyles2 : lightStyles2;
13462
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
13446
13463
  });
13447
13464
  const pip = usePiPWindow();
13448
13465
  const [selectedView, setSelectedView] = createSignal("queries");
@@ -13873,10 +13890,10 @@ var init_Devtools = __esm({
13873
13890
  }
13874
13891
  }), null);
13875
13892
  createRenderEffect((_p$) => {
13876
- const _v$6 = clsx(styles().queriesContainer, panelWidth() < secondBreakpoint && (selectedQueryHash() || selectedMutationId()) && u`
13893
+ const _v$6 = clsx(styles().queriesContainer, panelWidth() < secondBreakpoint && (selectedQueryHash() || selectedMutationId()) && css`
13877
13894
  height: 50%;
13878
13895
  max-height: 50%;
13879
- `, panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && u`
13896
+ `, panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && css`
13880
13897
  height: 100%;
13881
13898
  max-height: 100%;
13882
13899
  `, "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"}`;
@@ -13943,8 +13960,11 @@ var init_Devtools = __esm({
13943
13960
  };
13944
13961
  QueryRow = (props) => {
13945
13962
  const theme = useTheme();
13963
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
13964
+ target: useQueryDevtoolsContext().shadowDOMTarget
13965
+ }) : u;
13946
13966
  const styles = createMemo(() => {
13947
- return theme() === "dark" ? darkStyles2 : lightStyles2;
13967
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
13948
13968
  });
13949
13969
  const {
13950
13970
  colors,
@@ -13970,12 +13990,12 @@ var init_Devtools = __esm({
13970
13990
  }));
13971
13991
  const getObserverCountColorStyles = () => {
13972
13992
  if (color() === "gray") {
13973
- return u`
13993
+ return css`
13974
13994
  background-color: ${t2(colors[color()][200], colors[color()][700])};
13975
13995
  color: ${t2(colors[color()][700], colors[color()][300])};
13976
13996
  `;
13977
13997
  }
13978
- return u`
13998
+ return css`
13979
13999
  background-color: ${t2(colors[color()][200] + alpha[80], colors[color()][900])};
13980
14000
  color: ${t2(colors[color()][800], colors[color()][300])};
13981
14001
  `;
@@ -14014,8 +14034,11 @@ var init_Devtools = __esm({
14014
14034
  };
14015
14035
  MutationRow = (props) => {
14016
14036
  const theme = useTheme();
14037
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14038
+ target: useQueryDevtoolsContext().shadowDOMTarget
14039
+ }) : u;
14017
14040
  const styles = createMemo(() => {
14018
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14041
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14019
14042
  });
14020
14043
  const {
14021
14044
  colors,
@@ -14047,12 +14070,12 @@ var init_Devtools = __esm({
14047
14070
  }));
14048
14071
  const getObserverCountColorStyles = () => {
14049
14072
  if (color() === "gray") {
14050
- return u`
14073
+ return css`
14051
14074
  background-color: ${t2(colors[color()][200], colors[color()][700])};
14052
14075
  color: ${t2(colors[color()][700], colors[color()][300])};
14053
14076
  `;
14054
14077
  }
14055
- return u`
14078
+ return css`
14056
14079
  background-color: ${t2(colors[color()][200] + alpha[80], colors[color()][900])};
14057
14080
  color: ${t2(colors[color()][800], colors[color()][300])};
14058
14081
  `;
@@ -14129,8 +14152,11 @@ var init_Devtools = __esm({
14129
14152
  const paused = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().getAll().filter((q) => getQueryStatusLabel(q) === "paused").length);
14130
14153
  const inactive = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().getAll().filter((q) => getQueryStatusLabel(q) === "inactive").length);
14131
14154
  const theme = useTheme();
14155
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14156
+ target: useQueryDevtoolsContext().shadowDOMTarget
14157
+ }) : u;
14132
14158
  const styles = createMemo(() => {
14133
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14159
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14134
14160
  });
14135
14161
  return (() => {
14136
14162
  const _el$55 = _tmpl$26();
@@ -14191,8 +14217,11 @@ var init_Devtools = __esm({
14191
14217
  status: m.state.status
14192
14218
  }) === "red").length);
14193
14219
  const theme = useTheme();
14220
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14221
+ target: useQueryDevtoolsContext().shadowDOMTarget
14222
+ }) : u;
14194
14223
  const styles = createMemo(() => {
14195
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14224
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14196
14225
  });
14197
14226
  return (() => {
14198
14227
  const _el$56 = _tmpl$26();
@@ -14230,8 +14259,11 @@ var init_Devtools = __esm({
14230
14259
  };
14231
14260
  QueryStatus = (props) => {
14232
14261
  const theme = useTheme();
14262
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14263
+ target: useQueryDevtoolsContext().shadowDOMTarget
14264
+ }) : u;
14233
14265
  const styles = createMemo(() => {
14234
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14266
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14235
14267
  });
14236
14268
  const {
14237
14269
  colors,
@@ -14268,7 +14300,7 @@ var init_Devtools = __esm({
14268
14300
  return showLabel();
14269
14301
  },
14270
14302
  get ["class"]() {
14271
- return clsx(styles().queryStatusTag, !showLabel() && u`
14303
+ return clsx(styles().queryStatusTag, !showLabel() && css`
14272
14304
  cursor: pointer;
14273
14305
  &:hover {
14274
14306
  background: ${t2(colors.gray[200], colors.darkGray[400])}${alpha[80]};
@@ -14302,12 +14334,12 @@ var init_Devtools = __esm({
14302
14334
  }), _el$61);
14303
14335
  insert(_el$61, () => props.count);
14304
14336
  createRenderEffect((_p$) => {
14305
- const _v$32 = clsx(u`
14337
+ const _v$32 = clsx(css`
14306
14338
  width: ${tokens.size[1.5]};
14307
14339
  height: ${tokens.size[1.5]};
14308
14340
  border-radius: ${tokens.border.radius.full};
14309
14341
  background-color: ${tokens.colors[props.color][500]};
14310
- `, "tsqd-query-status-tag-dot"), _v$33 = clsx(styles().queryStatusCount, props.count > 0 && props.color !== "gray" && u`
14342
+ `, "tsqd-query-status-tag-dot"), _v$33 = clsx(styles().queryStatusCount, props.count > 0 && props.color !== "gray" && css`
14311
14343
  background-color: ${t2(colors[props.color][100], colors[props.color][900])};
14312
14344
  color: ${t2(colors[props.color][700], colors[props.color][300])};
14313
14345
  `, "tsqd-query-status-tag-count");
@@ -14323,8 +14355,11 @@ var init_Devtools = __esm({
14323
14355
  };
14324
14356
  QueryDetails = () => {
14325
14357
  const theme = useTheme();
14358
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14359
+ target: useQueryDevtoolsContext().shadowDOMTarget
14360
+ }) : u;
14326
14361
  const styles = createMemo(() => {
14327
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14362
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14328
14363
  });
14329
14364
  const {
14330
14365
  colors
@@ -14387,13 +14422,13 @@ var init_Devtools = __esm({
14387
14422
  });
14388
14423
  const getQueryStatusColors = () => {
14389
14424
  if (color() === "gray") {
14390
- return u`
14425
+ return css`
14391
14426
  background-color: ${t2(colors[color()][200], colors[color()][700])};
14392
14427
  color: ${t2(colors[color()][700], colors[color()][300])};
14393
14428
  border-color: ${t2(colors[color()][400], colors[color()][600])};
14394
14429
  `;
14395
14430
  }
14396
- return u`
14431
+ return css`
14397
14432
  background-color: ${t2(colors[color()][100], colors[color()][900])};
14398
14433
  color: ${t2(colors[color()][700], colors[color()][300])};
14399
14434
  border-color: ${t2(colors[color()][400], colors[color()][600])};
@@ -14459,9 +14494,9 @@ var init_Devtools = __esm({
14459
14494
  };
14460
14495
  insert(_el$88, () => queryStatus() === "error" ? "Restore" : "Trigger", _el$90);
14461
14496
  createRenderEffect((_p$) => {
14462
- const _v$34 = clsx(u`
14497
+ const _v$34 = clsx(css`
14463
14498
  color: ${t2(colors.red[500], colors.red[400])};
14464
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-error"), _v$35 = queryStatus() === "pending", _v$36 = u`
14499
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-error"), _v$35 = queryStatus() === "pending", _v$36 = css`
14465
14500
  background-color: ${t2(colors.red[500], colors.red[400])};
14466
14501
  `;
14467
14502
  _v$34 !== _p$._v$34 && className(_el$88, _p$._v$34 = _v$34);
@@ -14499,7 +14534,7 @@ var init_Devtools = __esm({
14499
14534
  }), null);
14500
14535
  insert(_el$91, createComponent(ChevronDown, {}), null);
14501
14536
  createRenderEffect((_p$) => {
14502
- const _v$37 = clsx(styles().actionsSelect, "tsqd-query-details-actions-btn", "tsqd-query-details-action-error-multiple"), _v$38 = u`
14537
+ const _v$37 = clsx(styles().actionsSelect, "tsqd-query-details-actions-btn", "tsqd-query-details-action-error-multiple"), _v$38 = css`
14503
14538
  background-color: ${tokens.colors.red[400]};
14504
14539
  `, _v$39 = queryStatus() === "pending";
14505
14540
  _v$37 !== _p$._v$37 && className(_el$91, _p$._v$37 = _v$37);
@@ -14533,25 +14568,25 @@ var init_Devtools = __esm({
14533
14568
  }
14534
14569
  }));
14535
14570
  createRenderEffect((_p$) => {
14536
- 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`
14571
+ 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`
14537
14572
  color: ${t2(colors.blue[600], colors.blue[400])};
14538
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-refetch"), _v$47 = statusLabel() === "fetching", _v$48 = u`
14573
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-refetch"), _v$47 = statusLabel() === "fetching", _v$48 = css`
14539
14574
  background-color: ${t2(colors.blue[600], colors.blue[400])};
14540
- `, _v$49 = clsx(u`
14575
+ `, _v$49 = clsx(css`
14541
14576
  color: ${t2(colors.yellow[600], colors.yellow[400])};
14542
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-invalidate"), _v$50 = queryStatus() === "pending", _v$51 = u`
14577
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-invalidate"), _v$50 = queryStatus() === "pending", _v$51 = css`
14543
14578
  background-color: ${t2(colors.yellow[600], colors.yellow[400])};
14544
- `, _v$52 = clsx(u`
14579
+ `, _v$52 = clsx(css`
14545
14580
  color: ${t2(colors.gray[600], colors.gray[300])};
14546
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-reset"), _v$53 = queryStatus() === "pending", _v$54 = u`
14581
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-reset"), _v$53 = queryStatus() === "pending", _v$54 = css`
14547
14582
  background-color: ${t2(colors.gray[600], colors.gray[400])};
14548
- `, _v$55 = clsx(u`
14583
+ `, _v$55 = clsx(css`
14549
14584
  color: ${t2(colors.pink[500], colors.pink[400])};
14550
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-remove"), _v$56 = statusLabel() === "fetching", _v$57 = u`
14585
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-remove"), _v$56 = statusLabel() === "fetching", _v$57 = css`
14551
14586
  background-color: ${t2(colors.pink[500], colors.pink[400])};
14552
- `, _v$58 = clsx(u`
14587
+ `, _v$58 = clsx(css`
14553
14588
  color: ${t2(colors.cyan[500], colors.cyan[400])};
14554
- `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-loading"), _v$59 = restoringLoading(), _v$60 = u`
14589
+ `, "tsqd-query-details-actions-btn", "tsqd-query-details-action-loading"), _v$59 = restoringLoading(), _v$60 = css`
14555
14590
  background-color: ${t2(colors.cyan[500], colors.cyan[400])};
14556
14591
  `, _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];
14557
14592
  _v$40 !== _p$._v$40 && className(_el$62, _p$._v$40 = _v$40);
@@ -14613,8 +14648,11 @@ var init_Devtools = __esm({
14613
14648
  };
14614
14649
  MutationDetails = () => {
14615
14650
  const theme = useTheme();
14651
+ const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({
14652
+ target: useQueryDevtoolsContext().shadowDOMTarget
14653
+ }) : u;
14616
14654
  const styles = createMemo(() => {
14617
- return theme() === "dark" ? darkStyles2 : lightStyles2;
14655
+ return theme() === "dark" ? darkStyles2(css) : lightStyles2(css);
14618
14656
  });
14619
14657
  const {
14620
14658
  colors
@@ -14641,13 +14679,13 @@ var init_Devtools = __esm({
14641
14679
  const activeMutation = createSubscribeToMutationCacheBatcher((mutationCache) => mutationCache().getAll().find((mutation) => mutation.mutationId === selectedMutationId()), false);
14642
14680
  const getQueryStatusColors = () => {
14643
14681
  if (color() === "gray") {
14644
- return u`
14682
+ return css`
14645
14683
  background-color: ${t2(colors[color()][200], colors[color()][700])};
14646
14684
  color: ${t2(colors[color()][700], colors[color()][300])};
14647
14685
  border-color: ${t2(colors[color()][400], colors[color()][600])};
14648
14686
  `;
14649
14687
  }
14650
- return u`
14688
+ return css`
14651
14689
  background-color: ${t2(colors[color()][100], colors[color()][900])};
14652
14690
  color: ${t2(colors[color()][700], colors[color()][300])};
14653
14691
  border-color: ${t2(colors[color()][400], colors[color()][600])};
@@ -14821,7 +14859,7 @@ var init_Devtools = __esm({
14821
14859
  });
14822
14860
  return value;
14823
14861
  };
14824
- stylesFactory2 = (theme) => {
14862
+ stylesFactory2 = (theme, css) => {
14825
14863
  const {
14826
14864
  colors,
14827
14865
  font,
@@ -14832,7 +14870,7 @@ var init_Devtools = __esm({
14832
14870
  } = tokens;
14833
14871
  const t2 = (light, dark) => theme === "light" ? light : dark;
14834
14872
  return {
14835
- devtoolsBtn: u`
14873
+ devtoolsBtn: css`
14836
14874
  z-index: 100000;
14837
14875
  position: fixed;
14838
14876
  padding: 4px;
@@ -14886,7 +14924,7 @@ var init_Devtools = __esm({
14886
14924
  }
14887
14925
  }
14888
14926
  `,
14889
- panel: u`
14927
+ panel: css`
14890
14928
  position: fixed;
14891
14929
  z-index: 9999;
14892
14930
  display: flex;
@@ -14912,26 +14950,26 @@ var init_Devtools = __esm({
14912
14950
  background: ${t2(colors.gray[400], colors.darkGray[300])};
14913
14951
  }
14914
14952
  `,
14915
- "devtoolsBtn-position-bottom-right": u`
14953
+ "devtoolsBtn-position-bottom-right": css`
14916
14954
  bottom: 12px;
14917
14955
  right: 12px;
14918
14956
  `,
14919
- "devtoolsBtn-position-bottom-left": u`
14957
+ "devtoolsBtn-position-bottom-left": css`
14920
14958
  bottom: 12px;
14921
14959
  left: 12px;
14922
14960
  `,
14923
- "devtoolsBtn-position-top-left": u`
14961
+ "devtoolsBtn-position-top-left": css`
14924
14962
  top: 12px;
14925
14963
  left: 12px;
14926
14964
  `,
14927
- "devtoolsBtn-position-top-right": u`
14965
+ "devtoolsBtn-position-top-right": css`
14928
14966
  top: 12px;
14929
14967
  right: 12px;
14930
14968
  `,
14931
- "devtoolsBtn-position-relative": u`
14969
+ "devtoolsBtn-position-relative": css`
14932
14970
  position: relative;
14933
14971
  `,
14934
- "panel-position-top": u`
14972
+ "panel-position-top": css`
14935
14973
  top: 0;
14936
14974
  right: 0;
14937
14975
  left: 0;
@@ -14939,7 +14977,7 @@ var init_Devtools = __esm({
14939
14977
  min-height: ${size2[14]};
14940
14978
  border-bottom: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
14941
14979
  `,
14942
- "panel-position-bottom": u`
14980
+ "panel-position-bottom": css`
14943
14981
  bottom: 0;
14944
14982
  right: 0;
14945
14983
  left: 0;
@@ -14947,21 +14985,21 @@ var init_Devtools = __esm({
14947
14985
  min-height: ${size2[14]};
14948
14986
  border-top: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
14949
14987
  `,
14950
- "panel-position-right": u`
14988
+ "panel-position-right": css`
14951
14989
  bottom: 0;
14952
14990
  right: 0;
14953
14991
  top: 0;
14954
14992
  border-left: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
14955
14993
  max-width: 90%;
14956
14994
  `,
14957
- "panel-position-left": u`
14995
+ "panel-position-left": css`
14958
14996
  bottom: 0;
14959
14997
  left: 0;
14960
14998
  top: 0;
14961
14999
  border-right: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
14962
15000
  max-width: 90%;
14963
15001
  `,
14964
- closeBtn: u`
15002
+ closeBtn: css`
14965
15003
  position: absolute;
14966
15004
  cursor: pointer;
14967
15005
  z-index: 5;
@@ -14982,7 +15020,7 @@ var init_Devtools = __esm({
14982
15020
  height: ${size2[2]};
14983
15021
  }
14984
15022
  `,
14985
- "closeBtn-position-top": u`
15023
+ "closeBtn-position-top": css`
14986
15024
  bottom: 0;
14987
15025
  right: ${size2[2]};
14988
15026
  transform: translate(0, 100%);
@@ -15006,7 +15044,7 @@ var init_Devtools = __esm({
15006
15044
  transform: rotate(180deg);
15007
15045
  }
15008
15046
  `,
15009
- "closeBtn-position-bottom": u`
15047
+ "closeBtn-position-bottom": css`
15010
15048
  top: 0;
15011
15049
  right: ${size2[2]};
15012
15050
  transform: translate(0, -100%);
@@ -15026,7 +15064,7 @@ var init_Devtools = __esm({
15026
15064
  width: calc(100% + ${size2[5]});
15027
15065
  }
15028
15066
  `,
15029
- "closeBtn-position-right": u`
15067
+ "closeBtn-position-right": css`
15030
15068
  bottom: ${size2[2]};
15031
15069
  left: 0;
15032
15070
  transform: translate(-100%, 0);
@@ -15049,7 +15087,7 @@ var init_Devtools = __esm({
15049
15087
  transform: rotate(-90deg);
15050
15088
  }
15051
15089
  `,
15052
- "closeBtn-position-left": u`
15090
+ "closeBtn-position-left": css`
15053
15091
  bottom: ${size2[2]};
15054
15092
  right: 0;
15055
15093
  transform: translate(100%, 0);
@@ -15072,7 +15110,7 @@ var init_Devtools = __esm({
15072
15110
  transform: rotate(90deg);
15073
15111
  }
15074
15112
  `,
15075
- queriesContainer: u`
15113
+ queriesContainer: css`
15076
15114
  flex: 1 1 700px;
15077
15115
  background-color: ${t2(colors.gray[50], colors.darkGray[700])};
15078
15116
  display: flex;
@@ -15081,7 +15119,7 @@ var init_Devtools = __esm({
15081
15119
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
15082
15120
  }
15083
15121
  `,
15084
- dragHandle: u`
15122
+ dragHandle: css`
15085
15123
  position: absolute;
15086
15124
  transition: background-color 0.125s ease;
15087
15125
  &:hover {
@@ -15089,31 +15127,31 @@ var init_Devtools = __esm({
15089
15127
  }
15090
15128
  z-index: 4;
15091
15129
  `,
15092
- "dragHandle-position-top": u`
15130
+ "dragHandle-position-top": css`
15093
15131
  bottom: 0;
15094
15132
  width: 100%;
15095
15133
  height: 3px;
15096
15134
  cursor: ns-resize;
15097
15135
  `,
15098
- "dragHandle-position-bottom": u`
15136
+ "dragHandle-position-bottom": css`
15099
15137
  top: 0;
15100
15138
  width: 100%;
15101
15139
  height: 3px;
15102
15140
  cursor: ns-resize;
15103
15141
  `,
15104
- "dragHandle-position-right": u`
15142
+ "dragHandle-position-right": css`
15105
15143
  left: 0;
15106
15144
  width: 3px;
15107
15145
  height: 100%;
15108
15146
  cursor: ew-resize;
15109
15147
  `,
15110
- "dragHandle-position-left": u`
15148
+ "dragHandle-position-left": css`
15111
15149
  right: 0;
15112
15150
  width: 3px;
15113
15151
  height: 100%;
15114
15152
  cursor: ew-resize;
15115
15153
  `,
15116
- row: u`
15154
+ row: css`
15117
15155
  display: flex;
15118
15156
  justify-content: space-between;
15119
15157
  align-items: center;
@@ -15130,12 +15168,12 @@ var init_Devtools = __esm({
15130
15168
  flex-direction: column;
15131
15169
  }
15132
15170
  `,
15133
- logoAndToggleContainer: u`
15171
+ logoAndToggleContainer: css`
15134
15172
  display: flex;
15135
15173
  gap: ${tokens.size[3]};
15136
15174
  align-items: center;
15137
15175
  `,
15138
- logo: u`
15176
+ logo: css`
15139
15177
  cursor: pointer;
15140
15178
  display: flex;
15141
15179
  flex-direction: column;
@@ -15152,14 +15190,14 @@ var init_Devtools = __esm({
15152
15190
  outline: 2px solid ${colors.blue[800]};
15153
15191
  }
15154
15192
  `,
15155
- tanstackLogo: u`
15193
+ tanstackLogo: css`
15156
15194
  font-size: ${font.size.md};
15157
15195
  font-weight: ${font.weight.bold};
15158
15196
  line-height: ${font.lineHeight.xs};
15159
15197
  white-space: nowrap;
15160
15198
  color: ${t2(colors.gray[600], colors.gray[300])};
15161
15199
  `,
15162
- queryFlavorLogo: u`
15200
+ queryFlavorLogo: css`
15163
15201
  font-weight: ${font.weight.semibold};
15164
15202
  font-size: ${font.size.xs};
15165
15203
  background: linear-gradient(
@@ -15172,12 +15210,12 @@ var init_Devtools = __esm({
15172
15210
  -webkit-text-fill-color: transparent;
15173
15211
  white-space: nowrap;
15174
15212
  `,
15175
- queryStatusContainer: u`
15213
+ queryStatusContainer: css`
15176
15214
  display: flex;
15177
15215
  gap: ${tokens.size[2]};
15178
15216
  height: min-content;
15179
15217
  `,
15180
- queryStatusTag: u`
15218
+ queryStatusTag: css`
15181
15219
  display: flex;
15182
15220
  gap: ${tokens.size[1.5]};
15183
15221
  box-sizing: border-box;
@@ -15198,10 +15236,10 @@ var init_Devtools = __esm({
15198
15236
  outline: 2px solid ${colors.blue[800]};
15199
15237
  }
15200
15238
  `,
15201
- queryStatusTagLabel: u`
15239
+ queryStatusTagLabel: css`
15202
15240
  font-size: ${font.size.xs};
15203
15241
  `,
15204
- queryStatusCount: u`
15242
+ queryStatusCount: css`
15205
15243
  font-size: ${font.size.xs};
15206
15244
  padding: 0 5px;
15207
15245
  display: flex;
@@ -15213,7 +15251,7 @@ var init_Devtools = __esm({
15213
15251
  font-variant-numeric: tabular-nums;
15214
15252
  height: ${tokens.size[4.5]};
15215
15253
  `,
15216
- statusTooltip: u`
15254
+ statusTooltip: css`
15217
15255
  position: absolute;
15218
15256
  z-index: 1;
15219
15257
  background-color: ${t2(colors.gray[50], colors.darkGray[500])};
@@ -15253,7 +15291,7 @@ var init_Devtools = __esm({
15253
15291
  border-width: 7px;
15254
15292
  }
15255
15293
  `,
15256
- filtersContainer: u`
15294
+ filtersContainer: css`
15257
15295
  display: flex;
15258
15296
  gap: ${tokens.size[2]};
15259
15297
  & > button {
@@ -15282,7 +15320,7 @@ var init_Devtools = __esm({
15282
15320
  }
15283
15321
  }
15284
15322
  `,
15285
- filterInput: u`
15323
+ filterInput: css`
15286
15324
  padding: ${size2[0.5]} ${size2[2]};
15287
15325
  border-radius: ${tokens.border.radius.sm};
15288
15326
  background-color: ${t2(colors.gray[100], colors.darkGray[400])};
@@ -15321,7 +15359,7 @@ var init_Devtools = __esm({
15321
15359
  outline: 2px solid ${colors.blue[800]};
15322
15360
  }
15323
15361
  `,
15324
- filterSelect: u`
15362
+ filterSelect: css`
15325
15363
  padding: ${tokens.size[0.5]} ${tokens.size[2]};
15326
15364
  border-radius: ${tokens.border.radius.sm};
15327
15365
  background-color: ${t2(colors.gray[100], colors.darkGray[400])};
@@ -15355,11 +15393,11 @@ var init_Devtools = __esm({
15355
15393
  outline: 2px solid ${colors.blue[800]};
15356
15394
  }
15357
15395
  `,
15358
- actionsContainer: u`
15396
+ actionsContainer: css`
15359
15397
  display: flex;
15360
15398
  gap: ${tokens.size[2]};
15361
15399
  `,
15362
- actionsBtn: u`
15400
+ actionsBtn: css`
15363
15401
  border-radius: ${tokens.border.radius.sm};
15364
15402
  background-color: ${t2(colors.gray[100], colors.darkGray[400])};
15365
15403
  border: 1px solid ${t2(colors.gray[300], colors.darkGray[200])};
@@ -15386,13 +15424,13 @@ var init_Devtools = __esm({
15386
15424
  outline: 2px solid ${colors.blue[800]};
15387
15425
  }
15388
15426
  `,
15389
- actionsBtnOffline: u`
15427
+ actionsBtnOffline: css`
15390
15428
  & svg {
15391
15429
  stroke: ${t2(colors.yellow[700], colors.yellow[500])};
15392
15430
  fill: ${t2(colors.yellow[700], colors.yellow[500])};
15393
15431
  }
15394
15432
  `,
15395
- overflowQueryContainer: u`
15433
+ overflowQueryContainer: css`
15396
15434
  flex: 1;
15397
15435
  overflow-y: auto;
15398
15436
  & > div {
@@ -15400,7 +15438,7 @@ var init_Devtools = __esm({
15400
15438
  flex-direction: column;
15401
15439
  }
15402
15440
  `,
15403
- queryRow: u`
15441
+ queryRow: css`
15404
15442
  display: flex;
15405
15443
  align-items: center;
15406
15444
  padding: 0;
@@ -15462,10 +15500,10 @@ var init_Devtools = __esm({
15462
15500
  font-size: ${font.size.xs};
15463
15501
  }
15464
15502
  `,
15465
- selectedQueryRow: u`
15503
+ selectedQueryRow: css`
15466
15504
  background-color: ${t2(colors.gray[200], colors.darkGray[500])};
15467
15505
  `,
15468
- detailsContainer: u`
15506
+ detailsContainer: css`
15469
15507
  flex: 1 1 700px;
15470
15508
  background-color: ${t2(colors.gray[50], colors.darkGray[700])};
15471
15509
  color: ${t2(colors.gray[700], colors.gray[300])};
@@ -15476,7 +15514,7 @@ var init_Devtools = __esm({
15476
15514
  display: flex;
15477
15515
  text-align: left;
15478
15516
  `,
15479
- detailsHeader: u`
15517
+ detailsHeader: css`
15480
15518
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
15481
15519
  position: sticky;
15482
15520
  top: 0;
@@ -15488,7 +15526,7 @@ var init_Devtools = __esm({
15488
15526
  line-height: ${font.lineHeight.xs};
15489
15527
  text-align: left;
15490
15528
  `,
15491
- detailsBody: u`
15529
+ detailsBody: css`
15492
15530
  margin: ${tokens.size[1.5]} 0px ${tokens.size[2]} 0px;
15493
15531
  & > div {
15494
15532
  display: flex;
@@ -15522,13 +15560,13 @@ var init_Devtools = __esm({
15522
15560
  align-items: center;
15523
15561
  }
15524
15562
  `,
15525
- queryDetailsStatus: u`
15563
+ queryDetailsStatus: css`
15526
15564
  border: 1px solid ${colors.darkGray[200]};
15527
15565
  border-radius: ${tokens.border.radius.sm};
15528
15566
  font-weight: ${font.weight.medium};
15529
15567
  padding: ${tokens.size[1]} ${tokens.size[2.5]};
15530
15568
  `,
15531
- actionsBody: u`
15569
+ actionsBody: css`
15532
15570
  flex-wrap: wrap;
15533
15571
  margin: ${tokens.size[2]} 0px ${tokens.size[2]} 0px;
15534
15572
  display: flex;
@@ -15568,7 +15606,7 @@ var init_Devtools = __esm({
15568
15606
  }
15569
15607
  }
15570
15608
  `,
15571
- actionsSelect: u`
15609
+ actionsSelect: css`
15572
15610
  font-size: ${font.size.xs};
15573
15611
  padding: ${tokens.size[0.5]} ${tokens.size[2]};
15574
15612
  display: flex;
@@ -15617,7 +15655,7 @@ var init_Devtools = __esm({
15617
15655
  height: ${tokens.size[2]};
15618
15656
  }
15619
15657
  `,
15620
- settingsMenu: u`
15658
+ settingsMenu: css`
15621
15659
  display: flex;
15622
15660
  & * {
15623
15661
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
@@ -15633,7 +15671,7 @@ var init_Devtools = __esm({
15633
15671
  min-width: 120px;
15634
15672
  padding: ${size2[0.5]};
15635
15673
  `,
15636
- settingsSubTrigger: u`
15674
+ settingsSubTrigger: css`
15637
15675
  display: flex;
15638
15676
  align-items: center;
15639
15677
  justify-content: space-between;
@@ -15661,14 +15699,14 @@ var init_Devtools = __esm({
15661
15699
  cursor: not-allowed;
15662
15700
  }
15663
15701
  `,
15664
- settingsMenuHeader: u`
15702
+ settingsMenuHeader: css`
15665
15703
  padding: ${tokens.size[1]} ${tokens.size[1]};
15666
15704
  font-weight: ${font.weight.medium};
15667
15705
  border-bottom: 1px solid ${t2(colors.gray[300], colors.darkGray[400])};
15668
15706
  color: ${t2(colors.gray[500], colors.gray[400])};
15669
15707
  font-size: ${font.size["xs"]};
15670
15708
  `,
15671
- settingsSubButton: u`
15709
+ settingsSubButton: css`
15672
15710
  display: flex;
15673
15711
  align-items: center;
15674
15712
  justify-content: space-between;
@@ -15690,7 +15728,7 @@ var init_Devtools = __esm({
15690
15728
  outline: 2px solid ${colors.blue[800]};
15691
15729
  }
15692
15730
  `,
15693
- themeSelectedButton: u`
15731
+ themeSelectedButton: css`
15694
15732
  background-color: ${t2(colors.purple[100], colors.purple[900])};
15695
15733
  color: ${t2(colors.purple[700], colors.purple[300])};
15696
15734
  & svg {
@@ -15700,7 +15738,7 @@ var init_Devtools = __esm({
15700
15738
  background-color: ${t2(colors.purple[100], colors.purple[900])};
15701
15739
  }
15702
15740
  `,
15703
- viewToggle: u`
15741
+ viewToggle: css`
15704
15742
  border-radius: ${tokens.border.radius.sm};
15705
15743
  background-color: ${t2(colors.gray[200], colors.darkGray[600])};
15706
15744
  border: 1px solid ${t2(colors.gray[300], colors.darkGray[200])};
@@ -15752,8 +15790,8 @@ var init_Devtools = __esm({
15752
15790
  `
15753
15791
  };
15754
15792
  };
15755
- lightStyles2 = stylesFactory2("light");
15756
- darkStyles2 = stylesFactory2("dark");
15793
+ lightStyles2 = (css) => stylesFactory2("light", css);
15794
+ darkStyles2 = (css) => stylesFactory2("dark", css);
15757
15795
  delegateEvents(["click", "mousedown", "input"]);
15758
15796
  }
15759
15797
  });
@@ -15771,6 +15809,7 @@ exports.TanstackQueryDevtools = class TanstackQueryDevtools {
15771
15809
  #version;
15772
15810
  #isMounted = false;
15773
15811
  #styleNonce;
15812
+ #shadowDOMTarget;
15774
15813
  #buttonPosition;
15775
15814
  #position;
15776
15815
  #initialIsOpen;
@@ -15787,13 +15826,15 @@ exports.TanstackQueryDevtools = class TanstackQueryDevtools {
15787
15826
  position,
15788
15827
  initialIsOpen,
15789
15828
  errorTypes,
15790
- styleNonce
15829
+ styleNonce,
15830
+ shadowDOMTarget
15791
15831
  } = config;
15792
15832
  this.#client = createSignal(client);
15793
15833
  this.#queryFlavor = queryFlavor;
15794
15834
  this.#version = version;
15795
15835
  this.#onlineManager = onlineManager;
15796
15836
  this.#styleNonce = styleNonce;
15837
+ this.#shadowDOMTarget = shadowDOMTarget;
15797
15838
  this.#buttonPosition = createSignal(buttonPosition);
15798
15839
  this.#position = createSignal(position);
15799
15840
  this.#initialIsOpen = createSignal(initialIsOpen);
@@ -15832,7 +15873,7 @@ exports.TanstackQueryDevtools = class TanstackQueryDevtools {
15832
15873
  Devtools2 = lazy(() => Promise.resolve().then(() => (init_Devtools(), Devtools_exports)));
15833
15874
  this.#Component = Devtools2;
15834
15875
  }
15835
- setupStyleSheet(this.#styleNonce);
15876
+ setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
15836
15877
  return createComponent(Devtools2, mergeProps({
15837
15878
  get queryFlavor() {
15838
15879
  return _self$.#queryFlavor;
@@ -15842,6 +15883,9 @@ exports.TanstackQueryDevtools = class TanstackQueryDevtools {
15842
15883
  },
15843
15884
  get onlineManager() {
15844
15885
  return _self$.#onlineManager;
15886
+ },
15887
+ get shadowDOMTarget() {
15888
+ return _self$.#shadowDOMTarget;
15845
15889
  }
15846
15890
  }, {
15847
15891
  get client() {