@tanstack/react-query-devtools 5.0.0-alpha.5 → 5.0.0-alpha.50

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.
Files changed (109) hide show
  1. package/build/lib/__tests__/devtools.test.d.ts +1 -1
  2. package/build/lib/__tests__/devtools.test.d.ts.map +1 -0
  3. package/build/lib/__tests__/utils.d.ts +2 -1
  4. package/build/lib/__tests__/utils.d.ts.map +1 -0
  5. package/build/lib/devtools.d.ts +11 -75
  6. package/build/lib/devtools.d.ts.map +1 -0
  7. package/build/lib/devtools.js +49 -783
  8. package/build/lib/devtools.js.map +1 -1
  9. package/build/lib/devtools.mjs +52 -766
  10. package/build/lib/devtools.mjs.map +1 -1
  11. package/build/lib/index.d.ts +1 -1
  12. package/build/lib/index.d.ts.map +1 -0
  13. package/build/lib/index.js +8 -4
  14. package/build/lib/index.js.map +1 -1
  15. package/build/lib/index.mjs +10 -5
  16. package/build/lib/index.mjs.map +1 -1
  17. package/build/lib/{index.prod.d.ts → index.prod.d.ts/index.d.ts} +1 -1
  18. package/build/lib/index.prod.js +7923 -1389
  19. package/build/lib/index.prod.js.map +1 -1
  20. package/build/lib/index.prod.mjs +7857 -1303
  21. package/build/lib/index.prod.mjs.map +1 -1
  22. package/package.json +17 -16
  23. package/src/__tests__/devtools.test.tsx +1 -861
  24. package/src/devtools.tsx +61 -1164
  25. package/src/index.ts +6 -6
  26. package/build/lib/Explorer.d.ts +0 -50
  27. package/build/lib/Explorer.esm.js +0 -253
  28. package/build/lib/Explorer.esm.js.map +0 -1
  29. package/build/lib/Explorer.js +0 -287
  30. package/build/lib/Explorer.js.map +0 -1
  31. package/build/lib/Explorer.mjs +0 -253
  32. package/build/lib/Explorer.mjs.map +0 -1
  33. package/build/lib/Logo.d.ts +0 -1
  34. package/build/lib/Logo.esm.js +0 -32
  35. package/build/lib/Logo.esm.js.map +0 -1
  36. package/build/lib/Logo.js +0 -55
  37. package/build/lib/Logo.js.map +0 -1
  38. package/build/lib/Logo.mjs +0 -32
  39. package/build/lib/Logo.mjs.map +0 -1
  40. package/build/lib/__tests__/Explorer.test.d.ts +0 -1
  41. package/build/lib/_virtual/_rollupPluginBabelHelpers.esm.js +0 -17
  42. package/build/lib/_virtual/_rollupPluginBabelHelpers.esm.js.map +0 -1
  43. package/build/lib/_virtual/_rollupPluginBabelHelpers.js +0 -19
  44. package/build/lib/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  45. package/build/lib/_virtual/_rollupPluginBabelHelpers.mjs +0 -17
  46. package/build/lib/_virtual/_rollupPluginBabelHelpers.mjs.map +0 -1
  47. package/build/lib/devtools.esm.js +0 -773
  48. package/build/lib/devtools.esm.js.map +0 -1
  49. package/build/lib/index.esm.js +0 -11
  50. package/build/lib/index.esm.js.map +0 -1
  51. package/build/lib/index.prod.esm.js +0 -1431
  52. package/build/lib/index.prod.esm.js.map +0 -1
  53. package/build/lib/noop.d.ts +0 -2
  54. package/build/lib/screenreader.d.ts +0 -3
  55. package/build/lib/screenreader.esm.js +0 -17
  56. package/build/lib/screenreader.esm.js.map +0 -1
  57. package/build/lib/screenreader.js +0 -40
  58. package/build/lib/screenreader.js.map +0 -1
  59. package/build/lib/screenreader.mjs +0 -17
  60. package/build/lib/screenreader.mjs.map +0 -1
  61. package/build/lib/styledComponents.d.ts +0 -9
  62. package/build/lib/styledComponents.esm.js +0 -93
  63. package/build/lib/styledComponents.esm.js.map +0 -1
  64. package/build/lib/styledComponents.js +0 -102
  65. package/build/lib/styledComponents.js.map +0 -1
  66. package/build/lib/styledComponents.mjs +0 -93
  67. package/build/lib/styledComponents.mjs.map +0 -1
  68. package/build/lib/theme.d.ts +0 -36
  69. package/build/lib/theme.esm.js +0 -32
  70. package/build/lib/theme.esm.js.map +0 -1
  71. package/build/lib/theme.js +0 -55
  72. package/build/lib/theme.js.map +0 -1
  73. package/build/lib/theme.mjs +0 -32
  74. package/build/lib/theme.mjs.map +0 -1
  75. package/build/lib/useLocalStorage.d.ts +0 -1
  76. package/build/lib/useLocalStorage.esm.js +0 -40
  77. package/build/lib/useLocalStorage.esm.js.map +0 -1
  78. package/build/lib/useLocalStorage.js +0 -63
  79. package/build/lib/useLocalStorage.js.map +0 -1
  80. package/build/lib/useLocalStorage.mjs +0 -40
  81. package/build/lib/useLocalStorage.mjs.map +0 -1
  82. package/build/lib/useMediaQuery.d.ts +0 -1
  83. package/build/lib/useMediaQuery.esm.js +0 -36
  84. package/build/lib/useMediaQuery.esm.js.map +0 -1
  85. package/build/lib/useMediaQuery.js +0 -59
  86. package/build/lib/useMediaQuery.js.map +0 -1
  87. package/build/lib/useMediaQuery.mjs +0 -36
  88. package/build/lib/useMediaQuery.mjs.map +0 -1
  89. package/build/lib/utils.d.ts +0 -79
  90. package/build/lib/utils.esm.js +0 -184
  91. package/build/lib/utils.esm.js.map +0 -1
  92. package/build/lib/utils.js +0 -218
  93. package/build/lib/utils.js.map +0 -1
  94. package/build/lib/utils.mjs +0 -184
  95. package/build/lib/utils.mjs.map +0 -1
  96. package/build/umd/index.development.js +0 -3099
  97. package/build/umd/index.development.js.map +0 -1
  98. package/build/umd/index.production.js +0 -2
  99. package/build/umd/index.production.js.map +0 -1
  100. package/src/Explorer.tsx +0 -385
  101. package/src/Logo.tsx +0 -32
  102. package/src/__tests__/Explorer.test.tsx +0 -150
  103. package/src/noop.ts +0 -7
  104. package/src/screenreader.tsx +0 -16
  105. package/src/styledComponents.ts +0 -108
  106. package/src/theme.tsx +0 -33
  107. package/src/useLocalStorage.ts +0 -52
  108. package/src/useMediaQuery.ts +0 -34
  109. package/src/utils.ts +0 -319
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ //# sourceMappingURL=devtools.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/devtools.test.tsx"],"names":[],"mappings":""}
@@ -12,7 +12,7 @@ export declare function sleep(timeout: number): Promise<void>;
12
12
  * @param textToMatch The string that needs to be matched
13
13
  * @reference https://stackoverflow.com/a/56859650/8252081
14
14
  */
15
- declare type MatcherFunction = (content: string, element: Element | null) => boolean;
15
+ type MatcherFunction = (content: string, element: Element | null) => boolean;
16
16
  export declare const getByTextContent: (textToMatch: string) => MatcherFunction;
17
17
  interface CreateQueryClientResponse {
18
18
  queryClient: QueryClient;
@@ -20,3 +20,4 @@ interface CreateQueryClientResponse {
20
20
  }
21
21
  export declare const createQueryClient: () => CreateQueryClientResponse;
22
22
  export {};
23
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/__tests__/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACnE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EACL,WAAW,EAEX,UAAU,EACX,MAAM,uBAAuB,CAAA;AAE9B,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,EAAE,EAAE,KAAK,CAAC,YAAY,EACtB,eAAe,GAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAM,EACnE,aAAa,CAAC,EAAE,aAAa,GAC5B,UAAU,CAAC,OAAO,MAAM,CAAC,CAkB3B;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpD;AAED;;;;;;;GAOG;AAEH,KAAK,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,OAAO,CAAA;AAE5E,eAAO,MAAM,gBAAgB,gBACb,MAAM,KAAG,eAatB,CAAA;AAEH,UAAU,yBAAyB;IACjC,WAAW,EAAE,WAAW,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,eAAO,MAAM,iBAAiB,QAAO,yBAWpC,CAAA"}
@@ -1,95 +1,31 @@
1
- import * as React from 'react';
2
1
  import type { QueryClient } from '@tanstack/react-query';
3
- import type { Corner, Side } from './utils';
2
+ import type { DevtoolsButtonPosition, DevtoolsPosition, DevToolsErrorType } from '@tanstack/query-devtools';
3
+ import React from 'react';
4
4
  export interface DevtoolsOptions {
5
5
  /**
6
6
  * Set this true if you want the dev tools to default to being open
7
7
  */
8
8
  initialIsOpen?: boolean;
9
- /**
10
- * Use this to add props to the panel. For example, you can add className, style (merge and override default style), etc.
11
- */
12
- panelProps?: React.ComponentPropsWithoutRef<'div'>;
13
- /**
14
- * Use this to add props to the close button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.
15
- */
16
- closeButtonProps?: React.ComponentPropsWithoutRef<'button'>;
17
- /**
18
- * Use this to add props to the toggle button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.
19
- */
20
- toggleButtonProps?: React.ComponentPropsWithoutRef<'button'>;
21
9
  /**
22
10
  * The position of the React Query logo to open and close the devtools panel.
11
+ * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
23
12
  * Defaults to 'bottom-left'.
24
13
  */
25
- position?: Corner;
14
+ buttonPosition?: DevtoolsButtonPosition;
26
15
  /**
27
16
  * The position of the React Query devtools panel.
17
+ * 'top' | 'bottom' | 'left' | 'right'
28
18
  * Defaults to 'bottom'.
29
19
  */
30
- panelPosition?: Side;
31
- /**
32
- * Use this to render the devtools inside a different type of container element for a11y purposes.
33
- * Any string which corresponds to a valid intrinsic JSX element is allowed.
34
- * Defaults to 'aside'.
35
- */
36
- containerElement?: string | any;
37
- /**
38
- * nonce for style element for CSP
39
- */
40
- styleNonce?: string;
20
+ position?: DevtoolsPosition;
41
21
  /**
42
22
  * Custom instance of QueryClient
43
23
  */
44
- queryClient?: QueryClient;
45
- }
46
- interface DevtoolsPanelOptions {
47
- /**
48
- * The standard React style object used to style a component with inline styles
49
- */
50
- style?: React.CSSProperties;
51
- /**
52
- * The standard React className property used to style a component with classes
53
- */
54
- className?: string;
55
- /**
56
- * A boolean variable indicating whether the panel is open or closed
57
- */
58
- isOpen?: boolean;
24
+ client?: QueryClient;
59
25
  /**
60
- * nonce for style element for CSP
61
- */
62
- styleNonce?: string;
63
- /**
64
- * A function that toggles the open and close state of the panel
65
- */
66
- setIsOpen: (isOpen: boolean) => void;
67
- /**
68
- * Handles the opening and closing the devtools panel
69
- */
70
- onDragStart: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
71
- /**
72
- * The position of the React Query devtools panel.
73
- * Defaults to 'bottom'.
74
- */
75
- position?: Side;
76
- /**
77
- * Handles the panel position select change
78
- */
79
- onPositionChange?: (side: Side) => void;
80
- /**
81
- * Show a close button inside the panel
82
- */
83
- showCloseButton?: boolean;
84
- /**
85
- * Use this to add props to the close button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.
86
- */
87
- closeButtonProps?: React.ComponentPropsWithoutRef<'button'>;
88
- /**
89
- * Custom instance of QueryClient
26
+ * Use this so you can define custom errors that can be shown in the devtools.
90
27
  */
91
- queryClient?: QueryClient;
28
+ errorTypes?: DevToolsErrorType[];
92
29
  }
93
- export declare function ReactQueryDevtools({ initialIsOpen, panelProps, closeButtonProps, toggleButtonProps, position, containerElement: Container, queryClient, styleNonce, panelPosition: initialPanelPosition, }: DevtoolsOptions): React.ReactElement | null;
94
- export declare const ReactQueryDevtoolsPanel: React.ForwardRefExoticComponent<DevtoolsPanelOptions & React.RefAttributes<HTMLDivElement>>;
95
- export {};
30
+ export declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement | null;
31
+ //# sourceMappingURL=devtools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../../src/devtools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EACV,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAA;IACvC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAA;CACjC;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,eAAe,GACrB,KAAK,CAAC,YAAY,GAAG,IAAI,CAqD3B"}