@tanstack/query-devtools 5.1.0 → 5.4.2

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.
@@ -8737,35 +8737,35 @@ var tokens = {
8737
8737
  },
8738
8738
  font: {
8739
8739
  size: {
8740
- "2xs": "0.625rem",
8741
- xs: "0.75rem",
8742
- sm: "0.875rem",
8743
- md: "1rem",
8744
- lg: "1.125rem",
8745
- xl: "1.25rem",
8746
- "2xl": "1.5rem",
8747
- "3xl": "1.875rem",
8748
- "4xl": "2.25rem",
8749
- "5xl": "3rem",
8750
- "6xl": "3.75rem",
8751
- "7xl": "4.5rem",
8752
- "8xl": "6rem",
8753
- "9xl": "8rem"
8740
+ "2xs": "calc(var(--tsqd-font-size) * 0.625)",
8741
+ xs: "calc(var(--tsqd-font-size) * 0.75)",
8742
+ sm: "calc(var(--tsqd-font-size) * 0.875)",
8743
+ md: "var(--tsqd-font-size)",
8744
+ lg: "calc(var(--tsqd-font-size) * 1.125)",
8745
+ xl: "calc(var(--tsqd-font-size) * 1.25)",
8746
+ "2xl": "calc(var(--tsqd-font-size) * 1.5)",
8747
+ "3xl": "calc(var(--tsqd-font-size) * 1.875)",
8748
+ "4xl": "calc(var(--tsqd-font-size) * 2.25)",
8749
+ "5xl": "calc(var(--tsqd-font-size) * 3)",
8750
+ "6xl": "calc(var(--tsqd-font-size) * 3.75)",
8751
+ "7xl": "calc(var(--tsqd-font-size) * 4.5)",
8752
+ "8xl": "calc(var(--tsqd-font-size) * 6)",
8753
+ "9xl": "calc(var(--tsqd-font-size) * 8)"
8754
8754
  },
8755
8755
  lineHeight: {
8756
- xs: "1rem",
8757
- sm: "1.25rem",
8758
- md: "1.5rem",
8759
- lg: "1.75rem",
8760
- xl: "1.75rem",
8761
- "2xl": "2rem",
8762
- "3xl": "2.25rem",
8763
- "4xl": "2.5rem",
8764
- "5xl": "1",
8765
- "6xl": "1",
8766
- "7xl": "1",
8767
- "8xl": "1",
8768
- "9xl": "1"
8756
+ xs: "calc(var(--tsqd-font-size) * 1)",
8757
+ sm: "calc(var(--tsqd-font-size) * 1.25)",
8758
+ md: "calc(var(--tsqd-font-size) * 1.5)",
8759
+ lg: "calc(var(--tsqd-font-size) * 1.75)",
8760
+ xl: "calc(var(--tsqd-font-size) * 2)",
8761
+ "2xl": "calc(var(--tsqd-font-size) * 2.25)",
8762
+ "3xl": "calc(var(--tsqd-font-size) * 2.5)",
8763
+ "4xl": "calc(var(--tsqd-font-size) * 2.75)",
8764
+ "5xl": "calc(var(--tsqd-font-size) * 3)",
8765
+ "6xl": "calc(var(--tsqd-font-size) * 3.25)",
8766
+ "7xl": "calc(var(--tsqd-font-size) * 3.5)",
8767
+ "8xl": "calc(var(--tsqd-font-size) * 3.75)",
8768
+ "9xl": "calc(var(--tsqd-font-size) * 4)"
8769
8769
  },
8770
8770
  weight: {
8771
8771
  thin: "100",
@@ -8790,55 +8790,55 @@ var tokens = {
8790
8790
  border: {
8791
8791
  radius: {
8792
8792
  none: "0px",
8793
- xs: "0.125rem",
8794
- sm: "0.25rem",
8795
- md: "0.375rem",
8796
- lg: "0.5rem",
8797
- xl: "0.75rem",
8798
- "2xl": "1rem",
8799
- "3xl": "1.5rem",
8793
+ xs: "calc(var(--tsqd-font-size) * 0.125)",
8794
+ sm: "calc(var(--tsqd-font-size) * 0.25)",
8795
+ md: "calc(var(--tsqd-font-size) * 0.375)",
8796
+ lg: "calc(var(--tsqd-font-size) * 0.5)",
8797
+ xl: "calc(var(--tsqd-font-size) * 0.75)",
8798
+ "2xl": "calc(var(--tsqd-font-size) * 1)",
8799
+ "3xl": "calc(var(--tsqd-font-size) * 1.5)",
8800
8800
  full: "9999px"
8801
8801
  }
8802
8802
  },
8803
8803
  size: {
8804
8804
  0: "0px",
8805
- 0.25: "0.0625rem",
8806
- 0.5: "0.125rem",
8807
- 1: "0.25rem",
8808
- 1.5: "0.375rem",
8809
- 2: "0.5rem",
8810
- 2.5: "0.625rem",
8811
- 3: "0.75rem",
8812
- 3.5: "0.875rem",
8813
- 4: "1rem",
8814
- 4.5: "1.125rem",
8815
- 5: "1.25rem",
8816
- 5.5: "1.375rem",
8817
- 6: "1.5rem",
8818
- 6.5: "1.625rem",
8819
- 7: "1.75rem",
8820
- 8: "2rem",
8821
- 9: "2.25rem",
8822
- 10: "2.5rem",
8823
- 11: "2.75rem",
8824
- 12: "3rem",
8825
- 14: "3.5rem",
8826
- 16: "4rem",
8827
- 20: "5rem",
8828
- 24: "6rem",
8829
- 28: "7rem",
8830
- 32: "8rem",
8831
- 36: "9rem",
8832
- 40: "10rem",
8833
- 44: "11rem",
8834
- 48: "12rem",
8835
- 52: "13rem",
8836
- 56: "14rem",
8837
- 60: "15rem",
8838
- 64: "16rem",
8839
- 72: "18rem",
8840
- 80: "20rem",
8841
- 96: "24rem"
8805
+ 0.25: "calc(var(--tsqd-font-size) * 0.0625)",
8806
+ 0.5: "calc(var(--tsqd-font-size) * 0.125)",
8807
+ 1: "calc(var(--tsqd-font-size) * 0.25)",
8808
+ 1.5: "calc(var(--tsqd-font-size) * 0.375)",
8809
+ 2: "calc(var(--tsqd-font-size) * 0.5)",
8810
+ 2.5: "calc(var(--tsqd-font-size) * 0.625)",
8811
+ 3: "calc(var(--tsqd-font-size) * 0.75)",
8812
+ 3.5: "calc(var(--tsqd-font-size) * 0.875)",
8813
+ 4: "calc(var(--tsqd-font-size) * 1)",
8814
+ 4.5: "calc(var(--tsqd-font-size) * 1.125)",
8815
+ 5: "calc(var(--tsqd-font-size) * 1.25)",
8816
+ 5.5: "calc(var(--tsqd-font-size) * 1.375)",
8817
+ 6: "calc(var(--tsqd-font-size) * 1.5)",
8818
+ 6.5: "calc(var(--tsqd-font-size) * 1.625)",
8819
+ 7: "calc(var(--tsqd-font-size) * 1.75)",
8820
+ 8: "calc(var(--tsqd-font-size) * 2)",
8821
+ 9: "calc(var(--tsqd-font-size) * 2.25)",
8822
+ 10: "calc(var(--tsqd-font-size) * 2.5)",
8823
+ 11: "calc(var(--tsqd-font-size) * 2.75)",
8824
+ 12: "calc(var(--tsqd-font-size) * 3)",
8825
+ 14: "calc(var(--tsqd-font-size) * 3.5)",
8826
+ 16: "calc(var(--tsqd-font-size) * 4)",
8827
+ 20: "calc(var(--tsqd-font-size) * 5)",
8828
+ 24: "calc(var(--tsqd-font-size) * 6)",
8829
+ 28: "calc(var(--tsqd-font-size) * 7)",
8830
+ 32: "calc(var(--tsqd-font-size) * 8)",
8831
+ 36: "calc(var(--tsqd-font-size) * 9)",
8832
+ 40: "calc(var(--tsqd-font-size) * 10)",
8833
+ 44: "calc(var(--tsqd-font-size) * 11)",
8834
+ 48: "calc(var(--tsqd-font-size) * 12)",
8835
+ 52: "calc(var(--tsqd-font-size) * 13)",
8836
+ 56: "calc(var(--tsqd-font-size) * 14)",
8837
+ 60: "calc(var(--tsqd-font-size) * 15)",
8838
+ 64: "calc(var(--tsqd-font-size) * 16)",
8839
+ 72: "calc(var(--tsqd-font-size) * 18)",
8840
+ 80: "calc(var(--tsqd-font-size) * 20)",
8841
+ 96: "calc(var(--tsqd-font-size) * 24)"
8842
8842
  },
8843
8843
  shadow: Shadow,
8844
8844
  zIndices: {
@@ -11507,8 +11507,8 @@ var stylesFactory = (theme) => {
11507
11507
  expanderButtonContainer: u`
11508
11508
  display: flex;
11509
11509
  align-items: center;
11510
- line-height: 1.125rem;
11511
- min-height: 1.125rem;
11510
+ line-height: ${size2[4]};
11511
+ min-height: ${size2[4]};
11512
11512
  gap: ${size2[2]};
11513
11513
  `,
11514
11514
  expanderButton: u`
@@ -11516,7 +11516,7 @@ var stylesFactory = (theme) => {
11516
11516
  color: inherit;
11517
11517
  font: inherit;
11518
11518
  outline: inherit;
11519
- height: 1rem;
11519
+ height: ${size2[5]};
11520
11520
  background: transparent;
11521
11521
  border: none;
11522
11522
  padding: 0;
@@ -11558,8 +11558,8 @@ var stylesFactory = (theme) => {
11558
11558
  display: inline-flex;
11559
11559
  gap: ${size2[2]};
11560
11560
  width: 100%;
11561
- margin-bottom: ${size2[0.5]};
11562
- line-height: 1.125rem;
11561
+ margin: ${size2[0.25]} 0px;
11562
+ line-height: ${size2[4.5]};
11563
11563
  align-items: center;
11564
11564
  `,
11565
11565
  editableInput: u`
@@ -11659,8 +11659,9 @@ var Devtools = (props) => {
11659
11659
  const position = createMemo(() => {
11660
11660
  return props.localStore.position || useQueryDevtoolsContext().position || POSITION;
11661
11661
  });
11662
+ let transitionsContainerRef;
11662
11663
  createEffect(() => {
11663
- const root = document.querySelector(".tsqd-parent-container");
11664
+ const root = transitionsContainerRef.parentElement;
11664
11665
  const height = props.localStore.height || DEFAULT_HEIGHT;
11665
11666
  const width = props.localStore.width || DEFAULT_WIDTH;
11666
11667
  const panelPosition = position();
@@ -11673,6 +11674,18 @@ var Devtools = (props) => {
11673
11674
  `${panelPosition === "left" ? "-" : ""}${width}px`
11674
11675
  );
11675
11676
  });
11677
+ onMount(() => {
11678
+ const onFocus = () => {
11679
+ const root = transitionsContainerRef.parentElement;
11680
+ const fontSize = getComputedStyle(root).fontSize;
11681
+ root.style.setProperty("--tsqd-font-size", fontSize);
11682
+ };
11683
+ onFocus();
11684
+ window.addEventListener("focus", onFocus);
11685
+ onCleanup(() => {
11686
+ window.removeEventListener("focus", onFocus);
11687
+ });
11688
+ });
11676
11689
  return <div
11677
11690
  class={clsx(
11678
11691
  u`
@@ -11698,6 +11711,7 @@ var Devtools = (props) => {
11698
11711
  `,
11699
11712
  "tsqd-transitions-container"
11700
11713
  )}
11714
+ ref={transitionsContainerRef}
11701
11715
  >
11702
11716
  <TransitionGroup name="tsqd-panel-transition"><Show when={isOpen()}><DevtoolsPanel
11703
11717
  localStore={props.localStore}
@@ -11864,6 +11878,7 @@ var DevtoolsPanel = (props) => {
11864
11878
  var ContentView = (props) => {
11865
11879
  setupQueryCacheSubscription();
11866
11880
  setupMutationCacheSubscription();
11881
+ let containerRef;
11867
11882
  const theme = useTheme();
11868
11883
  const styles = createMemo(() => {
11869
11884
  return theme() === "dark" ? darkStyles2 : lightStyles2;
@@ -11941,6 +11956,11 @@ var ContentView = (props) => {
11941
11956
  const setDevtoolsPosition = (pos) => {
11942
11957
  props.setLocalStore("position", pos);
11943
11958
  };
11959
+ const setComputedVariables = (el) => {
11960
+ const computedStyle = getComputedStyle(containerRef);
11961
+ const variable = computedStyle.getPropertyValue("--tsqd-font-size");
11962
+ el.style.setProperty("--tsqd-font-size", variable);
11963
+ };
11944
11964
  return <>
11945
11965
  <div
11946
11966
  class={clsx(
@@ -11951,6 +11971,7 @@ var ContentView = (props) => {
11951
11971
  `,
11952
11972
  "tsqd-queries-container"
11953
11973
  )}
11974
+ ref={containerRef}
11954
11975
  >
11955
11976
  <div class={clsx(styles().row, "tsqd-header")}>
11956
11977
  <div class={styles().logoAndToggleContainer}>
@@ -12121,7 +12142,9 @@ var ContentView = (props) => {
12121
12142
  "tsqd-action-settings"
12122
12143
  )}
12123
12144
  ><Settings /></index$d.Trigger>
12124
- <index$d.Portal><index$d.Content
12145
+ <index$d.Portal
12146
+ ref={(el) => setComputedVariables(el)}
12147
+ ><index$d.Content
12125
12148
  class={clsx(styles().settingsMenu, "tsqd-settings-menu")}
12126
12149
  >
12127
12150
  <div
@@ -12141,7 +12164,9 @@ var ContentView = (props) => {
12141
12164
  <span>Position</span>
12142
12165
  <ChevronDown />
12143
12166
  </index$d.SubTrigger>
12144
- <index$d.Portal><index$d.SubContent
12167
+ <index$d.Portal
12168
+ ref={(el) => setComputedVariables(el)}
12169
+ ><index$d.SubContent
12145
12170
  class={clsx(
12146
12171
  styles().settingsMenu,
12147
12172
  "tsqd-settings-submenu"
@@ -12216,7 +12241,9 @@ var ContentView = (props) => {
12216
12241
  <span>Theme</span>
12217
12242
  <ChevronDown />
12218
12243
  </index$d.SubTrigger>
12219
- <index$d.Portal><index$d.SubContent
12244
+ <index$d.Portal
12245
+ ref={(el) => setComputedVariables(el)}
12246
+ ><index$d.SubContent
12220
12247
  class={clsx(
12221
12248
  styles().settingsMenu,
12222
12249
  "tsqd-settings-submenu"
@@ -12906,7 +12933,7 @@ var QueryDetails = () => {
12906
12933
  <div class={clsx(styles().detailsHeader, "tsqd-query-details-header")}>Data Explorer</div>
12907
12934
  <div
12908
12935
  style={{
12909
- padding: "0.5rem"
12936
+ padding: tokens.size[2]
12910
12937
  }}
12911
12938
  class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer"
12912
12939
  ><Explorer
@@ -12919,7 +12946,7 @@ var QueryDetails = () => {
12919
12946
  <div class={clsx(styles().detailsHeader, "tsqd-query-details-header")}>Query Explorer</div>
12920
12947
  <div
12921
12948
  style={{
12922
- padding: "0.5rem"
12949
+ padding: tokens.size[2]
12923
12950
  }}
12924
12951
  class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"
12925
12952
  ><Explorer
@@ -13010,7 +13037,7 @@ var MutationDetails = () => {
13010
13037
  <div class={clsx(styles().detailsHeader, "tsqd-query-details-header")}>Variables Details</div>
13011
13038
  <div
13012
13039
  style={{
13013
- padding: "0.5rem"
13040
+ padding: tokens.size[2]
13014
13041
  }}
13015
13042
  class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"
13016
13043
  ><Explorer
@@ -13021,7 +13048,7 @@ var MutationDetails = () => {
13021
13048
  <div class={clsx(styles().detailsHeader, "tsqd-query-details-header")}>Context Details</div>
13022
13049
  <div
13023
13050
  style={{
13024
- padding: "0.5rem"
13051
+ padding: tokens.size[2]
13025
13052
  }}
13026
13053
  class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"
13027
13054
  ><Explorer
@@ -13032,7 +13059,7 @@ var MutationDetails = () => {
13032
13059
  <div class={clsx(styles().detailsHeader, "tsqd-query-details-header")}>Data Explorer</div>
13033
13060
  <div
13034
13061
  style={{
13035
- padding: "0.5rem"
13062
+ padding: tokens.size[2]
13036
13063
  }}
13037
13064
  class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"
13038
13065
  ><Explorer
@@ -13043,7 +13070,7 @@ var MutationDetails = () => {
13043
13070
  <div class={clsx(styles().detailsHeader, "tsqd-query-details-header")}>Mutations Explorer</div>
13044
13071
  <div
13045
13072
  style={{
13046
- padding: "0.5rem"
13073
+ padding: tokens.size[2]
13047
13074
  }}
13048
13075
  class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"
13049
13076
  ><Explorer
@@ -13216,7 +13243,7 @@ var stylesFactory2 = (theme) => {
13216
13243
  right: 0;
13217
13244
  left: 0;
13218
13245
  max-height: 90%;
13219
- min-height: 3.5rem;
13246
+ min-height: ${size2[14]};
13220
13247
  border-bottom: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
13221
13248
  `,
13222
13249
  "panel-position-bottom": u`
@@ -13224,7 +13251,7 @@ var stylesFactory2 = (theme) => {
13224
13251
  right: 0;
13225
13252
  left: 0;
13226
13253
  max-height: 90%;
13227
- min-height: 3.5rem;
13254
+ min-height: ${size2[14]};
13228
13255
  border-top: ${t2(colors.gray[400], colors.darkGray[300])} 1px solid;
13229
13256
  `,
13230
13257
  "panel-position-right": u`
@@ -13556,6 +13583,8 @@ var stylesFactory2 = (theme) => {
13556
13583
  outline: 2px solid ${colors.blue[800]};
13557
13584
  }
13558
13585
  & svg {
13586
+ width: ${tokens.size[3]};
13587
+ height: ${tokens.size[3]};
13559
13588
  color: ${t2(colors.gray[500], colors.gray[400])};
13560
13589
  }
13561
13590
  }
@@ -13641,8 +13670,8 @@ var stylesFactory2 = (theme) => {
13641
13670
  border-radius: ${tokens.border.radius.sm};
13642
13671
  background-color: ${t2(colors.gray[100], colors.darkGray[400])};
13643
13672
  border: 1px solid ${t2(colors.gray[300], colors.darkGray[200])};
13644
- width: 1.625rem;
13645
- height: 1.625rem;
13673
+ width: ${tokens.size[6.5]};
13674
+ height: ${tokens.size[6.5]};
13646
13675
  justify-content: center;
13647
13676
  display: flex;
13648
13677
  align-items: center;