vue-element-ui-x 1.0.1 → 1.0.3

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 (40) hide show
  1. package/lib/components/Attachments/index.js +11 -11
  2. package/lib/components/Bubble/index.js +30 -43
  3. package/lib/components/BubbleList/index.js +47 -77
  4. package/lib/components/Conversations/index.js +9 -9
  5. package/lib/components/FilesCard/index.js +1 -1
  6. package/lib/components/Prompts/index.js +21 -21
  7. package/lib/components/Sender/index.js +50 -49
  8. package/lib/components/Thinking/index.js +12 -18
  9. package/lib/components/ThoughtChain/index.js +23 -27
  10. package/lib/components/Typewriter/index.js +13 -17
  11. package/lib/components/Welcome/index.js +1 -1
  12. package/lib/index.common.js +1 -1
  13. package/lib/index.esm.js +1 -1
  14. package/lib/index.js +161 -196
  15. package/lib/index.umd.js +1 -1
  16. package/package.json +12 -9
  17. package/src/components/Attachments/src/main.vue +2 -10
  18. package/src/components/Bubble/src/main.vue +8 -19
  19. package/src/components/BubbleList/src/main.vue +2 -19
  20. package/src/components/Conversations/src/main.vue +0 -41
  21. package/src/components/Prompts/src/main.vue +248 -248
  22. package/src/components/Sender/src/components/LoadingButton.vue +37 -39
  23. package/src/components/Sender/src/components/SpeechLoadingButton.vue +41 -43
  24. package/src/components/Sender/src/main.vue +1 -0
  25. package/src/components/Thinking/src/main.vue +3 -4
  26. package/src/components/ThoughtChain/src/main.vue +1 -3
  27. package/src/components/Typewriter/src/main.vue +3 -7
  28. package/src/components/Welcome/src/main.vue +151 -151
  29. package/src/styles/Attachments.scss +236 -236
  30. package/src/styles/Bubble.scss +5 -4
  31. package/src/styles/BubbleList.scss +148 -148
  32. package/src/styles/Conversations.scss +175 -152
  33. package/src/styles/FilesCard.scss +222 -221
  34. package/src/styles/Prompts.scss +197 -195
  35. package/src/styles/Sender.scss +29 -18
  36. package/src/styles/Thinking.scss +36 -6
  37. package/src/styles/ThoughtChain.scss +113 -113
  38. package/src/styles/Typewriter.scss +66 -66
  39. package/src/styles/var.scss +4 -5
  40. package/src/theme/var.scss +183 -72
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "vue-element-ui-x",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "基于Vue 2 + Element UI的AI聊天组件库",
5
- "main": "lib/index.esm.js",
6
- "module": "lib/index.umd.js",
5
+ "main": "lib/index.common.js",
6
+ "module": "lib/index.esm.js",
7
7
  "files": [
8
8
  "lib",
9
9
  "src",
@@ -28,11 +28,13 @@
28
28
  },
29
29
  "scripts": {
30
30
  "build": "npm run build:common && npm run build:esm && npm run build:umd && npm run build:components && npm run build:locale",
31
- "build:common": "webpack --config build/webpack.common.conf.js",
32
- "build:esm": "webpack --config build/webpack.esm.conf.js",
33
- "build:umd": "webpack --config build/webpack.umd.conf.js",
34
- "build:components": "node build/build-components.js",
35
- "build:locale": "node build/build-locale.js"
31
+ "build:common": "cross-env SASS_SILENCE_DEPRECATIONS=legacy-js-api,import webpack --config build/webpack.common.conf.js",
32
+ "build:esm": "cross-env SASS_SILENCE_DEPRECATIONS=legacy-js-api,import webpack --config build/webpack.esm.conf.js",
33
+ "build:umd": "cross-env SASS_SILENCE_DEPRECATIONS=legacy-js-api,import webpack --config build/webpack.umd.conf.js",
34
+ "build:components": "cross-env SASS_SILENCE_DEPRECATIONS=legacy-js-api,import node build/build-components.js",
35
+ "build:locale": "cross-env SASS_SILENCE_DEPRECATIONS=legacy-js-api,import node build/build-locale.js",
36
+ "build:lib": "npm run build",
37
+ "publish:lib": "npm publish"
36
38
  },
37
39
  "peerDependencies": {
38
40
  "element-ui": "2.15.14",
@@ -40,8 +42,9 @@
40
42
  },
41
43
  "devDependencies": {
42
44
  "babel-loader": "^8.2.3",
45
+ "cross-env": "^7.0.3",
43
46
  "css-loader": "^5.2.7",
44
- "node-sass": "^6.0.1",
47
+ "sass": "^1.32.13",
45
48
  "sass-loader": "^10.0.0",
46
49
  "style-loader": "^2.0.0",
47
50
  "terser-webpack-plugin": "^4.2.3",
@@ -159,9 +159,7 @@
159
159
 
160
160
  export default {
161
161
  name: 'ElXAttachments',
162
- components: {
163
- ElXFilesCard,
164
- },
162
+ components: { ElXFilesCard },
165
163
  props: {
166
164
  items: {
167
165
  type: Array,
@@ -348,13 +346,7 @@
348
346
 
349
347
  // 默认实现:发出事件,让父组件处理
350
348
  const { file } = options;
351
- this.$emit(
352
- 'upload-change',
353
- {
354
- file,
355
- },
356
- [file],
357
- );
349
+ this.$emit('upload-change', { file }, [file]);
358
350
 
359
351
  // 如果需要模拟上传进度和成功/失败状态,可以在此实现
360
352
  // 例如:options.onProgress({ percent: 50 })
@@ -28,10 +28,9 @@
28
28
  class="el-x-bubble-avatar el-x-bubble-avatar-size"
29
29
  >
30
30
  <el-avatar
31
- :size="avatarSize"
31
+ :size="0"
32
32
  :src="avatar"
33
33
  :shape="avatarShape"
34
- :icon="avatarIcon"
35
34
  :src-set="avatarSrcSet"
36
35
  :alt="avatarAlt"
37
36
  @error="avatarError"
@@ -64,12 +63,12 @@
64
63
  class="el-x-bubble-content"
65
64
  :class="{
66
65
  'el-x-bubble-content-loading': loading,
67
- 'el-x-bubble-content-round': shape === 'round',
68
- 'el-x-bubble-content-corner': shape === 'corner',
69
- 'el-x-bubble-content-filled': variant === 'filled',
70
- 'el-x-bubble-content-borderless': variant === 'borderless',
71
- 'el-x-bubble-content-outlined': variant === 'outlined',
72
- 'el-x-bubble-content-shadow': variant === 'shadow',
66
+ 'el-x-bubble-content-round': shape === 'round' && !noStyle,
67
+ 'el-x-bubble-content-corner': shape === 'corner' && !noStyle,
68
+ 'el-x-bubble-content-filled': variant === 'filled' && !noStyle,
69
+ 'el-x-bubble-content-borderless': variant === 'borderless' && !noStyle,
70
+ 'el-x-bubble-content-outlined': variant === 'outlined' && !noStyle,
71
+ 'el-x-bubble-content-shadow': variant === 'shadow' && !noStyle,
73
72
  }"
74
73
  >
75
74
  <div
@@ -134,18 +133,12 @@
134
133
 
135
134
  export default {
136
135
  name: 'ElXBubble',
137
- components: {
138
- ElXTypewriter,
139
- },
136
+ components: { ElXTypewriter },
140
137
  props: {
141
138
  content: {
142
139
  type: String,
143
140
  default: '',
144
141
  },
145
- reasoning_content: {
146
- type: String,
147
- default: '',
148
- },
149
142
  avatar: {
150
143
  type: String,
151
144
  default: '',
@@ -174,10 +167,6 @@
174
167
  type: String,
175
168
  default: 'circle',
176
169
  },
177
- avatarIcon: {
178
- type: String,
179
- default: '',
180
- },
181
170
  avatarSrcSet: {
182
171
  type: String,
183
172
  default: '',
@@ -37,7 +37,6 @@
37
37
  :avatar-size="defaultAvatarSize || item.avatarSize"
38
38
  :avatar-gap="defaultAvatarGap || item.avatarGap"
39
39
  :avatar-shape="defaultAvatarShape || item.avatarShape"
40
- :avatar-icon="defaultAvatarIcon || item.avatarIcon"
41
40
  :avatar-src-set="defaultAvatarSrcSet || item.avatarSrcSet"
42
41
  :avatar-alt="defaultAvatarAlt || item.avatarAlt"
43
42
  :avatar-fit="defaultAvatarFit || item.avatarFit"
@@ -48,19 +47,7 @@
48
47
  <slot
49
48
  name="avatar"
50
49
  :item="item"
51
- >
52
- <template v-if="defaultAvatar || item.avatar">
53
- <el-avatar
54
- :size="defaultAvatarSize || item.avatarSize || 40"
55
- :src="defaultAvatar || item.avatar"
56
- :shape="defaultAvatarShape || item.avatarShape || 'circle'"
57
- :icon="defaultAvatarIcon || item.avatarIcon"
58
- :src-set="defaultAvatarSrcSet || item.avatarSrcSet"
59
- :alt="defaultAvatarAlt || item.avatarAlt"
60
- :fit="defaultAvatarFit || item.avatarFit || 'cover'"
61
- />
62
- </template>
63
- </slot>
50
+ ></slot>
64
51
  </template>
65
52
  <template
66
53
  v-if="$scopedSlots.header || $slots.header"
@@ -129,9 +116,9 @@
129
116
  </template>
130
117
 
131
118
  <script>
119
+ import createScrollDetector from '../../../utils/scrollDetector';
132
120
  import Bubble from '../../Bubble/index.js';
133
121
  import loadingBg from './loading.vue';
134
- import createScrollDetector from '../../../utils/scrollDetector';
135
122
 
136
123
  export default {
137
124
  name: 'ElXBubbleList',
@@ -232,10 +219,6 @@
232
219
  type: String,
233
220
  default: '',
234
221
  },
235
- defaultAvatarIcon: {
236
- type: String,
237
- default: '',
238
- },
239
222
  defaultAvatarSrcSet: {
240
223
  type: String,
241
224
  default: '',
@@ -583,46 +583,5 @@
583
583
  </script>
584
584
 
585
585
  <style lang="scss">
586
- // 引入外部样式文件
587
586
  @import '../../../styles/Conversations.scss';
588
-
589
- /* 自定义滚动条样式 */
590
- .el-x-conversations-scrollbar {
591
- height: 100%;
592
- overflow-y: auto;
593
-
594
- /* 隐藏默认滚动条 */
595
- &::-webkit-scrollbar {
596
- width: 6px;
597
- }
598
-
599
- &::-webkit-scrollbar-thumb {
600
- background-color: transparent;
601
- border-radius: 3px;
602
- transition: background-color 0.3s ease;
603
- }
604
-
605
- &::-webkit-scrollbar-track {
606
- background-color: transparent;
607
- }
608
-
609
- /* 鼠标悬停时显示滚动条 */
610
- &:hover {
611
- &::-webkit-scrollbar-thumb {
612
- background-color: #e0e0e0;
613
- }
614
- }
615
- }
616
-
617
- /* 为Firefox添加滚动条样式 */
618
- @supports (scrollbar-width: thin) {
619
- .el-x-conversations-scrollbar {
620
- scrollbar-width: thin;
621
- scrollbar-color: transparent transparent;
622
-
623
- &:hover {
624
- scrollbar-color: #e0e0e0 transparent;
625
- }
626
- }
627
- }
628
587
  </style>