@fv-ui/ai-chat 0.1.0 → 0.1.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.
- package/es/index.mjs +9 -2
- package/lib/index.js +9 -2
- package/package.json +80 -80
package/es/index.mjs
CHANGED
|
@@ -7,6 +7,13 @@ import { ElAvatar, ElButton, ElPopover, ElIcon, ElDialog, ElDropdown, ElDropdown
|
|
|
7
7
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
|
|
8
8
|
import { ArrowDown, Delete, Microphone, VideoPause, Promotion, Loading, SuccessFilled, CircleCloseFilled, ChatDotRound, Cpu, Cellphone, Link, Folder, Headset, Film, Monitor, DataAnalysis, Document, Notebook, Picture, Close, Paperclip, RefreshRight, MoreFilled, User, DocumentCopy, ArrowUp, CopyDocument, Download, FullScreen } from '@element-plus/icons-vue';
|
|
9
9
|
|
|
10
|
+
function unwrapPlugin(plugin) {
|
|
11
|
+
const candidate = plugin && typeof plugin === "object" && "default" in plugin ? plugin.default : plugin;
|
|
12
|
+
if (typeof candidate !== "function") {
|
|
13
|
+
throw new TypeError("[XMarkdown] \u65E0\u6548\u7684 markdown-it \u63D2\u4EF6:\u9884\u671F\u51FD\u6570,\u6536\u5230 " + typeof candidate);
|
|
14
|
+
}
|
|
15
|
+
return candidate;
|
|
16
|
+
}
|
|
10
17
|
function createMarkdownInstance(options) {
|
|
11
18
|
const md = new MarkdownIt({
|
|
12
19
|
html: true,
|
|
@@ -14,9 +21,9 @@ function createMarkdownInstance(options) {
|
|
|
14
21
|
linkify: true,
|
|
15
22
|
highlight: options?.highlight
|
|
16
23
|
});
|
|
17
|
-
md.use(mdKatex);
|
|
24
|
+
md.use(unwrapPlugin(mdKatex));
|
|
18
25
|
if (options?.mdPlugins) {
|
|
19
|
-
for (const p of options.mdPlugins) md.use(p);
|
|
26
|
+
for (const p of options.mdPlugins) md.use(unwrapPlugin(p));
|
|
20
27
|
}
|
|
21
28
|
return md;
|
|
22
29
|
}
|
package/lib/index.js
CHANGED
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
|
|
24
24
|
var ElementPlusIconsVue__namespace = /*#__PURE__*/_interopNamespaceDefault(ElementPlusIconsVue);
|
|
25
25
|
|
|
26
|
+
function unwrapPlugin(plugin) {
|
|
27
|
+
const candidate = plugin && typeof plugin === "object" && "default" in plugin ? plugin.default : plugin;
|
|
28
|
+
if (typeof candidate !== "function") {
|
|
29
|
+
throw new TypeError("[XMarkdown] \u65E0\u6548\u7684 markdown-it \u63D2\u4EF6:\u9884\u671F\u51FD\u6570,\u6536\u5230 " + typeof candidate);
|
|
30
|
+
}
|
|
31
|
+
return candidate;
|
|
32
|
+
}
|
|
26
33
|
function createMarkdownInstance(options) {
|
|
27
34
|
const md = new MarkdownIt({
|
|
28
35
|
html: true,
|
|
@@ -30,9 +37,9 @@
|
|
|
30
37
|
linkify: true,
|
|
31
38
|
highlight: options?.highlight
|
|
32
39
|
});
|
|
33
|
-
md.use(mdKatex);
|
|
40
|
+
md.use(unwrapPlugin(mdKatex));
|
|
34
41
|
if (options?.mdPlugins) {
|
|
35
|
-
for (const p of options.mdPlugins) md.use(p);
|
|
42
|
+
for (const p of options.mdPlugins) md.use(unwrapPlugin(p));
|
|
36
43
|
}
|
|
37
44
|
return md;
|
|
38
45
|
}
|
package/package.json
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@fv-ui/ai-chat",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "基于 Vue3 + Element Plus 的 AI 对话组件库",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"module": "es/index.mjs",
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
9
|
-
"style": "dist/style.css",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./es/index.mjs",
|
|
14
|
-
"require": "./lib/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./dist/style.css": "./dist/style.css",
|
|
17
|
-
"./styles/*": "./styles/*"
|
|
18
|
-
},
|
|
19
|
-
"sideEffects": [
|
|
20
|
-
"**/*.css"
|
|
21
|
-
],
|
|
22
|
-
"publishConfig": {
|
|
23
|
-
"registry": "https://registry.npmjs.org/",
|
|
24
|
-
"access": "public"
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"es",
|
|
28
|
-
"lib",
|
|
29
|
-
"dist",
|
|
30
|
-
"styles",
|
|
31
|
-
"README.md"
|
|
32
|
-
],
|
|
33
|
-
"scripts": {
|
|
34
|
-
"build": "vue-tsc --declaration --emitDeclarationOnly --outDir es-tsc -p tsconfig.json && rollup -c",
|
|
35
|
-
"test": "vitest run",
|
|
36
|
-
"test:watch": "vitest",
|
|
37
|
-
"lint": "eslint .",
|
|
38
|
-
"lint:fix": "eslint . --fix",
|
|
39
|
-
"prerelease": "pnpm run build && pnpm run test",
|
|
40
|
-
"release": "npm publish --access public --no-git-checks"
|
|
41
|
-
},
|
|
42
|
-
"peerDependencies": {
|
|
43
|
-
"@element-plus/icons-vue": "^2.3.0",
|
|
44
|
-
"element-plus": "^2.7.0",
|
|
45
|
-
"vue": "^3.4.0"
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"@vscode/markdown-it-katex": "^1.1.2",
|
|
49
|
-
"dompurify": "^3.1.0",
|
|
50
|
-
"katex": "^0.16.11",
|
|
51
|
-
"markdown-it": "^14.1.0",
|
|
52
|
-
"prismjs": "^1.29.0"
|
|
53
|
-
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@element-plus/icons-vue": "^2.3.0",
|
|
56
|
-
"@eslint/js": "^10.0.1",
|
|
57
|
-
"@rollup/plugin-commonjs": "^29.0.3",
|
|
58
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
59
|
-
"@types/dompurify": "^3.0.0",
|
|
60
|
-
"@types/markdown-it": "^14.1.0",
|
|
61
|
-
"@types/prismjs": "^1.26.0",
|
|
62
|
-
"@vitejs/plugin-vue": "^5.0.0",
|
|
63
|
-
"@vue/test-utils": "^2.4.0",
|
|
64
|
-
"element-plus": "^2.7.0",
|
|
65
|
-
"eslint": "^10.11.0",
|
|
66
|
-
"eslint-plugin-vue": "^10.11.0",
|
|
67
|
-
"happy-dom": "^14.0.0",
|
|
68
|
-
"rollup": "^4.18.0",
|
|
69
|
-
"rollup-plugin-dts": "^6.1.0",
|
|
70
|
-
"rollup-plugin-esbuild": "^6.2.1",
|
|
71
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
72
|
-
"sass": "^1.77.0",
|
|
73
|
-
"typescript": "^5.5.0",
|
|
74
|
-
"typescript-eslint": "^8.70.1",
|
|
75
|
-
"vite": "^5.2.0",
|
|
76
|
-
"vitest": "^1.6.0",
|
|
77
|
-
"vue": "^3.4.0",
|
|
78
|
-
"vue-tsc": "^3.3.11"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@fv-ui/ai-chat",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "基于 Vue3 + Element Plus 的 AI 对话组件库",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"module": "es/index.mjs",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"style": "dist/style.css",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./es/index.mjs",
|
|
14
|
+
"require": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./dist/style.css": "./dist/style.css",
|
|
17
|
+
"./styles/*": "./styles/*"
|
|
18
|
+
},
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"**/*.css"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"registry": "https://registry.npmjs.org/",
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"es",
|
|
28
|
+
"lib",
|
|
29
|
+
"dist",
|
|
30
|
+
"styles",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "vue-tsc --declaration --emitDeclarationOnly --outDir es-tsc -p tsconfig.json && rollup -c",
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"test:watch": "vitest",
|
|
37
|
+
"lint": "eslint .",
|
|
38
|
+
"lint:fix": "eslint . --fix",
|
|
39
|
+
"prerelease": "pnpm run build && pnpm run test",
|
|
40
|
+
"release": "npm publish --access public --no-git-checks"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@element-plus/icons-vue": "^2.3.0",
|
|
44
|
+
"element-plus": "^2.7.0",
|
|
45
|
+
"vue": "^3.4.0"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@vscode/markdown-it-katex": "^1.1.2",
|
|
49
|
+
"dompurify": "^3.1.0",
|
|
50
|
+
"katex": "^0.16.11",
|
|
51
|
+
"markdown-it": "^14.1.0",
|
|
52
|
+
"prismjs": "^1.29.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@element-plus/icons-vue": "^2.3.0",
|
|
56
|
+
"@eslint/js": "^10.0.1",
|
|
57
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
58
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
59
|
+
"@types/dompurify": "^3.0.0",
|
|
60
|
+
"@types/markdown-it": "^14.1.0",
|
|
61
|
+
"@types/prismjs": "^1.26.0",
|
|
62
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
63
|
+
"@vue/test-utils": "^2.4.0",
|
|
64
|
+
"element-plus": "^2.7.0",
|
|
65
|
+
"eslint": "^10.11.0",
|
|
66
|
+
"eslint-plugin-vue": "^10.11.0",
|
|
67
|
+
"happy-dom": "^14.0.0",
|
|
68
|
+
"rollup": "^4.18.0",
|
|
69
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
70
|
+
"rollup-plugin-esbuild": "^6.2.1",
|
|
71
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
72
|
+
"sass": "^1.77.0",
|
|
73
|
+
"typescript": "^5.5.0",
|
|
74
|
+
"typescript-eslint": "^8.70.1",
|
|
75
|
+
"vite": "^5.2.0",
|
|
76
|
+
"vitest": "^1.6.0",
|
|
77
|
+
"vue": "^3.4.0",
|
|
78
|
+
"vue-tsc": "^3.3.11"
|
|
79
|
+
}
|
|
80
|
+
}
|