@n8n/chat 0.16.0 → 0.18.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/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
-
import type { PropType } from 'vue';
|
|
4
3
|
import { computed, toRefs } from 'vue';
|
|
5
4
|
import VueMarkdown from 'vue-markdown-render';
|
|
6
5
|
import hljs from 'highlight.js/lib/core';
|
|
@@ -9,12 +8,9 @@ import type MarkdownIt from 'markdown-it';
|
|
|
9
8
|
import type { ChatMessage, ChatMessageText } from '@n8n/chat/types';
|
|
10
9
|
import { useOptions } from '@n8n/chat/composables';
|
|
11
10
|
|
|
12
|
-
const props = defineProps
|
|
13
|
-
message:
|
|
14
|
-
|
|
15
|
-
required: true,
|
|
16
|
-
},
|
|
17
|
-
});
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
message: ChatMessage;
|
|
13
|
+
}>();
|
|
18
14
|
|
|
19
15
|
const { message } = toRefs(props);
|
|
20
16
|
const { options } = useOptions();
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { PropType } from 'vue';
|
|
3
2
|
import { computed } from 'vue';
|
|
4
3
|
import { Message } from './index';
|
|
5
4
|
import type { ChatMessage } from '@n8n/chat/types';
|
|
6
5
|
|
|
7
|
-
const props =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<{
|
|
8
|
+
animation?: 'bouncing' | 'scaling';
|
|
9
|
+
}>(),
|
|
10
|
+
{
|
|
11
|
+
animation: 'bouncing',
|
|
11
12
|
},
|
|
12
|
-
|
|
13
|
+
);
|
|
13
14
|
|
|
14
15
|
const message: ChatMessage = {
|
|
15
16
|
id: 'typing',
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { PropType } from 'vue';
|
|
3
2
|
import Message from '@n8n/chat/components/Message.vue';
|
|
4
3
|
import type { ChatMessage } from '@n8n/chat/types';
|
|
5
4
|
import MessageTyping from '@n8n/chat/components/MessageTyping.vue';
|
|
6
5
|
import { useChat } from '@n8n/chat/composables';
|
|
7
6
|
|
|
8
|
-
defineProps
|
|
9
|
-
messages:
|
|
10
|
-
|
|
11
|
-
required: true,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
7
|
+
defineProps<{
|
|
8
|
+
messages: ChatMessage[];
|
|
9
|
+
}>();
|
|
14
10
|
|
|
15
11
|
const chatStore = useChat();
|
|
16
12
|
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
import { fileURLToPath, URL } from 'node:url';
|
|
2
|
-
|
|
3
1
|
import { defineConfig } from 'vite';
|
|
4
|
-
import checker from 'vite-plugin-checker';
|
|
5
2
|
import { resolve } from 'path';
|
|
6
3
|
import vue from '@vitejs/plugin-vue';
|
|
7
4
|
import icons from 'unplugin-icons/vite';
|
|
8
5
|
import dts from 'vite-plugin-dts';
|
|
9
6
|
|
|
10
7
|
const includeVue = process.env.INCLUDE_VUE === 'true';
|
|
11
|
-
const srcPath =
|
|
12
|
-
|
|
13
|
-
const plugins = [
|
|
14
|
-
vue(),
|
|
15
|
-
icons({
|
|
16
|
-
compiler: 'vue3',
|
|
17
|
-
autoInstall: true,
|
|
18
|
-
}),
|
|
19
|
-
dts(),
|
|
20
|
-
];
|
|
21
|
-
if (process.env.ENABLE_TYPE_CHECKING === 'true') {
|
|
22
|
-
plugins.push(checker({ vueTsc: true }));
|
|
23
|
-
}
|
|
8
|
+
const srcPath = resolve(__dirname, 'src');
|
|
24
9
|
|
|
25
10
|
// https://vitejs.dev/config/
|
|
26
11
|
export default defineConfig({
|
|
27
|
-
plugins
|
|
12
|
+
plugins: [
|
|
13
|
+
vue(),
|
|
14
|
+
icons({
|
|
15
|
+
compiler: 'vue3',
|
|
16
|
+
autoInstall: true,
|
|
17
|
+
}),
|
|
18
|
+
dts(),
|
|
19
|
+
],
|
|
28
20
|
resolve: {
|
|
29
21
|
alias: {
|
|
30
22
|
'@': srcPath,
|
|
@@ -54,7 +46,7 @@ export default defineConfig({
|
|
|
54
46
|
? {}
|
|
55
47
|
: {
|
|
56
48
|
vue: 'Vue',
|
|
57
|
-
|
|
49
|
+
},
|
|
58
50
|
},
|
|
59
51
|
},
|
|
60
52
|
},
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { mergeConfig } from 'vite';
|
|
3
|
+
import { type UserConfig } from 'vitest';
|
|
4
|
+
import { defineConfig } from 'vitest/config';
|
|
5
|
+
import viteConfig from './vite.config.mts';
|
|
6
|
+
|
|
7
|
+
const srcPath = resolve(__dirname, 'src');
|
|
8
|
+
const vitestConfig = defineConfig({
|
|
9
|
+
test: {
|
|
10
|
+
globals: true,
|
|
11
|
+
environment: 'jsdom',
|
|
12
|
+
root: srcPath,
|
|
13
|
+
setupFiles: ['./src/__tests__/setup.ts'],
|
|
14
|
+
...(process.env.COVERAGE_ENABLED === 'true'
|
|
15
|
+
? {
|
|
16
|
+
coverage: {
|
|
17
|
+
enabled: true,
|
|
18
|
+
provider: 'v8',
|
|
19
|
+
reporter: process.env.CI === 'true' ? 'cobertura' : 'text-summary',
|
|
20
|
+
all: true,
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
: {}),
|
|
24
|
+
},
|
|
25
|
+
}) as UserConfig;
|
|
26
|
+
|
|
27
|
+
export default mergeConfig(
|
|
28
|
+
viteConfig,
|
|
29
|
+
vitestConfig,
|
|
30
|
+
);
|
package/vitest.config.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'node:url';
|
|
2
|
-
import { mergeConfig, defineConfig } from 'vite';
|
|
3
|
-
import { configDefaults } from 'vitest/config';
|
|
4
|
-
import viteConfig from './vite.config';
|
|
5
|
-
|
|
6
|
-
export default mergeConfig(
|
|
7
|
-
viteConfig,
|
|
8
|
-
defineConfig({
|
|
9
|
-
test: {
|
|
10
|
-
globals: true,
|
|
11
|
-
environment: 'jsdom',
|
|
12
|
-
exclude: [...configDefaults.exclude, 'e2e/*'],
|
|
13
|
-
root: fileURLToPath(new URL('./', import.meta.url)),
|
|
14
|
-
setupFiles: ['./src/__tests__/setup.ts'],
|
|
15
|
-
transformMode: {
|
|
16
|
-
web: [/\.[jt]sx$/],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
);
|