@n8n/chat 0.19.0 → 0.20.0
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/README.md +2 -2
- package/dist/App.vue.d.ts +8 -0
- package/dist/__stories__/App.stories.d.ts +19 -0
- package/dist/__tests__/index.spec.d.ts +1 -0
- package/dist/__tests__/setup.d.ts +1 -0
- package/dist/__tests__/utils/create.d.ts +6 -0
- package/dist/__tests__/utils/fetch.d.ts +5 -0
- package/dist/__tests__/utils/selectors.d.ts +12 -0
- package/dist/api/generic.d.ts +7 -0
- package/dist/api/message.d.ts +4 -0
- package/dist/chat.bundle.es.js +12888 -0
- package/dist/chat.bundle.umd.js +37 -0
- package/dist/chat.es.js +8773 -0
- package/dist/chat.umd.js +18 -0
- package/dist/components/Button.vue.d.ts +11 -0
- package/dist/components/Chat.vue.d.ts +2 -0
- package/dist/components/ChatFile.vue.d.ts +23 -0
- package/dist/components/ChatWindow.vue.d.ts +2 -0
- package/dist/components/GetStarted.vue.d.ts +2 -0
- package/dist/components/GetStartedFooter.vue.d.ts +2 -0
- package/dist/components/Input.vue.d.ts +10 -0
- package/dist/components/Layout.vue.d.ts +13 -0
- package/dist/components/Message.vue.d.ts +40 -0
- package/dist/components/MessageTyping.vue.d.ts +29 -0
- package/dist/components/MessagesList.vue.d.ts +32 -0
- package/dist/components/PoweredBy.vue.d.ts +2 -0
- package/dist/composables/useChat.d.ts +3 -0
- package/dist/composables/useI18n.d.ts +4 -0
- package/dist/composables/useOptions.d.ts +5 -0
- package/dist/constants/defaults.d.ts +4 -0
- package/dist/constants/localStorage.d.ts +2 -0
- package/dist/constants/symbols.d.ts +5 -0
- package/dist/event-buses/chatEventBus.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/plugins/chat.d.ts +4 -0
- package/dist/style.css +10 -0
- package/dist/types/chat.d.ts +12 -0
- package/{src/types/messages.ts → dist/types/messages.d.ts} +11 -12
- package/dist/types/options.d.ts +33 -0
- package/dist/types/webhook.d.ts +16 -0
- package/dist/utils/event-bus.d.ts +8 -0
- package/dist/utils/mount.d.ts +1 -0
- package/package.json +14 -8
- package/.eslintignore +0 -2
- package/.eslintrc.cjs +0 -10
- package/.np-config.json +0 -5
- package/.storybook/main.ts +0 -4
- package/.storybook/preview.scss +0 -4
- package/.storybook/preview.ts +0 -15
- package/.vscode/extensions.json +0 -3
- package/build.config.js +0 -21
- package/env.d.ts +0 -1
- package/index.html +0 -13
- package/resources/images/fullscreen.png +0 -0
- package/resources/images/windowed.png +0 -0
- package/resources/workflow-manual.json +0 -238
- package/resources/workflow.json +0 -119
- package/scripts/pack.js +0 -11
- package/scripts/postbuild.js +0 -36
- package/src/App.vue +0 -23
- package/src/__stories__/App.stories.ts +0 -43
- package/src/__tests__/index.spec.ts +0 -218
- package/src/__tests__/setup.ts +0 -1
- package/src/__tests__/utils/create.ts +0 -16
- package/src/__tests__/utils/fetch.ts +0 -18
- package/src/__tests__/utils/selectors.ts +0 -53
- package/src/api/generic.ts +0 -63
- package/src/api/message.ts +0 -37
- package/src/components/Button.vue +0 -41
- package/src/components/Chat.vue +0 -96
- package/src/components/ChatWindow.vue +0 -123
- package/src/components/GetStarted.vue +0 -24
- package/src/components/GetStartedFooter.vue +0 -20
- package/src/components/Input.vue +0 -108
- package/src/components/Layout.vue +0 -99
- package/src/components/Message.vue +0 -137
- package/src/components/MessageTyping.vue +0 -110
- package/src/components/MessagesList.vue +0 -33
- package/src/components/PoweredBy.vue +0 -17
- package/src/composables/useChat.ts +0 -7
- package/src/composables/useI18n.ts +0 -21
- package/src/composables/useOptions.ts +0 -11
- package/src/constants/defaults.ts +0 -30
- package/src/constants/localStorage.ts +0 -2
- package/src/constants/symbols.ts +0 -8
- package/src/css/_tokens.scss +0 -38
- package/src/css/index.scss +0 -1
- package/src/event-buses/chatEventBus.ts +0 -3
- package/src/index.ts +0 -42
- package/src/main.scss +0 -5
- package/src/plugins/chat.ts +0 -115
- package/src/shims.d.ts +0 -6
- package/src/types/chat.ts +0 -12
- package/src/types/icons.d.ts +0 -5
- package/src/types/options.ts +0 -33
- package/src/types/webhook.ts +0 -18
- package/src/utils/event-bus.ts +0 -51
- package/src/utils/mount.ts +0 -16
- package/tsconfig.json +0 -24
- package/vite.config.mts +0 -53
- package/vitest.config.mts +0 -30
- /package/{src/__tests__/utils/index.ts → dist/__tests__/utils/index.d.ts} +0 -0
- /package/{src/api/index.ts → dist/api/index.d.ts} +0 -0
- /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
- /package/{src/composables/index.ts → dist/composables/index.d.ts} +0 -0
- /package/{src/constants/index.ts → dist/constants/index.d.ts} +0 -0
- /package/{src/event-buses/index.ts → dist/event-buses/index.d.ts} +0 -0
- /package/{public → dist}/favicon.ico +0 -0
- /package/{src/plugins/index.ts → dist/plugins/index.d.ts} +0 -0
- /package/{src/types/index.ts → dist/types/index.d.ts} +0 -0
- /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,19 @@
|
|
|
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;
|
|
19
|
+
export declare const WorkflowChat: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -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,7 @@
|
|
|
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 postWithFiles<T>(url: string, body?: Record<string, unknown>, files?: File[], options?: RequestInit): Promise<T>;
|
|
5
|
+
export declare function put<T>(url: string, body?: object, options?: RequestInit): Promise<T>;
|
|
6
|
+
export declare function patch<T>(url: string, body?: object, options?: RequestInit): Promise<T>;
|
|
7
|
+
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, files: File[], sessionId: string, options: ChatOptions): Promise<SendMessageResponse>;
|