mtxuilib 0.1.968 → 0.1.969
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/dist/components/devtools/DevTools.d.ts +3 -4
- package/dist/components/devtools/DevTools.js +8 -20
- package/dist/components/devtools/DevToolsView.d.ts +8 -0
- package/dist/components/devtools/DevToolsView.js +26 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mt/logs.d.ts +1 -1
- package/dist/mt/logs.js +0 -1
- package/package.json +4 -4
- package/src/components/devtools/DevTools.tsx +14 -35
- package/src/components/devtools/DevToolsView.tsx +48 -0
- package/src/components/devtools/index.tsx +2 -0
- package/src/hooks/index.ts +4 -0
- package/src/index.ts +2 -1
- package/src/mt/logs.tsx +0 -2
- package/src/components/devtools/index.ts +0 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface DevToolsProps {
|
|
1
|
+
interface DevToolsLoaderProps {
|
|
2
|
+
hotKey?: string;
|
|
4
3
|
open?: boolean;
|
|
5
4
|
onOpenChange?: (open: boolean) => void;
|
|
6
5
|
}
|
|
7
|
-
export declare const DevTools: (props:
|
|
6
|
+
export declare const DevTools: (props: DevToolsLoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { useState } from "react";
|
|
3
|
+
import { lazy, useState } from "react";
|
|
5
4
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
6
|
-
import { TailwindIndicator } from "
|
|
7
|
-
|
|
8
|
-
default: d.ReactQueryDevtools,
|
|
9
|
-
})), {
|
|
10
|
-
ssr: false,
|
|
11
|
-
});
|
|
12
|
-
const hotKeyDebug = "alt+.";
|
|
5
|
+
import { TailwindIndicator } from "../tailwind-indicator";
|
|
6
|
+
const LzDevTools = lazy(() => import("./DevToolsView").then((x) => ({ default: x.DevToolsView })));
|
|
13
7
|
export const DevTools = (props) => {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const setOpen = onOpenChange ?? setInternalOpen;
|
|
18
|
-
useHotkeys(hotKeyDebug, () => {
|
|
19
|
-
console.log("debug2:%o", !open);
|
|
8
|
+
const [open, setOpen] = useState(props.open);
|
|
9
|
+
const hotKey = props.hotKey || "ctrl+0";
|
|
10
|
+
useHotkeys(hotKey, () => {
|
|
20
11
|
setOpen(!open);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
return (_jsxs(_Fragment, { children: [_jsx(ReactQueryDevtoolsProduction, { buttonPosition: "bottom-right" }), _jsx(TailwindIndicator, {})] }));
|
|
12
|
+
});
|
|
13
|
+
return (_jsxs(_Fragment, { children: [open && _jsx(LzDevTools, { open: open, onOpenChange: setOpen }), _jsx(TailwindIndicator, {})] }));
|
|
26
14
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
2
|
+
export declare const ReactQueryDevtoolsProduction: typeof ReactQueryDevtools;
|
|
3
|
+
interface DevToolsProps {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const DevToolsView: (props: DevToolsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { TanStackRouterDevtools } from "@tanstack/router-devtools";
|
|
4
|
+
import dynamic from "next/dynamic";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { useHotkeys } from "react-hotkeys-hook";
|
|
7
|
+
export const ReactQueryDevtoolsProduction = dynamic(() => import("@tanstack/react-query-devtools/build/modern/production.js").then((d) => ({
|
|
8
|
+
default: d.ReactQueryDevtools,
|
|
9
|
+
})), {
|
|
10
|
+
ssr: false,
|
|
11
|
+
});
|
|
12
|
+
const hotKeyDebug = "alt+.";
|
|
13
|
+
export const DevToolsView = (props) => {
|
|
14
|
+
const { open: propsOpen, onOpenChange } = props;
|
|
15
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
16
|
+
const open = propsOpen ?? internalOpen;
|
|
17
|
+
const setOpen = onOpenChange ?? setInternalOpen;
|
|
18
|
+
useHotkeys(hotKeyDebug, () => {
|
|
19
|
+
console.log("debug2:%o", !open);
|
|
20
|
+
setOpen(!open);
|
|
21
|
+
}, [open, setOpen]);
|
|
22
|
+
if (!open) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsx(ReactQueryDevtoolsProduction, { buttonPosition: "bottom-right" }), _jsx(TanStackRouterDevtools, { position: "bottom-right" })] }));
|
|
26
|
+
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export * from "./use-enter-submit";
|
|
|
7
7
|
export * from "./use-local-storage";
|
|
8
8
|
export * from "./use-mobile";
|
|
9
9
|
export * from "./use-mounted";
|
|
10
|
+
export * from "./use-scroll-anchor";
|
|
10
11
|
export * from "./use-scroll-to-bottom";
|
|
12
|
+
export * from "./useAgentEventStream";
|
|
13
|
+
export * from "./useHighlighter";
|
|
14
|
+
export * from "./useLeaveConfirm";
|
|
11
15
|
export * from "./useScript";
|
|
12
16
|
export * from "./useSnapScroll";
|
package/dist/hooks/index.js
CHANGED
|
@@ -8,6 +8,10 @@ export * from "./use-enter-submit";
|
|
|
8
8
|
export * from "./use-local-storage";
|
|
9
9
|
export * from "./use-mobile";
|
|
10
10
|
export * from "./use-mounted";
|
|
11
|
+
export * from "./use-scroll-anchor";
|
|
11
12
|
export * from "./use-scroll-to-bottom";
|
|
13
|
+
export * from "./useAgentEventStream";
|
|
14
|
+
export * from "./useHighlighter";
|
|
15
|
+
export * from "./useLeaveConfirm";
|
|
12
16
|
export * from "./useScript";
|
|
13
17
|
export * from "./useSnapScroll";
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/mt/logs.d.ts
CHANGED
package/dist/mt/logs.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mtxuilib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.969",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -129,9 +129,9 @@
|
|
|
129
129
|
"@rjsf/core": "^5.23.2",
|
|
130
130
|
"@rjsf/utils": "^5.23.2",
|
|
131
131
|
"@rjsf/validator-ajv8": "^5.23.2",
|
|
132
|
-
"@tanstack/react-query": "^5.
|
|
133
|
-
"@tanstack/react-query-devtools": "^5.
|
|
134
|
-
"@tanstack/react-query-next-experimental": "^5.
|
|
132
|
+
"@tanstack/react-query": "^5.62.14",
|
|
133
|
+
"@tanstack/react-query-devtools": "^5.62.14",
|
|
134
|
+
"@tanstack/react-query-next-experimental": "^5.62.14",
|
|
135
135
|
"@tanstack/react-table": "^8.20.1",
|
|
136
136
|
"@visx/axis": "^3.12.0",
|
|
137
137
|
"@visx/brush": "^3.6.0",
|
|
@@ -1,47 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import dynamic from "next/dynamic";
|
|
4
|
-
import { useState } from "react";
|
|
2
|
+
import { lazy, useState } from "react";
|
|
5
3
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
6
|
-
import { TailwindIndicator } from "
|
|
4
|
+
import { TailwindIndicator } from "../tailwind-indicator";
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
() =>
|
|
10
|
-
|
|
11
|
-
(d) => ({
|
|
12
|
-
default: d.ReactQueryDevtools,
|
|
13
|
-
}),
|
|
14
|
-
),
|
|
15
|
-
{
|
|
16
|
-
ssr: false,
|
|
17
|
-
},
|
|
18
|
-
) as typeof ReactQueryDevtools;
|
|
6
|
+
const LzDevTools = lazy(() =>
|
|
7
|
+
import("./DevToolsView").then((x) => ({ default: x.DevToolsView })),
|
|
8
|
+
);
|
|
19
9
|
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
interface DevToolsLoaderProps {
|
|
11
|
+
hotKey?: string;
|
|
22
12
|
open?: boolean;
|
|
23
13
|
onOpenChange?: (open: boolean) => void;
|
|
24
14
|
}
|
|
25
|
-
export const DevTools = (props:
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
hotKeyDebug,
|
|
32
|
-
() => {
|
|
33
|
-
console.log("debug2:%o", !open);
|
|
34
|
-
setOpen(!open);
|
|
35
|
-
},
|
|
36
|
-
[open, setOpen],
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
if (!open) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
15
|
+
export const DevTools = (props: DevToolsLoaderProps) => {
|
|
16
|
+
const [open, setOpen] = useState(props.open);
|
|
17
|
+
const hotKey = props.hotKey || "ctrl+0";
|
|
18
|
+
useHotkeys(hotKey, () => {
|
|
19
|
+
setOpen(!open);
|
|
20
|
+
});
|
|
42
21
|
return (
|
|
43
22
|
<>
|
|
44
|
-
<
|
|
23
|
+
{open && <LzDevTools open={open} onOpenChange={setOpen} />}
|
|
45
24
|
<TailwindIndicator />
|
|
46
25
|
</>
|
|
47
26
|
);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import type { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
3
|
+
import { TanStackRouterDevtools } from "@tanstack/router-devtools";
|
|
4
|
+
import dynamic from "next/dynamic";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { useHotkeys } from "react-hotkeys-hook";
|
|
7
|
+
|
|
8
|
+
export const ReactQueryDevtoolsProduction: typeof ReactQueryDevtools = dynamic(
|
|
9
|
+
() =>
|
|
10
|
+
import("@tanstack/react-query-devtools/build/modern/production.js").then(
|
|
11
|
+
(d) => ({
|
|
12
|
+
default: d.ReactQueryDevtools,
|
|
13
|
+
}),
|
|
14
|
+
),
|
|
15
|
+
{
|
|
16
|
+
ssr: false,
|
|
17
|
+
},
|
|
18
|
+
) as typeof ReactQueryDevtools;
|
|
19
|
+
|
|
20
|
+
const hotKeyDebug = "alt+.";
|
|
21
|
+
interface DevToolsProps {
|
|
22
|
+
open?: boolean;
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
24
|
+
}
|
|
25
|
+
export const DevToolsView = (props: DevToolsProps) => {
|
|
26
|
+
const { open: propsOpen, onOpenChange } = props;
|
|
27
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
28
|
+
const open = propsOpen ?? internalOpen;
|
|
29
|
+
const setOpen = onOpenChange ?? setInternalOpen;
|
|
30
|
+
useHotkeys(
|
|
31
|
+
hotKeyDebug,
|
|
32
|
+
() => {
|
|
33
|
+
console.log("debug2:%o", !open);
|
|
34
|
+
setOpen(!open);
|
|
35
|
+
},
|
|
36
|
+
[open, setOpen],
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
if (!open) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
<ReactQueryDevtoolsProduction buttonPosition="bottom-right" />
|
|
45
|
+
<TanStackRouterDevtools position="bottom-right" />
|
|
46
|
+
</>
|
|
47
|
+
);
|
|
48
|
+
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -10,6 +10,10 @@ export * from "./use-enter-submit";
|
|
|
10
10
|
export * from "./use-local-storage";
|
|
11
11
|
export * from "./use-mobile";
|
|
12
12
|
export * from "./use-mounted";
|
|
13
|
+
export * from "./use-scroll-anchor";
|
|
13
14
|
export * from "./use-scroll-to-bottom";
|
|
15
|
+
export * from "./useAgentEventStream";
|
|
16
|
+
export * from "./useHighlighter";
|
|
17
|
+
export * from "./useLeaveConfirm";
|
|
14
18
|
export * from "./useScript";
|
|
15
19
|
export * from "./useSnapScroll";
|
package/src/index.ts
CHANGED
package/src/mt/logs.tsx
CHANGED