@rolder/kit 3.0.0-alpha.29 → 3.0.0-alpha.30
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/ai/ui/chat/index.d.ts +1 -7
- package/dist/ai/ui/chat/index.js +3 -4
- package/dist/ai/ui/chat/store/messages.d.ts +2 -0
- package/dist/ai/ui/chat/store/messages.js +5 -2
- package/dist/ai/ui/chat/store/states.d.ts +0 -2
- package/dist/ai/ui/chat/store/states.js +1 -5
- package/dist/app/defaultTheme.d.ts +7 -7
- package/package.json +1 -1
|
@@ -9,11 +9,5 @@ export declare const Chat: {
|
|
|
9
9
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
10
|
Loader: (props: import("@mantine/core").LoaderProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
11
|
Empty: () => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
-
Input: {
|
|
13
|
-
Root: ({ children, className, onSubmit, isUploading, accept, ...props }: import("./chatInput/Root").ChatInputRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
Textarea: (props: import("@mantine/core").TextareaProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
Footer: (props: import("@mantine/core").GroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
Submit: ({ children, ...props }: import("@mantine/core").ActionIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
File: (props: Omit<import("@mantine/core").FileButtonProps, "onChange" | "children">) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
};
|
|
19
12
|
};
|
|
13
|
+
export { Input } from './chatInput';
|
package/dist/ai/ui/chat/index.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { Input } from "./chatInput/index.js";
|
|
2
1
|
import { Empty } from "./Empty.js";
|
|
3
2
|
import { File } from "./File.js";
|
|
4
3
|
import { Loader } from "./Loader.js";
|
|
5
4
|
import { Message } from "./Message.js";
|
|
6
5
|
import { Messages } from "./Messages.js";
|
|
7
6
|
import { Root } from "./Root.js";
|
|
7
|
+
import { Input } from "./chatInput/index.js";
|
|
8
8
|
const Chat = {
|
|
9
9
|
Root: Root,
|
|
10
10
|
Messages: Messages,
|
|
11
11
|
Message: Message,
|
|
12
12
|
File: File,
|
|
13
13
|
Loader: Loader,
|
|
14
|
-
Empty: Empty
|
|
15
|
-
Input: Input
|
|
14
|
+
Empty: Empty
|
|
16
15
|
};
|
|
17
|
-
export { Chat };
|
|
16
|
+
export { Chat, Input };
|
|
@@ -5,6 +5,8 @@ export declare const $chatMessages: import("nanostores").PreinitializedMapStore<
|
|
|
5
5
|
export declare const getChatMessage: (messageId: string) => UIMessage<unknown, UIDataTypes, UITools>;
|
|
6
6
|
export declare const getChatMessages: <T extends UIMessage>() => T[];
|
|
7
7
|
export declare const setChatMessages: <T extends UIMessage>(messages: T[]) => void;
|
|
8
|
+
export declare const getIsEmpty: () => boolean;
|
|
9
|
+
export declare const useIsEmpty: () => boolean;
|
|
8
10
|
export declare const useChatMessageIds: <T extends UIMessage>(props?: UseChatOptions<T> & ChatInit<T>) => string[];
|
|
9
11
|
export declare const useChatMessage: <T extends UIMessage>(messageId: string) => T;
|
|
10
12
|
export declare const useChatMessagePart: <M extends UIMessage, T extends UIMessagePart<UIDataTypes, UITools>>(messageId: string, type?: T["type"]) => T | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useChat } from "@ai-sdk/react";
|
|
2
2
|
import { notifications } from "@mantine/notifications";
|
|
3
3
|
import { useStore } from "@nanostores/react";
|
|
4
|
-
import { atom, map } from "nanostores";
|
|
4
|
+
import { atom, computed, map } from "nanostores";
|
|
5
5
|
import { useEffect } from "react";
|
|
6
6
|
import { setChatError, setChatStatus } from "./states.js";
|
|
7
7
|
const $chatMessageIds = atom([]);
|
|
@@ -14,6 +14,9 @@ const setChatMessages = (messages)=>{
|
|
|
14
14
|
for (const msg of messages)messagesMap[msg.id] = msg;
|
|
15
15
|
$chatMessages.set(messagesMap);
|
|
16
16
|
};
|
|
17
|
+
const $isEmpty = computed($chatMessageIds, (messages)=>0 === messages.length);
|
|
18
|
+
const getIsEmpty = ()=>$isEmpty.get();
|
|
19
|
+
const useIsEmpty = ()=>useStore($isEmpty);
|
|
17
20
|
const useChatMessageIds = (props)=>{
|
|
18
21
|
const { messages, status, error, sendMessage } = useChat({
|
|
19
22
|
onError: (e)=>{
|
|
@@ -72,4 +75,4 @@ const messages_sendMessage = async ({ text, file }, data)=>{
|
|
|
72
75
|
body: data
|
|
73
76
|
});
|
|
74
77
|
};
|
|
75
|
-
export { $chatMessageIds, $chatMessages, getChatMessage, getChatMessages, messages_sendMessage as sendMessage, setChatMessages, useChatMessage, useChatMessageIds, useChatMessagePart };
|
|
78
|
+
export { $chatMessageIds, $chatMessages, getChatMessage, getChatMessages, getIsEmpty, messages_sendMessage as sendMessage, setChatMessages, useChatMessage, useChatMessageIds, useChatMessagePart, useIsEmpty };
|
|
@@ -6,8 +6,6 @@ export declare const getIsLoading: () => boolean;
|
|
|
6
6
|
export declare const useIsLoading: () => boolean;
|
|
7
7
|
export declare const getIsStreaming: () => boolean;
|
|
8
8
|
export declare const useIsStreaming: () => boolean;
|
|
9
|
-
export declare const getIsEmpty: () => boolean;
|
|
10
|
-
export declare const useIsEmpty: () => boolean;
|
|
11
9
|
export declare const getChatError: () => string | undefined;
|
|
12
10
|
export declare const setChatError: (error: string | undefined) => void;
|
|
13
11
|
export declare const useChatError: () => string | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useStore } from "@nanostores/react";
|
|
2
2
|
import { atom, computed } from "nanostores";
|
|
3
|
-
import { $chatMessageIds } from "./messages.js";
|
|
4
3
|
const $chatStatus = atom('ready');
|
|
5
4
|
const getChatStatus = ()=>$chatStatus.get();
|
|
6
5
|
const setChatStatus = (status)=>$chatStatus.set(status);
|
|
@@ -11,11 +10,8 @@ const useIsLoading = ()=>useStore($isLoading);
|
|
|
11
10
|
const $isStreaming = computed($chatStatus, (status)=>'streaming' === status);
|
|
12
11
|
const getIsStreaming = ()=>$isStreaming.get();
|
|
13
12
|
const useIsStreaming = ()=>useStore($isStreaming);
|
|
14
|
-
const $isEmpty = computed($chatMessageIds, (messages)=>0 === messages.length);
|
|
15
|
-
const getIsEmpty = ()=>$isEmpty.get();
|
|
16
|
-
const useIsEmpty = ()=>useStore($isEmpty);
|
|
17
13
|
const $chatError = atom();
|
|
18
14
|
const getChatError = ()=>$chatError.get();
|
|
19
15
|
const setChatError = (error)=>$chatError.set(error);
|
|
20
16
|
const useChatError = ()=>useStore($chatError);
|
|
21
|
-
export { getChatError, getChatStatus,
|
|
17
|
+
export { getChatError, getChatStatus, getIsLoading, getIsStreaming, setChatError, setChatStatus, useChatError, useChatStatus, useIsLoading, useIsStreaming };
|
|
@@ -34,7 +34,7 @@ export declare const defaultTheme: {
|
|
|
34
34
|
headings?: {
|
|
35
35
|
fontFamily?: string | undefined;
|
|
36
36
|
fontWeight?: string | undefined;
|
|
37
|
-
textWrap?: "
|
|
37
|
+
textWrap?: "balance" | "nowrap" | "wrap" | "stable" | "pretty" | undefined;
|
|
38
38
|
sizes?: {
|
|
39
39
|
h1?: {
|
|
40
40
|
fontSize?: string | undefined;
|
|
@@ -70,52 +70,52 @@ export declare const defaultTheme: {
|
|
|
70
70
|
} | undefined;
|
|
71
71
|
radius?: {
|
|
72
72
|
[x: string & {}]: string | undefined;
|
|
73
|
-
lg?: string | undefined;
|
|
74
73
|
xs?: string | undefined;
|
|
75
74
|
sm?: string | undefined;
|
|
76
75
|
md?: string | undefined;
|
|
76
|
+
lg?: string | undefined;
|
|
77
77
|
xl?: string | undefined;
|
|
78
78
|
} | undefined;
|
|
79
79
|
defaultRadius?: import("@mantine/core").MantineRadius | undefined;
|
|
80
80
|
spacing?: {
|
|
81
81
|
[x: number]: string | undefined;
|
|
82
82
|
[x: string & {}]: string | undefined;
|
|
83
|
-
lg?: string | undefined;
|
|
84
83
|
xs?: string | undefined;
|
|
85
84
|
sm?: string | undefined;
|
|
86
85
|
md?: string | undefined;
|
|
86
|
+
lg?: string | undefined;
|
|
87
87
|
xl?: string | undefined;
|
|
88
88
|
} | undefined;
|
|
89
89
|
fontSizes?: {
|
|
90
90
|
[x: string & {}]: string | undefined;
|
|
91
|
-
lg?: string | undefined;
|
|
92
91
|
xs?: string | undefined;
|
|
93
92
|
sm?: string | undefined;
|
|
94
93
|
md?: string | undefined;
|
|
94
|
+
lg?: string | undefined;
|
|
95
95
|
xl?: string | undefined;
|
|
96
96
|
} | undefined;
|
|
97
97
|
lineHeights?: {
|
|
98
98
|
[x: string & {}]: string | undefined;
|
|
99
|
-
lg?: string | undefined;
|
|
100
99
|
xs?: string | undefined;
|
|
101
100
|
sm?: string | undefined;
|
|
102
101
|
md?: string | undefined;
|
|
102
|
+
lg?: string | undefined;
|
|
103
103
|
xl?: string | undefined;
|
|
104
104
|
} | undefined;
|
|
105
105
|
breakpoints?: {
|
|
106
106
|
[x: string & {}]: string | undefined;
|
|
107
|
-
lg?: string | undefined;
|
|
108
107
|
xs?: string | undefined;
|
|
109
108
|
sm?: string | undefined;
|
|
110
109
|
md?: string | undefined;
|
|
110
|
+
lg?: string | undefined;
|
|
111
111
|
xl?: string | undefined;
|
|
112
112
|
} | undefined;
|
|
113
113
|
shadows?: {
|
|
114
114
|
[x: string & {}]: string | undefined;
|
|
115
|
-
lg?: string | undefined;
|
|
116
115
|
xs?: string | undefined;
|
|
117
116
|
sm?: string | undefined;
|
|
118
117
|
md?: string | undefined;
|
|
118
|
+
lg?: string | undefined;
|
|
119
119
|
xl?: string | undefined;
|
|
120
120
|
} | undefined;
|
|
121
121
|
respectReducedMotion?: boolean | undefined;
|