@n8n/chat 0.5.2 → 0.6.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 (247) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.cjs +51 -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/README.md +4 -21
  9. package/env.d.ts +1 -0
  10. package/index.html +13 -0
  11. package/package.json +2 -69
  12. package/resources/workflow.json +293 -0
  13. package/scripts/pack.js +11 -0
  14. package/scripts/postbuild.js +16 -0
  15. package/{App.vue → src/App.vue} +2 -2
  16. package/src/__stories__/App.stories.ts +43 -0
  17. package/src/__tests__/index.spec.ts +223 -0
  18. package/src/__tests__/utils/create.ts +16 -0
  19. package/src/__tests__/utils/fetch.ts +18 -0
  20. package/src/__tests__/utils/selectors.ts +53 -0
  21. package/src/api/generic.ts +64 -0
  22. package/src/api/message.ts +31 -0
  23. package/src/components/Button.vue +41 -0
  24. package/{components → src/components}/Chat.vue +15 -19
  25. package/src/components/ChatWindow.vue +125 -0
  26. package/src/components/GetStarted.vue +24 -0
  27. package/{components → src/components}/GetStartedFooter.vue +4 -4
  28. package/{components → src/components}/Input.vue +40 -35
  29. package/src/components/Layout.vue +82 -0
  30. package/src/components/Message.vue +97 -0
  31. package/src/components/MessageTyping.vue +109 -0
  32. package/{components → src/components}/MessagesList.vue +8 -8
  33. package/{components → src/components}/PoweredBy.vue +7 -6
  34. package/src/composables/useChat.ts +7 -0
  35. package/src/composables/useI18n.ts +16 -0
  36. package/src/composables/useOptions.ts +11 -0
  37. package/src/constants/defaults.ts +25 -0
  38. package/{constants/localStorage.mjs → src/constants/localStorage.ts} +1 -1
  39. package/src/constants/symbols.ts +8 -0
  40. package/src/event-buses/chatEventBus.ts +3 -0
  41. package/src/index.ts +42 -0
  42. package/src/main.scss +40 -0
  43. package/src/plugins/chat.ts +101 -0
  44. package/src/types/chat.ts +12 -0
  45. package/src/types/messages.ts +6 -0
  46. package/src/types/options.ts +23 -0
  47. package/src/types/webhook.ts +17 -0
  48. package/src/utils/event-bus.ts +51 -0
  49. package/src/utils/mount.ts +16 -0
  50. package/tsconfig.json +27 -0
  51. package/vite.config.ts +51 -0
  52. package/vitest.config.ts +20 -0
  53. package/__stories__/App.stories.d.ts +0 -16
  54. package/__stories__/App.stories.js +0 -38
  55. package/__stories__/App.stories.mjs +0 -32
  56. package/__tests__/index.spec.d.ts +0 -1
  57. package/__tests__/index.spec.js +0 -146
  58. package/__tests__/index.spec.mjs +0 -172
  59. package/__tests__/setup.js +0 -3
  60. package/__tests__/setup.mjs +0 -1
  61. package/__tests__/utils/create.d.ts +0 -5
  62. package/__tests__/utils/create.js +0 -16
  63. package/__tests__/utils/create.mjs +0 -10
  64. package/__tests__/utils/fetch.d.ts +0 -3
  65. package/__tests__/utils/fetch.js +0 -20
  66. package/__tests__/utils/fetch.mjs +0 -9
  67. package/__tests__/utils/index.js +0 -38
  68. package/__tests__/utils/index.mjs +0 -3
  69. package/__tests__/utils/selectors.d.ts +0 -12
  70. package/__tests__/utils/selectors.js +0 -58
  71. package/__tests__/utils/selectors.mjs +0 -41
  72. package/api/generic.d.ts +0 -6
  73. package/api/generic.js +0 -68
  74. package/api/generic.mjs +0 -54
  75. package/api/index.js +0 -27
  76. package/api/index.mjs +0 -2
  77. package/api/message.d.ts +0 -3
  78. package/api/message.js +0 -33
  79. package/api/message.mjs +0 -30
  80. package/chat.bundle.es.js +0 -10760
  81. package/chat.bundle.umd.js +0 -18
  82. package/components/Button.vue +0 -34
  83. package/components/ChatWindow.vue +0 -104
  84. package/components/GetStarted.vue +0 -24
  85. package/components/Layout.vue +0 -66
  86. package/components/Message.vue +0 -94
  87. package/components/MessageTyping.vue +0 -101
  88. package/components/index.js +0 -76
  89. package/components/index.mjs +0 -10
  90. package/composables/index.js +0 -38
  91. package/composables/index.mjs +0 -3
  92. package/composables/useChat.d.ts +0 -1
  93. package/composables/useChat.js +0 -11
  94. package/composables/useChat.mjs +0 -5
  95. package/composables/useI18n.d.ts +0 -4
  96. package/composables/useI18n.js +0 -23
  97. package/composables/useI18n.mjs +0 -12
  98. package/composables/useOptions.d.ts +0 -3
  99. package/composables/useOptions.js +0 -14
  100. package/composables/useOptions.mjs +0 -8
  101. package/constants/defaults.d.ts +0 -3
  102. package/constants/defaults.js +0 -32
  103. package/constants/defaults.mjs +0 -26
  104. package/constants/index.js +0 -38
  105. package/constants/index.mjs +0 -3
  106. package/constants/localStorage.d.ts +0 -2
  107. package/constants/localStorage.js +0 -8
  108. package/constants/symbols.d.ts +0 -3
  109. package/constants/symbols.js +0 -8
  110. package/constants/symbols.mjs +0 -2
  111. package/css/index.css +0 -31
  112. package/event-buses/chatEventBus.d.ts +0 -1
  113. package/event-buses/chatEventBus.js +0 -8
  114. package/event-buses/chatEventBus.mjs +0 -2
  115. package/event-buses/index.js +0 -16
  116. package/event-buses/index.mjs +0 -1
  117. package/index.d.ts +0 -3
  118. package/index.js +0 -43
  119. package/index.mjs +0 -36
  120. package/main.css +0 -151
  121. package/plugins/chat.d.ts +0 -3
  122. package/plugins/chat.js +0 -85
  123. package/plugins/chat.mjs +0 -83
  124. package/plugins/index.js +0 -16
  125. package/plugins/index.mjs +0 -1
  126. package/style.css +0 -1
  127. package/types/App.vue.d.ts +0 -8
  128. package/types/__stories__/App.stories.d.ts +0 -17
  129. package/types/__tests__/index.spec.d.ts +0 -1
  130. package/types/__tests__/setup.d.ts +0 -0
  131. package/types/__tests__/utils/create.d.ts +0 -5
  132. package/types/__tests__/utils/fetch.d.ts +0 -4
  133. package/types/__tests__/utils/index.d.ts +0 -3
  134. package/types/__tests__/utils/selectors.d.ts +0 -12
  135. package/types/api/generic.d.ts +0 -6
  136. package/types/api/index.d.ts +0 -2
  137. package/types/api/message.d.ts +0 -3
  138. package/types/chat.d.ts +0 -11
  139. package/types/chat.js +0 -1
  140. package/types/chat.mjs +0 -0
  141. package/types/components/Button.vue.d.ts +0 -9
  142. package/types/components/Chat.vue.d.ts +0 -2
  143. package/types/components/ChatWindow.vue.d.ts +0 -2
  144. package/types/components/GetStarted.vue.d.ts +0 -2
  145. package/types/components/GetStartedFooter.vue.d.ts +0 -2
  146. package/types/components/Input.vue.d.ts +0 -2
  147. package/types/components/Layout.vue.d.ts +0 -11
  148. package/types/components/Message.vue.d.ts +0 -21
  149. package/types/components/MessageTyping.vue.d.ts +0 -15
  150. package/types/components/MessagesList.vue.d.ts +0 -14
  151. package/types/components/PoweredBy.vue.d.ts +0 -2
  152. package/types/components/index.d.ts +0 -10
  153. package/types/composables/index.d.ts +0 -3
  154. package/types/composables/useChat.d.ts +0 -2
  155. package/types/composables/useI18n.d.ts +0 -4
  156. package/types/composables/useOptions.d.ts +0 -4
  157. package/types/constants/defaults.d.ts +0 -3
  158. package/types/constants/index.d.ts +0 -3
  159. package/types/constants/localStorage.d.ts +0 -2
  160. package/types/constants/symbols.d.ts +0 -4
  161. package/types/event-buses/chatEventBus.d.ts +0 -1
  162. package/types/event-buses/index.d.ts +0 -1
  163. package/types/index.js +0 -49
  164. package/types/index.mjs +0 -4
  165. package/types/messages.d.ts +0 -6
  166. package/types/messages.js +0 -1
  167. package/types/messages.mjs +0 -0
  168. package/types/options.d.ts +0 -25
  169. package/types/options.js +0 -1
  170. package/types/options.mjs +0 -0
  171. package/types/plugins/chat.d.ts +0 -3
  172. package/types/plugins/index.d.ts +0 -1
  173. package/types/src/App.vue.d.ts +0 -8
  174. package/types/src/__stories__/App.stories.d.ts +0 -17
  175. package/types/src/__tests__/index.spec.d.ts +0 -1
  176. package/types/src/__tests__/setup.d.ts +0 -0
  177. package/types/src/__tests__/utils/create.d.ts +0 -5
  178. package/types/src/__tests__/utils/fetch.d.ts +0 -4
  179. package/types/src/__tests__/utils/index.d.ts +0 -3
  180. package/types/src/__tests__/utils/selectors.d.ts +0 -12
  181. package/types/src/api/generic.d.ts +0 -6
  182. package/types/src/api/index.d.ts +0 -2
  183. package/types/src/api/message.d.ts +0 -3
  184. package/types/src/components/Button.vue.d.ts +0 -9
  185. package/types/src/components/Chat.vue.d.ts +0 -2
  186. package/types/src/components/ChatWindow.vue.d.ts +0 -2
  187. package/types/src/components/GetStarted.vue.d.ts +0 -2
  188. package/types/src/components/GetStartedFooter.vue.d.ts +0 -2
  189. package/types/src/components/Input.vue.d.ts +0 -2
  190. package/types/src/components/Layout.vue.d.ts +0 -11
  191. package/types/src/components/Message.vue.d.ts +0 -21
  192. package/types/src/components/MessageTyping.vue.d.ts +0 -15
  193. package/types/src/components/MessagesList.vue.d.ts +0 -14
  194. package/types/src/components/PoweredBy.vue.d.ts +0 -2
  195. package/types/src/components/index.d.ts +0 -10
  196. package/types/src/composables/index.d.ts +0 -3
  197. package/types/src/composables/useChat.d.ts +0 -2
  198. package/types/src/composables/useI18n.d.ts +0 -4
  199. package/types/src/composables/useOptions.d.ts +0 -4
  200. package/types/src/constants/defaults.d.ts +0 -3
  201. package/types/src/constants/index.d.ts +0 -3
  202. package/types/src/constants/localStorage.d.ts +0 -2
  203. package/types/src/constants/symbols.d.ts +0 -4
  204. package/types/src/event-buses/chatEventBus.d.ts +0 -1
  205. package/types/src/event-buses/index.d.ts +0 -1
  206. package/types/src/index.d.ts +0 -2
  207. package/types/src/plugins/chat.d.ts +0 -3
  208. package/types/src/plugins/index.d.ts +0 -1
  209. package/types/src/types/chat.d.ts +0 -11
  210. package/types/src/types/index.d.ts +0 -4
  211. package/types/src/types/messages.d.ts +0 -6
  212. package/types/src/types/options.d.ts +0 -25
  213. package/types/src/types/webhook.d.ts +0 -15
  214. package/types/src/utils/event-bus.d.ts +0 -8
  215. package/types/src/utils/mount.d.ts +0 -1
  216. package/types/types/chat.d.ts +0 -11
  217. package/types/types/index.d.ts +0 -4
  218. package/types/types/messages.d.ts +0 -6
  219. package/types/types/options.d.ts +0 -25
  220. package/types/types/webhook.d.ts +0 -15
  221. package/types/utils/event-bus.d.ts +0 -8
  222. package/types/utils/index.d.ts +0 -2
  223. package/types/utils/mount.d.ts +0 -1
  224. package/types/webhook.d.ts +0 -15
  225. package/types/webhook.js +0 -1
  226. package/types/webhook.mjs +0 -0
  227. package/utils/event-bus.d.ts +0 -8
  228. package/utils/event-bus.js +0 -38
  229. package/utils/event-bus.mjs +0 -32
  230. package/utils/index.d.ts +0 -2
  231. package/utils/index.js +0 -27
  232. package/utils/index.mjs +0 -2
  233. package/utils/mount.d.ts +0 -1
  234. package/utils/mount.js +0 -19
  235. package/utils/mount.mjs +0 -13
  236. /package/{favicon.ico → public/favicon.ico} +0 -0
  237. /package/{__tests__/setup.d.ts → src/__tests__/setup.ts} +0 -0
  238. /package/{__tests__/utils/index.d.ts → src/__tests__/utils/index.ts} +0 -0
  239. /package/{api/index.d.ts → src/api/index.ts} +0 -0
  240. /package/{components/index.d.ts → src/components/index.ts} +0 -0
  241. /package/{composables/index.d.ts → src/composables/index.ts} +0 -0
  242. /package/{constants/index.d.ts → src/constants/index.ts} +0 -0
  243. /package/{event-buses/index.d.ts → src/event-buses/index.ts} +0 -0
  244. /package/{plugins/index.d.ts → src/plugins/index.ts} +0 -0
  245. /package/{shims.d.ts → src/shims.d.ts} +0 -0
  246. /package/{types/index.d.ts → src/types/index.ts} +0 -0
  247. /package/{types/src/utils/index.d.ts → src/utils/index.ts} +0 -0
@@ -1 +0,0 @@
1
- export declare const chatEventBus: import('../utils').EventBus;
@@ -1 +0,0 @@
1
- export * from './chatEventBus';
@@ -1,2 +0,0 @@
1
- import type { ChatOptions } from './types';
2
- export declare function createChat(options?: Partial<ChatOptions>): import("vue").App<Element>;
@@ -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,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,2 +0,0 @@
1
- export * from './event-bus';
2
- export * from './mount';
@@ -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
File without changes
File without changes
File without changes
File without changes