@tanstack/query-devtools 5.90.1 → 5.91.1
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/DevtoolsComponent/{6ELMOJL2.js → 7HGFFDPC.js} +2 -2
- package/build/DevtoolsComponent/{NCMVHL6D.js → Q7LWSL4U.js} +2 -2
- package/build/DevtoolsPanelComponent/{PULY4AJ7.js → ONXD5SSW.js} +2 -2
- package/build/DevtoolsPanelComponent/{2AITGKQY.js → VLTTJS3N.js} +2 -2
- package/build/chunk/{2LDRPXKC.js → COYS3TMU.js} +131 -122
- package/build/chunk/{ZDWCUMSJ.js → MIMHJGAX.js} +131 -122
- package/build/dev.cjs +155 -126
- package/build/dev.js +24 -4
- package/build/index.cjs +155 -126
- package/build/index.d.cts +5 -1
- package/build/index.d.ts +5 -1
- package/build/index.js +24 -4
- package/package.json +2 -2
- package/src/Devtools.tsx +146 -151
- package/src/DevtoolsComponent.tsx +4 -4
- package/src/DevtoolsPanelComponent.tsx +4 -4
- package/src/Explorer.tsx +16 -2
- package/src/TanstackQueryDevtools.tsx +12 -0
- package/src/TanstackQueryDevtoolsPanel.tsx +12 -0
- package/src/contexts/QueryDevtoolsContext.ts +2 -0
- package/src/index.ts +1 -0
package/build/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var TanstackQueryDevtools = class {
|
|
|
15
15
|
#errorTypes;
|
|
16
16
|
#hideDisabledQueries;
|
|
17
17
|
#Component;
|
|
18
|
+
#theme;
|
|
18
19
|
#dispose;
|
|
19
20
|
constructor(config) {
|
|
20
21
|
const {
|
|
@@ -28,7 +29,8 @@ var TanstackQueryDevtools = class {
|
|
|
28
29
|
errorTypes,
|
|
29
30
|
styleNonce,
|
|
30
31
|
shadowDOMTarget,
|
|
31
|
-
hideDisabledQueries
|
|
32
|
+
hideDisabledQueries,
|
|
33
|
+
theme
|
|
32
34
|
} = config;
|
|
33
35
|
this.#client = createSignal(client);
|
|
34
36
|
this.#queryFlavor = queryFlavor;
|
|
@@ -41,6 +43,7 @@ var TanstackQueryDevtools = class {
|
|
|
41
43
|
this.#initialIsOpen = createSignal(initialIsOpen);
|
|
42
44
|
this.#errorTypes = createSignal(errorTypes);
|
|
43
45
|
this.#hideDisabledQueries = createSignal(hideDisabledQueries);
|
|
46
|
+
this.#theme = createSignal(theme);
|
|
44
47
|
}
|
|
45
48
|
setButtonPosition(position) {
|
|
46
49
|
this.#buttonPosition[1](position);
|
|
@@ -57,6 +60,9 @@ var TanstackQueryDevtools = class {
|
|
|
57
60
|
setClient(client) {
|
|
58
61
|
this.#client[1](client);
|
|
59
62
|
}
|
|
63
|
+
setTheme(theme) {
|
|
64
|
+
this.#theme[1](theme);
|
|
65
|
+
}
|
|
60
66
|
mount(el) {
|
|
61
67
|
if (this.#isMounted) {
|
|
62
68
|
throw new Error("Devtools is already mounted");
|
|
@@ -69,11 +75,12 @@ var TanstackQueryDevtools = class {
|
|
|
69
75
|
const [errors] = this.#errorTypes;
|
|
70
76
|
const [hideDisabledQueries] = this.#hideDisabledQueries;
|
|
71
77
|
const [queryClient] = this.#client;
|
|
78
|
+
const [theme] = this.#theme;
|
|
72
79
|
let Devtools;
|
|
73
80
|
if (this.#Component) {
|
|
74
81
|
Devtools = this.#Component;
|
|
75
82
|
} else {
|
|
76
|
-
Devtools = lazy(() => import('./DevtoolsComponent/
|
|
83
|
+
Devtools = lazy(() => import('./DevtoolsComponent/Q7LWSL4U.js'));
|
|
77
84
|
this.#Component = Devtools;
|
|
78
85
|
}
|
|
79
86
|
setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
|
|
@@ -108,6 +115,9 @@ var TanstackQueryDevtools = class {
|
|
|
108
115
|
},
|
|
109
116
|
get hideDisabledQueries() {
|
|
110
117
|
return hideDisabledQueries();
|
|
118
|
+
},
|
|
119
|
+
get theme() {
|
|
120
|
+
return theme();
|
|
111
121
|
}
|
|
112
122
|
}));
|
|
113
123
|
}, el);
|
|
@@ -139,6 +149,7 @@ var TanstackQueryDevtoolsPanel = class {
|
|
|
139
149
|
#hideDisabledQueries;
|
|
140
150
|
#onClose;
|
|
141
151
|
#Component;
|
|
152
|
+
#theme;
|
|
142
153
|
#dispose;
|
|
143
154
|
constructor(config) {
|
|
144
155
|
const {
|
|
@@ -153,7 +164,8 @@ var TanstackQueryDevtoolsPanel = class {
|
|
|
153
164
|
styleNonce,
|
|
154
165
|
shadowDOMTarget,
|
|
155
166
|
onClose,
|
|
156
|
-
hideDisabledQueries
|
|
167
|
+
hideDisabledQueries,
|
|
168
|
+
theme
|
|
157
169
|
} = config;
|
|
158
170
|
this.#client = createSignal(client);
|
|
159
171
|
this.#queryFlavor = queryFlavor;
|
|
@@ -167,6 +179,7 @@ var TanstackQueryDevtoolsPanel = class {
|
|
|
167
179
|
this.#errorTypes = createSignal(errorTypes);
|
|
168
180
|
this.#hideDisabledQueries = createSignal(hideDisabledQueries);
|
|
169
181
|
this.#onClose = createSignal(onClose);
|
|
182
|
+
this.#theme = createSignal(theme);
|
|
170
183
|
}
|
|
171
184
|
setButtonPosition(position) {
|
|
172
185
|
this.#buttonPosition[1](position);
|
|
@@ -186,6 +199,9 @@ var TanstackQueryDevtoolsPanel = class {
|
|
|
186
199
|
setOnClose(onClose) {
|
|
187
200
|
this.#onClose[1](() => onClose);
|
|
188
201
|
}
|
|
202
|
+
setTheme(theme) {
|
|
203
|
+
this.#theme[1](theme);
|
|
204
|
+
}
|
|
189
205
|
mount(el) {
|
|
190
206
|
if (this.#isMounted) {
|
|
191
207
|
throw new Error("Devtools is already mounted");
|
|
@@ -199,11 +215,12 @@ var TanstackQueryDevtoolsPanel = class {
|
|
|
199
215
|
const [hideDisabledQueries] = this.#hideDisabledQueries;
|
|
200
216
|
const [queryClient] = this.#client;
|
|
201
217
|
const [onClose] = this.#onClose;
|
|
218
|
+
const [theme] = this.#theme;
|
|
202
219
|
let Devtools;
|
|
203
220
|
if (this.#Component) {
|
|
204
221
|
Devtools = this.#Component;
|
|
205
222
|
} else {
|
|
206
|
-
Devtools = lazy(() => import('./DevtoolsPanelComponent/
|
|
223
|
+
Devtools = lazy(() => import('./DevtoolsPanelComponent/VLTTJS3N.js'));
|
|
207
224
|
this.#Component = Devtools;
|
|
208
225
|
}
|
|
209
226
|
setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
|
|
@@ -241,6 +258,9 @@ var TanstackQueryDevtoolsPanel = class {
|
|
|
241
258
|
},
|
|
242
259
|
get onClose() {
|
|
243
260
|
return onClose();
|
|
261
|
+
},
|
|
262
|
+
get theme() {
|
|
263
|
+
return theme();
|
|
244
264
|
}
|
|
245
265
|
}));
|
|
246
266
|
}, el);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/query-devtools",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.91.1",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack Query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"superjson": "^2.2.2",
|
|
58
58
|
"tsup-preset-solid": "^2.2.0",
|
|
59
59
|
"vite-plugin-solid": "^2.11.6",
|
|
60
|
-
"@tanstack/query-core": "5.90.
|
|
60
|
+
"@tanstack/query-core": "5.90.10"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"clean": "premove ./build ./coverage ./dist-ts",
|
package/src/Devtools.tsx
CHANGED
|
@@ -1000,7 +1000,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
|
|
|
1000
1000
|
'tsqd-action-open-pip',
|
|
1001
1001
|
)}
|
|
1002
1002
|
aria-label="Open in picture-in-picture mode"
|
|
1003
|
-
title=
|
|
1003
|
+
title="Open in picture-in-picture mode"
|
|
1004
1004
|
>
|
|
1005
1005
|
<PiPIcon />
|
|
1006
1006
|
</button>
|
|
@@ -1013,6 +1013,8 @@ export const ContentView: Component<ContentViewProps> = (props) => {
|
|
|
1013
1013
|
'tsqd-actions-btn',
|
|
1014
1014
|
'tsqd-action-settings',
|
|
1015
1015
|
)}
|
|
1016
|
+
aria-label="Open settings menu"
|
|
1017
|
+
title="Open settings menu"
|
|
1016
1018
|
>
|
|
1017
1019
|
<Settings />
|
|
1018
1020
|
</DropdownMenu.Trigger>
|
|
@@ -1061,62 +1063,58 @@ export const ContentView: Component<ContentViewProps> = (props) => {
|
|
|
1061
1063
|
'tsqd-settings-submenu',
|
|
1062
1064
|
)}
|
|
1063
1065
|
>
|
|
1064
|
-
<DropdownMenu.
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
styles().settingsSubButton,
|
|
1071
|
-
'tsqd-settings-menu-position-btn',
|
|
1072
|
-
'tsqd-settings-menu-position-btn-top',
|
|
1073
|
-
)}
|
|
1074
|
-
>
|
|
1075
|
-
<span>Top</span>
|
|
1076
|
-
<ArrowUp />
|
|
1077
|
-
</DropdownMenu.Item>
|
|
1078
|
-
<DropdownMenu.Item
|
|
1079
|
-
onSelect={() => {
|
|
1080
|
-
setDevtoolsPosition('bottom')
|
|
1081
|
-
}}
|
|
1082
|
-
as="button"
|
|
1083
|
-
class={cx(
|
|
1084
|
-
styles().settingsSubButton,
|
|
1085
|
-
'tsqd-settings-menu-position-btn',
|
|
1086
|
-
'tsqd-settings-menu-position-btn-bottom',
|
|
1087
|
-
)}
|
|
1088
|
-
>
|
|
1089
|
-
<span>Bottom</span>
|
|
1090
|
-
<ArrowDown />
|
|
1091
|
-
</DropdownMenu.Item>
|
|
1092
|
-
<DropdownMenu.Item
|
|
1093
|
-
onSelect={() => {
|
|
1094
|
-
setDevtoolsPosition('left')
|
|
1095
|
-
}}
|
|
1096
|
-
as="button"
|
|
1097
|
-
class={cx(
|
|
1098
|
-
styles().settingsSubButton,
|
|
1099
|
-
'tsqd-settings-menu-position-btn',
|
|
1100
|
-
'tsqd-settings-menu-position-btn-left',
|
|
1101
|
-
)}
|
|
1102
|
-
>
|
|
1103
|
-
<span>Left</span>
|
|
1104
|
-
<ArrowLeft />
|
|
1105
|
-
</DropdownMenu.Item>
|
|
1106
|
-
<DropdownMenu.Item
|
|
1107
|
-
onSelect={() => {
|
|
1108
|
-
setDevtoolsPosition('right')
|
|
1109
|
-
}}
|
|
1110
|
-
as="button"
|
|
1111
|
-
class={cx(
|
|
1112
|
-
styles().settingsSubButton,
|
|
1113
|
-
'tsqd-settings-menu-position-btn',
|
|
1114
|
-
'tsqd-settings-menu-position-btn-right',
|
|
1115
|
-
)}
|
|
1066
|
+
<DropdownMenu.RadioGroup
|
|
1067
|
+
aria-label="Position settings"
|
|
1068
|
+
value={props.localStore.position}
|
|
1069
|
+
onChange={(value) =>
|
|
1070
|
+
setDevtoolsPosition(value as DevtoolsPosition)
|
|
1071
|
+
}
|
|
1116
1072
|
>
|
|
1117
|
-
<
|
|
1118
|
-
|
|
1119
|
-
|
|
1073
|
+
<DropdownMenu.RadioItem
|
|
1074
|
+
value="top"
|
|
1075
|
+
class={cx(
|
|
1076
|
+
styles().settingsSubButton,
|
|
1077
|
+
'tsqd-settings-menu-position-btn',
|
|
1078
|
+
'tsqd-settings-menu-position-btn-top',
|
|
1079
|
+
)}
|
|
1080
|
+
>
|
|
1081
|
+
<span>Top</span>
|
|
1082
|
+
<ArrowUp />
|
|
1083
|
+
</DropdownMenu.RadioItem>
|
|
1084
|
+
<DropdownMenu.RadioItem
|
|
1085
|
+
value="bottom"
|
|
1086
|
+
class={cx(
|
|
1087
|
+
styles().settingsSubButton,
|
|
1088
|
+
'tsqd-settings-menu-position-btn',
|
|
1089
|
+
'tsqd-settings-menu-position-btn-bottom',
|
|
1090
|
+
)}
|
|
1091
|
+
>
|
|
1092
|
+
<span>Bottom</span>
|
|
1093
|
+
<ArrowDown />
|
|
1094
|
+
</DropdownMenu.RadioItem>
|
|
1095
|
+
<DropdownMenu.RadioItem
|
|
1096
|
+
value="left"
|
|
1097
|
+
class={cx(
|
|
1098
|
+
styles().settingsSubButton,
|
|
1099
|
+
'tsqd-settings-menu-position-btn',
|
|
1100
|
+
'tsqd-settings-menu-position-btn-left',
|
|
1101
|
+
)}
|
|
1102
|
+
>
|
|
1103
|
+
<span>Left</span>
|
|
1104
|
+
<ArrowLeft />
|
|
1105
|
+
</DropdownMenu.RadioItem>
|
|
1106
|
+
<DropdownMenu.RadioItem
|
|
1107
|
+
value="right"
|
|
1108
|
+
class={cx(
|
|
1109
|
+
styles().settingsSubButton,
|
|
1110
|
+
'tsqd-settings-menu-position-btn',
|
|
1111
|
+
'tsqd-settings-menu-position-btn-right',
|
|
1112
|
+
)}
|
|
1113
|
+
>
|
|
1114
|
+
<span>Right</span>
|
|
1115
|
+
<ArrowRight />
|
|
1116
|
+
</DropdownMenu.RadioItem>
|
|
1117
|
+
</DropdownMenu.RadioGroup>
|
|
1120
1118
|
</DropdownMenu.SubContent>
|
|
1121
1119
|
</DropdownMenu.Portal>
|
|
1122
1120
|
</DropdownMenu.Sub>
|
|
@@ -1146,54 +1144,47 @@ export const ContentView: Component<ContentViewProps> = (props) => {
|
|
|
1146
1144
|
'tsqd-settings-submenu',
|
|
1147
1145
|
)}
|
|
1148
1146
|
>
|
|
1149
|
-
<DropdownMenu.
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
as="button"
|
|
1154
|
-
class={cx(
|
|
1155
|
-
styles().settingsSubButton,
|
|
1156
|
-
props.localStore.theme_preference === 'light' &&
|
|
1157
|
-
styles().themeSelectedButton,
|
|
1158
|
-
'tsqd-settings-menu-position-btn',
|
|
1159
|
-
'tsqd-settings-menu-position-btn-top',
|
|
1160
|
-
)}
|
|
1161
|
-
>
|
|
1162
|
-
<span>Light</span>
|
|
1163
|
-
<Sun />
|
|
1164
|
-
</DropdownMenu.Item>
|
|
1165
|
-
<DropdownMenu.Item
|
|
1166
|
-
onSelect={() => {
|
|
1167
|
-
props.setLocalStore('theme_preference', 'dark')
|
|
1147
|
+
<DropdownMenu.RadioGroup
|
|
1148
|
+
value={props.localStore.theme_preference}
|
|
1149
|
+
onChange={(value) => {
|
|
1150
|
+
props.setLocalStore('theme_preference', value)
|
|
1168
1151
|
}}
|
|
1169
|
-
|
|
1170
|
-
class={cx(
|
|
1171
|
-
styles().settingsSubButton,
|
|
1172
|
-
props.localStore.theme_preference === 'dark' &&
|
|
1173
|
-
styles().themeSelectedButton,
|
|
1174
|
-
'tsqd-settings-menu-position-btn',
|
|
1175
|
-
'tsqd-settings-menu-position-btn-bottom',
|
|
1176
|
-
)}
|
|
1152
|
+
aria-label="Theme preference"
|
|
1177
1153
|
>
|
|
1178
|
-
<
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1154
|
+
<DropdownMenu.RadioItem
|
|
1155
|
+
value="light"
|
|
1156
|
+
class={cx(
|
|
1157
|
+
styles().settingsSubButton,
|
|
1158
|
+
'tsqd-settings-menu-position-btn',
|
|
1159
|
+
'tsqd-settings-menu-position-btn-top',
|
|
1160
|
+
)}
|
|
1161
|
+
>
|
|
1162
|
+
<span>Light</span>
|
|
1163
|
+
<Sun />
|
|
1164
|
+
</DropdownMenu.RadioItem>
|
|
1165
|
+
<DropdownMenu.RadioItem
|
|
1166
|
+
value="dark"
|
|
1167
|
+
class={cx(
|
|
1168
|
+
styles().settingsSubButton,
|
|
1169
|
+
'tsqd-settings-menu-position-btn',
|
|
1170
|
+
'tsqd-settings-menu-position-btn-bottom',
|
|
1171
|
+
)}
|
|
1172
|
+
>
|
|
1173
|
+
<span>Dark</span>
|
|
1174
|
+
<Moon />
|
|
1175
|
+
</DropdownMenu.RadioItem>
|
|
1176
|
+
<DropdownMenu.RadioItem
|
|
1177
|
+
value="system"
|
|
1178
|
+
class={cx(
|
|
1179
|
+
styles().settingsSubButton,
|
|
1180
|
+
'tsqd-settings-menu-position-btn',
|
|
1181
|
+
'tsqd-settings-menu-position-btn-left',
|
|
1182
|
+
)}
|
|
1183
|
+
>
|
|
1184
|
+
<span>System</span>
|
|
1185
|
+
<Monitor />
|
|
1186
|
+
</DropdownMenu.RadioItem>
|
|
1187
|
+
</DropdownMenu.RadioGroup>
|
|
1197
1188
|
</DropdownMenu.SubContent>
|
|
1198
1189
|
</DropdownMenu.Portal>
|
|
1199
1190
|
</DropdownMenu.Sub>
|
|
@@ -1221,51 +1212,49 @@ export const ContentView: Component<ContentViewProps> = (props) => {
|
|
|
1221
1212
|
styles().settingsMenu,
|
|
1222
1213
|
'tsqd-settings-submenu',
|
|
1223
1214
|
)}
|
|
1215
|
+
aria-label="Hide disabled queries setting"
|
|
1224
1216
|
>
|
|
1225
|
-
<DropdownMenu.
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
class={cx(
|
|
1231
|
-
styles().settingsSubButton,
|
|
1232
|
-
props.localStore.hideDisabledQueries !== 'true' &&
|
|
1233
|
-
styles().themeSelectedButton,
|
|
1234
|
-
'tsqd-settings-menu-position-btn',
|
|
1235
|
-
'tsqd-settings-menu-position-btn-show',
|
|
1236
|
-
)}
|
|
1217
|
+
<DropdownMenu.RadioGroup
|
|
1218
|
+
value={props.localStore.hideDisabledQueries}
|
|
1219
|
+
onChange={(value) =>
|
|
1220
|
+
props.setLocalStore('hideDisabledQueries', value)
|
|
1221
|
+
}
|
|
1237
1222
|
>
|
|
1238
|
-
<
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1223
|
+
<DropdownMenu.RadioItem
|
|
1224
|
+
value="false"
|
|
1225
|
+
class={cx(
|
|
1226
|
+
styles().settingsSubButton,
|
|
1227
|
+
'tsqd-settings-menu-position-btn',
|
|
1228
|
+
'tsqd-settings-menu-position-btn-show',
|
|
1229
|
+
)}
|
|
1243
1230
|
>
|
|
1244
|
-
<
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
<span>Hide</span>
|
|
1261
|
-
<Show
|
|
1262
|
-
when={
|
|
1263
|
-
props.localStore.hideDisabledQueries === 'true'
|
|
1264
|
-
}
|
|
1231
|
+
<span>Show</span>
|
|
1232
|
+
<Show
|
|
1233
|
+
when={
|
|
1234
|
+
props.localStore.hideDisabledQueries !== 'true'
|
|
1235
|
+
}
|
|
1236
|
+
>
|
|
1237
|
+
<CheckCircle />
|
|
1238
|
+
</Show>
|
|
1239
|
+
</DropdownMenu.RadioItem>
|
|
1240
|
+
<DropdownMenu.RadioItem
|
|
1241
|
+
value="true"
|
|
1242
|
+
class={cx(
|
|
1243
|
+
styles().settingsSubButton,
|
|
1244
|
+
'tsqd-settings-menu-position-btn',
|
|
1245
|
+
'tsqd-settings-menu-position-btn-hide',
|
|
1246
|
+
)}
|
|
1265
1247
|
>
|
|
1266
|
-
<
|
|
1267
|
-
|
|
1268
|
-
|
|
1248
|
+
<span>Hide</span>
|
|
1249
|
+
<Show
|
|
1250
|
+
when={
|
|
1251
|
+
props.localStore.hideDisabledQueries === 'true'
|
|
1252
|
+
}
|
|
1253
|
+
>
|
|
1254
|
+
<CheckCircle />
|
|
1255
|
+
</Show>
|
|
1256
|
+
</DropdownMenu.RadioItem>
|
|
1257
|
+
</DropdownMenu.RadioGroup>
|
|
1269
1258
|
</DropdownMenu.SubContent>
|
|
1270
1259
|
</DropdownMenu.Portal>
|
|
1271
1260
|
</DropdownMenu.Sub>
|
|
@@ -1961,6 +1950,9 @@ const QueryDetails = () => {
|
|
|
1961
1950
|
styles().detailsBody,
|
|
1962
1951
|
'tsqd-query-details-summary-container',
|
|
1963
1952
|
)}
|
|
1953
|
+
role="status"
|
|
1954
|
+
aria-live="polite"
|
|
1955
|
+
aria-atomic="true"
|
|
1964
1956
|
>
|
|
1965
1957
|
<div class="tsqd-query-details-summary">
|
|
1966
1958
|
<pre>
|
|
@@ -2372,6 +2364,9 @@ const MutationDetails = () => {
|
|
|
2372
2364
|
styles().detailsBody,
|
|
2373
2365
|
'tsqd-query-details-summary-container',
|
|
2374
2366
|
)}
|
|
2367
|
+
role="status"
|
|
2368
|
+
aria-live="polite"
|
|
2369
|
+
aria-atomic="true"
|
|
2375
2370
|
>
|
|
2376
2371
|
<div class="tsqd-query-details-summary">
|
|
2377
2372
|
<pre>
|
|
@@ -3521,15 +3516,15 @@ const stylesFactory = (
|
|
|
3521
3516
|
outline-offset: 2px;
|
|
3522
3517
|
outline: 2px solid ${colors.blue[800]};
|
|
3523
3518
|
}
|
|
3524
|
-
|
|
3525
|
-
themeSelectedButton: css`
|
|
3526
|
-
background-color: ${t(colors.purple[100], colors.purple[900])};
|
|
3527
|
-
color: ${t(colors.purple[700], colors.purple[300])};
|
|
3528
|
-
& svg {
|
|
3529
|
-
color: ${t(colors.purple[700], colors.purple[300])};
|
|
3530
|
-
}
|
|
3531
|
-
&:hover {
|
|
3519
|
+
&[data-checked] {
|
|
3532
3520
|
background-color: ${t(colors.purple[100], colors.purple[900])};
|
|
3521
|
+
color: ${t(colors.purple[700], colors.purple[300])};
|
|
3522
|
+
& svg {
|
|
3523
|
+
color: ${t(colors.purple[700], colors.purple[300])};
|
|
3524
|
+
}
|
|
3525
|
+
&:hover {
|
|
3526
|
+
background-color: ${t(colors.purple[100], colors.purple[900])};
|
|
3527
|
+
}
|
|
3533
3528
|
}
|
|
3534
3529
|
`,
|
|
3535
3530
|
viewToggle: css`
|
|
@@ -4,6 +4,7 @@ import { Devtools } from './Devtools'
|
|
|
4
4
|
import { getPreferredColorScheme } from './utils'
|
|
5
5
|
import { THEME_PREFERENCE } from './constants'
|
|
6
6
|
import { PiPProvider, QueryDevtoolsContext, ThemeContext } from './contexts'
|
|
7
|
+
import type { Theme } from './contexts'
|
|
7
8
|
import type { DevtoolsComponentType } from './Devtools'
|
|
8
9
|
|
|
9
10
|
const DevtoolsComponent: DevtoolsComponentType = (props) => {
|
|
@@ -14,10 +15,9 @@ const DevtoolsComponent: DevtoolsComponentType = (props) => {
|
|
|
14
15
|
const colorScheme = getPreferredColorScheme()
|
|
15
16
|
|
|
16
17
|
const theme = createMemo(() => {
|
|
17
|
-
const preference = (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
| 'light'
|
|
18
|
+
const preference = (props.theme ||
|
|
19
|
+
localStore.theme_preference ||
|
|
20
|
+
THEME_PREFERENCE) as Theme
|
|
21
21
|
if (preference !== 'system') return preference
|
|
22
22
|
return colorScheme()
|
|
23
23
|
})
|
|
@@ -4,6 +4,7 @@ import { ContentView, ParentPanel } from './Devtools'
|
|
|
4
4
|
import { getPreferredColorScheme } from './utils'
|
|
5
5
|
import { THEME_PREFERENCE } from './constants'
|
|
6
6
|
import { PiPProvider, QueryDevtoolsContext, ThemeContext } from './contexts'
|
|
7
|
+
import type { Theme } from './contexts'
|
|
7
8
|
import type { DevtoolsComponentType } from './Devtools'
|
|
8
9
|
|
|
9
10
|
const DevtoolsPanelComponent: DevtoolsComponentType = (props) => {
|
|
@@ -14,10 +15,9 @@ const DevtoolsPanelComponent: DevtoolsComponentType = (props) => {
|
|
|
14
15
|
const colorScheme = getPreferredColorScheme()
|
|
15
16
|
|
|
16
17
|
const theme = createMemo(() => {
|
|
17
|
-
const preference = (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
| 'light'
|
|
18
|
+
const preference = (props.theme ||
|
|
19
|
+
localStore.theme_preference ||
|
|
20
|
+
THEME_PREFERENCE) as Theme
|
|
21
21
|
if (preference !== 'system') return preference
|
|
22
22
|
return colorScheme()
|
|
23
23
|
})
|
package/src/Explorer.tsx
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { serialize, stringify } from 'superjson'
|
|
2
2
|
import { clsx as cx } from 'clsx'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Index,
|
|
5
|
+
Match,
|
|
6
|
+
Show,
|
|
7
|
+
Switch,
|
|
8
|
+
createMemo,
|
|
9
|
+
createSignal,
|
|
10
|
+
createUniqueId,
|
|
11
|
+
} from 'solid-js'
|
|
4
12
|
import { Key } from '@solid-primitives/keyed'
|
|
5
13
|
import * as goober from 'goober'
|
|
6
14
|
import { tokens } from './theme'
|
|
@@ -325,6 +333,8 @@ export default function Explorer(props: ExplorerProps) {
|
|
|
325
333
|
|
|
326
334
|
const currentDataPath = props.dataPath ?? []
|
|
327
335
|
|
|
336
|
+
const inputId = createUniqueId()
|
|
337
|
+
|
|
328
338
|
return (
|
|
329
339
|
<div class={styles().entry}>
|
|
330
340
|
<Show when={subEntryPages().length}>
|
|
@@ -332,6 +342,7 @@ export default function Explorer(props: ExplorerProps) {
|
|
|
332
342
|
<button
|
|
333
343
|
class={styles().expanderButton}
|
|
334
344
|
onClick={() => toggleExpanded()}
|
|
345
|
+
aria-expanded={expanded() ? 'true' : 'false'}
|
|
335
346
|
>
|
|
336
347
|
<Expander expanded={expanded()} /> <span>{props.label}</span>{' '}
|
|
337
348
|
<span class={styles().info}>
|
|
@@ -446,7 +457,9 @@ export default function Explorer(props: ExplorerProps) {
|
|
|
446
457
|
</Show>
|
|
447
458
|
<Show when={subEntryPages().length === 0}>
|
|
448
459
|
<div class={styles().row}>
|
|
449
|
-
<
|
|
460
|
+
<label for={inputId} class={styles().label}>
|
|
461
|
+
{props.label}:
|
|
462
|
+
</label>
|
|
450
463
|
<Show
|
|
451
464
|
when={
|
|
452
465
|
props.editable &&
|
|
@@ -467,6 +480,7 @@ export default function Explorer(props: ExplorerProps) {
|
|
|
467
480
|
}
|
|
468
481
|
>
|
|
469
482
|
<input
|
|
483
|
+
id={inputId}
|
|
470
484
|
type={type() === 'number' ? 'number' : 'text'}
|
|
471
485
|
class={cx(styles().value, styles().editableInput)}
|
|
472
486
|
value={props.value as string | number}
|
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
DevtoolsErrorType,
|
|
12
12
|
DevtoolsPosition,
|
|
13
13
|
QueryDevtoolsProps,
|
|
14
|
+
Theme,
|
|
14
15
|
} from './contexts'
|
|
15
16
|
import type { Signal } from 'solid-js'
|
|
16
17
|
|
|
@@ -33,6 +34,7 @@ class TanstackQueryDevtools {
|
|
|
33
34
|
#errorTypes: Signal<Array<DevtoolsErrorType> | undefined>
|
|
34
35
|
#hideDisabledQueries: Signal<boolean | undefined>
|
|
35
36
|
#Component: DevtoolsComponentType | undefined
|
|
37
|
+
#theme: Signal<Theme | undefined>
|
|
36
38
|
#dispose?: () => void
|
|
37
39
|
|
|
38
40
|
constructor(config: TanstackQueryDevtoolsConfig) {
|
|
@@ -48,6 +50,7 @@ class TanstackQueryDevtools {
|
|
|
48
50
|
styleNonce,
|
|
49
51
|
shadowDOMTarget,
|
|
50
52
|
hideDisabledQueries,
|
|
53
|
+
theme,
|
|
51
54
|
} = config
|
|
52
55
|
this.#client = createSignal(client)
|
|
53
56
|
this.#queryFlavor = queryFlavor
|
|
@@ -60,6 +63,7 @@ class TanstackQueryDevtools {
|
|
|
60
63
|
this.#initialIsOpen = createSignal(initialIsOpen)
|
|
61
64
|
this.#errorTypes = createSignal(errorTypes)
|
|
62
65
|
this.#hideDisabledQueries = createSignal(hideDisabledQueries)
|
|
66
|
+
this.#theme = createSignal(theme)
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
setButtonPosition(position: DevtoolsButtonPosition) {
|
|
@@ -82,6 +86,10 @@ class TanstackQueryDevtools {
|
|
|
82
86
|
this.#client[1](client)
|
|
83
87
|
}
|
|
84
88
|
|
|
89
|
+
setTheme(theme?: Theme) {
|
|
90
|
+
this.#theme[1](theme)
|
|
91
|
+
}
|
|
92
|
+
|
|
85
93
|
mount<T extends HTMLElement>(el: T) {
|
|
86
94
|
if (this.#isMounted) {
|
|
87
95
|
throw new Error('Devtools is already mounted')
|
|
@@ -93,6 +101,7 @@ class TanstackQueryDevtools {
|
|
|
93
101
|
const [errors] = this.#errorTypes
|
|
94
102
|
const [hideDisabledQueries] = this.#hideDisabledQueries
|
|
95
103
|
const [queryClient] = this.#client
|
|
104
|
+
const [theme] = this.#theme
|
|
96
105
|
let Devtools: DevtoolsComponentType
|
|
97
106
|
|
|
98
107
|
if (this.#Component) {
|
|
@@ -128,6 +137,9 @@ class TanstackQueryDevtools {
|
|
|
128
137
|
get hideDisabledQueries() {
|
|
129
138
|
return hideDisabledQueries()
|
|
130
139
|
},
|
|
140
|
+
get theme() {
|
|
141
|
+
return theme()
|
|
142
|
+
},
|
|
131
143
|
}}
|
|
132
144
|
/>
|
|
133
145
|
)
|