@tanstack/query-devtools 5.0.0-rc.5 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.cts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Query, QueryClient, onlineManager } from '@tanstack/query-core';
2
- import { Component, Signal } from 'solid-js';
3
2
 
4
3
  type XPosition = 'left' | 'right';
5
4
  type YPosition = 'top' | 'bottom';
@@ -26,22 +25,10 @@ interface QueryDevtoolsProps {
26
25
  errorTypes?: Array<DevToolsErrorType>;
27
26
  }
28
27
 
29
- declare const DevtoolsComponent: Component<QueryDevtoolsProps>;
30
-
31
28
  interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
32
29
  }
33
30
  declare class TanstackQueryDevtools {
34
- client: Signal<QueryClient>;
35
- onlineManager: typeof onlineManager;
36
- queryFlavor: string;
37
- version: string;
38
- isMounted: boolean;
39
- buttonPosition: Signal<DevtoolsButtonPosition | undefined>;
40
- position: Signal<DevtoolsPosition | undefined>;
41
- initialIsOpen: Signal<boolean | undefined>;
42
- errorTypes: Signal<Array<DevToolsErrorType> | undefined>;
43
- Component: typeof DevtoolsComponent | undefined;
44
- dispose?: () => void;
31
+ #private;
45
32
  constructor(config: TanstackQueryDevtoolsConfig);
46
33
  setButtonPosition(position: DevtoolsButtonPosition): void;
47
34
  setPosition(position: DevtoolsPosition): void;
package/build/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Query, QueryClient, onlineManager } from '@tanstack/query-core';
2
- import { Component, Signal } from 'solid-js';
3
2
 
4
3
  type XPosition = 'left' | 'right';
5
4
  type YPosition = 'top' | 'bottom';
@@ -26,22 +25,10 @@ interface QueryDevtoolsProps {
26
25
  errorTypes?: Array<DevToolsErrorType>;
27
26
  }
28
27
 
29
- declare const DevtoolsComponent: Component<QueryDevtoolsProps>;
30
-
31
28
  interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
32
29
  }
33
30
  declare class TanstackQueryDevtools {
34
- client: Signal<QueryClient>;
35
- onlineManager: typeof onlineManager;
36
- queryFlavor: string;
37
- version: string;
38
- isMounted: boolean;
39
- buttonPosition: Signal<DevtoolsButtonPosition | undefined>;
40
- position: Signal<DevtoolsPosition | undefined>;
41
- initialIsOpen: Signal<boolean | undefined>;
42
- errorTypes: Signal<Array<DevToolsErrorType> | undefined>;
43
- Component: typeof DevtoolsComponent | undefined;
44
- dispose?: () => void;
31
+ #private;
45
32
  constructor(config: TanstackQueryDevtoolsConfig);
46
33
  setButtonPosition(position: DevtoolsButtonPosition): void;
47
34
  setPosition(position: DevtoolsPosition): void;
package/build/index.js CHANGED
@@ -2,7 +2,17 @@ import { createSignal, render, lazy, createComponent, mergeProps } from './chunk
2
2
 
3
3
  // src/index.tsx
4
4
  var TanstackQueryDevtools = class {
5
- isMounted = false;
5
+ #client;
6
+ #onlineManager;
7
+ #queryFlavor;
8
+ #version;
9
+ #isMounted = false;
10
+ #buttonPosition;
11
+ #position;
12
+ #initialIsOpen;
13
+ #errorTypes;
14
+ #Component;
15
+ #dispose;
6
16
  constructor(config) {
7
17
  const {
8
18
  client,
@@ -14,57 +24,57 @@ var TanstackQueryDevtools = class {
14
24
  initialIsOpen,
15
25
  errorTypes
16
26
  } = config;
17
- this.client = createSignal(client);
18
- this.queryFlavor = queryFlavor;
19
- this.version = version;
20
- this.onlineManager = onlineManager;
21
- this.buttonPosition = createSignal(buttonPosition);
22
- this.position = createSignal(position);
23
- this.initialIsOpen = createSignal(initialIsOpen);
24
- this.errorTypes = createSignal(errorTypes);
27
+ this.#client = createSignal(client);
28
+ this.#queryFlavor = queryFlavor;
29
+ this.#version = version;
30
+ this.#onlineManager = onlineManager;
31
+ this.#buttonPosition = createSignal(buttonPosition);
32
+ this.#position = createSignal(position);
33
+ this.#initialIsOpen = createSignal(initialIsOpen);
34
+ this.#errorTypes = createSignal(errorTypes);
25
35
  }
26
36
  setButtonPosition(position) {
27
- this.buttonPosition[1](position);
37
+ this.#buttonPosition[1](position);
28
38
  }
29
39
  setPosition(position) {
30
- this.position[1](position);
40
+ this.#position[1](position);
31
41
  }
32
42
  setInitialIsOpen(isOpen) {
33
- this.initialIsOpen[1](isOpen);
43
+ this.#initialIsOpen[1](isOpen);
34
44
  }
35
45
  setErrorTypes(errorTypes) {
36
- this.errorTypes[1](errorTypes);
46
+ this.#errorTypes[1](errorTypes);
37
47
  }
38
48
  setClient(client) {
39
- this.client[1](client);
49
+ this.#client[1](client);
40
50
  }
41
51
  mount(el) {
42
- if (this.isMounted) {
52
+ if (this.#isMounted) {
43
53
  throw new Error("Devtools is already mounted");
44
54
  }
45
55
  const dispose = render(() => {
46
- const [btnPosition] = this.buttonPosition;
47
- const [pos] = this.position;
48
- const [isOpen] = this.initialIsOpen;
49
- const [errors] = this.errorTypes;
50
- const [queryClient] = this.client;
56
+ const [btnPosition] = this.#buttonPosition;
57
+ const [pos] = this.#position;
58
+ const [isOpen] = this.#initialIsOpen;
59
+ const [errors] = this.#errorTypes;
60
+ const [queryClient] = this.#client;
51
61
  let Devtools;
52
- if (this.Component) {
53
- Devtools = this.Component;
62
+ if (this.#Component) {
63
+ Devtools = this.#Component;
54
64
  } else {
55
- Devtools = lazy(() => import('./Devtools/CIR3WCBJ.js'));
56
- this.Component = Devtools;
65
+ Devtools = lazy(() => import('./Devtools/4TNE5QTO.js'));
66
+ this.#Component = Devtools;
57
67
  }
58
68
  const _self$ = this;
59
69
  return createComponent(Devtools, mergeProps({
60
70
  get queryFlavor() {
61
- return _self$.queryFlavor;
71
+ return _self$.#queryFlavor;
62
72
  },
63
73
  get version() {
64
- return _self$.version;
74
+ return _self$.#version;
65
75
  },
66
76
  get onlineManager() {
67
- return _self$.onlineManager;
77
+ return _self$.#onlineManager;
68
78
  }
69
79
  }, {
70
80
  get client() {
@@ -84,15 +94,15 @@ var TanstackQueryDevtools = class {
84
94
  }
85
95
  }));
86
96
  }, el);
87
- this.isMounted = true;
88
- this.dispose = dispose;
97
+ this.#isMounted = true;
98
+ this.#dispose = dispose;
89
99
  }
90
100
  unmount() {
91
- if (!this.isMounted) {
101
+ if (!this.#isMounted) {
92
102
  throw new Error("Devtools is not mounted");
93
103
  }
94
- this.dispose?.();
95
- this.isMounted = false;
104
+ this.#dispose?.();
105
+ this.#isMounted = false;
96
106
  }
97
107
  };
98
108
 
package/build/index.jsx CHANGED
@@ -6,8 +6,18 @@ import {
6
6
 
7
7
  // src/index.tsx
8
8
  var TanstackQueryDevtools = class {
9
+ #client;
10
+ #onlineManager;
11
+ #queryFlavor;
12
+ #version;
13
+ #isMounted = false;
14
+ #buttonPosition;
15
+ #position;
16
+ #initialIsOpen;
17
+ #errorTypes;
18
+ #Component;
19
+ #dispose;
9
20
  constructor(config) {
10
- this.isMounted = false;
11
21
  const {
12
22
  client,
13
23
  queryFlavor,
@@ -18,51 +28,51 @@ var TanstackQueryDevtools = class {
18
28
  initialIsOpen,
19
29
  errorTypes
20
30
  } = config;
21
- this.client = createSignal(client);
22
- this.queryFlavor = queryFlavor;
23
- this.version = version;
24
- this.onlineManager = onlineManager;
25
- this.buttonPosition = createSignal(buttonPosition);
26
- this.position = createSignal(position);
27
- this.initialIsOpen = createSignal(initialIsOpen);
28
- this.errorTypes = createSignal(errorTypes);
31
+ this.#client = createSignal(client);
32
+ this.#queryFlavor = queryFlavor;
33
+ this.#version = version;
34
+ this.#onlineManager = onlineManager;
35
+ this.#buttonPosition = createSignal(buttonPosition);
36
+ this.#position = createSignal(position);
37
+ this.#initialIsOpen = createSignal(initialIsOpen);
38
+ this.#errorTypes = createSignal(errorTypes);
29
39
  }
30
40
  setButtonPosition(position) {
31
- this.buttonPosition[1](position);
41
+ this.#buttonPosition[1](position);
32
42
  }
33
43
  setPosition(position) {
34
- this.position[1](position);
44
+ this.#position[1](position);
35
45
  }
36
46
  setInitialIsOpen(isOpen) {
37
- this.initialIsOpen[1](isOpen);
47
+ this.#initialIsOpen[1](isOpen);
38
48
  }
39
49
  setErrorTypes(errorTypes) {
40
- this.errorTypes[1](errorTypes);
50
+ this.#errorTypes[1](errorTypes);
41
51
  }
42
52
  setClient(client) {
43
- this.client[1](client);
53
+ this.#client[1](client);
44
54
  }
45
55
  mount(el) {
46
- if (this.isMounted) {
56
+ if (this.#isMounted) {
47
57
  throw new Error("Devtools is already mounted");
48
58
  }
49
59
  const dispose = render(() => {
50
- const [btnPosition] = this.buttonPosition;
51
- const [pos] = this.position;
52
- const [isOpen] = this.initialIsOpen;
53
- const [errors] = this.errorTypes;
54
- const [queryClient] = this.client;
60
+ const [btnPosition] = this.#buttonPosition;
61
+ const [pos] = this.#position;
62
+ const [isOpen] = this.#initialIsOpen;
63
+ const [errors] = this.#errorTypes;
64
+ const [queryClient] = this.#client;
55
65
  let Devtools;
56
- if (this.Component) {
57
- Devtools = this.Component;
66
+ if (this.#Component) {
67
+ Devtools = this.#Component;
58
68
  } else {
59
- Devtools = lazy(() => import("./Devtools/5OOWR6BQ.jsx"));
60
- this.Component = Devtools;
69
+ Devtools = lazy(() => import("./Devtools/3BAJISSX.jsx"));
70
+ this.#Component = Devtools;
61
71
  }
62
72
  return <Devtools
63
- queryFlavor={this.queryFlavor}
64
- version={this.version}
65
- onlineManager={this.onlineManager}
73
+ queryFlavor={this.#queryFlavor}
74
+ version={this.#version}
75
+ onlineManager={this.#onlineManager}
66
76
  {...{
67
77
  get client() {
68
78
  return queryClient();
@@ -82,15 +92,15 @@ var TanstackQueryDevtools = class {
82
92
  }}
83
93
  />;
84
94
  }, el);
85
- this.isMounted = true;
86
- this.dispose = dispose;
95
+ this.#isMounted = true;
96
+ this.#dispose = dispose;
87
97
  }
88
98
  unmount() {
89
- if (!this.isMounted) {
99
+ if (!this.#isMounted) {
90
100
  throw new Error("Devtools is not mounted");
91
101
  }
92
- this.dispose?.();
93
- this.isMounted = false;
102
+ this.#dispose?.();
103
+ this.#isMounted = false;
94
104
  }
95
105
  };
96
106
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/query-devtools",
3
- "version": "5.0.0-rc.5",
3
+ "version": "5.0.0",
4
4
  "description": "Developer tools to interact with and visualize the TanStack Query cache",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -17,8 +17,8 @@
17
17
  "browser": {},
18
18
  "exports": {
19
19
  "solid": {
20
- "development": "./build/dev.jsx",
21
- "import": "./build/index.jsx"
20
+ "development": "./build/index.js",
21
+ "import": "./build/index.js"
22
22
  },
23
23
  "development": {
24
24
  "import": {
@@ -50,7 +50,7 @@
50
50
  "superjson": "^1.12.4",
51
51
  "tsup-preset-solid": "^2.0.1",
52
52
  "vite-plugin-solid": "^2.7.0",
53
- "@tanstack/query-core": "5.0.0-rc.5"
53
+ "@tanstack/query-core": "5.0.0"
54
54
  },
55
55
  "scripts": {
56
56
  "clean": "rimraf ./build && rimraf ./coverage",
package/src/Context.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { createContext, useContext } from 'solid-js'
2
+ import type { Accessor } from 'solid-js'
2
3
  import type { Query, QueryClient, onlineManager } from '@tanstack/query-core'
3
4
 
4
5
  type XPosition = 'left' | 'right'
@@ -39,3 +40,11 @@ export const QueryDevtoolsContext = createContext<QueryDevtoolsProps>({
39
40
  export function useQueryDevtoolsContext() {
40
41
  return useContext(QueryDevtoolsContext)
41
42
  }
43
+
44
+ export const ThemeContext = createContext<Accessor<'light' | 'dark'>>(
45
+ () => 'dark' as const,
46
+ )
47
+
48
+ export function useTheme() {
49
+ return useContext(ThemeContext)
50
+ }