@rolder/kit 3.0.0-alpha.3 → 3.0.0-alpha.31
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/index.d.ts +2 -0
- package/dist/ai/index.js +2 -0
- package/dist/ai/ui/{conversation → chat}/Empty.js +4 -3
- package/dist/ai/ui/chat/File.d.ts +3 -0
- package/dist/ai/ui/{conversation → chat}/File.js +10 -8
- package/dist/ai/ui/chat/FileIcon.js +43 -0
- package/dist/ai/ui/{conversation → chat}/Loader.js +4 -3
- package/dist/ai/ui/chat/Message.d.ts +3 -0
- package/dist/ai/ui/chat/Message.js +24 -0
- package/dist/ai/ui/chat/Messages.d.ts +2 -0
- package/dist/ai/ui/chat/Messages.js +12 -0
- package/dist/ai/ui/chat/Root.d.ts +8 -0
- package/dist/ai/ui/chat/Root.js +22 -0
- package/dist/ai/ui/chat/chatInput/File.js +72 -0
- package/dist/ai/ui/chat/chatInput/FileIcon.js +43 -0
- package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.js +4 -1
- package/dist/ai/ui/chat/chatInput/Root.d.ts +9 -0
- package/dist/ai/ui/chat/chatInput/Root.js +25 -0
- package/dist/ai/ui/chat/chatInput/Submit.js +24 -0
- package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.js +10 -8
- package/dist/ai/ui/{promptInput → chat/chatInput}/index.d.ts +2 -3
- package/dist/ai/ui/{promptInput → chat/chatInput}/index.js +2 -2
- package/dist/ai/ui/chat/chatInput/store.d.ts +13 -0
- package/dist/ai/ui/chat/chatInput/store.js +40 -0
- package/dist/ai/ui/chat/index.d.ts +13 -0
- package/dist/ai/ui/{conversation → chat}/index.js +5 -3
- package/dist/ai/ui/chat/store/index.d.ts +2 -0
- package/dist/ai/ui/chat/store/index.js +2 -0
- package/dist/ai/ui/chat/store/messages.d.ts +17 -0
- package/dist/ai/ui/chat/store/messages.js +78 -0
- package/dist/ai/ui/chat/store/states.d.ts +11 -0
- package/dist/ai/ui/chat/store/states.js +17 -0
- package/dist/ai/ui/index.d.ts +1 -0
- package/dist/ai/ui/index.js +1 -0
- package/dist/ai/utils/index.d.ts +2 -0
- package/dist/ai/utils/index.js +2 -0
- package/dist/app/defaultTheme.d.ts +1 -1
- package/dist/app/index.d.ts +1 -0
- package/dist/app/index.js +1 -0
- package/dist/functions/index.d.ts +3 -1
- package/dist/functions/index.js +4 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.js +1 -6
- package/dist/styles.css +3 -3
- package/dist/ui/AnimatedChevron.d.ts +2 -2
- package/dist/ui/AnimatedChevron.js +7 -25
- package/dist/ui/editor/Toolbar.js +4 -22
- package/dist/ui/error/index.d.ts +4 -4
- package/dist/ui/error/index.js +5 -4
- package/dist/ui/form/buttons/CancelButton.js +4 -26
- package/dist/ui/form/buttons/SubmitButton.js +4 -29
- package/dist/ui/form/fields/TextPassowrdField.js +4 -26
- package/dist/ui/form/index.d.ts +2 -2
- package/dist/ui/form/index.js +3 -3
- package/dist/ui/hoverPaper/index.d.ts +2 -2
- package/dist/ui/hoverPaper/index.js +3 -2
- package/dist/ui/scrollArea/ScrollArea.d.ts +1 -1
- package/dist/ui/scrollArea/ScrollAreaButton.d.ts +1 -1
- package/dist/ui/scrollArea/ScrollAreaButton.js +7 -28
- package/package.json +29 -22
- package/dist/ai/ui/conversation/ConversationContext.d.ts +0 -7
- package/dist/ai/ui/conversation/ConversationContext.js +0 -8
- package/dist/ai/ui/conversation/ConversationProvider.d.ts +0 -2
- package/dist/ai/ui/conversation/ConversationProvider.js +0 -14
- package/dist/ai/ui/conversation/File.d.ts +0 -4
- package/dist/ai/ui/conversation/FileIcon.js +0 -225
- package/dist/ai/ui/conversation/Message.d.ts +0 -4
- package/dist/ai/ui/conversation/Message.js +0 -25
- package/dist/ai/ui/conversation/Root.d.ts +0 -2
- package/dist/ai/ui/conversation/Root.js +0 -26
- package/dist/ai/ui/conversation/index.d.ts +0 -13
- package/dist/ai/ui/conversation/types.d.ts +0 -7
- package/dist/ai/ui/conversation/types.js +0 -0
- package/dist/ai/ui/conversation/useChatMessage.d.ts +0 -2
- package/dist/ai/ui/conversation/useChatMessage.js +0 -12
- package/dist/ai/ui/promptInput/File.js +0 -117
- package/dist/ai/ui/promptInput/FileIcon.js +0 -225
- package/dist/ai/ui/promptInput/PromptInputContext.d.ts +0 -12
- package/dist/ai/ui/promptInput/PromptInputContext.js +0 -8
- package/dist/ai/ui/promptInput/PromptInputProvider.d.ts +0 -2
- package/dist/ai/ui/promptInput/PromptInputProvider.js +0 -50
- package/dist/ai/ui/promptInput/Root.d.ts +0 -3
- package/dist/ai/ui/promptInput/Root.js +0 -17
- package/dist/ai/ui/promptInput/Submit.js +0 -40
- package/dist/ai/ui/promptInput/types.d.ts +0 -11
- package/dist/ai/ui/promptInput/types.js +0 -0
- package/dist/functions/cookies/index.d.ts +0 -3
- package/dist/functions/cookies/index.js +0 -3
- package/dist/surreal/connection.d.ts +0 -9
- package/dist/surreal/connection.js +0 -49
- package/dist/surreal/deafaultCrud.d.ts +0 -2
- package/dist/surreal/deafaultCrud.js +0 -18
- package/dist/surreal/deserialize.d.ts +0 -17
- package/dist/surreal/deserialize.js +0 -46
- package/dist/surreal/encryption.d.ts +0 -6
- package/dist/surreal/encryption.js +0 -30
- package/dist/surreal/index.d.ts +0 -4
- package/dist/surreal/index.js +0 -5
- package/dist/ui/editor/styles.module.js +0 -7
- package/dist/ui/editor/styles_module.css +0 -16
- /package/dist/ai/ui/{conversation → chat}/Empty.d.ts +0 -0
- /package/dist/ai/ui/{conversation → chat}/FileIcon.d.ts +0 -0
- /package/dist/ai/ui/{conversation → chat}/Loader.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/File.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/FileIcon.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Submit.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.d.ts +0 -0
- /package/dist/functions/{cookies/getCookie.d.ts → getCookie.d.ts} +0 -0
- /package/dist/functions/{cookies/getCookie.js → getCookie.js} +0 -0
- /package/dist/functions/{cookies/setCookie.d.ts → setCookie.d.ts} +0 -0
- /package/dist/functions/{cookies/setCookie.js → setCookie.js} +0 -0
- /package/dist/functions/{cookies/setCookies.d.ts → setCookies.d.ts} +0 -0
- /package/dist/functions/{cookies/setCookies.js → setCookies.js} +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useChat } from "@ai-sdk/react";
|
|
2
|
+
import { notifications } from "@mantine/notifications";
|
|
3
|
+
import { useStore } from "@nanostores/react";
|
|
4
|
+
import { atom, computed, map } from "nanostores";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import { setChatError, setChatStatus } from "./states.js";
|
|
7
|
+
const $chatMessageIds = atom([]);
|
|
8
|
+
const $chatMessages = map({});
|
|
9
|
+
const getChatMessage = (messageId)=>$chatMessages.get()[messageId];
|
|
10
|
+
const getChatMessages = ()=>$chatMessageIds.get().map((id)=>$chatMessages.get()[id]);
|
|
11
|
+
const setChatMessages = (messages)=>{
|
|
12
|
+
$chatMessageIds.set(messages.map((msg)=>msg.id));
|
|
13
|
+
const messagesMap = {};
|
|
14
|
+
for (const msg of messages)messagesMap[msg.id] = msg;
|
|
15
|
+
$chatMessages.set(messagesMap);
|
|
16
|
+
};
|
|
17
|
+
const $isEmpty = computed($chatMessageIds, (messages)=>0 === messages.length);
|
|
18
|
+
const getIsEmpty = ()=>$isEmpty.get();
|
|
19
|
+
const useIsEmpty = ()=>useStore($isEmpty);
|
|
20
|
+
const useChatMessageIds = (props)=>{
|
|
21
|
+
const { messages, status, error, sendMessage } = useChat({
|
|
22
|
+
onError: (e)=>{
|
|
23
|
+
notifications.show({
|
|
24
|
+
title: 'Ошибка сервера ИИ',
|
|
25
|
+
message: e.message,
|
|
26
|
+
color: 'red',
|
|
27
|
+
autoClose: false
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
useEffect(()=>{
|
|
33
|
+
setChatStatus(status);
|
|
34
|
+
}, [
|
|
35
|
+
status
|
|
36
|
+
]);
|
|
37
|
+
useEffect(()=>{
|
|
38
|
+
setChatError(error?.message);
|
|
39
|
+
}, [
|
|
40
|
+
error?.message
|
|
41
|
+
]);
|
|
42
|
+
useEffect(()=>{
|
|
43
|
+
setChatSendMessage(sendMessage);
|
|
44
|
+
}, [
|
|
45
|
+
sendMessage
|
|
46
|
+
]);
|
|
47
|
+
useEffect(()=>{
|
|
48
|
+
setChatMessages(messages);
|
|
49
|
+
}, [
|
|
50
|
+
messages
|
|
51
|
+
]);
|
|
52
|
+
return useStore($chatMessageIds);
|
|
53
|
+
};
|
|
54
|
+
const useChatMessage = (messageId)=>useStore($chatMessages, {
|
|
55
|
+
keys: [
|
|
56
|
+
messageId
|
|
57
|
+
]
|
|
58
|
+
})[messageId];
|
|
59
|
+
const useChatMessagePart = (messageId, type)=>{
|
|
60
|
+
const message = useChatMessage(messageId);
|
|
61
|
+
const part = message?.parts?.find((i)=>i.type === type);
|
|
62
|
+
return part;
|
|
63
|
+
};
|
|
64
|
+
const $chatSendMessage = atom();
|
|
65
|
+
const getChatSendMessage = ()=>$chatSendMessage.get();
|
|
66
|
+
const setChatSendMessage = (sendMessage)=>$chatSendMessage.set(sendMessage);
|
|
67
|
+
const messages_sendMessage = async ({ text, file }, data)=>{
|
|
68
|
+
const files = file ? [
|
|
69
|
+
file
|
|
70
|
+
] : [];
|
|
71
|
+
await getChatSendMessage()?.({
|
|
72
|
+
text,
|
|
73
|
+
files
|
|
74
|
+
}, {
|
|
75
|
+
body: data
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
export { $chatMessageIds, $chatMessages, getChatMessage, getChatMessages, getIsEmpty, messages_sendMessage as sendMessage, setChatMessages, useChatMessage, useChatMessageIds, useChatMessagePart, useIsEmpty };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChatStatus } from 'ai';
|
|
2
|
+
export declare const getChatStatus: () => ChatStatus;
|
|
3
|
+
export declare const setChatStatus: (status: ChatStatus) => void;
|
|
4
|
+
export declare const useChatStatus: () => ChatStatus;
|
|
5
|
+
export declare const getIsLoading: () => boolean;
|
|
6
|
+
export declare const useIsLoading: () => boolean;
|
|
7
|
+
export declare const getIsStreaming: () => boolean;
|
|
8
|
+
export declare const useIsStreaming: () => boolean;
|
|
9
|
+
export declare const getChatError: () => string | undefined;
|
|
10
|
+
export declare const setChatError: (error: string | undefined) => void;
|
|
11
|
+
export declare const useChatError: () => string | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useStore } from "@nanostores/react";
|
|
2
|
+
import { atom, computed } from "nanostores";
|
|
3
|
+
const $chatStatus = atom('ready');
|
|
4
|
+
const getChatStatus = ()=>$chatStatus.get();
|
|
5
|
+
const setChatStatus = (status)=>$chatStatus.set(status);
|
|
6
|
+
const useChatStatus = ()=>useStore($chatStatus);
|
|
7
|
+
const $isLoading = computed($chatStatus, (status)=>'ready' !== status);
|
|
8
|
+
const getIsLoading = ()=>$isLoading.get();
|
|
9
|
+
const useIsLoading = ()=>useStore($isLoading);
|
|
10
|
+
const $isStreaming = computed($chatStatus, (status)=>'streaming' === status);
|
|
11
|
+
const getIsStreaming = ()=>$isStreaming.get();
|
|
12
|
+
const useIsStreaming = ()=>useStore($isStreaming);
|
|
13
|
+
const $chatError = atom();
|
|
14
|
+
const getChatError = ()=>$chatError.get();
|
|
15
|
+
const setChatError = (error)=>$chatError.set(error);
|
|
16
|
+
const useChatError = ()=>useStore($chatError);
|
|
17
|
+
export { getChatError, getChatStatus, getIsLoading, getIsStreaming, setChatError, setChatStatus, useChatError, useChatStatus, useIsLoading, useIsStreaming };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './chat';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./chat/index.js";
|
|
@@ -6,9 +6,9 @@ export declare const defaultTheme: {
|
|
|
6
6
|
black?: string | undefined;
|
|
7
7
|
colors?: {
|
|
8
8
|
[x: string & {}]: import("@mantine/core").MantineColorsTuple | undefined;
|
|
9
|
+
red?: import("@mantine/core").MantineColorsTuple | undefined;
|
|
9
10
|
dark?: import("@mantine/core").MantineColorsTuple | undefined;
|
|
10
11
|
gray?: import("@mantine/core").MantineColorsTuple | undefined;
|
|
11
|
-
red?: import("@mantine/core").MantineColorsTuple | undefined;
|
|
12
12
|
pink?: import("@mantine/core").MantineColorsTuple | undefined;
|
|
13
13
|
grape?: import("@mantine/core").MantineColorsTuple | undefined;
|
|
14
14
|
violet?: import("@mantine/core").MantineColorsTuple | undefined;
|
package/dist/app/index.d.ts
CHANGED
package/dist/app/index.js
CHANGED
package/dist/functions/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { type Accept, PromptInput, type PromptInputProps, } from './ai/ui/promptInput';
|
|
3
|
-
export { convertFileUIPartBlobToDataURL } from './ai/utils/convertFileUIPartBlobToDataURL';
|
|
4
|
-
export { parseAiMessagePart } from './ai/utils/parseAiMessagePart';
|
|
1
|
+
export * from './ai';
|
|
5
2
|
export * from './app';
|
|
6
3
|
export * from './functions';
|
|
7
4
|
export * from './hooks';
|
|
8
|
-
export * from './surreal';
|
|
9
5
|
export * from './ui';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { PromptInput } from "./ai/ui/promptInput/index.js";
|
|
3
|
-
import { convertFileUIPartBlobToDataURL } from "./ai/utils/convertFileUIPartBlobToDataURL.js";
|
|
4
|
-
import { parseAiMessagePart } from "./ai/utils/parseAiMessagePart.js";
|
|
1
|
+
export * from "./ai/index.js";
|
|
5
2
|
export * from "./app/index.js";
|
|
6
3
|
export * from "./functions/index.js";
|
|
7
4
|
export * from "./hooks/index.js";
|
|
8
|
-
export * from "./surreal/index.js";
|
|
9
5
|
export * from "./ui/index.js";
|
|
10
|
-
export { Conversation, PromptInput, convertFileUIPartBlobToDataURL, parseAiMessagePart, useChatMessage };
|
package/dist/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.rolder-
|
|
1
|
+
.rolder-chat-input-root {
|
|
2
2
|
background-color: light-dark(var(--mantine-color-white), var(--mantine-color-dark-6));
|
|
3
3
|
|
|
4
4
|
&:focus-within {
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.rolder-
|
|
11
|
+
.rolder-chat-input-textarea {
|
|
12
12
|
border: 0;
|
|
13
13
|
border-radius: 8px;
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.rolder-
|
|
17
|
+
.rolder-chat-input-file-action-action {
|
|
18
18
|
color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1));
|
|
19
19
|
|
|
20
20
|
&[data-disabled] {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
interface Props extends
|
|
1
|
+
import { type IconProps } from '@tabler/icons-react';
|
|
2
|
+
interface Props extends IconProps {
|
|
3
3
|
expanded?: boolean;
|
|
4
4
|
}
|
|
5
5
|
export declare const AnimatedChevron: ({ expanded, style, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
viewBox: "0 0 24 24",
|
|
7
|
-
fill: "none",
|
|
8
|
-
stroke: "currentColor",
|
|
9
|
-
strokeWidth: "1.5",
|
|
10
|
-
strokeLinecap: "round",
|
|
11
|
-
strokeLinejoin: "round",
|
|
12
|
-
role: "img",
|
|
13
|
-
"aria-label": "Chevron",
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { IconChevronDown } from "@tabler/icons-react";
|
|
3
|
+
const AnimatedChevron = ({ expanded, style, ...props })=>/*#__PURE__*/ jsx(IconChevronDown, {
|
|
4
|
+
strokeWidth: 1.5,
|
|
5
|
+
"data-expanded": expanded,
|
|
14
6
|
style: {
|
|
15
7
|
transition: 'transform 0.2s ease-in-out',
|
|
16
|
-
transform: expanded ? 'rotate(
|
|
8
|
+
transform: expanded ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
17
9
|
...style
|
|
18
10
|
},
|
|
19
|
-
...props
|
|
20
|
-
children: [
|
|
21
|
-
/*#__PURE__*/ jsx("path", {
|
|
22
|
-
stroke: "none",
|
|
23
|
-
d: "M0 0h24v24H0z",
|
|
24
|
-
fill: "none"
|
|
25
|
-
}),
|
|
26
|
-
/*#__PURE__*/ jsx("path", {
|
|
27
|
-
d: "M6 9l6 6l6 -6"
|
|
28
|
-
})
|
|
29
|
-
]
|
|
11
|
+
...props
|
|
30
12
|
});
|
|
31
13
|
export { AnimatedChevron };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Loader } from "@mantine/core";
|
|
3
3
|
import { RichTextEditor } from "@mantine/tiptap";
|
|
4
|
+
import { IconCheck } from "@tabler/icons-react";
|
|
4
5
|
import { useEditor } from "./Provider.js";
|
|
5
6
|
const Toolbar = ({ saving, children })=>{
|
|
6
7
|
const { editor, disabledToolbar } = useEditor();
|
|
@@ -124,28 +125,9 @@ const Toolbar = ({ saving, children })=>{
|
|
|
124
125
|
},
|
|
125
126
|
children: saving ? /*#__PURE__*/ jsx(Loader, {
|
|
126
127
|
size: 14
|
|
127
|
-
}) : /*#__PURE__*/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
height: "16",
|
|
131
|
-
viewBox: "0 0 16 16",
|
|
132
|
-
fill: "none",
|
|
133
|
-
stroke: "currentColor",
|
|
134
|
-
strokeWidth: "1.5",
|
|
135
|
-
strokeLinecap: "round",
|
|
136
|
-
strokeLinejoin: "round",
|
|
137
|
-
role: "img",
|
|
138
|
-
"aria-label": "Saved",
|
|
139
|
-
children: [
|
|
140
|
-
/*#__PURE__*/ jsx("path", {
|
|
141
|
-
stroke: "none",
|
|
142
|
-
d: "M0 0h24v24H0z",
|
|
143
|
-
fill: "none"
|
|
144
|
-
}),
|
|
145
|
-
/*#__PURE__*/ jsx("path", {
|
|
146
|
-
d: "M5 12l5 5l10 -10"
|
|
147
|
-
})
|
|
148
|
-
]
|
|
128
|
+
}) : /*#__PURE__*/ jsx(IconCheck, {
|
|
129
|
+
stroke: 1.5,
|
|
130
|
+
size: 16
|
|
149
131
|
})
|
|
150
132
|
})
|
|
151
133
|
]
|
package/dist/ui/error/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export { DefaultError } from './DefaultError';
|
|
2
|
+
export { DefaultNotFound } from './DefaultNotFound';
|
|
3
|
+
export { defaultErrorNotification } from './defaultErrorNotification';
|
|
4
|
+
export { Forbidden } from './Forbidden';
|
package/dist/ui/error/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { DefaultError } from "./DefaultError.js";
|
|
2
|
+
import { DefaultNotFound } from "./DefaultNotFound.js";
|
|
3
|
+
import { defaultErrorNotification } from "./defaultErrorNotification.js";
|
|
4
|
+
import { Forbidden } from "./Forbidden.js";
|
|
5
|
+
export { DefaultError, DefaultNotFound, Forbidden, defaultErrorNotification };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from "@mantine/core";
|
|
3
|
+
import { IconCancel } from "@tabler/icons-react";
|
|
3
4
|
import { useFormContext } from "../context.js";
|
|
4
5
|
const CancelButton = (props)=>{
|
|
5
6
|
const form = useFormContext();
|
|
@@ -9,31 +10,8 @@ const CancelButton = (props)=>{
|
|
|
9
10
|
type: "reset",
|
|
10
11
|
size: "xs",
|
|
11
12
|
variant: "light",
|
|
12
|
-
leftSection: /*#__PURE__*/
|
|
13
|
-
|
|
14
|
-
width: "16",
|
|
15
|
-
height: "16",
|
|
16
|
-
viewBox: "0 0 16 16",
|
|
17
|
-
fill: "none",
|
|
18
|
-
stroke: "currentColor",
|
|
19
|
-
strokeWidth: "2",
|
|
20
|
-
strokeLinecap: "round",
|
|
21
|
-
strokeLinejoin: "round",
|
|
22
|
-
role: "img",
|
|
23
|
-
"aria-label": "Cancel",
|
|
24
|
-
children: [
|
|
25
|
-
/*#__PURE__*/ jsx("path", {
|
|
26
|
-
stroke: "none",
|
|
27
|
-
d: "M0 0h24v24H0z",
|
|
28
|
-
fill: "none"
|
|
29
|
-
}),
|
|
30
|
-
/*#__PURE__*/ jsx("path", {
|
|
31
|
-
d: "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"
|
|
32
|
-
}),
|
|
33
|
-
/*#__PURE__*/ jsx("path", {
|
|
34
|
-
d: "M18.364 5.636l-12.728 12.728"
|
|
35
|
-
})
|
|
36
|
-
]
|
|
13
|
+
leftSection: /*#__PURE__*/ jsx(IconCancel, {
|
|
14
|
+
size: 16
|
|
37
15
|
}),
|
|
38
16
|
disabled: isSubmitting,
|
|
39
17
|
...props,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from "@mantine/core";
|
|
3
|
+
import { IconDeviceFloppy } from "@tabler/icons-react";
|
|
3
4
|
import { useFormContext } from "../context.js";
|
|
4
5
|
const SubmitButton = (props)=>{
|
|
5
6
|
const form = useFormContext();
|
|
@@ -8,34 +9,8 @@ const SubmitButton = (props)=>{
|
|
|
8
9
|
children: (state)=>/*#__PURE__*/ jsx(Button, {
|
|
9
10
|
type: "submit",
|
|
10
11
|
size: "xs",
|
|
11
|
-
leftSection: /*#__PURE__*/
|
|
12
|
-
|
|
13
|
-
width: "20",
|
|
14
|
-
height: "20",
|
|
15
|
-
viewBox: "0 0 20 20",
|
|
16
|
-
fill: "none",
|
|
17
|
-
stroke: "currentColor",
|
|
18
|
-
strokeWidth: "2",
|
|
19
|
-
strokeLinecap: "round",
|
|
20
|
-
strokeLinejoin: "round",
|
|
21
|
-
role: "img",
|
|
22
|
-
"aria-label": "Submit",
|
|
23
|
-
children: [
|
|
24
|
-
/*#__PURE__*/ jsx("path", {
|
|
25
|
-
stroke: "none",
|
|
26
|
-
d: "M0 0h24v24H0z",
|
|
27
|
-
fill: "none"
|
|
28
|
-
}),
|
|
29
|
-
/*#__PURE__*/ jsx("path", {
|
|
30
|
-
d: "M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"
|
|
31
|
-
}),
|
|
32
|
-
/*#__PURE__*/ jsx("path", {
|
|
33
|
-
d: "M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"
|
|
34
|
-
}),
|
|
35
|
-
/*#__PURE__*/ jsx("path", {
|
|
36
|
-
d: "M14 4l0 4l-6 0l0 -4"
|
|
37
|
-
})
|
|
38
|
-
]
|
|
12
|
+
leftSection: /*#__PURE__*/ jsx(IconDeviceFloppy, {
|
|
13
|
+
size: 20
|
|
39
14
|
}),
|
|
40
15
|
loading: state.isSubmitting,
|
|
41
16
|
disabled: !state.isDirty,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ActionIcon, TextInput } from "@mantine/core";
|
|
3
|
+
import { IconRefresh } from "@tabler/icons-react";
|
|
3
4
|
import omgopass from "omgopass";
|
|
4
5
|
import { useFieldContext } from "../context.js";
|
|
5
6
|
const TextPassowrdField = (props)=>{
|
|
@@ -13,31 +14,8 @@ const TextPassowrdField = (props)=>{
|
|
|
13
14
|
minSyllableLength: 2,
|
|
14
15
|
maxSyllableLength: 2
|
|
15
16
|
})),
|
|
16
|
-
children: /*#__PURE__*/
|
|
17
|
-
|
|
18
|
-
width: "16",
|
|
19
|
-
height: "16",
|
|
20
|
-
viewBox: "0 0 16 16",
|
|
21
|
-
fill: "none",
|
|
22
|
-
stroke: "currentColor",
|
|
23
|
-
"stroke-width": "2",
|
|
24
|
-
"stroke-linecap": "round",
|
|
25
|
-
"stroke-linejoin": "round",
|
|
26
|
-
role: "img",
|
|
27
|
-
"aria-label": "Refresh",
|
|
28
|
-
children: [
|
|
29
|
-
/*#__PURE__*/ jsx("path", {
|
|
30
|
-
stroke: "none",
|
|
31
|
-
d: "M0 0h24v24H0z",
|
|
32
|
-
fill: "none"
|
|
33
|
-
}),
|
|
34
|
-
/*#__PURE__*/ jsx("path", {
|
|
35
|
-
d: "M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"
|
|
36
|
-
}),
|
|
37
|
-
/*#__PURE__*/ jsx("path", {
|
|
38
|
-
d: "M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"
|
|
39
|
-
})
|
|
40
|
-
]
|
|
17
|
+
children: /*#__PURE__*/ jsx(IconRefresh, {
|
|
18
|
+
size: 16
|
|
41
19
|
})
|
|
42
20
|
}),
|
|
43
21
|
name: field.name,
|
package/dist/ui/form/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { blurOnError } from './blurOnError';
|
|
2
2
|
export { useAppForm, useFieldContext, withForm } from './context';
|
|
3
|
-
export
|
|
3
|
+
export { fieldsSchema } from './fieldsSchema';
|
package/dist/ui/form/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { blurOnError } from "./blurOnError.js";
|
|
1
2
|
import { useAppForm, useFieldContext, withForm } from "./context.js";
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export { useAppForm, useFieldContext, withForm };
|
|
3
|
+
import { fieldsSchema } from "./fieldsSchema.js";
|
|
4
|
+
export { blurOnError, fieldsSchema, useAppForm, useFieldContext, withForm };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { HoverPaper } from './HoverPaper';
|
|
2
|
+
export { usePaperHover } from './usePaperHover';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { HoverPaper } from "./HoverPaper.js";
|
|
2
|
+
import { usePaperHover } from "./usePaperHover.js";
|
|
3
|
+
export { HoverPaper, usePaperHover };
|
|
@@ -55,7 +55,7 @@ export declare const ScrollArea: {
|
|
|
55
55
|
displayName: string;
|
|
56
56
|
} & {
|
|
57
57
|
ScrollButton: {
|
|
58
|
-
({ className }: import("./types").ScrollButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
58
|
+
({ className, upIcon, downIcon, }: import("./types").ScrollButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
59
59
|
displayName: string;
|
|
60
60
|
};
|
|
61
61
|
Provider: import("react").Provider<ScrollAreaContextValue | null>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ScrollButtonProps } from './types';
|
|
2
2
|
export declare const ScrollAreaButton: {
|
|
3
|
-
({ className }: ScrollButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
({ className, upIcon, downIcon, }: ScrollButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -1,36 +1,15 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ActionIcon } from "@mantine/core";
|
|
3
|
+
import { IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
3
4
|
import { useScrollArea } from "./context.js";
|
|
4
|
-
const ScrollAreaButton = ({ className })=>{
|
|
5
|
+
const ScrollAreaButton = ({ className, upIcon, downIcon })=>{
|
|
5
6
|
const { hasScrollableContent, isAboveCenter, scrollToTop, scrollToBottom } = useScrollArea();
|
|
6
7
|
if (!hasScrollableContent) return null;
|
|
7
8
|
const isScrollingDown = isAboveCenter;
|
|
8
|
-
const icon = /*#__PURE__*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
viewBox: "0 0 24 24",
|
|
13
|
-
fill: "none",
|
|
14
|
-
stroke: "currentColor",
|
|
15
|
-
strokeWidth: "1.5",
|
|
16
|
-
strokeLinecap: "round",
|
|
17
|
-
strokeLinejoin: "round",
|
|
18
|
-
role: "img",
|
|
19
|
-
"aria-label": "Chevron",
|
|
20
|
-
style: {
|
|
21
|
-
transition: 'transform 0.2s ease-in-out',
|
|
22
|
-
transform: isScrollingDown ? 'rotate(-180deg)' : 'rotate(0deg)'
|
|
23
|
-
},
|
|
24
|
-
children: [
|
|
25
|
-
/*#__PURE__*/ jsx("path", {
|
|
26
|
-
stroke: "none",
|
|
27
|
-
d: "M0 0h24v24H0z",
|
|
28
|
-
fill: "none"
|
|
29
|
-
}),
|
|
30
|
-
/*#__PURE__*/ jsx("path", {
|
|
31
|
-
d: "M6 9l6 6l6 -6"
|
|
32
|
-
})
|
|
33
|
-
]
|
|
9
|
+
const icon = isScrollingDown ? downIcon ?? /*#__PURE__*/ jsx(IconChevronDown, {
|
|
10
|
+
strokeWidth: 1.5
|
|
11
|
+
}) : upIcon ?? /*#__PURE__*/ jsx(IconChevronUp, {
|
|
12
|
+
strokeWidth: 1.5
|
|
34
13
|
});
|
|
35
14
|
const handleClick = ()=>{
|
|
36
15
|
if (isScrollingDown) scrollToBottom();
|
package/package.json
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolder/kit",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"import": "./dist/index.js"
|
|
9
|
-
}
|
|
9
|
+
},
|
|
10
|
+
"./styles.css": "./dist/styles.css"
|
|
10
11
|
},
|
|
12
|
+
"sideEffects": false,
|
|
11
13
|
"files": [
|
|
12
14
|
"dist"
|
|
13
15
|
],
|
|
14
16
|
"scripts": {
|
|
15
17
|
"build": "rslib build",
|
|
16
18
|
"dev": "rslib build --watch",
|
|
17
|
-
"
|
|
19
|
+
"prepublishOnly": "bun run build",
|
|
20
|
+
"check": "biome check --write && tsgo --noEmit"
|
|
18
21
|
},
|
|
19
22
|
"devDependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@rsbuild/plugin-react": "^1.4.2",
|
|
23
|
+
"@rsbuild/plugin-react": "^1.4.3",
|
|
22
24
|
"@rslib/core": "^0.19.2",
|
|
23
|
-
"@types/bun": "^1.3.
|
|
25
|
+
"@types/bun": "^1.3.6",
|
|
24
26
|
"@types/js-cookie": "^3.0.6",
|
|
25
27
|
"@types/omgopass": "^3.2.3",
|
|
26
28
|
"@types/react": "^19.2.8",
|
|
27
|
-
"
|
|
28
|
-
"typescript": "^5.9.3"
|
|
29
|
-
"@tabler/icons": "^3.36.1"
|
|
29
|
+
"@typescript/native-preview": "^7.0.0-dev.20260115.1",
|
|
30
|
+
"typescript": "^5.9.3"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
32
|
-
"react": "
|
|
33
|
-
"react-dom": "
|
|
33
|
+
"react": "^19.2.3",
|
|
34
|
+
"react-dom": "^19.2.3",
|
|
34
35
|
"clsx": "^2.1.1",
|
|
36
|
+
"@tiptap/react": "^3.15.3",
|
|
35
37
|
"@tiptap/extension-highlight": "^3.15.3",
|
|
36
38
|
"@tiptap/extension-placeholder": "^3.15.3",
|
|
37
39
|
"@tiptap/extension-table": "^3.15.3",
|
|
@@ -43,25 +45,30 @@
|
|
|
43
45
|
"@codemirror/lint": "^6.9.2",
|
|
44
46
|
"@uiw/codemirror-theme-vscode": "^4.25.4",
|
|
45
47
|
"@uiw/react-codemirror": "^4.25.4",
|
|
46
|
-
"@mantine/core": "^8.3.
|
|
47
|
-
"@mantine/hooks": "^8.3.
|
|
48
|
-
"@mantine/tiptap": "^8.3.
|
|
49
|
-
"@mantine/notifications": "^8.3.
|
|
50
|
-
"@tanstack/react-router": "1.
|
|
51
|
-
"@tanstack/react-form": "1.27.7",
|
|
52
|
-
"@tanstack/react-start": "^1.
|
|
53
|
-
"@tanstack/react-query": "^5.90.
|
|
54
|
-
"@tanstack/react-router-ssr-query": "^1.
|
|
48
|
+
"@mantine/core": "^8.3.12",
|
|
49
|
+
"@mantine/hooks": "^8.3.12",
|
|
50
|
+
"@mantine/tiptap": "^8.3.12",
|
|
51
|
+
"@mantine/notifications": "^8.3.12",
|
|
52
|
+
"@tanstack/react-router": "^1.150.0",
|
|
53
|
+
"@tanstack/react-form": "^1.27.7",
|
|
54
|
+
"@tanstack/react-start": "^1.150.0",
|
|
55
|
+
"@tanstack/react-query": "^5.90.17",
|
|
56
|
+
"@tanstack/react-router-ssr-query": "^1.150.0",
|
|
55
57
|
"zod": "^4.3.5",
|
|
56
58
|
"js-cookie": "^3.0.5",
|
|
57
59
|
"nanostores": "^1.1.0",
|
|
60
|
+
"@nanostores/react": "^1.0.0",
|
|
58
61
|
"surrealdb": "^2.0.0-alpha.16",
|
|
59
62
|
"omgopass": "^3.2.1",
|
|
60
|
-
"ai": "^6.0.
|
|
63
|
+
"ai": "^6.0.37",
|
|
64
|
+
"@ai-sdk/react": "^3.0.39",
|
|
61
65
|
"streamdown": "^2.0.1"
|
|
62
66
|
},
|
|
63
67
|
"trustedDependencies": [
|
|
64
68
|
"core-js",
|
|
65
69
|
"esbuild"
|
|
66
|
-
]
|
|
70
|
+
],
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"@tabler/icons-react": "^3.36.1"
|
|
73
|
+
}
|
|
67
74
|
}
|