@n8n/chat 0.6.1 → 0.7.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.
Files changed (209) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.cjs +10 -0
  3. package/.np-config.json +5 -0
  4. package/.storybook/main.ts +27 -0
  5. package/.storybook/preview.scss +4 -0
  6. package/.storybook/preview.ts +16 -0
  7. package/.vscode/extensions.json +3 -0
  8. package/build.config.js +21 -0
  9. package/env.d.ts +1 -0
  10. package/index.html +13 -0
  11. package/package.json +2 -34
  12. package/resources/images/fullscreen.png +0 -0
  13. package/resources/images/windowed.png +0 -0
  14. package/resources/workflow-manual.json +238 -0
  15. package/resources/workflow.json +119 -0
  16. package/scripts/pack.js +11 -0
  17. package/scripts/postbuild.js +36 -0
  18. package/src/__stories__/App.stories.ts +43 -0
  19. package/src/__tests__/index.spec.ts +218 -0
  20. package/src/__tests__/utils/create.ts +16 -0
  21. package/src/__tests__/utils/fetch.ts +18 -0
  22. package/src/__tests__/utils/selectors.ts +53 -0
  23. package/src/api/generic.ts +63 -0
  24. package/src/api/message.ts +37 -0
  25. package/src/components/Button.vue +41 -0
  26. package/src/components/ChatWindow.vue +125 -0
  27. package/{components → src/components}/GetStarted.vue +7 -7
  28. package/{components → src/components}/GetStartedFooter.vue +2 -2
  29. package/{components → src/components}/Input.vue +40 -35
  30. package/src/components/Layout.vue +82 -0
  31. package/src/components/Message.vue +97 -0
  32. package/src/components/MessageTyping.vue +109 -0
  33. package/{components → src/components}/MessagesList.vue +4 -4
  34. package/{components → src/components}/PoweredBy.vue +7 -6
  35. package/src/composables/useChat.ts +7 -0
  36. package/src/composables/useI18n.ts +16 -0
  37. package/src/composables/useOptions.ts +11 -0
  38. package/src/constants/defaults.ts +29 -0
  39. package/{constants/localStorage.mjs → src/constants/localStorage.ts} +1 -1
  40. package/src/constants/symbols.ts +8 -0
  41. package/src/css/_tokens.scss +36 -0
  42. package/src/css/index.scss +1 -0
  43. package/src/event-buses/chatEventBus.ts +3 -0
  44. package/src/index.ts +42 -0
  45. package/src/main.scss +5 -0
  46. package/src/plugins/chat.ts +105 -0
  47. package/src/types/chat.ts +12 -0
  48. package/src/types/messages.ts +6 -0
  49. package/src/types/options.ts +28 -0
  50. package/src/types/webhook.ts +17 -0
  51. package/src/utils/event-bus.ts +51 -0
  52. package/src/utils/mount.ts +16 -0
  53. package/tsconfig.json +27 -0
  54. package/vite.config.ts +53 -0
  55. package/vitest.config.ts +20 -0
  56. package/__stories__/App.stories.d.ts +0 -16
  57. package/__stories__/App.stories.js +0 -38
  58. package/__stories__/App.stories.mjs +0 -32
  59. package/__tests__/index.spec.d.ts +0 -1
  60. package/__tests__/index.spec.js +0 -146
  61. package/__tests__/index.spec.mjs +0 -172
  62. package/__tests__/setup.js +0 -3
  63. package/__tests__/setup.mjs +0 -1
  64. package/__tests__/utils/create.d.ts +0 -5
  65. package/__tests__/utils/create.js +0 -16
  66. package/__tests__/utils/create.mjs +0 -10
  67. package/__tests__/utils/fetch.d.ts +0 -3
  68. package/__tests__/utils/fetch.js +0 -20
  69. package/__tests__/utils/fetch.mjs +0 -9
  70. package/__tests__/utils/index.js +0 -38
  71. package/__tests__/utils/index.mjs +0 -3
  72. package/__tests__/utils/selectors.d.ts +0 -12
  73. package/__tests__/utils/selectors.js +0 -58
  74. package/__tests__/utils/selectors.mjs +0 -41
  75. package/api/generic.d.ts +0 -6
  76. package/api/generic.js +0 -68
  77. package/api/generic.mjs +0 -54
  78. package/api/index.js +0 -27
  79. package/api/index.mjs +0 -2
  80. package/api/message.d.ts +0 -3
  81. package/api/message.js +0 -33
  82. package/api/message.mjs +0 -30
  83. package/chat.bundle.es.js +0 -10753
  84. package/chat.bundle.umd.js +0 -18
  85. package/chat.es.js +0 -6864
  86. package/chat.umd.js +0 -18
  87. package/components/Button.vue +0 -34
  88. package/components/ChatWindow.vue +0 -104
  89. package/components/Layout.vue +0 -66
  90. package/components/Message.vue +0 -94
  91. package/components/MessageTyping.vue +0 -101
  92. package/components/index.js +0 -76
  93. package/components/index.mjs +0 -10
  94. package/composables/index.js +0 -38
  95. package/composables/index.mjs +0 -3
  96. package/composables/useChat.d.ts +0 -1
  97. package/composables/useChat.js +0 -11
  98. package/composables/useChat.mjs +0 -5
  99. package/composables/useI18n.d.ts +0 -4
  100. package/composables/useI18n.js +0 -23
  101. package/composables/useI18n.mjs +0 -12
  102. package/composables/useOptions.d.ts +0 -3
  103. package/composables/useOptions.js +0 -14
  104. package/composables/useOptions.mjs +0 -8
  105. package/constants/defaults.d.ts +0 -3
  106. package/constants/defaults.js +0 -32
  107. package/constants/defaults.mjs +0 -26
  108. package/constants/index.js +0 -38
  109. package/constants/index.mjs +0 -3
  110. package/constants/localStorage.d.ts +0 -2
  111. package/constants/localStorage.js +0 -8
  112. package/constants/symbols.d.ts +0 -3
  113. package/constants/symbols.js +0 -8
  114. package/constants/symbols.mjs +0 -2
  115. package/css/index.css +0 -31
  116. package/event-buses/chatEventBus.d.ts +0 -1
  117. package/event-buses/chatEventBus.js +0 -8
  118. package/event-buses/chatEventBus.mjs +0 -2
  119. package/event-buses/index.js +0 -16
  120. package/event-buses/index.mjs +0 -1
  121. package/index.d.ts +0 -3
  122. package/index.js +0 -43
  123. package/index.mjs +0 -36
  124. package/main.css +0 -151
  125. package/plugins/chat.d.ts +0 -3
  126. package/plugins/chat.js +0 -85
  127. package/plugins/chat.mjs +0 -83
  128. package/plugins/index.js +0 -16
  129. package/plugins/index.mjs +0 -1
  130. package/style.css +0 -1
  131. package/types/App.vue.d.ts +0 -8
  132. package/types/__stories__/App.stories.d.ts +0 -17
  133. package/types/__tests__/index.spec.d.ts +0 -1
  134. package/types/__tests__/setup.d.ts +0 -0
  135. package/types/__tests__/utils/create.d.ts +0 -5
  136. package/types/__tests__/utils/fetch.d.ts +0 -4
  137. package/types/__tests__/utils/index.d.ts +0 -3
  138. package/types/__tests__/utils/selectors.d.ts +0 -12
  139. package/types/api/generic.d.ts +0 -6
  140. package/types/api/index.d.ts +0 -2
  141. package/types/api/message.d.ts +0 -3
  142. package/types/chat.d.ts +0 -11
  143. package/types/chat.js +0 -1
  144. package/types/chat.mjs +0 -0
  145. package/types/components/Button.vue.d.ts +0 -9
  146. package/types/components/Chat.vue.d.ts +0 -2
  147. package/types/components/ChatWindow.vue.d.ts +0 -2
  148. package/types/components/GetStarted.vue.d.ts +0 -2
  149. package/types/components/GetStartedFooter.vue.d.ts +0 -2
  150. package/types/components/Input.vue.d.ts +0 -2
  151. package/types/components/Layout.vue.d.ts +0 -11
  152. package/types/components/Message.vue.d.ts +0 -21
  153. package/types/components/MessageTyping.vue.d.ts +0 -15
  154. package/types/components/MessagesList.vue.d.ts +0 -14
  155. package/types/components/PoweredBy.vue.d.ts +0 -2
  156. package/types/components/index.d.ts +0 -10
  157. package/types/composables/index.d.ts +0 -3
  158. package/types/composables/useChat.d.ts +0 -2
  159. package/types/composables/useI18n.d.ts +0 -4
  160. package/types/composables/useOptions.d.ts +0 -4
  161. package/types/constants/defaults.d.ts +0 -3
  162. package/types/constants/index.d.ts +0 -3
  163. package/types/constants/localStorage.d.ts +0 -2
  164. package/types/constants/symbols.d.ts +0 -4
  165. package/types/event-buses/chatEventBus.d.ts +0 -1
  166. package/types/event-buses/index.d.ts +0 -1
  167. package/types/index.js +0 -49
  168. package/types/index.mjs +0 -4
  169. package/types/messages.d.ts +0 -6
  170. package/types/messages.js +0 -1
  171. package/types/messages.mjs +0 -0
  172. package/types/options.d.ts +0 -25
  173. package/types/options.js +0 -1
  174. package/types/options.mjs +0 -0
  175. package/types/plugins/chat.d.ts +0 -3
  176. package/types/plugins/index.d.ts +0 -1
  177. package/types/types/chat.d.ts +0 -11
  178. package/types/types/index.d.ts +0 -4
  179. package/types/types/messages.d.ts +0 -6
  180. package/types/types/options.d.ts +0 -25
  181. package/types/types/webhook.d.ts +0 -15
  182. package/types/utils/event-bus.d.ts +0 -8
  183. package/types/utils/mount.d.ts +0 -1
  184. package/types/webhook.d.ts +0 -15
  185. package/types/webhook.js +0 -1
  186. package/types/webhook.mjs +0 -0
  187. package/utils/event-bus.d.ts +0 -8
  188. package/utils/event-bus.js +0 -38
  189. package/utils/event-bus.mjs +0 -32
  190. package/utils/index.d.ts +0 -2
  191. package/utils/index.js +0 -27
  192. package/utils/index.mjs +0 -2
  193. package/utils/mount.d.ts +0 -1
  194. package/utils/mount.js +0 -19
  195. package/utils/mount.mjs +0 -13
  196. package/{favicon.ico → public/favicon.ico} +0 -0
  197. package/{App.vue → src/App.vue} +1 -1
  198. package/{__tests__/setup.d.ts → src/__tests__/setup.ts} +0 -0
  199. package/{__tests__/utils/index.d.ts → src/__tests__/utils/index.ts} +0 -0
  200. package/{api/index.d.ts → src/api/index.ts} +0 -0
  201. package/{components → src/components}/Chat.vue +1 -1
  202. /package/{components/index.d.ts → src/components/index.ts} +0 -0
  203. /package/{composables/index.d.ts → src/composables/index.ts} +0 -0
  204. /package/{constants/index.d.ts → src/constants/index.ts} +0 -0
  205. /package/{event-buses/index.d.ts → src/event-buses/index.ts} +0 -0
  206. /package/{plugins/index.d.ts → src/plugins/index.ts} +0 -0
  207. /package/{shims.d.ts → src/shims.d.ts} +0 -0
  208. /package/{types/index.d.ts → src/types/index.ts} +0 -0
  209. /package/{types/utils/index.d.ts → src/utils/index.ts} +0 -0
@@ -1,15 +0,0 @@
1
- import type { PropType } from 'vue';
2
- declare const _default: import("vue").DefineComponent<{
3
- animation: {
4
- type: PropType<"bouncing" | "scaling">;
5
- default: string;
6
- };
7
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
- animation: {
9
- type: PropType<"bouncing" | "scaling">;
10
- default: string;
11
- };
12
- }>>, {
13
- animation: "bouncing" | "scaling";
14
- }, {}>;
15
- export default _default;
@@ -1,14 +0,0 @@
1
- import type { PropType } from 'vue';
2
- import type { ChatMessage } from '../types';
3
- declare const _default: import("vue").DefineComponent<{
4
- messages: {
5
- type: PropType<ChatMessage[]>;
6
- required: true;
7
- };
8
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
- messages: {
10
- type: PropType<ChatMessage[]>;
11
- required: true;
12
- };
13
- }>>, {}, {}>;
14
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- export default _default;
@@ -1,10 +0,0 @@
1
- export { default as Button } from './Button.vue';
2
- export { default as Chat } from './Chat.vue';
3
- export { default as ChatWindow } from './ChatWindow.vue';
4
- export { default as GetStarted } from './GetStarted.vue';
5
- export { default as GetStartedFooter } from './GetStartedFooter.vue';
6
- export { default as Input } from './Input.vue';
7
- export { default as Layout } from './Layout.vue';
8
- export { default as Message } from './Message.vue';
9
- export { default as MessagesList } from './MessagesList.vue';
10
- export { default as PoweredBy } from './PoweredBy.vue';
@@ -1,3 +0,0 @@
1
- export * from './useChat';
2
- export * from './useI18n';
3
- export * from './useOptions';
@@ -1,2 +0,0 @@
1
- import type { Chat } from '../types';
2
- export declare function useChat(): Chat;
@@ -1,4 +0,0 @@
1
- export declare function useI18n(): {
2
- t: (key: string) => string;
3
- te: (key: string) => boolean;
4
- };
@@ -1,4 +0,0 @@
1
- import type { ChatOptions } from '../types';
2
- export declare function useOptions(): {
3
- options: ChatOptions;
4
- };
@@ -1,3 +0,0 @@
1
- import type { ChatOptions } from '../types';
2
- export declare const defaultOptions: ChatOptions;
3
- export declare const defaultMountingTarget = "#n8n-chat";
@@ -1,3 +0,0 @@
1
- export * from './defaults';
2
- export * from './localStorage';
3
- export * from './symbols';
@@ -1,2 +0,0 @@
1
- export declare const localStorageNamespace = "n8n-chat";
2
- export declare const localStorageSessionIdKey = "n8n-chat/sessionId";
@@ -1,4 +0,0 @@
1
- import type { InjectionKey } from 'vue';
2
- import type { Chat, ChatOptions } from '../types';
3
- export declare const ChatSymbol: InjectionKey<Chat>;
4
- export declare const ChatOptionsSymbol: InjectionKey<ChatOptions>;
@@ -1 +0,0 @@
1
- export declare const chatEventBus: import('../utils').EventBus;
@@ -1 +0,0 @@
1
- export * from './chatEventBus';
package/types/index.js DELETED
@@ -1,49 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _chat = require("./chat");
7
- Object.keys(_chat).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _chat[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _chat[key];
14
- }
15
- });
16
- });
17
- var _messages = require("./messages");
18
- Object.keys(_messages).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _messages[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _messages[key];
25
- }
26
- });
27
- });
28
- var _options = require("./options");
29
- Object.keys(_options).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _options[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _options[key];
36
- }
37
- });
38
- });
39
- var _webhook = require("./webhook");
40
- Object.keys(_webhook).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _webhook[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _webhook[key];
47
- }
48
- });
49
- });
package/types/index.mjs DELETED
@@ -1,4 +0,0 @@
1
- export * from "./chat.mjs";
2
- export * from "./messages.mjs";
3
- export * from "./options.mjs";
4
- export * from "./webhook.mjs";
@@ -1,6 +0,0 @@
1
- export interface ChatMessage {
2
- id: string;
3
- text: string;
4
- createdAt: string;
5
- sender: 'user' | 'bot';
6
- }
package/types/messages.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
File without changes
@@ -1,25 +0,0 @@
1
- export interface ChatOptions {
2
- webhookUrl: string;
3
- webhookConfig?: {
4
- method?: 'GET' | 'POST';
5
- headers?: Record<string, string>;
6
- };
7
- target?: string | Element;
8
- mode?: 'window' | 'fullscreen';
9
- showWelcomeScreen?: boolean;
10
- loadPreviousSession?: boolean;
11
- chatInputKey?: string;
12
- chatSessionKey?: string;
13
- defaultLanguage?: 'en';
14
- initialMessages?: string[];
15
- metadata?: Record<string, unknown>;
16
- i18n: Record<string, {
17
- title: string;
18
- subtitle: string;
19
- footer: string;
20
- getStarted: string;
21
- inputPlaceholder: string;
22
- [message: string]: string;
23
- }>;
24
- theme?: {};
25
- }
package/types/options.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
package/types/options.mjs DELETED
File without changes
@@ -1,3 +0,0 @@
1
- import type { Plugin } from 'vue';
2
- import type { ChatOptions } from '../types';
3
- export declare const ChatPlugin: Plugin<ChatOptions>;
@@ -1 +0,0 @@
1
- export * from './chat';
@@ -1,11 +0,0 @@
1
- import type { ChatMessage } from '../types/messages';
2
- import type { Ref } from 'vue';
3
- export interface Chat {
4
- initialMessages: Ref<ChatMessage[]>;
5
- messages: Ref<ChatMessage[]>;
6
- currentSessionId: Ref<string | null>;
7
- waitingForResponse: Ref<boolean>;
8
- loadPreviousSession: () => Promise<string | undefined>;
9
- startNewSession: () => Promise<void>;
10
- sendMessage: (text: string) => Promise<void>;
11
- }
@@ -1,4 +0,0 @@
1
- export * from './chat';
2
- export * from './messages';
3
- export * from './options';
4
- export * from './webhook';
@@ -1,6 +0,0 @@
1
- export interface ChatMessage {
2
- id: string;
3
- text: string;
4
- createdAt: string;
5
- sender: 'user' | 'bot';
6
- }
@@ -1,25 +0,0 @@
1
- export interface ChatOptions {
2
- webhookUrl: string;
3
- webhookConfig?: {
4
- method?: 'GET' | 'POST';
5
- headers?: Record<string, string>;
6
- };
7
- target?: string | Element;
8
- mode?: 'window' | 'fullscreen';
9
- showWelcomeScreen?: boolean;
10
- loadPreviousSession?: boolean;
11
- chatInputKey?: string;
12
- chatSessionKey?: string;
13
- defaultLanguage?: 'en';
14
- initialMessages?: string[];
15
- metadata?: Record<string, unknown>;
16
- i18n: Record<string, {
17
- title: string;
18
- subtitle: string;
19
- footer: string;
20
- getStarted: string;
21
- inputPlaceholder: string;
22
- [message: string]: string;
23
- }>;
24
- theme?: {};
25
- }
@@ -1,15 +0,0 @@
1
- export interface LoadPreviousSessionResponseItem {
2
- id: string[];
3
- kwargs: {
4
- content: string;
5
- additional_kwargs: Record<string, unknown>;
6
- };
7
- lc: number;
8
- type: string;
9
- }
10
- export interface LoadPreviousSessionResponse {
11
- data: LoadPreviousSessionResponseItem[];
12
- }
13
- export interface SendMessageResponse {
14
- output: string;
15
- }
@@ -1,8 +0,0 @@
1
- export type CallbackFn = Function;
2
- export type UnregisterFn = () => void;
3
- export interface EventBus {
4
- on: (eventName: string, fn: CallbackFn) => UnregisterFn;
5
- off: (eventName: string, fn: CallbackFn) => void;
6
- emit: <T = Event>(eventName: string, event?: T) => void;
7
- }
8
- export declare function createEventBus(): EventBus;
@@ -1 +0,0 @@
1
- export declare function createDefaultMountingTarget(mountingTarget: string): void;
@@ -1,15 +0,0 @@
1
- export interface LoadPreviousSessionResponseItem {
2
- id: string[];
3
- kwargs: {
4
- content: string;
5
- additional_kwargs: Record<string, unknown>;
6
- };
7
- lc: number;
8
- type: string;
9
- }
10
- export interface LoadPreviousSessionResponse {
11
- data: LoadPreviousSessionResponseItem[];
12
- }
13
- export interface SendMessageResponse {
14
- output: string;
15
- }
package/types/webhook.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
package/types/webhook.mjs DELETED
File without changes
@@ -1,8 +0,0 @@
1
- export type CallbackFn = Function;
2
- export type UnregisterFn = () => void;
3
- export interface EventBus {
4
- on: (eventName: string, fn: CallbackFn) => UnregisterFn;
5
- off: (eventName: string, fn: CallbackFn) => void;
6
- emit: <T = Event>(eventName: string, event?: T) => void;
7
- }
8
- export declare function createEventBus(): EventBus;
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createEventBus = createEventBus;
7
- function createEventBus() {
8
- const handlers = /* @__PURE__ */new Map();
9
- function off(eventName, fn) {
10
- const eventFns = handlers.get(eventName);
11
- if (eventFns) {
12
- eventFns.splice(eventFns.indexOf(fn) >>> 0, 1);
13
- }
14
- }
15
- function on(eventName, fn) {
16
- let eventFns = handlers.get(eventName);
17
- if (!eventFns) {
18
- eventFns = [fn];
19
- } else {
20
- eventFns.push(fn);
21
- }
22
- handlers.set(eventName, eventFns);
23
- return () => off(eventName, fn);
24
- }
25
- function emit(eventName, event) {
26
- const eventFns = handlers.get(eventName);
27
- if (eventFns) {
28
- eventFns.slice().forEach(async handler => {
29
- await handler(event);
30
- });
31
- }
32
- }
33
- return {
34
- on,
35
- off,
36
- emit
37
- };
38
- }
@@ -1,32 +0,0 @@
1
- export function createEventBus() {
2
- const handlers = /* @__PURE__ */ new Map();
3
- function off(eventName, fn) {
4
- const eventFns = handlers.get(eventName);
5
- if (eventFns) {
6
- eventFns.splice(eventFns.indexOf(fn) >>> 0, 1);
7
- }
8
- }
9
- function on(eventName, fn) {
10
- let eventFns = handlers.get(eventName);
11
- if (!eventFns) {
12
- eventFns = [fn];
13
- } else {
14
- eventFns.push(fn);
15
- }
16
- handlers.set(eventName, eventFns);
17
- return () => off(eventName, fn);
18
- }
19
- function emit(eventName, event) {
20
- const eventFns = handlers.get(eventName);
21
- if (eventFns) {
22
- eventFns.slice().forEach(async (handler) => {
23
- await handler(event);
24
- });
25
- }
26
- }
27
- return {
28
- on,
29
- off,
30
- emit
31
- };
32
- }
package/utils/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './event-bus';
2
- export * from './mount';
package/utils/index.js DELETED
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _eventBus = require("./event-bus");
7
- Object.keys(_eventBus).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _eventBus[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _eventBus[key];
14
- }
15
- });
16
- });
17
- var _mount = require("./mount");
18
- Object.keys(_mount).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _mount[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _mount[key];
25
- }
26
- });
27
- });
package/utils/index.mjs DELETED
@@ -1,2 +0,0 @@
1
- export * from "./event-bus.mjs";
2
- export * from "./mount.mjs";
package/utils/mount.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function createDefaultMountingTarget(mountingTarget: string): void;
package/utils/mount.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createDefaultMountingTarget = createDefaultMountingTarget;
7
- function createDefaultMountingTarget(mountingTarget) {
8
- const mountingTargetNode = document.querySelector(mountingTarget);
9
- if (!mountingTargetNode) {
10
- const generatedMountingTargetNode = document.createElement("div");
11
- if (mountingTarget.startsWith("#")) {
12
- generatedMountingTargetNode.id = mountingTarget.replace("#", "");
13
- }
14
- if (mountingTarget.startsWith(".")) {
15
- generatedMountingTargetNode.classList.add(mountingTarget.replace(".", ""));
16
- }
17
- document.body.appendChild(generatedMountingTargetNode);
18
- }
19
- }
package/utils/mount.mjs DELETED
@@ -1,13 +0,0 @@
1
- export function createDefaultMountingTarget(mountingTarget) {
2
- const mountingTargetNode = document.querySelector(mountingTarget);
3
- if (!mountingTargetNode) {
4
- const generatedMountingTargetNode = document.createElement("div");
5
- if (mountingTarget.startsWith("#")) {
6
- generatedMountingTargetNode.id = mountingTarget.replace("#", "");
7
- }
8
- if (mountingTarget.startsWith(".")) {
9
- generatedMountingTargetNode.classList.add(mountingTarget.replace(".", ""));
10
- }
11
- document.body.appendChild(generatedMountingTargetNode);
12
- }
13
- }
File without changes
@@ -1,9 +1,9 @@
1
1
  <script lang="ts" setup>
2
- import { Chat, ChatWindow } from '@n8n/chat/components';
3
2
  import { computed, onMounted } from 'vue';
4
3
  import hljs from 'highlight.js/lib/core';
5
4
  import hljsXML from 'highlight.js/lib/languages/xml';
6
5
  import hljsJavascript from 'highlight.js/lib/languages/javascript';
6
+ import { Chat, ChatWindow } from '@n8n/chat/components';
7
7
  import { useOptions } from '@n8n/chat/composables';
8
8
 
9
9
  defineProps({});
File without changes
File without changes
@@ -1,10 +1,10 @@
1
1
  <script setup lang="ts">
2
+ import { nextTick, onMounted } from 'vue';
2
3
  import Layout from '@n8n/chat/components/Layout.vue';
3
4
  import GetStarted from '@n8n/chat/components/GetStarted.vue';
4
5
  import GetStartedFooter from '@n8n/chat/components/GetStartedFooter.vue';
5
6
  import MessagesList from '@n8n/chat/components/MessagesList.vue';
6
7
  import Input from '@n8n/chat/components/Input.vue';
7
- import { nextTick, onMounted } from 'vue';
8
8
  import { useI18n, useChat, useOptions } from '@n8n/chat/composables';
9
9
  import { chatEventBus } from '@n8n/chat/event-buses';
10
10
 
File without changes
File without changes
File without changes
File without changes