@n8n/chat 0.18.0 → 0.19.1

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 (110) hide show
  1. package/README.md +2 -2
  2. package/dist/App.vue.d.ts +8 -0
  3. package/dist/__stories__/App.stories.d.ts +18 -0
  4. package/dist/__tests__/index.spec.d.ts +1 -0
  5. package/dist/__tests__/setup.d.ts +1 -0
  6. package/dist/__tests__/utils/create.d.ts +6 -0
  7. package/dist/__tests__/utils/fetch.d.ts +5 -0
  8. package/dist/__tests__/utils/selectors.d.ts +12 -0
  9. package/dist/api/generic.d.ts +6 -0
  10. package/dist/api/message.d.ts +4 -0
  11. package/dist/chat.bundle.es.js +11029 -0
  12. package/dist/chat.bundle.umd.js +37 -0
  13. package/dist/chat.es.js +6939 -0
  14. package/dist/chat.umd.js +18 -0
  15. package/dist/components/Button.vue.d.ts +11 -0
  16. package/dist/components/Chat.vue.d.ts +2 -0
  17. package/dist/components/ChatWindow.vue.d.ts +2 -0
  18. package/dist/components/GetStarted.vue.d.ts +2 -0
  19. package/dist/components/GetStartedFooter.vue.d.ts +2 -0
  20. package/dist/components/Input.vue.d.ts +2 -0
  21. package/dist/components/Layout.vue.d.ts +13 -0
  22. package/dist/components/Message.vue.d.ts +26 -0
  23. package/dist/components/MessageTyping.vue.d.ts +29 -0
  24. package/dist/components/MessagesList.vue.d.ts +17 -0
  25. package/dist/components/PoweredBy.vue.d.ts +2 -0
  26. package/dist/composables/useChat.d.ts +3 -0
  27. package/dist/composables/useI18n.d.ts +4 -0
  28. package/dist/composables/useOptions.d.ts +5 -0
  29. package/dist/constants/defaults.d.ts +4 -0
  30. package/dist/constants/localStorage.d.ts +2 -0
  31. package/dist/constants/symbols.d.ts +5 -0
  32. package/dist/event-buses/chatEventBus.d.ts +1 -0
  33. package/dist/index.d.ts +3 -0
  34. package/dist/plugins/chat.d.ts +4 -0
  35. package/dist/style.css +1 -0
  36. package/dist/types/chat.d.ts +12 -0
  37. package/{src/types/messages.ts → dist/types/messages.d.ts} +10 -12
  38. package/dist/types/options.d.ts +31 -0
  39. package/dist/types/webhook.d.ts +16 -0
  40. package/dist/utils/event-bus.d.ts +8 -0
  41. package/dist/utils/mount.d.ts +1 -0
  42. package/package.json +45 -9
  43. package/.eslintignore +0 -2
  44. package/.eslintrc.cjs +0 -10
  45. package/.np-config.json +0 -5
  46. package/.storybook/main.ts +0 -4
  47. package/.storybook/preview.scss +0 -4
  48. package/.storybook/preview.ts +0 -15
  49. package/.vscode/extensions.json +0 -3
  50. package/build.config.js +0 -21
  51. package/env.d.ts +0 -1
  52. package/index.html +0 -13
  53. package/resources/images/fullscreen.png +0 -0
  54. package/resources/images/windowed.png +0 -0
  55. package/resources/workflow-manual.json +0 -238
  56. package/resources/workflow.json +0 -119
  57. package/scripts/pack.js +0 -11
  58. package/scripts/postbuild.js +0 -36
  59. package/src/App.vue +0 -23
  60. package/src/__stories__/App.stories.ts +0 -43
  61. package/src/__tests__/index.spec.ts +0 -218
  62. package/src/__tests__/setup.ts +0 -1
  63. package/src/__tests__/utils/create.ts +0 -16
  64. package/src/__tests__/utils/fetch.ts +0 -18
  65. package/src/__tests__/utils/selectors.ts +0 -53
  66. package/src/api/generic.ts +0 -63
  67. package/src/api/message.ts +0 -37
  68. package/src/components/Button.vue +0 -41
  69. package/src/components/Chat.vue +0 -96
  70. package/src/components/ChatWindow.vue +0 -123
  71. package/src/components/GetStarted.vue +0 -24
  72. package/src/components/GetStartedFooter.vue +0 -20
  73. package/src/components/Input.vue +0 -108
  74. package/src/components/Layout.vue +0 -99
  75. package/src/components/Message.vue +0 -137
  76. package/src/components/MessageTyping.vue +0 -110
  77. package/src/components/MessagesList.vue +0 -33
  78. package/src/components/PoweredBy.vue +0 -17
  79. package/src/composables/useChat.ts +0 -7
  80. package/src/composables/useI18n.ts +0 -21
  81. package/src/composables/useOptions.ts +0 -11
  82. package/src/constants/defaults.ts +0 -30
  83. package/src/constants/localStorage.ts +0 -2
  84. package/src/constants/symbols.ts +0 -8
  85. package/src/css/_tokens.scss +0 -38
  86. package/src/css/index.scss +0 -1
  87. package/src/event-buses/chatEventBus.ts +0 -3
  88. package/src/index.ts +0 -42
  89. package/src/main.scss +0 -5
  90. package/src/plugins/chat.ts +0 -115
  91. package/src/shims.d.ts +0 -6
  92. package/src/types/chat.ts +0 -12
  93. package/src/types/icons.d.ts +0 -5
  94. package/src/types/options.ts +0 -33
  95. package/src/types/webhook.ts +0 -18
  96. package/src/utils/event-bus.ts +0 -51
  97. package/src/utils/mount.ts +0 -16
  98. package/tsconfig.json +0 -27
  99. package/vite.config.mts +0 -53
  100. package/vitest.config.mts +0 -30
  101. /package/{src/__tests__/utils/index.ts → dist/__tests__/utils/index.d.ts} +0 -0
  102. /package/{src/api/index.ts → dist/api/index.d.ts} +0 -0
  103. /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
  104. /package/{src/composables/index.ts → dist/composables/index.d.ts} +0 -0
  105. /package/{src/constants/index.ts → dist/constants/index.d.ts} +0 -0
  106. /package/{src/event-buses/index.ts → dist/event-buses/index.d.ts} +0 -0
  107. /package/{public → dist}/favicon.ico +0 -0
  108. /package/{src/plugins/index.ts → dist/plugins/index.d.ts} +0 -0
  109. /package/{src/types/index.ts → dist/types/index.d.ts} +0 -0
  110. /package/{src/utils/index.ts → dist/utils/index.d.ts} +0 -0
package/README.md CHANGED
@@ -31,9 +31,9 @@ Open the **Webhook** node and replace `YOUR_PRODUCTION_WEBHOOK_URL` with your pr
31
31
  Add the following code to your HTML page.
32
32
 
33
33
  ```html
34
- <link href="https://cdn.jsdelivr.net/npm/@n8n/chat/style.css" rel="stylesheet" />
34
+ <link href="https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css" rel="stylesheet" />
35
35
  <script type="module">
36
- import { createChat } from 'https://cdn.jsdelivr.net/npm/@n8n/chat/chat.bundle.es.js';
36
+ import { createChat } from 'https://cdn.jsdelivr.net/npm/@n8n/chat/dist/chat.bundle.es.js';
37
37
 
38
38
  createChat({
39
39
  webhookUrl: 'YOUR_PRODUCTION_WEBHOOK_URL'
@@ -0,0 +1,8 @@
1
+ declare const _default: import('vue').DefineComponent<Readonly<import('vue').ComponentPropsOptions<{
2
+ [x: string]: unknown;
3
+ }>>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, readonly string[] | Readonly<import('vue').ExtractPropTypes<Readonly<import('vue').ComponentObjectPropsOptions<{
4
+ [x: string]: unknown;
5
+ }>>>>, {
6
+ readonly [x: number]: string;
7
+ } | {}, {}>;
8
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { StoryObj } from '@storybook/vue3';
2
+ import { ChatOptions } from '../types';
3
+
4
+ declare const meta: {
5
+ title: string;
6
+ render: (args: Partial<ChatOptions>) => {
7
+ setup(): {};
8
+ template: string;
9
+ };
10
+ parameters: {
11
+ layout: string;
12
+ };
13
+ tags: string[];
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ export declare const Fullscreen: Story;
18
+ export declare const Windowed: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,6 @@
1
+ import { createChat } from '../../index';
2
+
3
+ export declare function createTestChat(options?: Parameters<typeof createChat>[0]): {
4
+ unmount: () => void;
5
+ container: Element;
6
+ };
@@ -0,0 +1,5 @@
1
+ import { LoadPreviousSessionResponse, SendMessageResponse } from '../../types';
2
+
3
+ export declare function createFetchResponse<T>(data: T): () => Promise<Response>;
4
+ export declare const createGetLatestMessagesResponse: (data?: LoadPreviousSessionResponse["data"]) => LoadPreviousSessionResponse;
5
+ export declare const createSendMessageResponse: (output: SendMessageResponse["output"]) => SendMessageResponse;
@@ -0,0 +1,12 @@
1
+ export declare function getMountingTarget(target?: string): Element | null;
2
+ export declare function getChatWindowWrapper(): Element | null;
3
+ export declare function getChatWindowToggle(): Element | null;
4
+ export declare function getChatWrapper(): Element | null;
5
+ export declare function getChatMessages(): NodeListOf<Element>;
6
+ export declare function getChatMessage(index: number): Element;
7
+ export declare function getChatMessageByText(text: string): HTMLElement | null;
8
+ export declare function getChatMessageTyping(): Element | null;
9
+ export declare function getGetStartedButton(): Element | null;
10
+ export declare function getChatInput(): Element | null;
11
+ export declare function getChatInputTextarea(): Element | null;
12
+ export declare function getChatInputSendButton(): Element | null;
@@ -0,0 +1,6 @@
1
+ export declare function authenticatedFetch<T>(...args: Parameters<typeof fetch>): Promise<T>;
2
+ export declare function get<T>(url: string, query?: object, options?: RequestInit): Promise<T>;
3
+ export declare function post<T>(url: string, body?: object, options?: RequestInit): Promise<T>;
4
+ export declare function put<T>(url: string, body?: object, options?: RequestInit): Promise<T>;
5
+ export declare function patch<T>(url: string, body?: object, options?: RequestInit): Promise<T>;
6
+ export declare function del<T>(url: string, body?: object, options?: RequestInit): Promise<T>;
@@ -0,0 +1,4 @@
1
+ import { ChatOptions, LoadPreviousSessionResponse, SendMessageResponse } from '../types';
2
+
3
+ export declare function loadPreviousSession(sessionId: string, options: ChatOptions): Promise<LoadPreviousSessionResponse>;
4
+ export declare function sendMessage(message: string, sessionId: string, options: ChatOptions): Promise<SendMessageResponse>;