@tanstack/router-devtools 0.0.1-beta.99 → 1.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/LICENSE +1 -1
- package/build/cjs/Explorer.js +10 -8
- package/build/cjs/Explorer.js.map +1 -1
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +2 -4
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/build/cjs/devtools.js +351 -106
- package/build/cjs/devtools.js.map +1 -1
- package/build/cjs/index.js +1 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/styledComponents.js +1 -4
- package/build/cjs/styledComponents.js.map +1 -1
- package/build/cjs/theme.js +10 -16
- package/build/cjs/theme.js.map +1 -1
- package/build/cjs/useLocalStorage.js +5 -9
- package/build/cjs/useLocalStorage.js.map +1 -1
- package/build/cjs/useMediaQuery.js +4 -8
- package/build/cjs/useMediaQuery.js.map +1 -1
- package/build/cjs/utils.js +36 -16
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +342 -65
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +3494 -2700
- package/build/stats-react.json +393 -147
- package/build/types/Explorer.d.ts +10 -4
- package/build/types/devtools.d.ts +1 -1
- package/build/types/index.d.ts +77 -1
- package/build/types/styledComponents.d.ts +3 -3
- package/build/types/theme.d.ts +13 -13
- package/build/types/utils.d.ts +3 -2
- package/build/umd/index.development.js +662 -145
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +4 -14
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -3
- package/src/Explorer.tsx +5 -0
- package/src/devtools.tsx +574 -287
- package/src/theme.tsx +6 -6
- package/src/utils.ts +14 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const Entry: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
3
|
export declare const Label: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
-
export declare const LabelButton: React.ForwardRefExoticComponent<
|
|
5
|
-
export declare const ExpandButton: React.ForwardRefExoticComponent<
|
|
4
|
+
export declare const LabelButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const ExpandButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
export declare const Value: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
|
|
7
7
|
export declare const SubEntries: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export declare const Info: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -10,7 +10,7 @@ type ExpanderProps = {
|
|
|
10
10
|
expanded: boolean;
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
12
|
};
|
|
13
|
-
export declare const Expander: ({ expanded, style }: ExpanderProps) => JSX.Element;
|
|
13
|
+
export declare const Expander: ({ expanded, style }: ExpanderProps) => React.JSX.Element;
|
|
14
14
|
type Entry = {
|
|
15
15
|
label: string;
|
|
16
16
|
};
|
|
@@ -25,6 +25,7 @@ type RendererProps = {
|
|
|
25
25
|
toggleExpanded: () => void;
|
|
26
26
|
pageSize: number;
|
|
27
27
|
renderer?: Renderer;
|
|
28
|
+
filterSubEntries?: (subEntries: Property[]) => Property[];
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
30
31
|
* Chunk elements in the array by size
|
|
@@ -43,5 +44,10 @@ type ExplorerProps = Partial<RendererProps> & {
|
|
|
43
44
|
renderer?: Renderer;
|
|
44
45
|
defaultExpanded?: true | Record<string, boolean>;
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
+
type Property = {
|
|
48
|
+
defaultExpanded?: boolean | Record<string, boolean>;
|
|
49
|
+
label: string;
|
|
50
|
+
value: unknown;
|
|
51
|
+
};
|
|
52
|
+
export default function Explorer({ value, defaultExpanded, renderer, pageSize, filterSubEntries, ...rest }: ExplorerProps): JSX.Element;
|
|
47
53
|
export {};
|
package/build/types/index.d.ts
CHANGED
|
@@ -1 +1,77 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @tanstack/router-devtools/src/index.tsx
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) TanStack
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { AnyRouter } from '@tanstack/react-router';
|
|
13
|
+
|
|
14
|
+
type PartialKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
15
|
+
interface DevtoolsOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Set this true if you want the dev tools to default to being open
|
|
18
|
+
*/
|
|
19
|
+
initialIsOpen?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Use this to add props to the panel. For example, you can add className, style (merge and override default style), etc.
|
|
22
|
+
*/
|
|
23
|
+
panelProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
24
|
+
/**
|
|
25
|
+
* 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.
|
|
26
|
+
*/
|
|
27
|
+
closeButtonProps?: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
28
|
+
/**
|
|
29
|
+
* 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.
|
|
30
|
+
*/
|
|
31
|
+
toggleButtonProps?: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
32
|
+
/**
|
|
33
|
+
* The position of the TanStack Router logo to open and close the devtools panel.
|
|
34
|
+
* Defaults to 'bottom-left'.
|
|
35
|
+
*/
|
|
36
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
37
|
+
/**
|
|
38
|
+
* Use this to render the devtools inside a different type of container element for a11y purposes.
|
|
39
|
+
* Any string which corresponds to a valid intrinsic JSX element is allowed.
|
|
40
|
+
* Defaults to 'footer'.
|
|
41
|
+
*/
|
|
42
|
+
containerElement?: string | any;
|
|
43
|
+
/**
|
|
44
|
+
* A boolean variable indicating if the "lite" version of the library is being used
|
|
45
|
+
*/
|
|
46
|
+
router?: AnyRouter;
|
|
47
|
+
}
|
|
48
|
+
interface DevtoolsPanelOptions {
|
|
49
|
+
/**
|
|
50
|
+
* The standard React style object used to style a component with inline styles
|
|
51
|
+
*/
|
|
52
|
+
style?: React.CSSProperties;
|
|
53
|
+
/**
|
|
54
|
+
* The standard React className property used to style a component with classes
|
|
55
|
+
*/
|
|
56
|
+
className?: string;
|
|
57
|
+
/**
|
|
58
|
+
* A boolean variable indicating whether the panel is open or closed
|
|
59
|
+
*/
|
|
60
|
+
isOpen?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* A function that toggles the open and close state of the panel
|
|
63
|
+
*/
|
|
64
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Handles the opening and closing the devtools panel
|
|
67
|
+
*/
|
|
68
|
+
handleDragStart: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
69
|
+
/**
|
|
70
|
+
* A boolean variable indicating if the "lite" version of the library is being used
|
|
71
|
+
*/
|
|
72
|
+
router?: AnyRouter;
|
|
73
|
+
}
|
|
74
|
+
declare function TanStackRouterDevtools({ initialIsOpen, panelProps, closeButtonProps, toggleButtonProps, position, containerElement: Container, router, }: DevtoolsOptions): React.ReactElement | null;
|
|
75
|
+
declare const TanStackRouterDevtoolsPanel: React.ForwardRefExoticComponent<DevtoolsPanelOptions & React.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
|
|
77
|
+
export { type PartialKeys, TanStackRouterDevtools, TanStackRouterDevtoolsPanel };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Panel: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
3
|
export declare const ActivePanel: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
-
export declare const Button: import("react").ForwardRefExoticComponent<
|
|
4
|
+
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
export declare const Code: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
|
|
6
|
-
export declare const Input: import("react").ForwardRefExoticComponent<
|
|
7
|
-
export declare const Select: import("react").ForwardRefExoticComponent<
|
|
6
|
+
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
7
|
+
export declare const Select: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
package/build/types/theme.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const defaultTheme: {
|
|
3
|
-
readonly background: "#
|
|
4
|
-
readonly backgroundAlt: "#
|
|
3
|
+
readonly background: "#222222";
|
|
4
|
+
readonly backgroundAlt: "#292929";
|
|
5
5
|
readonly foreground: "white";
|
|
6
|
-
readonly gray: "#
|
|
7
|
-
readonly grayAlt: "#
|
|
6
|
+
readonly gray: "#444";
|
|
7
|
+
readonly grayAlt: "#444";
|
|
8
8
|
readonly inputBackgroundColor: "#fff";
|
|
9
9
|
readonly inputTextColor: "#000";
|
|
10
|
-
readonly success: "#
|
|
10
|
+
readonly success: "#80cb00";
|
|
11
11
|
readonly danger: "#ff0085";
|
|
12
|
-
readonly active: "#
|
|
12
|
+
readonly active: "#0099ff";
|
|
13
13
|
readonly warning: "#ffb200";
|
|
14
14
|
};
|
|
15
15
|
export type Theme = typeof defaultTheme;
|
|
@@ -17,18 +17,18 @@ interface ProviderProps {
|
|
|
17
17
|
theme: Theme;
|
|
18
18
|
children?: React.ReactNode;
|
|
19
19
|
}
|
|
20
|
-
export declare function ThemeProvider({ theme, ...rest }: ProviderProps): JSX.Element;
|
|
20
|
+
export declare function ThemeProvider({ theme, ...rest }: ProviderProps): React.JSX.Element;
|
|
21
21
|
export declare function useTheme(): {
|
|
22
|
-
readonly background: "#
|
|
23
|
-
readonly backgroundAlt: "#
|
|
22
|
+
readonly background: "#222222";
|
|
23
|
+
readonly backgroundAlt: "#292929";
|
|
24
24
|
readonly foreground: "white";
|
|
25
|
-
readonly gray: "#
|
|
26
|
-
readonly grayAlt: "#
|
|
25
|
+
readonly gray: "#444";
|
|
26
|
+
readonly grayAlt: "#444";
|
|
27
27
|
readonly inputBackgroundColor: "#fff";
|
|
28
28
|
readonly inputTextColor: "#000";
|
|
29
|
-
readonly success: "#
|
|
29
|
+
readonly success: "#80cb00";
|
|
30
30
|
readonly danger: "#ff0085";
|
|
31
|
-
readonly active: "#
|
|
31
|
+
readonly active: "#0099ff";
|
|
32
32
|
readonly warning: "#ffb200";
|
|
33
33
|
};
|
|
34
34
|
export {};
|
package/build/types/utils.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AnyRouteMatch } from '@tanstack/router';
|
|
2
|
+
import { AnyRootRoute, AnyRoute, AnyRouteMatch } from '@tanstack/react-router';
|
|
3
3
|
import { Theme } from './theme';
|
|
4
4
|
export declare const isServer: boolean;
|
|
5
5
|
type StyledComponent<T> = T extends 'button' ? React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> : T extends 'input' ? React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> : T extends 'select' ? React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement> : T extends keyof HTMLElementTagNameMap ? React.HTMLAttributes<HTMLElementTagNameMap[T]> : never;
|
|
6
|
-
export declare function getStatusColor(match: AnyRouteMatch, theme: Theme): "#
|
|
6
|
+
export declare function getStatusColor(match: AnyRouteMatch, theme: Theme): "#444" | "#80cb00" | "#ff0085" | "#0099ff";
|
|
7
|
+
export declare function getRouteStatusColor(matches: AnyRouteMatch[], route: AnyRoute | AnyRootRoute, theme: Theme): "#444" | "#80cb00" | "#ff0085" | "#0099ff";
|
|
7
8
|
type Styles = React.CSSProperties | ((props: Record<string, any>, theme: Theme) => React.CSSProperties);
|
|
8
9
|
export declare function styled<T extends keyof HTMLElementTagNameMap>(type: T, newStyles: Styles, queries?: Record<string, Styles>): React.ForwardRefExoticComponent<React.PropsWithoutRef<StyledComponent<T>> & React.RefAttributes<HTMLElementTagNameMap[T]>>;
|
|
9
10
|
export declare function useIsMounted(): () => boolean;
|