@kg-ui/kg-ui-plus 0.0.12 → 0.0.14
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 +3 -3
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +1 -1
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue3.mjs +2 -2
- package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +2 -2
- package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/{components → SearchInput}/NewTheme.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/{components → SearchInput}/NewTheme.vue2.mjs +6 -6
- package/dist/es/KgCopilot/CopiFooter/SearchInput/NewTheme.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/{components/SearchInput → SearchInput}/SelectPlugin.vue.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/{components/SearchInput → SearchInput}/SelectPlugin.vue2.mjs +13 -61
- package/dist/es/KgCopilot/CopiFooter/SearchInput/SelectPlugin.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/{components/SearchInput → SearchInput}/SelectPluginByKey.vue.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/{components/SearchInput → SearchInput}/SelectPluginByKey.vue2.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/SearchInput/SelectPluginByKey.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/{components/SearchInput → SearchInput}/SpeechControl.vue.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/{components/SearchInput → SearchInput}/SpeechControl.vue2.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/SpeechControl.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/{components/SearchInput → SearchInput}/Upload.vue.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/{components/SearchInput → SearchInput}/Upload.vue2.mjs +3 -3
- package/dist/es/KgCopilot/CopiFooter/SearchInput/Upload.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/{components/SearchInput → SearchInput}/index.vue.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue2.mjs +256 -0
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/index.vue2.mjs +3 -8
- package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/index.vue2.mjs +31 -32
- package/dist/es/KgCopilot/dialogue/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/readMd.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/readMd.vue2.mjs +2 -3
- package/dist/es/KgCopilot/dialogue/readMd.vue3.mjs +2 -2
- package/dist/es/KgCopilot/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/index.vue3.mjs +2 -2
- package/dist/es/directives/heighlight/index.mjs +1 -1
- package/dist/es/home/LFilter/FilterArea.vue.mjs +1 -1
- package/dist/es/home/LFilter/FilterArea.vue2.mjs +1 -1
- package/dist/es/home/LFilter/FilterArea.vue3.mjs +2 -2
- package/dist/es/home/LFilter/FilterItem.vue.mjs +1 -1
- package/dist/es/home/LFilter/FilterItem.vue2.mjs +1 -1
- package/dist/es/home/LFilter/FilterItem.vue3.mjs +2 -2
- package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +1 -1
- package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +1 -1
- package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +2 -2
- package/dist/es/home/LProject/index.vue.mjs +1 -1
- package/dist/es/home/LProject/index.vue3.mjs +2 -2
- package/dist/es/home/index.vue.mjs +1 -1
- package/dist/es/home/index.vue3.mjs +2 -2
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/styles/sunburst.css.mjs +4 -0
- package/dist/es/store/modules/copilot.mjs +1 -0
- package/dist/es/style.css +1 -1
- package/package.json +122 -122
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPluginByKey.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue3.mjs +0 -4
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue2.mjs +0 -187
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue3.mjs +0 -4
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/styles/paraiso-light.css.mjs +0 -4
package/package.json
CHANGED
@@ -1,122 +1,122 @@
|
|
1
|
-
{
|
2
|
-
"name": "@kg-ui/kg-ui-plus",
|
3
|
-
"version": "0.0.
|
4
|
-
"description": "A Component Library for Vue 3",
|
5
|
-
"private": false,
|
6
|
-
"main": "dist/es/index.mjs",
|
7
|
-
"files": [
|
8
|
-
"dist"
|
9
|
-
],
|
10
|
-
"scripts": {
|
11
|
-
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
|
12
|
-
"serve": "pnpm dev",
|
13
|
-
"build": "rimraf dist && NODE_OPTIONS=--max-old-space-size=8192 vite build",
|
14
|
-
"report": "rimraf dist && vite build",
|
15
|
-
"preview": "vite preview",
|
16
|
-
"preview:build": "pnpm build && vite preview",
|
17
|
-
"typecheck": "tsc --noEmit && vue-tsc --noEmit --skipLibCheck",
|
18
|
-
"svgo": "svgo -f src/assets/svg -o src/assets/svg",
|
19
|
-
"cloc": "NODE_OPTIONS=--max-old-space-size=4096 cloc . --exclude-dir=node_modules --exclude-lang=YAML",
|
20
|
-
"clean:cache": "rm -rf node_modules && rm -rf .eslintcache && pnpm install",
|
21
|
-
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock,build}/**/*.{vue,js,ts,tsx}\" --fix",
|
22
|
-
"lint:prettier": "prettier --write \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"",
|
23
|
-
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,css,scss,postcss,less}\" --cache --cache-location node_modules/.cache/stylelint/",
|
24
|
-
"lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js",
|
25
|
-
"lint:pretty": "pretty-quick --staged",
|
26
|
-
"lint": "pnpm lint:eslint && pnpm lint:prettier && pnpm lint:stylelint",
|
27
|
-
"preinstall": "npx only-allow pnpm"
|
28
|
-
},
|
29
|
-
"browserslist": [
|
30
|
-
"> 1%",
|
31
|
-
"not ie 11",
|
32
|
-
"not op_mini all"
|
33
|
-
],
|
34
|
-
"dependencies": {
|
35
|
-
"@microsoft/fetch-event-source":"^2.0.1",
|
36
|
-
"@pureadmin/utils": "1.8.5",
|
37
|
-
"axios": "1.2.0",
|
38
|
-
"dayjs": "1.11.6",
|
39
|
-
"dompurify": "^3.0.10",
|
40
|
-
"element-plus": "2.2.27",
|
41
|
-
"highlight.js": "^11.9.0",
|
42
|
-
"marked": "^12.0.1",
|
43
|
-
"path": "0.12.7",
|
44
|
-
"pinia": "2.0.28",
|
45
|
-
"pinyin-match": "1.2.4",
|
46
|
-
"qs": "6.11.0"
|
47
|
-
},
|
48
|
-
"devDependencies": {
|
49
|
-
"@babel/core": ">=7.0.0-0 <8.0.0",
|
50
|
-
"@commitlint/cli": "13.1.0",
|
51
|
-
"@commitlint/config-conventional": "13.1.0",
|
52
|
-
"@iconify-icons/ep": "1.2.7",
|
53
|
-
"@iconify-icons/ph": "^1.2.5",
|
54
|
-
"@iconify-icons/ri": "1.2.3",
|
55
|
-
"@iconify/vue": "4.0.0",
|
56
|
-
"@types/node": "18.11.9",
|
57
|
-
"@types/qs": "6.9.7",
|
58
|
-
"@typescript-eslint/eslint-plugin": "5.42.1",
|
59
|
-
"@typescript-eslint/parser": "5.42.1",
|
60
|
-
"@vitejs/plugin-vue": "4.0.0",
|
61
|
-
"@vitejs/plugin-vue-jsx": "3.0.0",
|
62
|
-
"@vue/eslint-config-prettier": "7.0.0",
|
63
|
-
"@vue/eslint-config-typescript": "11.0.2",
|
64
|
-
"autoprefixer": "10.4.13",
|
65
|
-
"cloc": "2.10.0",
|
66
|
-
"cssnano": "5.1.14",
|
67
|
-
"eslint": "8.8.0",
|
68
|
-
"eslint-plugin-prettier": "4.0.0",
|
69
|
-
"eslint-plugin-vue": "9.7.0",
|
70
|
-
"husky": "7.0.4",
|
71
|
-
"lint-staged": "11.1.2",
|
72
|
-
"picocolors": "1.0.0",
|
73
|
-
"postcss": "8.4.18",
|
74
|
-
"postcss-html": "1.5.0",
|
75
|
-
"postcss-import": "15.0.0",
|
76
|
-
"postcss-scss": "4.0.5",
|
77
|
-
"prettier": "2.5.1",
|
78
|
-
"pretty-quick": "3.1.1",
|
79
|
-
"rimraf": "3.0.2",
|
80
|
-
"rollup-plugin-visualizer": "5.8.3",
|
81
|
-
"sass": "^1.72.0",
|
82
|
-
"sass-loader": "^14.1.1",
|
83
|
-
"stylelint": "^14.16.1",
|
84
|
-
"stylelint-config-html": "^1.1.0",
|
85
|
-
"stylelint-config-prettier": "^9.0.5",
|
86
|
-
"stylelint-config-recommended": "^9.0.0",
|
87
|
-
"stylelint-config-standard": "^29.0.0",
|
88
|
-
"stylelint-order": "^5.0.0",
|
89
|
-
"svgo": "3.0.2",
|
90
|
-
"tailwindcss": "3.2.4",
|
91
|
-
"terser": "5.16.1",
|
92
|
-
"typescript": "4.9.3",
|
93
|
-
"unplugin-vue-define-options": "0.12.2",
|
94
|
-
"vite": "4.0.3",
|
95
|
-
"vite-plugin-cdn-import": "0.3.5",
|
96
|
-
"vite-plugin-compression": "0.5.1",
|
97
|
-
"vite-plugin-dts": "1.4.1",
|
98
|
-
"vite-plugin-remove-console": "1.3.0",
|
99
|
-
"vite-svg-loader": "3.6.0",
|
100
|
-
"vue": "3.2.45",
|
101
|
-
"vue-eslint-parser": "9.1.0",
|
102
|
-
"vue-tsc": "1.0.9",
|
103
|
-
"webpack": "^5.0.0"
|
104
|
-
},
|
105
|
-
"publishConfig": {
|
106
|
-
"access": "public",
|
107
|
-
"registry": "https://registry.npmjs.org/"
|
108
|
-
},
|
109
|
-
"pnpm": {
|
110
|
-
"peerDependencyRules": {
|
111
|
-
"ignoreMissing": [
|
112
|
-
"rollup",
|
113
|
-
"webpack"
|
114
|
-
]
|
115
|
-
}
|
116
|
-
},
|
117
|
-
"volta": {
|
118
|
-
"node": "16.13.1"
|
119
|
-
},
|
120
|
-
"author": "lyn",
|
121
|
-
"license": "MIT"
|
122
|
-
}
|
1
|
+
{
|
2
|
+
"name": "@kg-ui/kg-ui-plus",
|
3
|
+
"version": "0.0.14",
|
4
|
+
"description": "A Component Library for Vue 3",
|
5
|
+
"private": false,
|
6
|
+
"main": "dist/es/index.mjs",
|
7
|
+
"files": [
|
8
|
+
"dist"
|
9
|
+
],
|
10
|
+
"scripts": {
|
11
|
+
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
|
12
|
+
"serve": "pnpm dev",
|
13
|
+
"build": "rimraf dist && NODE_OPTIONS=--max-old-space-size=8192 vite build",
|
14
|
+
"report": "rimraf dist && vite build",
|
15
|
+
"preview": "vite preview",
|
16
|
+
"preview:build": "pnpm build && vite preview",
|
17
|
+
"typecheck": "tsc --noEmit && vue-tsc --noEmit --skipLibCheck",
|
18
|
+
"svgo": "svgo -f src/assets/svg -o src/assets/svg",
|
19
|
+
"cloc": "NODE_OPTIONS=--max-old-space-size=4096 cloc . --exclude-dir=node_modules --exclude-lang=YAML",
|
20
|
+
"clean:cache": "rm -rf node_modules && rm -rf .eslintcache && pnpm install",
|
21
|
+
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock,build}/**/*.{vue,js,ts,tsx}\" --fix",
|
22
|
+
"lint:prettier": "prettier --write \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"",
|
23
|
+
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,css,scss,postcss,less}\" --cache --cache-location node_modules/.cache/stylelint/",
|
24
|
+
"lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js",
|
25
|
+
"lint:pretty": "pretty-quick --staged",
|
26
|
+
"lint": "pnpm lint:eslint && pnpm lint:prettier && pnpm lint:stylelint",
|
27
|
+
"preinstall": "npx only-allow pnpm"
|
28
|
+
},
|
29
|
+
"browserslist": [
|
30
|
+
"> 1%",
|
31
|
+
"not ie 11",
|
32
|
+
"not op_mini all"
|
33
|
+
],
|
34
|
+
"dependencies": {
|
35
|
+
"@microsoft/fetch-event-source": "^2.0.1",
|
36
|
+
"@pureadmin/utils": "1.8.5",
|
37
|
+
"axios": "1.2.0",
|
38
|
+
"dayjs": "1.11.6",
|
39
|
+
"dompurify": "^3.0.10",
|
40
|
+
"element-plus": "2.2.27",
|
41
|
+
"highlight.js": "^11.9.0",
|
42
|
+
"marked": "^12.0.1",
|
43
|
+
"path": "0.12.7",
|
44
|
+
"pinia": "2.0.28",
|
45
|
+
"pinyin-match": "1.2.4",
|
46
|
+
"qs": "6.11.0"
|
47
|
+
},
|
48
|
+
"devDependencies": {
|
49
|
+
"@babel/core": ">=7.0.0-0 <8.0.0",
|
50
|
+
"@commitlint/cli": "13.1.0",
|
51
|
+
"@commitlint/config-conventional": "13.1.0",
|
52
|
+
"@iconify-icons/ep": "1.2.7",
|
53
|
+
"@iconify-icons/ph": "^1.2.5",
|
54
|
+
"@iconify-icons/ri": "1.2.3",
|
55
|
+
"@iconify/vue": "4.0.0",
|
56
|
+
"@types/node": "18.11.9",
|
57
|
+
"@types/qs": "6.9.7",
|
58
|
+
"@typescript-eslint/eslint-plugin": "5.42.1",
|
59
|
+
"@typescript-eslint/parser": "5.42.1",
|
60
|
+
"@vitejs/plugin-vue": "4.0.0",
|
61
|
+
"@vitejs/plugin-vue-jsx": "3.0.0",
|
62
|
+
"@vue/eslint-config-prettier": "7.0.0",
|
63
|
+
"@vue/eslint-config-typescript": "11.0.2",
|
64
|
+
"autoprefixer": "10.4.13",
|
65
|
+
"cloc": "2.10.0",
|
66
|
+
"cssnano": "5.1.14",
|
67
|
+
"eslint": "8.8.0",
|
68
|
+
"eslint-plugin-prettier": "4.0.0",
|
69
|
+
"eslint-plugin-vue": "9.7.0",
|
70
|
+
"husky": "7.0.4",
|
71
|
+
"lint-staged": "11.1.2",
|
72
|
+
"picocolors": "1.0.0",
|
73
|
+
"postcss": "8.4.18",
|
74
|
+
"postcss-html": "1.5.0",
|
75
|
+
"postcss-import": "15.0.0",
|
76
|
+
"postcss-scss": "4.0.5",
|
77
|
+
"prettier": "2.5.1",
|
78
|
+
"pretty-quick": "3.1.1",
|
79
|
+
"rimraf": "3.0.2",
|
80
|
+
"rollup-plugin-visualizer": "5.8.3",
|
81
|
+
"sass": "^1.72.0",
|
82
|
+
"sass-loader": "^14.1.1",
|
83
|
+
"stylelint": "^14.16.1",
|
84
|
+
"stylelint-config-html": "^1.1.0",
|
85
|
+
"stylelint-config-prettier": "^9.0.5",
|
86
|
+
"stylelint-config-recommended": "^9.0.0",
|
87
|
+
"stylelint-config-standard": "^29.0.0",
|
88
|
+
"stylelint-order": "^5.0.0",
|
89
|
+
"svgo": "3.0.2",
|
90
|
+
"tailwindcss": "3.2.4",
|
91
|
+
"terser": "5.16.1",
|
92
|
+
"typescript": "4.9.3",
|
93
|
+
"unplugin-vue-define-options": "0.12.2",
|
94
|
+
"vite": "4.0.3",
|
95
|
+
"vite-plugin-cdn-import": "0.3.5",
|
96
|
+
"vite-plugin-compression": "0.5.1",
|
97
|
+
"vite-plugin-dts": "1.4.1",
|
98
|
+
"vite-plugin-remove-console": "1.3.0",
|
99
|
+
"vite-svg-loader": "3.6.0",
|
100
|
+
"vue": "3.2.45",
|
101
|
+
"vue-eslint-parser": "9.1.0",
|
102
|
+
"vue-tsc": "1.0.9",
|
103
|
+
"webpack": "^5.0.0"
|
104
|
+
},
|
105
|
+
"publishConfig": {
|
106
|
+
"access": "public",
|
107
|
+
"registry": "https://registry.npmjs.org/"
|
108
|
+
},
|
109
|
+
"pnpm": {
|
110
|
+
"peerDependencyRules": {
|
111
|
+
"ignoreMissing": [
|
112
|
+
"rollup",
|
113
|
+
"webpack"
|
114
|
+
]
|
115
|
+
}
|
116
|
+
},
|
117
|
+
"volta": {
|
118
|
+
"node": "16.13.1"
|
119
|
+
},
|
120
|
+
"author": "lyn",
|
121
|
+
"license": "MIT"
|
122
|
+
}
|
@@ -1,187 +0,0 @@
|
|
1
|
-
import { defineComponent, ref, onMounted, computed, watch, resolveComponent, openBlock, createElementBlock, unref, toDisplayString, createCommentVNode, createVNode, createElementVNode, withKeys, createTextVNode, normalizeStyle, pushScopeId, popScopeId } from "vue";
|
2
|
-
import Upload from "./Upload.vue.mjs";
|
3
|
-
import data from "../../../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs";
|
4
|
-
import SpeechControl from "./SpeechControl.vue.mjs";
|
5
|
-
import SelectPlugin from "./SelectPlugin.vue.mjs";
|
6
|
-
import SelectPluginByKey from "./SelectPluginByKey.vue.mjs";
|
7
|
-
import { useCopilotStoreHook } from "../../../../store/modules/copilot.mjs";
|
8
|
-
import { storeToRefs } from "pinia";
|
9
|
-
const _withScopeId = (n) => (pushScopeId("data-v-554a5c95"), n = n(), popScopeId(), n);
|
10
|
-
const _hoisted_1 = { class: "input-container" };
|
11
|
-
const _hoisted_2 = {
|
12
|
-
key: 0,
|
13
|
-
class: "plugin-town"
|
14
|
-
};
|
15
|
-
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "stop-icon" }, null, -1));
|
16
|
-
const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", null, "停止响应", -1));
|
17
|
-
const _hoisted_5 = [
|
18
|
-
_hoisted_3,
|
19
|
-
_hoisted_4
|
20
|
-
];
|
21
|
-
const _hoisted_6 = {
|
22
|
-
class: "input-row",
|
23
|
-
id: "copiFooter"
|
24
|
-
};
|
25
|
-
const _hoisted_7 = ["onKeydown"];
|
26
|
-
const _hoisted_8 = { class: "bottom-controls" };
|
27
|
-
const _hoisted_9 = { class: "bottom-left-controls" };
|
28
|
-
const _hoisted_10 = { class: "bottom-right-controls" };
|
29
|
-
const _hoisted_11 = { class: "text-sum" };
|
30
|
-
const _hoisted_12 = {
|
31
|
-
key: 2,
|
32
|
-
class: "disable",
|
33
|
-
"click.stop": ""
|
34
|
-
};
|
35
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
36
|
-
__name: "index",
|
37
|
-
setup(__props) {
|
38
|
-
const CopilotStore = useCopilotStoreHook();
|
39
|
-
const {
|
40
|
-
searchText,
|
41
|
-
isInitCopilot,
|
42
|
-
sendLonding,
|
43
|
-
stopDialogue,
|
44
|
-
checkedPluginByBtn
|
45
|
-
} = storeToRefs(CopilotStore);
|
46
|
-
const { setSearchText, sendMsg, setShowNewTheme, cancelRequest } = CopilotStore;
|
47
|
-
const coptInput = ref();
|
48
|
-
onMounted(() => {
|
49
|
-
coptInput.value.focus();
|
50
|
-
});
|
51
|
-
const textLength = computed(() => {
|
52
|
-
const num = searchText.value.length;
|
53
|
-
if (num === 0) {
|
54
|
-
setShowNewTheme(false);
|
55
|
-
}
|
56
|
-
return num;
|
57
|
-
});
|
58
|
-
const root = document.documentElement;
|
59
|
-
const inputChange = (e) => {
|
60
|
-
if (e.target.offsetHeight < 200) {
|
61
|
-
root.style.setProperty(
|
62
|
-
"--input-bottom-height",
|
63
|
-
`${e.target.offsetHeight + 70}px`
|
64
|
-
);
|
65
|
-
} else {
|
66
|
-
root.style.setProperty("--font-size", `270px`);
|
67
|
-
}
|
68
|
-
if (e.target.innerText.length >= 2e3) {
|
69
|
-
e.target.innerText = e.target.innerText.substring(0, 2e3);
|
70
|
-
const range = document.createRange();
|
71
|
-
range.selectNodeContents(e.target);
|
72
|
-
range.collapse(false);
|
73
|
-
const sel = window.getSelection();
|
74
|
-
sel.removeAllRanges();
|
75
|
-
sel.addRange(range);
|
76
|
-
}
|
77
|
-
setSearchText(e.target.innerText);
|
78
|
-
};
|
79
|
-
const isShowSelect = ref(false);
|
80
|
-
const handleKeyDown = (e) => {
|
81
|
-
if (e.key === "@") {
|
82
|
-
selectPluginByKey();
|
83
|
-
}
|
84
|
-
};
|
85
|
-
const closeSelection = () => {
|
86
|
-
isShowSelect.value = false;
|
87
|
-
};
|
88
|
-
const selectPluginByKey = () => {
|
89
|
-
isShowSelect.value = true;
|
90
|
-
getCursorPosition();
|
91
|
-
};
|
92
|
-
const initInput = () => {
|
93
|
-
coptInput.value.innerText = "";
|
94
|
-
setSearchText("");
|
95
|
-
root.style.setProperty("--input-bottom-height", `110px`);
|
96
|
-
};
|
97
|
-
let cursorPos = "";
|
98
|
-
const deleteText = () => {
|
99
|
-
const textArr = coptInput.value.innerText.split("");
|
100
|
-
textArr.splice(parseInt(cursorPos) - 1, 1);
|
101
|
-
searchText.value = textArr.join("");
|
102
|
-
};
|
103
|
-
const getCursorPosition = () => {
|
104
|
-
const selection = window.getSelection();
|
105
|
-
const range = selection.getRangeAt(0);
|
106
|
-
cursorPos = range.startOffset.toString();
|
107
|
-
};
|
108
|
-
const handlerSendMsg = (event) => {
|
109
|
-
if (event.key === "Enter") {
|
110
|
-
event.preventDefault();
|
111
|
-
}
|
112
|
-
const sendText = searchText.value;
|
113
|
-
if (!sendText)
|
114
|
-
return;
|
115
|
-
if (sendLonding.value)
|
116
|
-
return;
|
117
|
-
sendMsg(sendText);
|
118
|
-
initInput();
|
119
|
-
};
|
120
|
-
const handleClickStopBtn = () => {
|
121
|
-
cancelRequest();
|
122
|
-
};
|
123
|
-
watch(isInitCopilot, (newVal) => {
|
124
|
-
if (newVal) {
|
125
|
-
initInput();
|
126
|
-
isInitCopilot.value = false;
|
127
|
-
}
|
128
|
-
});
|
129
|
-
return (_ctx, _cache) => {
|
130
|
-
const _component_IconifyIconOffline = resolveComponent("IconifyIconOffline");
|
131
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
132
|
-
unref(checkedPluginByBtn).length !== 0 ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(unref(checkedPluginByBtn).map((item) => item.name).join(" ")) + " ", 1)) : createCommentVNode("", true),
|
133
|
-
createVNode(SelectPluginByKey, {
|
134
|
-
isShowSelect: isShowSelect.value,
|
135
|
-
onClose: closeSelection,
|
136
|
-
onDeleteText: deleteText
|
137
|
-
}, null, 8, ["isShowSelect"]),
|
138
|
-
createVNode(SelectPlugin),
|
139
|
-
unref(sendLonding) ? (openBlock(), createElementBlock("button", {
|
140
|
-
key: 1,
|
141
|
-
class: "stop-responding-button",
|
142
|
-
onClick: handleClickStopBtn
|
143
|
-
}, _hoisted_5)) : createCommentVNode("", true),
|
144
|
-
createElementVNode("div", _hoisted_6, [
|
145
|
-
createElementVNode("div", {
|
146
|
-
ref_key: "coptInput",
|
147
|
-
ref: coptInput,
|
148
|
-
class: "text-area",
|
149
|
-
contenteditable: "plaintext-only",
|
150
|
-
placeholder: "有问题请尽管问我。。。",
|
151
|
-
onInput: inputChange,
|
152
|
-
onKeydown: withKeys(handlerSendMsg, ["enter"]),
|
153
|
-
onKeyup: handleKeyDown
|
154
|
-
}, toDisplayString(unref(searchText)), 41, _hoisted_7),
|
155
|
-
createVNode(SpeechControl)
|
156
|
-
]),
|
157
|
-
createElementVNode("div", _hoisted_8, [
|
158
|
-
createElementVNode("div", _hoisted_9, [
|
159
|
-
createVNode(Upload, { type: "pic" })
|
160
|
-
]),
|
161
|
-
createElementVNode("div", _hoisted_10, [
|
162
|
-
createElementVNode("span", _hoisted_11, [
|
163
|
-
createElementVNode("span", null, toDisplayString(unref(textLength)), 1),
|
164
|
-
createTextVNode("/2000")
|
165
|
-
]),
|
166
|
-
createElementVNode("button", {
|
167
|
-
class: "send-button",
|
168
|
-
onClick: handlerSendMsg
|
169
|
-
}, [
|
170
|
-
createVNode(_component_IconifyIconOffline, {
|
171
|
-
class: "icon",
|
172
|
-
icon: unref(data),
|
173
|
-
style: normalizeStyle({
|
174
|
-
color: unref(textLength) && !unref(sendLonding) ? "#1e56ea" : "#dbdbdb"
|
175
|
-
})
|
176
|
-
}, null, 8, ["icon", "style"])
|
177
|
-
])
|
178
|
-
])
|
179
|
-
]),
|
180
|
-
unref(stopDialogue) ? (openBlock(), createElementBlock("div", _hoisted_12)) : createCommentVNode("", true)
|
181
|
-
]);
|
182
|
-
};
|
183
|
-
}
|
184
|
-
});
|
185
|
-
export {
|
186
|
-
_sfc_main as default
|
187
|
-
};
|