@rolder/kit 3.0.0-alpha.61 → 3.0.0-alpha.63
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.
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { type LoaderProps } from '@mantine/core';
|
|
2
|
+
type MessageProps = {
|
|
2
3
|
messageId: string;
|
|
3
|
-
|
|
4
|
+
loaderProps?: LoaderProps;
|
|
5
|
+
};
|
|
6
|
+
export declare const Message: import("react").MemoExoticComponent<({ messageId, loaderProps }: MessageProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
7
|
+
export {};
|
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Paper } from "@mantine/core";
|
|
3
3
|
import { memo } from "react";
|
|
4
4
|
import { Streamdown } from "streamdown";
|
|
5
|
+
import { Loader } from "./Loader.js";
|
|
5
6
|
import { getIsStreaming, useChatMessage, useChatMessagePart } from "./store/index.js";
|
|
6
|
-
const Message = /*#__PURE__*/ memo(({ messageId })=>{
|
|
7
|
+
const Message = /*#__PURE__*/ memo(({ messageId, loaderProps })=>{
|
|
7
8
|
const message = useChatMessage(messageId);
|
|
8
9
|
const part = useChatMessagePart(messageId, 'text');
|
|
9
10
|
console.log(messageId);
|
|
10
|
-
return part ? /*#__PURE__*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
return part ? /*#__PURE__*/ jsxs(Fragment, {
|
|
12
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ jsx(Loader, {
|
|
14
|
+
...loaderProps
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ jsx(Paper, {
|
|
17
|
+
radius: "md",
|
|
18
|
+
px: "md",
|
|
19
|
+
py: "sm",
|
|
20
|
+
maw: "80%",
|
|
21
|
+
ml: 'user' === message.role ? 'auto' : void 0,
|
|
22
|
+
bg: 'user' === message.role ? 'var(--mantine-color-default-hover)' : 'var(--mantine-primary-color-light)',
|
|
23
|
+
fz: "sm",
|
|
24
|
+
children: /*#__PURE__*/ jsx(Streamdown, {
|
|
25
|
+
isAnimating: getIsStreaming() && 'assistant' === message.role,
|
|
26
|
+
children: part?.text
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
}) : null;
|
|
26
31
|
});
|
|
27
32
|
export { Message };
|
|
@@ -3,13 +3,13 @@ export declare const Chat: {
|
|
|
3
3
|
Messages: ({ children, ...props }: Omit<import("@mantine/core").StackProps, "children"> & {
|
|
4
4
|
children: (messageId: string) => import("react").ReactNode;
|
|
5
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
Message: import("react").MemoExoticComponent<({ messageId }: {
|
|
6
|
+
Message: import("react").MemoExoticComponent<({ messageId, loaderProps }: {
|
|
7
7
|
messageId: string;
|
|
8
|
-
|
|
8
|
+
loaderProps?: import("@mantine/core").LoaderProps;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element | null>;
|
|
9
10
|
File: ({ messageId }: {
|
|
10
11
|
messageId: string;
|
|
11
12
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
-
Loader: (props: import("@mantine/core").LoaderProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
13
|
Empty: () => import("react/jsx-runtime").JSX.Element | null;
|
|
14
14
|
};
|
|
15
15
|
export { ChatInput } from './chatInput';
|
package/dist/ai/ui/chat/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Empty } from "./Empty.js";
|
|
2
2
|
import { File } from "./File.js";
|
|
3
|
-
import { Loader } from "./Loader.js";
|
|
4
3
|
import { Message } from "./Message.js";
|
|
5
4
|
import { Messages } from "./Messages.js";
|
|
6
5
|
import { Root } from "./Root.js";
|
|
@@ -11,7 +10,6 @@ const Chat = {
|
|
|
11
10
|
Messages: Messages,
|
|
12
11
|
Message: Message,
|
|
13
12
|
File: File,
|
|
14
|
-
Loader: Loader,
|
|
15
13
|
Empty: Empty
|
|
16
14
|
};
|
|
17
15
|
export { Chat, ChatInput };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolder/kit",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.63",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"@nanostores/react": "^1.0.0",
|
|
43
43
|
"@tanstack/react-form": "^1.27.7",
|
|
44
44
|
"@tanstack/react-query": "^5.90.18",
|
|
45
|
-
"@tanstack/react-router": "^1.
|
|
46
|
-
"@tanstack/react-router-ssr-query": "^1.
|
|
47
|
-
"@tanstack/react-start": "^1.
|
|
45
|
+
"@tanstack/react-router": "^1.151.0",
|
|
46
|
+
"@tanstack/react-router-ssr-query": "^1.151.0",
|
|
47
|
+
"@tanstack/react-start": "^1.151.0",
|
|
48
48
|
"@tiptap/extension-highlight": "^3.15.3",
|
|
49
49
|
"@tiptap/extension-placeholder": "^3.15.3",
|
|
50
50
|
"@tiptap/extension-table": "^3.15.3",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"react": "^19.2.3",
|
|
66
66
|
"react-dom": "^19.2.3",
|
|
67
67
|
"streamdown": "^2.0.1",
|
|
68
|
-
"surrealdb": "^
|
|
68
|
+
"surrealdb": "^2.0.0-alpha.16",
|
|
69
69
|
"xlsx": "^0.18.5",
|
|
70
70
|
"zod": "^4.3.5"
|
|
71
71
|
},
|