@tanstack/query-devtools 5.92.0 → 5.94.4

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.d.cts DELETED
@@ -1,69 +0,0 @@
1
- import { Query, QueryClient, onlineManager } from '@tanstack/query-core';
2
-
3
- type XPosition = 'left' | 'right';
4
- type YPosition = 'top' | 'bottom';
5
- type DevtoolsPosition = XPosition | YPosition;
6
- type DevtoolsButtonPosition = `${YPosition}-${XPosition}` | 'relative';
7
- type Theme = 'dark' | 'light' | 'system';
8
- interface DevtoolsErrorType {
9
- /**
10
- * The name of the error.
11
- */
12
- name: string;
13
- /**
14
- * How the error is initialized.
15
- */
16
- initializer: (query: Query) => Error;
17
- }
18
- interface QueryDevtoolsProps {
19
- readonly client: QueryClient;
20
- queryFlavor: string;
21
- version: string;
22
- onlineManager: typeof onlineManager;
23
- buttonPosition?: DevtoolsButtonPosition;
24
- position?: DevtoolsPosition;
25
- initialIsOpen?: boolean;
26
- errorTypes?: Array<DevtoolsErrorType>;
27
- shadowDOMTarget?: ShadowRoot;
28
- onClose?: () => unknown;
29
- hideDisabledQueries?: boolean;
30
- theme?: Theme;
31
- }
32
-
33
- interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
34
- styleNonce?: string;
35
- shadowDOMTarget?: ShadowRoot;
36
- }
37
- declare class TanstackQueryDevtools {
38
- #private;
39
- constructor(config: TanstackQueryDevtoolsConfig);
40
- setButtonPosition(position: DevtoolsButtonPosition): void;
41
- setPosition(position: DevtoolsPosition): void;
42
- setInitialIsOpen(isOpen: boolean): void;
43
- setErrorTypes(errorTypes: Array<DevtoolsErrorType>): void;
44
- setClient(client: QueryClient): void;
45
- setTheme(theme?: Theme): void;
46
- mount<T extends HTMLElement>(el: T): void;
47
- unmount(): void;
48
- }
49
-
50
- interface TanstackQueryDevtoolsPanelConfig extends QueryDevtoolsProps {
51
- styleNonce?: string;
52
- shadowDOMTarget?: ShadowRoot;
53
- onClose?: () => unknown;
54
- }
55
- declare class TanstackQueryDevtoolsPanel {
56
- #private;
57
- constructor(config: TanstackQueryDevtoolsPanelConfig);
58
- setButtonPosition(position: DevtoolsButtonPosition): void;
59
- setPosition(position: DevtoolsPosition): void;
60
- setInitialIsOpen(isOpen: boolean): void;
61
- setErrorTypes(errorTypes: Array<DevtoolsErrorType>): void;
62
- setClient(client: QueryClient): void;
63
- setOnClose(onClose: () => unknown): void;
64
- setTheme(theme?: Theme): void;
65
- mount<T extends HTMLElement>(el: T): void;
66
- unmount(): void;
67
- }
68
-
69
- export { type DevtoolsButtonPosition, type DevtoolsErrorType, type DevtoolsPosition, TanstackQueryDevtools, type TanstackQueryDevtoolsConfig, TanstackQueryDevtoolsPanel, type TanstackQueryDevtoolsPanelConfig, type Theme };
package/build/index.d.ts DELETED
@@ -1,69 +0,0 @@
1
- import { Query, QueryClient, onlineManager } from '@tanstack/query-core';
2
-
3
- type XPosition = 'left' | 'right';
4
- type YPosition = 'top' | 'bottom';
5
- type DevtoolsPosition = XPosition | YPosition;
6
- type DevtoolsButtonPosition = `${YPosition}-${XPosition}` | 'relative';
7
- type Theme = 'dark' | 'light' | 'system';
8
- interface DevtoolsErrorType {
9
- /**
10
- * The name of the error.
11
- */
12
- name: string;
13
- /**
14
- * How the error is initialized.
15
- */
16
- initializer: (query: Query) => Error;
17
- }
18
- interface QueryDevtoolsProps {
19
- readonly client: QueryClient;
20
- queryFlavor: string;
21
- version: string;
22
- onlineManager: typeof onlineManager;
23
- buttonPosition?: DevtoolsButtonPosition;
24
- position?: DevtoolsPosition;
25
- initialIsOpen?: boolean;
26
- errorTypes?: Array<DevtoolsErrorType>;
27
- shadowDOMTarget?: ShadowRoot;
28
- onClose?: () => unknown;
29
- hideDisabledQueries?: boolean;
30
- theme?: Theme;
31
- }
32
-
33
- interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
34
- styleNonce?: string;
35
- shadowDOMTarget?: ShadowRoot;
36
- }
37
- declare class TanstackQueryDevtools {
38
- #private;
39
- constructor(config: TanstackQueryDevtoolsConfig);
40
- setButtonPosition(position: DevtoolsButtonPosition): void;
41
- setPosition(position: DevtoolsPosition): void;
42
- setInitialIsOpen(isOpen: boolean): void;
43
- setErrorTypes(errorTypes: Array<DevtoolsErrorType>): void;
44
- setClient(client: QueryClient): void;
45
- setTheme(theme?: Theme): void;
46
- mount<T extends HTMLElement>(el: T): void;
47
- unmount(): void;
48
- }
49
-
50
- interface TanstackQueryDevtoolsPanelConfig extends QueryDevtoolsProps {
51
- styleNonce?: string;
52
- shadowDOMTarget?: ShadowRoot;
53
- onClose?: () => unknown;
54
- }
55
- declare class TanstackQueryDevtoolsPanel {
56
- #private;
57
- constructor(config: TanstackQueryDevtoolsPanelConfig);
58
- setButtonPosition(position: DevtoolsButtonPosition): void;
59
- setPosition(position: DevtoolsPosition): void;
60
- setInitialIsOpen(isOpen: boolean): void;
61
- setErrorTypes(errorTypes: Array<DevtoolsErrorType>): void;
62
- setClient(client: QueryClient): void;
63
- setOnClose(onClose: () => unknown): void;
64
- setTheme(theme?: Theme): void;
65
- mount<T extends HTMLElement>(el: T): void;
66
- unmount(): void;
67
- }
68
-
69
- export { type DevtoolsButtonPosition, type DevtoolsErrorType, type DevtoolsPosition, TanstackQueryDevtools, type TanstackQueryDevtoolsConfig, TanstackQueryDevtoolsPanel, type TanstackQueryDevtoolsPanelConfig, type Theme };
package/build/index.js DELETED
@@ -1,279 +0,0 @@
1
- import { createSignal, render, lazy, setupStyleSheet, createComponent, mergeProps } from './chunk/EIDV623S.js';
2
-
3
- // src/TanstackQueryDevtools.tsx
4
- var TanstackQueryDevtools = class {
5
- #client;
6
- #onlineManager;
7
- #queryFlavor;
8
- #version;
9
- #isMounted = false;
10
- #styleNonce;
11
- #shadowDOMTarget;
12
- #buttonPosition;
13
- #position;
14
- #initialIsOpen;
15
- #errorTypes;
16
- #hideDisabledQueries;
17
- #Component;
18
- #theme;
19
- #dispose;
20
- constructor(config) {
21
- const {
22
- client,
23
- queryFlavor,
24
- version,
25
- onlineManager,
26
- buttonPosition,
27
- position,
28
- initialIsOpen,
29
- errorTypes,
30
- styleNonce,
31
- shadowDOMTarget,
32
- hideDisabledQueries,
33
- theme
34
- } = config;
35
- this.#client = createSignal(client);
36
- this.#queryFlavor = queryFlavor;
37
- this.#version = version;
38
- this.#onlineManager = onlineManager;
39
- this.#styleNonce = styleNonce;
40
- this.#shadowDOMTarget = shadowDOMTarget;
41
- this.#buttonPosition = createSignal(buttonPosition);
42
- this.#position = createSignal(position);
43
- this.#initialIsOpen = createSignal(initialIsOpen);
44
- this.#errorTypes = createSignal(errorTypes);
45
- this.#hideDisabledQueries = createSignal(hideDisabledQueries);
46
- this.#theme = createSignal(theme);
47
- }
48
- setButtonPosition(position) {
49
- this.#buttonPosition[1](position);
50
- }
51
- setPosition(position) {
52
- this.#position[1](position);
53
- }
54
- setInitialIsOpen(isOpen) {
55
- this.#initialIsOpen[1](isOpen);
56
- }
57
- setErrorTypes(errorTypes) {
58
- this.#errorTypes[1](errorTypes);
59
- }
60
- setClient(client) {
61
- this.#client[1](client);
62
- }
63
- setTheme(theme) {
64
- this.#theme[1](theme);
65
- }
66
- mount(el) {
67
- if (this.#isMounted) {
68
- throw new Error("Devtools is already mounted");
69
- }
70
- const dispose = render(() => {
71
- const _self$ = this;
72
- const [btnPosition] = this.#buttonPosition;
73
- const [pos] = this.#position;
74
- const [isOpen] = this.#initialIsOpen;
75
- const [errors] = this.#errorTypes;
76
- const [hideDisabledQueries] = this.#hideDisabledQueries;
77
- const [queryClient] = this.#client;
78
- const [theme] = this.#theme;
79
- let Devtools;
80
- if (this.#Component) {
81
- Devtools = this.#Component;
82
- } else {
83
- Devtools = lazy(() => import('./DevtoolsComponent/WDYDFRGG.js'));
84
- this.#Component = Devtools;
85
- }
86
- setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
87
- return createComponent(Devtools, mergeProps({
88
- get queryFlavor() {
89
- return _self$.#queryFlavor;
90
- },
91
- get version() {
92
- return _self$.#version;
93
- },
94
- get onlineManager() {
95
- return _self$.#onlineManager;
96
- },
97
- get shadowDOMTarget() {
98
- return _self$.#shadowDOMTarget;
99
- }
100
- }, {
101
- get client() {
102
- return queryClient();
103
- },
104
- get buttonPosition() {
105
- return btnPosition();
106
- },
107
- get position() {
108
- return pos();
109
- },
110
- get initialIsOpen() {
111
- return isOpen();
112
- },
113
- get errorTypes() {
114
- return errors();
115
- },
116
- get hideDisabledQueries() {
117
- return hideDisabledQueries();
118
- },
119
- get theme() {
120
- return theme();
121
- }
122
- }));
123
- }, el);
124
- this.#isMounted = true;
125
- this.#dispose = dispose;
126
- }
127
- unmount() {
128
- if (!this.#isMounted) {
129
- throw new Error("Devtools is not mounted");
130
- }
131
- this.#dispose?.();
132
- this.#isMounted = false;
133
- }
134
- };
135
-
136
- // src/TanstackQueryDevtoolsPanel.tsx
137
- var TanstackQueryDevtoolsPanel = class {
138
- #client;
139
- #onlineManager;
140
- #queryFlavor;
141
- #version;
142
- #isMounted = false;
143
- #styleNonce;
144
- #shadowDOMTarget;
145
- #buttonPosition;
146
- #position;
147
- #initialIsOpen;
148
- #errorTypes;
149
- #hideDisabledQueries;
150
- #onClose;
151
- #Component;
152
- #theme;
153
- #dispose;
154
- constructor(config) {
155
- const {
156
- client,
157
- queryFlavor,
158
- version,
159
- onlineManager,
160
- buttonPosition,
161
- position,
162
- initialIsOpen,
163
- errorTypes,
164
- styleNonce,
165
- shadowDOMTarget,
166
- onClose,
167
- hideDisabledQueries,
168
- theme
169
- } = config;
170
- this.#client = createSignal(client);
171
- this.#queryFlavor = queryFlavor;
172
- this.#version = version;
173
- this.#onlineManager = onlineManager;
174
- this.#styleNonce = styleNonce;
175
- this.#shadowDOMTarget = shadowDOMTarget;
176
- this.#buttonPosition = createSignal(buttonPosition);
177
- this.#position = createSignal(position);
178
- this.#initialIsOpen = createSignal(initialIsOpen);
179
- this.#errorTypes = createSignal(errorTypes);
180
- this.#hideDisabledQueries = createSignal(hideDisabledQueries);
181
- this.#onClose = createSignal(onClose);
182
- this.#theme = createSignal(theme);
183
- }
184
- setButtonPosition(position) {
185
- this.#buttonPosition[1](position);
186
- }
187
- setPosition(position) {
188
- this.#position[1](position);
189
- }
190
- setInitialIsOpen(isOpen) {
191
- this.#initialIsOpen[1](isOpen);
192
- }
193
- setErrorTypes(errorTypes) {
194
- this.#errorTypes[1](errorTypes);
195
- }
196
- setClient(client) {
197
- this.#client[1](client);
198
- }
199
- setOnClose(onClose) {
200
- this.#onClose[1](() => onClose);
201
- }
202
- setTheme(theme) {
203
- this.#theme[1](theme);
204
- }
205
- mount(el) {
206
- if (this.#isMounted) {
207
- throw new Error("Devtools is already mounted");
208
- }
209
- const dispose = render(() => {
210
- const _self$ = this;
211
- const [btnPosition] = this.#buttonPosition;
212
- const [pos] = this.#position;
213
- const [isOpen] = this.#initialIsOpen;
214
- const [errors] = this.#errorTypes;
215
- const [hideDisabledQueries] = this.#hideDisabledQueries;
216
- const [queryClient] = this.#client;
217
- const [onClose] = this.#onClose;
218
- const [theme] = this.#theme;
219
- let Devtools;
220
- if (this.#Component) {
221
- Devtools = this.#Component;
222
- } else {
223
- Devtools = lazy(() => import('./DevtoolsPanelComponent/2SSKDMRQ.js'));
224
- this.#Component = Devtools;
225
- }
226
- setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
227
- return createComponent(Devtools, mergeProps({
228
- get queryFlavor() {
229
- return _self$.#queryFlavor;
230
- },
231
- get version() {
232
- return _self$.#version;
233
- },
234
- get onlineManager() {
235
- return _self$.#onlineManager;
236
- },
237
- get shadowDOMTarget() {
238
- return _self$.#shadowDOMTarget;
239
- }
240
- }, {
241
- get client() {
242
- return queryClient();
243
- },
244
- get buttonPosition() {
245
- return btnPosition();
246
- },
247
- get position() {
248
- return pos();
249
- },
250
- get initialIsOpen() {
251
- return isOpen();
252
- },
253
- get errorTypes() {
254
- return errors();
255
- },
256
- get hideDisabledQueries() {
257
- return hideDisabledQueries();
258
- },
259
- get onClose() {
260
- return onClose();
261
- },
262
- get theme() {
263
- return theme();
264
- }
265
- }));
266
- }, el);
267
- this.#isMounted = true;
268
- this.#dispose = dispose;
269
- }
270
- unmount() {
271
- if (!this.#isMounted) {
272
- throw new Error("Devtools is not mounted");
273
- }
274
- this.#dispose?.();
275
- this.#isMounted = false;
276
- }
277
- };
278
-
279
- export { TanstackQueryDevtools, TanstackQueryDevtoolsPanel };