@quidgest/chatbot 0.5.3-dev.0 → 0.5.4
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/ChatBot/__tests__/ChatBot.spec.d.ts +1 -0
- package/dist/components/ChatBot/types.d.ts +3 -1
- package/dist/components/ChatBotInput/ChatBotInput.vue.d.ts +3 -3
- package/dist/components/ChatBotInput/index.d.ts +2 -2
- package/dist/components/ChatBotInput/types.d.ts +4 -4
- package/dist/components/ChatBotMessage/__tests__/ChatBotMessage.spec.d.ts +1 -0
- package/dist/components/ChatBotMessage/types.d.ts +3 -2
- package/dist/composables/useChatMessages.d.ts +2 -1
- package/dist/composables/useTexts.d.ts +1 -0
- package/dist/index.js +18 -18
- package/dist/index.mjs +1200 -1165
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/src/assets/styles/preview-file.scss +70 -0
- package/src/assets/styles/styles.scss +9 -33
- package/src/components/ChatBot/ChatBot.vue +10 -14
- package/src/components/ChatBot/__tests__/ChatBot.spec.ts +52 -0
- package/src/components/ChatBot/__tests__/__snapshots__/ChatBot.spec.ts.snap +39 -0
- package/src/components/ChatBot/types.ts +3 -1
- package/src/components/ChatBotInput/ChatBotInput.vue +81 -74
- package/src/components/ChatBotInput/__tests__/ChatBotInput.spec.ts +29 -42
- package/src/components/ChatBotInput/__tests__/__snapshots__/ChatBotInput.spec.ts.snap +5 -5
- package/src/components/ChatBotInput/index.ts +2 -2
- package/src/components/ChatBotInput/types.ts +4 -4
- package/src/components/ChatBotMessage/ChatBotMessage.vue +31 -3
- package/src/components/ChatBotMessage/ChatBotMessageButtons.vue +1 -0
- package/src/components/ChatBotMessage/__tests__/ChatBotMessage.spec.ts +260 -0
- package/src/components/ChatBotMessage/__tests__/__snapshots__/ChatBotMessage.spec.ts.snap +35 -0
- package/src/components/ChatBotMessage/types.ts +4 -3
- package/src/components/FieldPreview/__tests__/__snapshots__/FieldPreview.spec.ts.snap +1 -1
- package/src/composables/useChatMessages.ts +3 -2
- package/src/composables/useTexts.ts +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ChatBotFile } from '../ChatBotInput';
|
|
2
|
+
|
|
1
3
|
export type ChatBotProps = {
|
|
2
4
|
apiEndpoint?: string;
|
|
3
5
|
controllerEndpoint?: string;
|
|
@@ -36,7 +38,7 @@ export type ChatMessage = {
|
|
|
36
38
|
date: Date;
|
|
37
39
|
sender: ChatBotMessageSender;
|
|
38
40
|
sessionID: string;
|
|
39
|
-
|
|
41
|
+
file?: ChatBotFile;
|
|
40
42
|
isWelcomeMessage?: boolean;
|
|
41
43
|
fields?: FieldData[];
|
|
42
44
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ChatBotInputProps,
|
|
1
|
+
import { ChatBotInputProps, ChatBotFile } from './';
|
|
2
2
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ChatBotInputProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
|
-
"send-message": (prompt: string,
|
|
4
|
+
"send-message": (prompt: string, file?: ChatBotFile | undefined) => void;
|
|
5
5
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ChatBotInputProps>>> & Readonly<{
|
|
6
|
-
"onSend-message"?: ((prompt: string,
|
|
6
|
+
"onSend-message"?: ((prompt: string, file?: ChatBotFile | undefined) => any) | undefined;
|
|
7
7
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
8
|
export default _default;
|
|
9
9
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as ChatBotInput } from './ChatBotInput.vue';
|
|
2
|
-
import { ChatBotInputProps,
|
|
2
|
+
import { ChatBotInputProps, ChatBotFile } from './types';
|
|
3
3
|
|
|
4
4
|
export { ChatBotInput };
|
|
5
|
-
export type { ChatBotInputProps,
|
|
5
|
+
export type { ChatBotInputProps, ChatBotFile };
|
|
@@ -16,13 +16,13 @@ export type ChatBotInputProps = {
|
|
|
16
16
|
*/
|
|
17
17
|
agentId?: string;
|
|
18
18
|
};
|
|
19
|
-
export type
|
|
19
|
+
export type ChatBotFile = {
|
|
20
20
|
/**
|
|
21
|
-
* The
|
|
21
|
+
* The preview URL for the file (if it's an image)
|
|
22
22
|
*/
|
|
23
|
-
previewUrl
|
|
23
|
+
previewUrl?: string;
|
|
24
24
|
/**
|
|
25
25
|
* The file object
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
fileData: File;
|
|
28
28
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChatBotMessageSender, FieldData } from '../ChatBot/types';
|
|
2
|
+
import { ChatBotFile } from '../ChatBotInput';
|
|
2
3
|
|
|
3
4
|
export type ChatBotMessageProps = {
|
|
4
5
|
sender?: ChatBotMessageSender;
|
|
@@ -10,9 +11,9 @@ export type ChatBotMessageProps = {
|
|
|
10
11
|
*/
|
|
11
12
|
dateFormat: string;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* File Preview
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
+
file?: ChatBotFile;
|
|
16
17
|
/**
|
|
17
18
|
* Default api endpoint
|
|
18
19
|
*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { ChatMessage, ChatBotMessageSender } from '../components/ChatBot/types';
|
|
3
|
+
import { ChatBotFile } from '../components/ChatBotInput';
|
|
3
4
|
|
|
4
5
|
export declare function useChatMessages(): {
|
|
5
6
|
messages: Ref<ChatMessage[], ChatMessage[]>;
|
|
6
7
|
nextMessageId: Ref<number, number>;
|
|
7
|
-
addChatMessage: (message: string, sender?: ChatBotMessageSender,
|
|
8
|
+
addChatMessage: (message: string, sender?: ChatBotMessageSender, file?: ChatBotFile, sessionID?: string, isWelcomeMessage?: boolean) => ChatMessage;
|
|
8
9
|
getLastMessage: () => ChatMessage | undefined;
|
|
9
10
|
clearMessages: () => void;
|
|
10
11
|
getMessages: () => ChatMessage[];
|