@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.
Files changed (32) hide show
  1. package/dist/components/ChatBot/__tests__/ChatBot.spec.d.ts +1 -0
  2. package/dist/components/ChatBot/types.d.ts +3 -1
  3. package/dist/components/ChatBotInput/ChatBotInput.vue.d.ts +3 -3
  4. package/dist/components/ChatBotInput/index.d.ts +2 -2
  5. package/dist/components/ChatBotInput/types.d.ts +4 -4
  6. package/dist/components/ChatBotMessage/__tests__/ChatBotMessage.spec.d.ts +1 -0
  7. package/dist/components/ChatBotMessage/types.d.ts +3 -2
  8. package/dist/composables/useChatMessages.d.ts +2 -1
  9. package/dist/composables/useTexts.d.ts +1 -0
  10. package/dist/index.js +18 -18
  11. package/dist/index.mjs +1200 -1165
  12. package/dist/style.css +1 -1
  13. package/package.json +2 -1
  14. package/src/assets/styles/preview-file.scss +70 -0
  15. package/src/assets/styles/styles.scss +9 -33
  16. package/src/components/ChatBot/ChatBot.vue +10 -14
  17. package/src/components/ChatBot/__tests__/ChatBot.spec.ts +52 -0
  18. package/src/components/ChatBot/__tests__/__snapshots__/ChatBot.spec.ts.snap +39 -0
  19. package/src/components/ChatBot/types.ts +3 -1
  20. package/src/components/ChatBotInput/ChatBotInput.vue +81 -74
  21. package/src/components/ChatBotInput/__tests__/ChatBotInput.spec.ts +29 -42
  22. package/src/components/ChatBotInput/__tests__/__snapshots__/ChatBotInput.spec.ts.snap +5 -5
  23. package/src/components/ChatBotInput/index.ts +2 -2
  24. package/src/components/ChatBotInput/types.ts +4 -4
  25. package/src/components/ChatBotMessage/ChatBotMessage.vue +31 -3
  26. package/src/components/ChatBotMessage/ChatBotMessageButtons.vue +1 -0
  27. package/src/components/ChatBotMessage/__tests__/ChatBotMessage.spec.ts +260 -0
  28. package/src/components/ChatBotMessage/__tests__/__snapshots__/ChatBotMessage.spec.ts.snap +35 -0
  29. package/src/components/ChatBotMessage/types.ts +4 -3
  30. package/src/components/FieldPreview/__tests__/__snapshots__/FieldPreview.spec.ts.snap +1 -1
  31. package/src/composables/useChatMessages.ts +3 -2
  32. package/src/composables/useTexts.ts +2 -1
@@ -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
- imagePreviewUrl?: string;
41
+ file?: ChatBotFile;
40
42
  isWelcomeMessage?: boolean;
41
43
  fields?: FieldData[];
42
44
  };
@@ -1,9 +1,9 @@
1
- import { ChatBotInputProps, ChatBotImage } from './types';
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, image?: ChatBotImage | undefined) => void;
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, image?: ChatBotImage | undefined) => any) | undefined;
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, ChatBotImage } from './types';
2
+ import { ChatBotInputProps, ChatBotFile } from './types';
3
3
 
4
4
  export { ChatBotInput };
5
- export type { ChatBotInputProps, ChatBotImage };
5
+ export type { ChatBotInputProps, ChatBotFile };
@@ -16,13 +16,13 @@ export type ChatBotInputProps = {
16
16
  */
17
17
  agentId?: string;
18
18
  };
19
- export type ChatBotImage = {
19
+ export type ChatBotFile = {
20
20
  /**
21
- * The image URL
21
+ * The preview URL for the file (if it's an image)
22
22
  */
23
- previewUrl: string;
23
+ previewUrl?: string;
24
24
  /**
25
25
  * The file object
26
26
  */
27
- file: File;
27
+ fileData: File;
28
28
  };
@@ -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
- * Image preview URL
14
+ * File Preview
14
15
  */
15
- imagePreviewUrl?: string;
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, imagePreviewUrl?: string | null, sessionID?: string, isWelcomeMessage?: boolean) => ChatMessage;
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[];
@@ -28,4 +28,5 @@ export declare function useTexts(): {
28
28
  regenerateResponse: string;
29
29
  generatingResponse: string;
30
30
  suggestionsForField: string;
31
+ fileUpload: string;
31
32
  };