@rolder/kit 3.0.0-alpha.11 → 3.0.0-alpha.112
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/chat/Root.d.ts +55 -0
- package/dist/ai/ui/chat/Root.js +18 -0
- package/dist/ai/ui/chat/chatInput/File.js +71 -0
- package/dist/ai/ui/chat/chatInput/FileIcon.js +43 -0
- package/dist/ai/ui/chat/chatInput/Root.d.ts +9 -0
- package/dist/ai/ui/chat/chatInput/Root.js +24 -0
- package/dist/ai/ui/chat/chatInput/Submit.js +23 -0
- package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.js +8 -7
- 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/file.d.ts +8 -0
- package/dist/ai/ui/chat/chatInput/store/file.js +32 -0
- package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.js +21 -0
- package/dist/ai/ui/chat/chatInput/store/index.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/store/index.js +2 -0
- package/dist/ai/ui/chat/chatInput/store/input.d.ts +13 -0
- package/dist/ai/ui/chat/chatInput/store/input.js +81 -0
- package/dist/ai/ui/chat/chatInput/store/parseFile.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/store/parseFile.js +23 -0
- package/dist/ai/ui/chat/index.d.ts +12 -0
- package/dist/ai/ui/chat/index.js +15 -0
- package/dist/ai/ui/chat/messages/Empty.d.ts +4 -0
- package/dist/ai/ui/chat/messages/Empty.js +11 -0
- package/dist/ai/ui/chat/messages/Loader.d.ts +5 -0
- package/dist/ai/ui/chat/messages/Loader.js +12 -0
- package/dist/ai/ui/chat/messages/Message.d.ts +8 -0
- package/dist/ai/ui/chat/messages/Message.js +22 -0
- package/dist/ai/ui/chat/messages/Messages.d.ts +3 -0
- package/dist/ai/ui/chat/messages/Messages.js +40 -0
- package/dist/ai/ui/chat/messages/index.d.ts +2 -0
- package/dist/ai/ui/chat/messages/index.js +2 -0
- package/dist/ai/ui/chat/parts/File.d.ts +6 -0
- package/dist/ai/ui/{conversation → chat/parts}/File.js +10 -10
- package/dist/ai/ui/chat/parts/FileIcon.js +43 -0
- package/dist/ai/ui/chat/parts/PartPaper.d.ts +8 -0
- package/dist/ai/ui/chat/parts/PartPaper.js +14 -0
- package/dist/ai/ui/chat/parts/TextPart.d.ts +6 -0
- package/dist/ai/ui/chat/parts/TextPart.js +15 -0
- package/dist/ai/ui/chat/parts/ToolExecution.d.ts +7 -0
- package/dist/ai/ui/chat/parts/ToolExecution.js +56 -0
- package/dist/ai/ui/chat/parts/ToolPart.d.ts +10 -0
- package/dist/ai/ui/chat/parts/ToolPart.js +24 -0
- package/dist/ai/ui/chat/parts/index.d.ts +3 -0
- package/dist/ai/ui/chat/parts/index.js +3 -0
- package/dist/ai/ui/chat/store/index.d.ts +4 -0
- package/dist/ai/ui/chat/store/index.js +4 -0
- package/dist/ai/ui/chat/store/messages.d.ts +12 -0
- package/dist/ai/ui/chat/store/messages.js +40 -0
- package/dist/ai/ui/chat/store/send.d.ts +14 -0
- package/dist/ai/ui/chat/store/send.js +16 -0
- package/dist/ai/ui/chat/store/states.d.ts +11 -0
- package/dist/ai/ui/chat/store/states.js +20 -0
- package/dist/ai/ui/chat/store/useInitChat.d.ts +3 -0
- package/dist/ai/ui/chat/store/useInitChat.js +40 -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/AppDefaults.js +1 -1
- package/dist/app/DefaultApp.js +1 -1
- package/dist/app/cookieColorSchemeManager.js +1 -1
- package/dist/app/defaultTheme.d.ts +7 -7
- package/dist/app/index.d.ts +3 -0
- package/dist/app/index.js +3 -0
- package/dist/betterAuth/client/getAuthClient.d.ts +3050 -0
- package/dist/betterAuth/client/getAuthClient.js +18 -0
- package/dist/betterAuth/client/index.d.ts +1 -0
- package/dist/betterAuth/client/index.js +1 -0
- package/dist/betterAuth/index.d.ts +3 -0
- package/dist/betterAuth/index.js +3 -0
- package/dist/betterAuth/server/defaultAuthServerConfig.d.ts +452 -0
- package/dist/betterAuth/server/defaultAuthServerConfig.js +49 -0
- package/dist/betterAuth/server/env.d.ts +1 -0
- package/dist/betterAuth/server/env.js +8 -0
- package/dist/betterAuth/server/getDBSession.d.ts +2 -0
- package/dist/betterAuth/server/getDBSession.js +85 -0
- package/dist/betterAuth/server/getSessionToken.d.ts +1 -0
- package/dist/betterAuth/server/getSessionToken.js +14 -0
- package/dist/betterAuth/server/getSessionUser.d.ts +1 -0
- package/dist/betterAuth/server/getSessionUser.js +22 -0
- package/dist/betterAuth/server/index.d.ts +10 -0
- package/dist/betterAuth/server/index.js +11 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.d.ts +8 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.js +64 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.test.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.test.js +84 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/getDB.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/getDB.js +26 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/index.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/index.js +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/schema.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/schema.js +97 -0
- package/dist/betterAuth/server/surrealDbAdapter/index.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/index.js +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/count.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/count.js +17 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/create.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/create.js +21 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/delete.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/delete.js +18 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.js +19 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.js +51 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.js +42 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/index.d.ts +8 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/index.js +8 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/types.d.ts +56 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/update.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/update.js +25 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.js +21 -0
- package/dist/betterAuth/server/surrealDbAdapter/types.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.js +31 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.d.ts +3 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.js +58 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.d.ts +9 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.js +46 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.js +5 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/index.d.ts +6 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/index.js +6 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.js +43 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.js +38 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.js +33 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/types.d.ts +34 -0
- package/dist/betterAuth/server/types.d.ts +8 -0
- package/dist/betterAuth/useSessionUser.d.ts +1 -0
- package/dist/betterAuth/useSessionUser.js +8 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/styles.css +3 -8
- package/dist/surrealDB/deafaultCrud.d.ts +2 -0
- package/dist/{surreal → surrealDB}/deafaultCrud.js +6 -5
- package/dist/surrealDB/getDBInstance.d.ts +3 -0
- package/dist/surrealDB/getDBInstance.js +34 -0
- package/dist/surrealDB/getDBInstanceTanstack.d.ts +3 -0
- package/dist/{surreal/connection.js → surrealDB/getDBInstanceTanstack.js} +2 -2
- package/dist/surrealDB/index.d.ts +6 -0
- package/dist/surrealDB/index.js +6 -0
- package/dist/{surreal/connection.d.ts → surrealDB/types.d.ts} +3 -3
- package/dist/surrealDB/types.js +0 -0
- package/dist/tanstack/cookie/index.d.ts +3 -0
- package/dist/tanstack/cookie/index.js +4 -0
- package/dist/{functions → tanstack/cookie}/setCookie.d.ts +1 -1
- package/dist/tanstack/index.d.ts +3 -0
- package/dist/tanstack/index.js +3 -0
- package/dist/tanstack/middlewares/index.d.ts +6 -0
- package/dist/tanstack/middlewares/index.js +5 -0
- package/dist/tanstack/middlewares/locale.d.ts +4 -0
- package/dist/{app/defaultRequestMiddlewares.js → tanstack/middlewares/locale.js} +2 -5
- package/dist/tanstack/s3/getS3Client.d.ts +2 -0
- package/dist/tanstack/s3/getS3Client.js +18 -0
- package/dist/tanstack/s3/getSignedFileUrlFn.d.ts +4 -0
- package/dist/tanstack/s3/getSignedFileUrlFn.js +21 -0
- package/dist/tanstack/s3/index.d.ts +2 -0
- package/dist/tanstack/s3/index.js +2 -0
- package/dist/tanstack/s3/uploadRequest.d.ts +3 -0
- package/dist/tanstack/s3/uploadRequest.js +21 -0
- package/dist/ui/AnimatedChevron.d.ts +3 -4
- package/dist/ui/AnimatedChevron.js +6 -25
- package/dist/ui/JsonInput.d.ts +1 -1
- package/dist/ui/JsonInput.js +1 -1
- package/dist/ui/editor/Content.d.ts +2 -2
- package/dist/ui/editor/Content.js +2 -2
- package/dist/ui/editor/Root.d.ts +7 -1
- package/dist/ui/editor/Root.js +42 -5
- package/dist/ui/editor/Toolbar.d.ts +3 -2
- package/dist/ui/editor/Toolbar.js +7 -25
- package/dist/ui/editor/index.d.ts +5 -9
- package/dist/ui/editor/index.js +3 -4
- package/dist/ui/editor/store.d.ts +6 -0
- package/dist/ui/editor/store.js +10 -0
- package/dist/ui/error/DefaultError.d.ts +1 -1
- package/dist/ui/error/DefaultNotFound.d.ts +1 -1
- package/dist/ui/error/Forbidden.d.ts +1 -1
- package/dist/ui/form/buttons/CancelButton.d.ts +2 -2
- package/dist/ui/form/buttons/CancelButton.js +4 -26
- package/dist/ui/form/buttons/SubmitButton.d.ts +2 -2
- package/dist/ui/form/buttons/SubmitButton.js +4 -29
- package/dist/ui/form/buttons/SubscribeActionIcon.d.ts +2 -2
- package/dist/ui/form/buttons/SubscribeButton.d.ts +2 -2
- package/dist/ui/form/context.d.ts +55 -55
- package/dist/ui/form/context.js +3 -3
- package/dist/ui/form/fields/JsonField.d.ts +1 -1
- package/dist/ui/form/fields/MultiSelectField.d.ts +1 -1
- package/dist/ui/form/fields/NumberField.d.ts +1 -1
- package/dist/ui/form/fields/PasswordField.d.ts +2 -0
- package/dist/ui/form/fields/{PassowrdField.js → PasswordField.js} +2 -2
- package/dist/ui/form/fields/SelectField.d.ts +1 -1
- package/dist/ui/form/fields/SwitchField.d.ts +1 -1
- package/dist/ui/form/fields/TextField.d.ts +1 -1
- package/dist/ui/form/fields/TextPasswordField.d.ts +2 -0
- package/dist/ui/form/fields/TextPasswordField.js +29 -0
- package/dist/ui/form/fields/TextareaField.d.ts +1 -1
- package/dist/ui/form/fields/index.d.ts +2 -2
- package/dist/ui/form/fields/index.js +2 -2
- package/dist/ui/form/index.d.ts +0 -1
- package/dist/ui/form/index.js +1 -2
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.js +9 -0
- package/dist/ui/saveInput/JsonInput.d.ts +2 -2
- package/dist/ui/saveInput/NumberInput.d.ts +2 -2
- package/dist/ui/saveInput/SaveInput.d.ts +14 -14
- package/dist/ui/saveInput/Select.d.ts +2 -2
- package/dist/ui/saveInput/Switch.d.ts +2 -2
- package/dist/ui/saveInput/TextInput.d.ts +2 -2
- package/dist/ui/saveInput/Textarea.d.ts +2 -2
- package/dist/ui/scrollArea/Root.d.ts +7 -0
- package/dist/ui/scrollArea/Root.js +42 -0
- package/dist/ui/scrollArea/ScrollButton.d.ts +7 -0
- package/dist/ui/scrollArea/ScrollButton.js +30 -0
- package/dist/ui/scrollArea/index.d.ts +6 -3
- package/dist/ui/scrollArea/index.js +7 -3
- package/dist/ui/scrollArea/methods.d.ts +4 -0
- package/dist/ui/scrollArea/methods.js +32 -0
- package/dist/ui/scrollArea/store.d.ts +12 -0
- package/dist/ui/scrollArea/store.js +25 -0
- package/dist/{ui/form/fieldsSchema.d.ts → zodSchemas.d.ts} +1 -1
- package/dist/{ui/form/fieldsSchema.js → zodSchemas.js} +2 -2
- package/package.json +103 -71
- 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/Empty.d.ts +0 -1
- package/dist/ai/ui/conversation/Empty.js +0 -21
- package/dist/ai/ui/conversation/File.d.ts +0 -4
- package/dist/ai/ui/conversation/FileIcon.js +0 -225
- package/dist/ai/ui/conversation/Loader.d.ts +0 -2
- package/dist/ai/ui/conversation/Loader.js +0 -12
- 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/index.js +0 -14
- package/dist/ai/ui/conversation/types.d.ts +0 -7
- 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/app/defaultRequestMiddlewares.d.ts +0 -4
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -26
- package/dist/surreal/deafaultCrud.d.ts +0 -2
- package/dist/ui/editor/Provider.d.ts +0 -17
- package/dist/ui/editor/Provider.js +0 -80
- package/dist/ui/editor/types.d.ts +0 -7
- package/dist/ui/form/fields/PassowrdField.d.ts +0 -2
- package/dist/ui/form/fields/TextPassowrdField.d.ts +0 -2
- package/dist/ui/form/fields/TextPassowrdField.js +0 -51
- package/dist/ui/scrollArea/ScrollArea.d.ts +0 -62
- package/dist/ui/scrollArea/ScrollArea.js +0 -30
- package/dist/ui/scrollArea/ScrollAreaButton.d.ts +0 -5
- package/dist/ui/scrollArea/ScrollAreaButton.js +0 -51
- package/dist/ui/scrollArea/ScrollAreaContent.d.ts +0 -6
- package/dist/ui/scrollArea/ScrollAreaContent.js +0 -29
- package/dist/ui/scrollArea/context.d.ts +0 -28
- package/dist/ui/scrollArea/context.js +0 -10
- package/dist/ui/scrollArea/types.d.ts +0 -65
- package/dist/ui/scrollArea/useScrollArea.d.ts +0 -9
- package/dist/ui/scrollArea/useScrollArea.js +0 -146
- /package/dist/ai/ui/{promptInput → chat/chatInput}/File.d.ts +0 -0
- /package/dist/ai/ui/{conversation → 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}/Footer.js +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/ai/ui/{promptInput → chat/parts}/FileIcon.d.ts +0 -0
- /package/dist/{ai/ui/conversation → betterAuth/server/surrealDbAdapter/methods}/types.js +0 -0
- /package/dist/{ai/ui/promptInput → betterAuth/server/surrealDbAdapter}/types.js +0 -0
- /package/dist/{ui/editor → betterAuth/server/surrealDbAdapter/utils}/types.js +0 -0
- /package/dist/{ui/scrollArea → betterAuth/server}/types.js +0 -0
- /package/dist/{surreal → surrealDB}/deserialize.d.ts +0 -0
- /package/dist/{surreal → surrealDB}/deserialize.js +0 -0
- /package/dist/{surreal → surrealDB}/encryption.d.ts +0 -0
- /package/dist/{surreal → surrealDB}/encryption.js +0 -0
- /package/dist/{functions → tanstack/cookie}/getCookie.d.ts +0 -0
- /package/dist/{functions → tanstack/cookie}/getCookie.js +0 -0
- /package/dist/{functions → tanstack/cookie}/setCookie.js +0 -0
- /package/dist/{functions → tanstack/cookie}/setCookies.d.ts +0 -0
- /package/dist/{functions → tanstack/cookie}/setCookies.js +0 -0
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type { ConversationProps } from './types';
|
|
2
|
-
export { useChatMessage } from './useChatMessage';
|
|
3
|
-
export declare const Conversation: {
|
|
4
|
-
Root: ({ children, loading, streaming, empty, ...props }: import("./types").ConversationProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
Message: <T extends import("ai").UIMessage>({ message }: {
|
|
6
|
-
message: T;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
File: <T extends import("ai").UIMessage>({ message }: {
|
|
9
|
-
message: T;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
-
Loader: (props: import("@mantine/core").LoaderProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
-
Empty: () => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Empty } from "./Empty.js";
|
|
2
|
-
import { File } from "./File.js";
|
|
3
|
-
import { Loader } from "./Loader.js";
|
|
4
|
-
import { Message } from "./Message.js";
|
|
5
|
-
import { Root } from "./Root.js";
|
|
6
|
-
import { useChatMessage } from "./useChatMessage.js";
|
|
7
|
-
const Conversation = {
|
|
8
|
-
Root: Root,
|
|
9
|
-
Message: Message,
|
|
10
|
-
File: File,
|
|
11
|
-
Loader: Loader,
|
|
12
|
-
Empty: Empty
|
|
13
|
-
};
|
|
14
|
-
export { Conversation, useChatMessage };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { parseAiMessagePart } from "../../utils/parseAiMessagePart.js";
|
|
3
|
-
const useChatMessage = (part)=>{
|
|
4
|
-
const [parsedText, setParsedText] = useState('');
|
|
5
|
-
useEffect(()=>{
|
|
6
|
-
parseAiMessagePart(part).then((i)=>setParsedText(i.text));
|
|
7
|
-
}, [
|
|
8
|
-
part
|
|
9
|
-
]);
|
|
10
|
-
return parsedText;
|
|
11
|
-
};
|
|
12
|
-
export { useChatMessage };
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ActionIcon, FileButton, Tooltip } from "@mantine/core";
|
|
3
|
-
import { useRef } from "react";
|
|
4
|
-
import { FileIcon } from "./FileIcon.js";
|
|
5
|
-
import { usePromptInput } from "./PromptInputContext.js";
|
|
6
|
-
const File = (props)=>{
|
|
7
|
-
const resetRef = useRef(null);
|
|
8
|
-
const { file, setFile, accept, submiting, uploading } = usePromptInput();
|
|
9
|
-
return /*#__PURE__*/ jsx(FileButton, {
|
|
10
|
-
resetRef: resetRef,
|
|
11
|
-
onChange: async (file)=>{
|
|
12
|
-
if (file) setFile(file);
|
|
13
|
-
},
|
|
14
|
-
accept: accept,
|
|
15
|
-
disabled: submiting || uploading,
|
|
16
|
-
...props,
|
|
17
|
-
children: (props)=>/*#__PURE__*/ jsxs(ActionIcon.Group, {
|
|
18
|
-
children: [
|
|
19
|
-
/*#__PURE__*/ jsx(ActionIcon, {
|
|
20
|
-
size: "lg",
|
|
21
|
-
variant: "default",
|
|
22
|
-
disabled: submiting,
|
|
23
|
-
loading: uploading,
|
|
24
|
-
classNames: {
|
|
25
|
-
root: 'rolder-prompt-input-file-action-action'
|
|
26
|
-
},
|
|
27
|
-
...props,
|
|
28
|
-
children: /*#__PURE__*/ jsxs("svg", {
|
|
29
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
30
|
-
width: "24",
|
|
31
|
-
height: "24",
|
|
32
|
-
viewBox: "0 0 24 24",
|
|
33
|
-
fill: "none",
|
|
34
|
-
stroke: "currentColor",
|
|
35
|
-
strokeWidth: "1.5",
|
|
36
|
-
strokeLinecap: "round",
|
|
37
|
-
strokeLinejoin: "round",
|
|
38
|
-
role: "img",
|
|
39
|
-
"aria-label": "Paperclip",
|
|
40
|
-
children: [
|
|
41
|
-
/*#__PURE__*/ jsx("path", {
|
|
42
|
-
stroke: "none",
|
|
43
|
-
d: "M0 0h24v24H0z",
|
|
44
|
-
fill: "none"
|
|
45
|
-
}),
|
|
46
|
-
/*#__PURE__*/ jsx("path", {
|
|
47
|
-
d: "M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5"
|
|
48
|
-
})
|
|
49
|
-
]
|
|
50
|
-
})
|
|
51
|
-
}),
|
|
52
|
-
file && /*#__PURE__*/ jsxs(Fragment, {
|
|
53
|
-
children: [
|
|
54
|
-
/*#__PURE__*/ jsx(Tooltip, {
|
|
55
|
-
label: file.name,
|
|
56
|
-
openDelay: 500,
|
|
57
|
-
children: /*#__PURE__*/ jsx(ActionIcon.GroupSection, {
|
|
58
|
-
variant: "default",
|
|
59
|
-
size: "lg",
|
|
60
|
-
children: /*#__PURE__*/ jsx(FileIcon, {
|
|
61
|
-
mimeType: file.type
|
|
62
|
-
})
|
|
63
|
-
})
|
|
64
|
-
}),
|
|
65
|
-
/*#__PURE__*/ jsx(ActionIcon, {
|
|
66
|
-
size: "lg",
|
|
67
|
-
variant: "default",
|
|
68
|
-
classNames: {
|
|
69
|
-
root: 'rolder-prompt-input-file-action-action'
|
|
70
|
-
},
|
|
71
|
-
onClick: ()=>{
|
|
72
|
-
resetRef.current?.();
|
|
73
|
-
setFile(void 0);
|
|
74
|
-
},
|
|
75
|
-
children: /*#__PURE__*/ jsxs("svg", {
|
|
76
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
77
|
-
width: "24",
|
|
78
|
-
height: "24",
|
|
79
|
-
viewBox: "0 0 24 24",
|
|
80
|
-
fill: "none",
|
|
81
|
-
stroke: "currentColor",
|
|
82
|
-
strokeWidth: "1.5",
|
|
83
|
-
strokeLinecap: "round",
|
|
84
|
-
strokeLinejoin: "round",
|
|
85
|
-
role: "img",
|
|
86
|
-
"aria-label": "Trash",
|
|
87
|
-
children: [
|
|
88
|
-
/*#__PURE__*/ jsx("path", {
|
|
89
|
-
stroke: "none",
|
|
90
|
-
d: "M0 0h24v24H0z",
|
|
91
|
-
fill: "none"
|
|
92
|
-
}),
|
|
93
|
-
/*#__PURE__*/ jsx("path", {
|
|
94
|
-
d: "M4 7l16 0"
|
|
95
|
-
}),
|
|
96
|
-
/*#__PURE__*/ jsx("path", {
|
|
97
|
-
d: "M10 11l0 6"
|
|
98
|
-
}),
|
|
99
|
-
/*#__PURE__*/ jsx("path", {
|
|
100
|
-
d: "M14 11l0 6"
|
|
101
|
-
}),
|
|
102
|
-
/*#__PURE__*/ jsx("path", {
|
|
103
|
-
d: "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"
|
|
104
|
-
}),
|
|
105
|
-
/*#__PURE__*/ jsx("path", {
|
|
106
|
-
d: "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"
|
|
107
|
-
})
|
|
108
|
-
]
|
|
109
|
-
})
|
|
110
|
-
})
|
|
111
|
-
]
|
|
112
|
-
})
|
|
113
|
-
]
|
|
114
|
-
})
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
export { File };
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
const FileIcon = ({ mimeType })=>{
|
|
3
|
-
switch(true){
|
|
4
|
-
case mimeType.includes('image/'):
|
|
5
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
6
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
-
width: "24",
|
|
8
|
-
height: "24",
|
|
9
|
-
viewBox: "0 0 24 24",
|
|
10
|
-
fill: "none",
|
|
11
|
-
stroke: "var(--mantine-color-dimmed)",
|
|
12
|
-
strokeWidth: "1.5",
|
|
13
|
-
strokeLinecap: "round",
|
|
14
|
-
strokeLinejoin: "round",
|
|
15
|
-
role: "img",
|
|
16
|
-
"aria-label": "Image",
|
|
17
|
-
children: [
|
|
18
|
-
/*#__PURE__*/ jsx("path", {
|
|
19
|
-
stroke: "none",
|
|
20
|
-
d: "M0 0h24v24H0z",
|
|
21
|
-
fill: "none"
|
|
22
|
-
}),
|
|
23
|
-
/*#__PURE__*/ jsx("path", {
|
|
24
|
-
d: "M15 8h.01"
|
|
25
|
-
}),
|
|
26
|
-
/*#__PURE__*/ jsx("path", {
|
|
27
|
-
d: "M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12"
|
|
28
|
-
}),
|
|
29
|
-
/*#__PURE__*/ jsx("path", {
|
|
30
|
-
d: "M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5"
|
|
31
|
-
}),
|
|
32
|
-
/*#__PURE__*/ jsx("path", {
|
|
33
|
-
d: "M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3"
|
|
34
|
-
})
|
|
35
|
-
]
|
|
36
|
-
});
|
|
37
|
-
case mimeType.includes('application/pdf'):
|
|
38
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
39
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
-
width: "24",
|
|
41
|
-
height: "24",
|
|
42
|
-
viewBox: "0 0 24 24",
|
|
43
|
-
fill: "none",
|
|
44
|
-
stroke: "var(--mantine-color-dimmed)",
|
|
45
|
-
strokeWidth: "1.5",
|
|
46
|
-
strokeLinecap: "round",
|
|
47
|
-
strokeLinejoin: "round",
|
|
48
|
-
role: "img",
|
|
49
|
-
"aria-label": "FilePdf",
|
|
50
|
-
children: [
|
|
51
|
-
/*#__PURE__*/ jsx("path", {
|
|
52
|
-
stroke: "none",
|
|
53
|
-
d: "M0 0h24v24H0z",
|
|
54
|
-
fill: "none"
|
|
55
|
-
}),
|
|
56
|
-
/*#__PURE__*/ jsx("path", {
|
|
57
|
-
d: "M14 3v4a1 1 0 0 0 1 1h4"
|
|
58
|
-
}),
|
|
59
|
-
/*#__PURE__*/ jsx("path", {
|
|
60
|
-
d: "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"
|
|
61
|
-
}),
|
|
62
|
-
/*#__PURE__*/ jsx("path", {
|
|
63
|
-
d: "M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"
|
|
64
|
-
}),
|
|
65
|
-
/*#__PURE__*/ jsx("path", {
|
|
66
|
-
d: "M17 18h2"
|
|
67
|
-
}),
|
|
68
|
-
/*#__PURE__*/ jsx("path", {
|
|
69
|
-
d: "M20 15h-3v6"
|
|
70
|
-
}),
|
|
71
|
-
/*#__PURE__*/ jsx("path", {
|
|
72
|
-
d: "M11 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1"
|
|
73
|
-
})
|
|
74
|
-
]
|
|
75
|
-
});
|
|
76
|
-
case mimeType.includes('application/vnd.openxmlformats-officedocument.wordprocessingml.document'):
|
|
77
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
78
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
79
|
-
width: "24",
|
|
80
|
-
height: "24",
|
|
81
|
-
viewBox: "0 0 24 24",
|
|
82
|
-
fill: "none",
|
|
83
|
-
stroke: "var(--mantine-color-dimmed)",
|
|
84
|
-
strokeWidth: "1.5",
|
|
85
|
-
strokeLinecap: "round",
|
|
86
|
-
strokeLinejoin: "round",
|
|
87
|
-
role: "img",
|
|
88
|
-
"aria-label": "FileDoc",
|
|
89
|
-
children: [
|
|
90
|
-
/*#__PURE__*/ jsx("path", {
|
|
91
|
-
stroke: "none",
|
|
92
|
-
d: "M0 0h24v24H0z",
|
|
93
|
-
fill: "none"
|
|
94
|
-
}),
|
|
95
|
-
/*#__PURE__*/ jsx("path", {
|
|
96
|
-
d: "M14 3v4a1 1 0 0 0 1 1h4"
|
|
97
|
-
}),
|
|
98
|
-
/*#__PURE__*/ jsx("path", {
|
|
99
|
-
d: "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"
|
|
100
|
-
}),
|
|
101
|
-
/*#__PURE__*/ jsx("path", {
|
|
102
|
-
d: "M5 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1"
|
|
103
|
-
}),
|
|
104
|
-
/*#__PURE__*/ jsx("path", {
|
|
105
|
-
d: "M20 16.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0"
|
|
106
|
-
}),
|
|
107
|
-
/*#__PURE__*/ jsx("path", {
|
|
108
|
-
d: "M12.5 15a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1 -3 0v-3a1.5 1.5 0 0 1 1.5 -1.5"
|
|
109
|
-
})
|
|
110
|
-
]
|
|
111
|
-
});
|
|
112
|
-
case mimeType.includes('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'):
|
|
113
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
114
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
115
|
-
width: "24",
|
|
116
|
-
height: "24",
|
|
117
|
-
viewBox: "0 0 24 24",
|
|
118
|
-
fill: "none",
|
|
119
|
-
stroke: "var(--mantine-color-dimmed)",
|
|
120
|
-
strokeWidth: "1.5",
|
|
121
|
-
strokeLinecap: "round",
|
|
122
|
-
strokeLinejoin: "round",
|
|
123
|
-
role: "img",
|
|
124
|
-
"aria-label": "FileXls",
|
|
125
|
-
children: [
|
|
126
|
-
/*#__PURE__*/ jsx("path", {
|
|
127
|
-
stroke: "none",
|
|
128
|
-
d: "M0 0h24v24H0z",
|
|
129
|
-
fill: "none"
|
|
130
|
-
}),
|
|
131
|
-
/*#__PURE__*/ jsx("path", {
|
|
132
|
-
d: "M14 3v4a1 1 0 0 0 1 1h4"
|
|
133
|
-
}),
|
|
134
|
-
/*#__PURE__*/ jsx("path", {
|
|
135
|
-
d: "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"
|
|
136
|
-
}),
|
|
137
|
-
/*#__PURE__*/ jsx("path", {
|
|
138
|
-
d: "M4 15l4 6"
|
|
139
|
-
}),
|
|
140
|
-
/*#__PURE__*/ jsx("path", {
|
|
141
|
-
d: "M4 21l4 -6"
|
|
142
|
-
}),
|
|
143
|
-
/*#__PURE__*/ jsx("path", {
|
|
144
|
-
d: "M17 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"
|
|
145
|
-
}),
|
|
146
|
-
/*#__PURE__*/ jsx("path", {
|
|
147
|
-
d: "M11 15v6h3"
|
|
148
|
-
})
|
|
149
|
-
]
|
|
150
|
-
});
|
|
151
|
-
case mimeType.includes('application/vnd.openxmlformats-officedocument.presentationml.presentation'):
|
|
152
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
153
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
154
|
-
width: "24",
|
|
155
|
-
height: "24",
|
|
156
|
-
viewBox: "0 0 24 24",
|
|
157
|
-
fill: "none",
|
|
158
|
-
stroke: "var(--mantine-color-dimmed)",
|
|
159
|
-
strokeWidth: "1.5",
|
|
160
|
-
strokeLinecap: "round",
|
|
161
|
-
strokeLinejoin: "round",
|
|
162
|
-
role: "img",
|
|
163
|
-
"aria-label": "FilePpt",
|
|
164
|
-
children: [
|
|
165
|
-
/*#__PURE__*/ jsx("path", {
|
|
166
|
-
stroke: "none",
|
|
167
|
-
d: "M0 0h24v24H0z",
|
|
168
|
-
fill: "none"
|
|
169
|
-
}),
|
|
170
|
-
/*#__PURE__*/ jsx("path", {
|
|
171
|
-
d: "M14 3v4a1 1 0 0 0 1 1h4"
|
|
172
|
-
}),
|
|
173
|
-
/*#__PURE__*/ jsx("path", {
|
|
174
|
-
d: "M14 3v4a1 1 0 0 0 1 1h4"
|
|
175
|
-
}),
|
|
176
|
-
/*#__PURE__*/ jsx("path", {
|
|
177
|
-
d: "M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"
|
|
178
|
-
}),
|
|
179
|
-
/*#__PURE__*/ jsx("path", {
|
|
180
|
-
d: "M11 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"
|
|
181
|
-
}),
|
|
182
|
-
/*#__PURE__*/ jsx("path", {
|
|
183
|
-
d: "M16.5 15h3"
|
|
184
|
-
}),
|
|
185
|
-
/*#__PURE__*/ jsx("path", {
|
|
186
|
-
d: "M18 15v6"
|
|
187
|
-
}),
|
|
188
|
-
/*#__PURE__*/ jsx("path", {
|
|
189
|
-
d: "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"
|
|
190
|
-
})
|
|
191
|
-
]
|
|
192
|
-
});
|
|
193
|
-
default:
|
|
194
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
195
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
196
|
-
width: "24",
|
|
197
|
-
height: "24",
|
|
198
|
-
viewBox: "0 0 24 24",
|
|
199
|
-
fill: "none",
|
|
200
|
-
stroke: "var(--mantine-color-dimmed)",
|
|
201
|
-
strokeWidth: "1.5",
|
|
202
|
-
strokeLinecap: "round",
|
|
203
|
-
strokeLinejoin: "round",
|
|
204
|
-
role: "img",
|
|
205
|
-
"aria-label": "File",
|
|
206
|
-
children: [
|
|
207
|
-
/*#__PURE__*/ jsx("path", {
|
|
208
|
-
stroke: "none",
|
|
209
|
-
d: "M0 0h24v24H0z",
|
|
210
|
-
fill: "none"
|
|
211
|
-
}),
|
|
212
|
-
/*#__PURE__*/ jsx("path", {
|
|
213
|
-
d: "M15 3v4a1 1 0 0 0 1 1h4"
|
|
214
|
-
}),
|
|
215
|
-
/*#__PURE__*/ jsx("path", {
|
|
216
|
-
d: "M18 17h-7a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h4l5 5v7a2 2 0 0 1 -2 2"
|
|
217
|
-
}),
|
|
218
|
-
/*#__PURE__*/ jsx("path", {
|
|
219
|
-
d: "M16 17v2a2 2 0 0 1 -2 2h-7a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2"
|
|
220
|
-
})
|
|
221
|
-
]
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
export { FileIcon };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface PromptInputContext {
|
|
2
|
-
text: string;
|
|
3
|
-
setText: (text: string) => void;
|
|
4
|
-
file?: File;
|
|
5
|
-
setFile: (file?: File) => void;
|
|
6
|
-
onSubmit: () => void;
|
|
7
|
-
submiting: boolean;
|
|
8
|
-
uploading: boolean;
|
|
9
|
-
accept?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const PromptInputContext: import("react").Context<PromptInputContext | null>;
|
|
12
|
-
export declare const usePromptInput: () => PromptInputContext;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
|
-
const PromptInputContext = createContext(null);
|
|
3
|
-
const usePromptInput = ()=>{
|
|
4
|
-
const context = useContext(PromptInputContext);
|
|
5
|
-
if (!context) throw new Error('usePromptInput must be used within a PromptInputProvider');
|
|
6
|
-
return context;
|
|
7
|
-
};
|
|
8
|
-
export { PromptInputContext, usePromptInput };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { PromptInputContext } from "./PromptInputContext.js";
|
|
4
|
-
const Provider = ({ children, onSubmit, submiting, uploading, accept = [
|
|
5
|
-
'text',
|
|
6
|
-
'image',
|
|
7
|
-
'pdf'
|
|
8
|
-
] })=>{
|
|
9
|
-
const [text, setText] = useState('');
|
|
10
|
-
const [file, setFile] = useState();
|
|
11
|
-
const value = {
|
|
12
|
-
text,
|
|
13
|
-
setText,
|
|
14
|
-
file,
|
|
15
|
-
setFile,
|
|
16
|
-
onSubmit: ()=>{
|
|
17
|
-
if (text.trim()) {
|
|
18
|
-
onSubmit({
|
|
19
|
-
text: text.trim(),
|
|
20
|
-
file
|
|
21
|
-
});
|
|
22
|
-
setText('');
|
|
23
|
-
setFile(void 0);
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
submiting,
|
|
27
|
-
uploading,
|
|
28
|
-
accept: accept.map((type)=>{
|
|
29
|
-
switch(type){
|
|
30
|
-
case 'text':
|
|
31
|
-
return 'text/plain';
|
|
32
|
-
case 'image':
|
|
33
|
-
return 'image/*';
|
|
34
|
-
case 'pdf':
|
|
35
|
-
return 'application/pdf';
|
|
36
|
-
case 'excel':
|
|
37
|
-
return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
38
|
-
case 'word':
|
|
39
|
-
return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
|
40
|
-
default:
|
|
41
|
-
return type;
|
|
42
|
-
}
|
|
43
|
-
}).join(',')
|
|
44
|
-
};
|
|
45
|
-
return /*#__PURE__*/ jsx(PromptInputContext.Provider, {
|
|
46
|
-
value: value,
|
|
47
|
-
children: children
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
export { Provider };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Paper } from "@mantine/core";
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
import { Provider } from "./PromptInputProvider.js";
|
|
5
|
-
const Root = ({ className, onSubmit, submiting, uploading, accept, ...props })=>/*#__PURE__*/ jsx(Provider, {
|
|
6
|
-
onSubmit: onSubmit,
|
|
7
|
-
submiting: submiting,
|
|
8
|
-
uploading: uploading,
|
|
9
|
-
accept: accept,
|
|
10
|
-
children: /*#__PURE__*/ jsx(Paper, {
|
|
11
|
-
radius: "md",
|
|
12
|
-
withBorder: true,
|
|
13
|
-
className: clsx('rolder-prompt-input-root', className),
|
|
14
|
-
...props
|
|
15
|
-
})
|
|
16
|
-
});
|
|
17
|
-
export { Root };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ActionIcon } from "@mantine/core";
|
|
3
|
-
import { usePromptInput } from "./PromptInputContext.js";
|
|
4
|
-
const Submit = ({ children, ...props })=>{
|
|
5
|
-
const Icon = /*#__PURE__*/ jsxs("svg", {
|
|
6
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
-
width: "24",
|
|
8
|
-
height: "24",
|
|
9
|
-
viewBox: "0 0 24 24",
|
|
10
|
-
fill: "none",
|
|
11
|
-
stroke: "currentColor",
|
|
12
|
-
strokeWidth: "1.5",
|
|
13
|
-
strokeLinecap: "round",
|
|
14
|
-
strokeLinejoin: "round",
|
|
15
|
-
role: "img",
|
|
16
|
-
"aria-label": "Submit",
|
|
17
|
-
children: [
|
|
18
|
-
/*#__PURE__*/ jsx("path", {
|
|
19
|
-
stroke: "none",
|
|
20
|
-
d: "M0 0h24v24H0z",
|
|
21
|
-
fill: "none"
|
|
22
|
-
}),
|
|
23
|
-
/*#__PURE__*/ jsx("path", {
|
|
24
|
-
d: "M9 20v-8h-3.586a1 1 0 0 1 -.707 -1.707l6.586 -6.586a1 1 0 0 1 1.414 0l6.586 6.586a1 1 0 0 1 -.707 1.707h-3.586v8a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1"
|
|
25
|
-
})
|
|
26
|
-
]
|
|
27
|
-
});
|
|
28
|
-
const { onSubmit, submiting, uploading } = usePromptInput();
|
|
29
|
-
return /*#__PURE__*/ jsx(ActionIcon, {
|
|
30
|
-
"aria-label": "Submit",
|
|
31
|
-
variant: "light",
|
|
32
|
-
size: "lg",
|
|
33
|
-
onClick: onSubmit,
|
|
34
|
-
disabled: uploading,
|
|
35
|
-
loading: submiting,
|
|
36
|
-
...props,
|
|
37
|
-
children: children ?? Icon
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
export { Submit };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type Accept = 'text' | 'image' | 'pdf' | 'excel' | 'word';
|
|
2
|
-
export interface PromptInputProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
onSubmit: ({ text, file }: {
|
|
5
|
-
text: string;
|
|
6
|
-
file?: File;
|
|
7
|
-
}) => void;
|
|
8
|
-
submiting: boolean;
|
|
9
|
-
uploading: boolean;
|
|
10
|
-
accept?: Accept[];
|
|
11
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** biome-ignore-all assist/source/organizeImports: <> */
|
|
2
|
-
export { Conversation, type ConversationProps, useChatMessage, } from './ai/ui/conversation';
|
|
3
|
-
export { type Accept, PromptInput, type PromptInputProps, } from './ai/ui/promptInput';
|
|
4
|
-
export { convertFileUIPartBlobToDataURL } from './ai/utils/convertFileUIPartBlobToDataURL';
|
|
5
|
-
export { parseAiMessagePart } from './ai/utils/parseAiMessagePart';
|
|
6
|
-
export { DefaultApp } from './app/DefaultApp';
|
|
7
|
-
export { defaultRequestMiddlewares } from './app/defaultRequestMiddlewares';
|
|
8
|
-
export { defaultTheme } from './app/defaultTheme';
|
|
9
|
-
export { getCookie } from './functions/getCookie';
|
|
10
|
-
export { setCookie } from './functions/setCookie';
|
|
11
|
-
export { setCookies } from './functions/setCookies';
|
|
12
|
-
export { useMutation } from './hooks/useMutation';
|
|
13
|
-
export { useMutationWithInvalidate } from './hooks/useMutationWithInvalidate';
|
|
14
|
-
export { getDB } from './surreal/connection';
|
|
15
|
-
export { surrealDeleteFn, surrealUnsubscribeFn } from './surreal/deafaultCrud';
|
|
16
|
-
export { deserialize } from './surreal/deserialize';
|
|
17
|
-
export { encryptionFn } from './surreal/encryption';
|
|
18
|
-
export { Editor, useEditor } from './ui/editor';
|
|
19
|
-
export { DefaultError, DefaultNotFound, defaultErrorNotification, Forbidden, } from './ui/error';
|
|
20
|
-
export { AnimatedChevron } from './ui/AnimatedChevron';
|
|
21
|
-
export { useAppForm, useFieldContext, withForm, blurOnError, fieldsSchema, } from './ui/form';
|
|
22
|
-
export { HoverPaper, usePaperHover } from './ui/hoverPaper';
|
|
23
|
-
export { JsonInput } from './ui/JsonInput';
|
|
24
|
-
export { RouterLink } from './ui/RouterLink';
|
|
25
|
-
export { SaveInput } from './ui/saveInput';
|
|
26
|
-
export { ScrollArea, useScrollArea, type ScrollAreaContextValue, type ScrollAreaHook, type ScrollAreaProps, type ScrollAreaState, type ScrollButtonProps, type ScrollPosition, } from './ui/scrollArea';
|
package/dist/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Conversation, useChatMessage } from "./ai/ui/conversation/index.js";
|
|
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";
|
|
5
|
-
import { DefaultApp } from "./app/DefaultApp.js";
|
|
6
|
-
import { defaultRequestMiddlewares } from "./app/defaultRequestMiddlewares.js";
|
|
7
|
-
import { defaultTheme } from "./app/defaultTheme.js";
|
|
8
|
-
import { getCookie } from "./functions/getCookie.js";
|
|
9
|
-
import { setCookie } from "./functions/setCookie.js";
|
|
10
|
-
import { setCookies } from "./functions/setCookies.js";
|
|
11
|
-
import { useMutation } from "./hooks/useMutation.js";
|
|
12
|
-
import { useMutationWithInvalidate } from "./hooks/useMutationWithInvalidate.js";
|
|
13
|
-
import { getDB } from "./surreal/connection.js";
|
|
14
|
-
import { surrealDeleteFn, surrealUnsubscribeFn } from "./surreal/deafaultCrud.js";
|
|
15
|
-
import { deserialize } from "./surreal/deserialize.js";
|
|
16
|
-
import { encryptionFn } from "./surreal/encryption.js";
|
|
17
|
-
import { Editor, useEditor } from "./ui/editor/index.js";
|
|
18
|
-
import { DefaultError, DefaultNotFound, Forbidden, defaultErrorNotification } from "./ui/error/index.js";
|
|
19
|
-
import { AnimatedChevron } from "./ui/AnimatedChevron.js";
|
|
20
|
-
import { blurOnError, fieldsSchema, useAppForm, useFieldContext, withForm } from "./ui/form/index.js";
|
|
21
|
-
import { HoverPaper, usePaperHover } from "./ui/hoverPaper/index.js";
|
|
22
|
-
import { JsonInput } from "./ui/JsonInput.js";
|
|
23
|
-
import { RouterLink } from "./ui/RouterLink.js";
|
|
24
|
-
import { SaveInput } from "./ui/saveInput/index.js";
|
|
25
|
-
import { ScrollArea, useScrollArea } from "./ui/scrollArea/index.js";
|
|
26
|
-
export { AnimatedChevron, Conversation, DefaultApp, DefaultError, DefaultNotFound, Editor, Forbidden, HoverPaper, JsonInput, PromptInput, RouterLink, SaveInput, ScrollArea, blurOnError, convertFileUIPartBlobToDataURL, defaultErrorNotification, defaultRequestMiddlewares, defaultTheme, deserialize, encryptionFn, fieldsSchema, getCookie, getDB, parseAiMessagePart, setCookie, setCookies, surrealDeleteFn, surrealUnsubscribeFn, useAppForm, useChatMessage, useEditor, useFieldContext, useMutation, useMutationWithInvalidate, usePaperHover, useScrollArea, withForm };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const surrealDeleteFn: import("@tanstack/start-client-core").RequiredFetcher<undefined, (data: string) => string, Promise<void>>;
|
|
2
|
-
export declare const surrealUnsubscribeFn: import("@tanstack/start-client-core").RequiredFetcher<undefined, (data: string) => string, Promise<void>>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/react';
|
|
2
|
-
import type { EditorProps } from './types';
|
|
3
|
-
interface EditorContext {
|
|
4
|
-
editor: Editor | null;
|
|
5
|
-
editable?: boolean;
|
|
6
|
-
setEditable: (value: boolean) => void;
|
|
7
|
-
disabledToolbar: boolean;
|
|
8
|
-
setDisabledToolbar: (value: boolean) => void;
|
|
9
|
-
focused: boolean;
|
|
10
|
-
setFocused: (value: boolean) => void;
|
|
11
|
-
editedByUser: boolean;
|
|
12
|
-
setEditedByUser: (value: boolean) => void;
|
|
13
|
-
}
|
|
14
|
-
declare const EditorContext: import("react").Context<EditorContext | null>;
|
|
15
|
-
export declare const Provider: ({ children, initialContent, initialEditable, initialDisabledToolbar, onChange, }: EditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare const useEditor: () => EditorContext;
|
|
17
|
-
export {};
|