vue-element-ui-x 1.0.4 → 1.0.5

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 (91) hide show
  1. package/lib/components/Sender/index.js +1 -1
  2. package/lib/components/ThoughtChain/index.js +30 -30
  3. package/lib/index.common.js +1 -1
  4. package/lib/index.esm.js +1 -1
  5. package/lib/index.js +774 -774
  6. package/lib/index.umd.js +1 -1
  7. package/package.json +5 -10
  8. package/src/components/Attachments/index.js +0 -8
  9. package/src/components/Attachments/src/main.vue +0 -529
  10. package/src/components/Bubble/index.js +0 -6
  11. package/src/components/Bubble/src/main.vue +0 -288
  12. package/src/components/BubbleList/index.js +0 -8
  13. package/src/components/BubbleList/src/loading.vue +0 -75
  14. package/src/components/BubbleList/src/main.vue +0 -444
  15. package/src/components/Conversations/index.js +0 -8
  16. package/src/components/Conversations/src/components/item.vue +0 -350
  17. package/src/components/Conversations/src/main.vue +0 -587
  18. package/src/components/FilesCard/index.js +0 -8
  19. package/src/components/FilesCard/src/fileSvg/audio.vue +0 -38
  20. package/src/components/FilesCard/src/fileSvg/changeFileName.bat +0 -18
  21. package/src/components/FilesCard/src/fileSvg/code.vue +0 -35
  22. package/src/components/FilesCard/src/fileSvg/database.vue +0 -94
  23. package/src/components/FilesCard/src/fileSvg/excel.vue +0 -38
  24. package/src/components/FilesCard/src/fileSvg/file.vue +0 -40
  25. package/src/components/FilesCard/src/fileSvg/image.vue +0 -40
  26. package/src/components/FilesCard/src/fileSvg/index.js +0 -46
  27. package/src/components/FilesCard/src/fileSvg/link.vue +0 -54
  28. package/src/components/FilesCard/src/fileSvg/mark.vue +0 -38
  29. package/src/components/FilesCard/src/fileSvg/pdf.vue +0 -38
  30. package/src/components/FilesCard/src/fileSvg/ppt.vue +0 -38
  31. package/src/components/FilesCard/src/fileSvg/three.vue +0 -38
  32. package/src/components/FilesCard/src/fileSvg/txt.vue +0 -38
  33. package/src/components/FilesCard/src/fileSvg/unknown.vue +0 -54
  34. package/src/components/FilesCard/src/fileSvg/video.vue +0 -38
  35. package/src/components/FilesCard/src/fileSvg/word.vue +0 -38
  36. package/src/components/FilesCard/src/fileSvg/zip.vue +0 -38
  37. package/src/components/FilesCard/src/main.vue +0 -403
  38. package/src/components/FilesCard/src/options.js +0 -18
  39. package/src/components/Prompts/index.js +0 -8
  40. package/src/components/Prompts/src/main.vue +0 -248
  41. package/src/components/Sender/index.js +0 -8
  42. package/src/components/Sender/src/components/ClearButton.vue +0 -28
  43. package/src/components/Sender/src/components/Loading.vue +0 -53
  44. package/src/components/Sender/src/components/LoadingButton.vue +0 -37
  45. package/src/components/Sender/src/components/SendButton.vue +0 -26
  46. package/src/components/Sender/src/components/SpeechButton.vue +0 -24
  47. package/src/components/Sender/src/components/SpeechLoading.vue +0 -87
  48. package/src/components/Sender/src/components/SpeechLoadingButton.vue +0 -41
  49. package/src/components/Sender/src/main.vue +0 -803
  50. package/src/components/Thinking/index.js +0 -8
  51. package/src/components/Thinking/src/main.vue +0 -199
  52. package/src/components/ThoughtChain/index.js +0 -8
  53. package/src/components/ThoughtChain/src/main.vue +0 -291
  54. package/src/components/Typewriter/index.js +0 -8
  55. package/src/components/Typewriter/src/main.vue +0 -255
  56. package/src/components/Welcome/index.js +0 -8
  57. package/src/components/Welcome/src/main.vue +0 -151
  58. package/src/index.js +0 -104
  59. package/src/locale/index.js +0 -97
  60. package/src/locale/lang/ar.js +0 -18
  61. package/src/locale/lang/de.js +0 -18
  62. package/src/locale/lang/en.js +0 -18
  63. package/src/locale/lang/es.js +0 -18
  64. package/src/locale/lang/fr.js +0 -18
  65. package/src/locale/lang/index.js +0 -62
  66. package/src/locale/lang/it.js +0 -18
  67. package/src/locale/lang/ja.js +0 -18
  68. package/src/locale/lang/ko.js +0 -18
  69. package/src/locale/lang/pt-br.js +0 -18
  70. package/src/locale/lang/ru-RU.js +0 -18
  71. package/src/locale/lang/zh-CN.js +0 -18
  72. package/src/locale/lang/zh-TW.js +0 -18
  73. package/src/locale/mixin.js +0 -9
  74. package/src/mixins/index.js +0 -49
  75. package/src/mixins/recordMixin.js +0 -117
  76. package/src/mixins/sendMixin.js +0 -450
  77. package/src/mixins/streamMixin.js +0 -497
  78. package/src/styles/Attachments.scss +0 -236
  79. package/src/styles/Bubble.scss +0 -158
  80. package/src/styles/BubbleList.scss +0 -148
  81. package/src/styles/Conversations.scss +0 -283
  82. package/src/styles/FilesCard.scss +0 -222
  83. package/src/styles/Prompts.scss +0 -197
  84. package/src/styles/Sender.scss +0 -207
  85. package/src/styles/Thinking.scss +0 -142
  86. package/src/styles/ThoughtChain.scss +0 -113
  87. package/src/styles/Typewriter.scss +0 -66
  88. package/src/styles/Welcome.scss +0 -283
  89. package/src/theme/var.scss +0 -183
  90. package/src/utils/index.js +0 -199
  91. package/src/utils/scrollDetector.js +0 -34
@@ -1,248 +0,0 @@
1
- <template>
2
- <div
3
- :class="['el-x-prompts', { 'el-x-prompts-rtl': direction === 'rtl' }, rootClassName]"
4
- :style="customStyle"
5
- >
6
- <!-- 标题 -->
7
- <h5
8
- v-if="title"
9
- class="el-x-prompts-title"
10
- :class="[classNames.title]"
11
- :style="titleStyle"
12
- >
13
- {{ title }}
14
- </h5>
15
-
16
- <!-- 提示列表 -->
17
- <div
18
- :class="[
19
- 'el-x-prompts-list',
20
- {
21
- 'el-x-prompts-list-wrap': wrap,
22
- 'el-x-prompts-list-vertical': vertical,
23
- },
24
- classNames.list,
25
- ]"
26
- :style="listStyle"
27
- >
28
- <div
29
- v-for="(info, index) in items"
30
- :key="info.key || `key_${index}`"
31
- :class="[
32
- 'el-x-prompts-item',
33
- {
34
- 'el-x-prompts-item-disabled': info.disabled,
35
- 'el-x-prompts-item-has-nest': hasChildren(info),
36
- },
37
- classNames.item,
38
- ]"
39
- :style="itemStyle"
40
- @click="handleItemClick(info)"
41
- >
42
- <!-- 图标 -->
43
- <div
44
- v-if="info.icon"
45
- class="el-x-prompts-icon"
46
- >
47
- <slot
48
- name="icon"
49
- :item="info"
50
- >
51
- <i :class="info.icon"></i>
52
- </slot>
53
- </div>
54
-
55
- <!-- 内容 -->
56
- <div
57
- :class="['el-x-prompts-content', classNames.itemContent]"
58
- :style="itemContentStyle"
59
- >
60
- <!-- 标签 -->
61
- <h6
62
- v-if="info.label"
63
- class="el-x-prompts-label"
64
- >
65
- <slot
66
- name="label"
67
- :item="info"
68
- >{{ info.label }}</slot
69
- >
70
- </h6>
71
-
72
- <!-- 描述 -->
73
- <p
74
- v-if="info.description"
75
- class="el-x-prompts-desc"
76
- >
77
- <slot
78
- name="description"
79
- :item="info"
80
- >{{ info.description }}</slot
81
- >
82
- </p>
83
-
84
- <!-- 子项 -->
85
- <component
86
- :is="$options.name"
87
- v-if="hasChildren(info)"
88
- class="el-x-prompts-nested"
89
- :items="info.children"
90
- :vertical="true"
91
- @on-item-click="$emit('on-item-click', $event)"
92
- :class-names="{
93
- list: classNames.subList,
94
- item: classNames.subItem,
95
- }"
96
- :styles="{
97
- list: styles.subList,
98
- item: styles.subItem,
99
- }"
100
- />
101
- </div>
102
- </div>
103
- </div>
104
- </div>
105
- </template>
106
-
107
- <script>
108
- export default {
109
- name: 'ElXPrompts',
110
-
111
- props: {
112
- /**
113
- * 包含多个提示项的列表
114
- */
115
- items: {
116
- type: Array,
117
- default: () => [],
118
- },
119
-
120
- /**
121
- * 显示在提示列表顶部的标题
122
- */
123
- title: {
124
- type: String,
125
- default: '',
126
- },
127
-
128
- /**
129
- * Item 提示项被点击时的回调函数
130
- */
131
- onItemClick: {
132
- type: Function,
133
- default: null,
134
- },
135
-
136
- /**
137
- * 提示列表是否垂直排列
138
- */
139
- vertical: {
140
- type: Boolean,
141
- default: false,
142
- },
143
-
144
- /**
145
- * 提示列表是否换行
146
- */
147
- wrap: {
148
- type: Boolean,
149
- default: false,
150
- },
151
-
152
- /**
153
- * 自定义样式,用于各个提示项的不同部分
154
- */
155
- styles: {
156
- type: Object,
157
- default: () => ({}),
158
- },
159
-
160
- /**
161
- * 自定义样式类名,用于各个提示项的不同部分
162
- */
163
- classNames: {
164
- type: Object,
165
- default: () => ({}),
166
- },
167
-
168
- /**
169
- * 根节点的样式类名
170
- */
171
- rootClassName: {
172
- type: String,
173
- default: '',
174
- },
175
-
176
- /**
177
- * 自定义样式
178
- */
179
- customStyle: {
180
- type: Object,
181
- default: () => ({}),
182
- },
183
-
184
- /**
185
- * 方向
186
- */
187
- direction: {
188
- type: String,
189
- default: 'ltr',
190
- },
191
- },
192
-
193
- computed: {
194
- titleStyle() {
195
- return {
196
- ...this.styles.title,
197
- };
198
- },
199
-
200
- listStyle() {
201
- return {
202
- ...this.styles.list,
203
- };
204
- },
205
-
206
- itemStyle() {
207
- return {
208
- ...this.styles.item,
209
- };
210
- },
211
-
212
- itemContentStyle() {
213
- return {
214
- ...this.styles.itemContent,
215
- };
216
- },
217
- },
218
-
219
- methods: {
220
- hasChildren(item) {
221
- return item.children && item.children.length > 0;
222
- },
223
-
224
- handleItemClick(info) {
225
- if (info.disabled) {
226
- return;
227
- }
228
- // 如果有子项,不触发点击事件
229
- if (this.hasChildren(info)) {
230
- return;
231
- }
232
- this.$emit('on-item-click', {
233
- data: info,
234
- });
235
- // 向后兼容性
236
- if (this.onItemClick) {
237
- this.onItemClick({
238
- data: info,
239
- });
240
- }
241
- },
242
- },
243
- };
244
- </script>
245
-
246
- <style lang="scss" scoped>
247
- @import '../../../styles/Prompts.scss';
248
- </style>
@@ -1,8 +0,0 @@
1
- import ElXSender from './src/main.vue';
2
-
3
- /* istanbul ignore next */
4
- ElXSender.install = function (Vue) {
5
- Vue.component(ElXSender.name, ElXSender);
6
- };
7
-
8
- export default ElXSender;
@@ -1,28 +0,0 @@
1
- <template>
2
- <div class="el-x-send-button">
3
- <el-button
4
- circle
5
- @click="$emit('clear')"
6
- size="small"
7
- >
8
- <i class="el-icon-brush"></i>
9
- </el-button>
10
- </div>
11
- </template>
12
-
13
- <script>
14
- export default {
15
- name: 'ClearButton',
16
- };
17
- </script>
18
-
19
- <style scoped lang="scss">
20
- .el-x-send-button {
21
- .el-button {
22
- .el-icon-brush {
23
- // 旋转180
24
- transform: rotate(180deg);
25
- }
26
- }
27
- }
28
- </style>
@@ -1,53 +0,0 @@
1
- <template>
2
- <svg
3
- viewBox="0 0 1000 1000"
4
- xmlns="http://www.w3.org/2000/svg"
5
- xmlns:xlink="http://www.w3.org/1999/xlink"
6
- >
7
- <title>Loading</title>
8
- <rect
9
- fill="currentColor"
10
- height="250"
11
- rx="24"
12
- ry="24"
13
- width="250"
14
- x="375"
15
- y="375"
16
- />
17
- <circle
18
- cx="500"
19
- cy="500"
20
- fill="none"
21
- r="450"
22
- stroke="currentColor"
23
- stroke-width="100"
24
- opacity="0.45"
25
- />
26
- <circle
27
- cx="500"
28
- cy="500"
29
- fill="none"
30
- r="450"
31
- stroke="currentColor"
32
- stroke-width="100"
33
- stroke-dasharray="600 9999999"
34
- >
35
- <animateTransform
36
- attributeName="transform"
37
- dur="1s"
38
- from="0 500 500"
39
- repeatCount="indefinite"
40
- to="360 500 500"
41
- type="rotate"
42
- />
43
- </circle>
44
- </svg>
45
- </template>
46
-
47
- <script>
48
- export default {
49
- name: 'Loading',
50
- };
51
- </script>
52
-
53
- <style scoped></style>
@@ -1,37 +0,0 @@
1
- <template>
2
- <div class="el-x-send-button">
3
- <el-button
4
- circle
5
- @click="$emit('cancel')"
6
- size="small"
7
- >
8
- <loading class="loading-svg" />
9
- </el-button>
10
- </div>
11
- </template>
12
-
13
- <script>
14
- import Loading from './Loading.vue';
15
-
16
- export default {
17
- name: 'LoadingButton',
18
- components: { Loading },
19
- };
20
- </script>
21
-
22
- <style scoped lang="scss">
23
- @import '../../../../theme/var.scss';
24
-
25
- .el-x-send-button {
26
- height: 32px;
27
- .el-button {
28
- padding: 0;
29
- width: 32px;
30
- height: 32px;
31
- }
32
- .loading-svg {
33
- color: $--color-primary;
34
- width: 100%;
35
- }
36
- }
37
- </style>
@@ -1,26 +0,0 @@
1
- <template>
2
- <div class="el-x-send-button">
3
- <el-button
4
- circle
5
- :disabled="disabled"
6
- @click="$emit('submit')"
7
- size="small"
8
- >
9
- <i class="el-icon-top"></i>
10
- </el-button>
11
- </div>
12
- </template>
13
-
14
- <script>
15
- export default {
16
- name: 'SendButton',
17
- props: {
18
- disabled: {
19
- type: Boolean,
20
- default: false,
21
- },
22
- },
23
- };
24
- </script>
25
-
26
- <style scoped lang="scss"></style>
@@ -1,24 +0,0 @@
1
- <template>
2
- <div class="el-x-send-button">
3
- <el-button
4
- circle
5
- size="small"
6
- @click="onClick"
7
- >
8
- <i class="el-icon-microphone"></i>
9
- </el-button>
10
- </div>
11
- </template>
12
-
13
- <script>
14
- export default {
15
- name: 'SpeechButton',
16
- methods: {
17
- onClick() {
18
- this.$emit('click');
19
- },
20
- },
21
- };
22
- </script>
23
-
24
- <style scoped lang="scss"></style>
@@ -1,87 +0,0 @@
1
- <template>
2
- <svg
3
- :class="className"
4
- color="currentColor"
5
- :viewBox="`0 0 ${SIZE} ${SIZE}`"
6
- xmlns="http://www.w3.org/2000/svg"
7
- xmlns:xlink="http://www.w3.org/1999/xlink"
8
- >
9
- <title>Speech Recording</title>
10
-
11
- <rect
12
- v-for="(item, index) in rects"
13
- :key="index"
14
- fill="currentColor"
15
- :rx="RECT_RADIUS"
16
- :ry="RECT_RADIUS"
17
- :height="RECT_HEIGHT_MIN"
18
- :width="RECT_WIDTH"
19
- :x="item.x"
20
- :y="item.yMin"
21
- >
22
- <animate
23
- attributeName="height"
24
- :values="`${RECT_HEIGHT_MIN}; ${RECT_HEIGHT_MAX}; ${RECT_HEIGHT_MIN}`"
25
- keyTimes="0; 0.5; 1"
26
- :dur="`${DURATION}s`"
27
- :begin="`${(DURATION / COUNT) * index}s`"
28
- repeatCount="indefinite"
29
- />
30
- <animate
31
- attributeName="y"
32
- :values="`${item.yMin}; ${item.yMax}; ${item.yMin}`"
33
- keyTimes="0; 0.5; 1"
34
- :dur="`${DURATION}s`"
35
- :begin="`${(DURATION / COUNT) * index}s`"
36
- repeatCount="indefinite"
37
- />
38
- </rect>
39
- </svg>
40
- </template>
41
-
42
- <script>
43
- export default {
44
- name: 'SpeechLoading',
45
-
46
- props: {
47
- className: {
48
- type: String,
49
- default: '',
50
- },
51
- },
52
-
53
- data() {
54
- return {
55
- // 定义常量
56
- SIZE: 1000,
57
- COUNT: 4,
58
- RECT_WIDTH: 140,
59
- RECT_RADIUS: 70, // RECT_WIDTH / 2
60
- RECT_HEIGHT_MIN: 250,
61
- RECT_HEIGHT_MAX: 500,
62
- DURATION: 0.8,
63
- };
64
- },
65
-
66
- computed: {
67
- // 计算矩形的位置和高度范围
68
- rects() {
69
- const dest = (this.SIZE - this.RECT_WIDTH * this.COUNT) / (this.COUNT - 1);
70
- return Array.from({
71
- length: this.COUNT,
72
- }).map((_, index) => {
73
- const x = index * (dest + this.RECT_WIDTH);
74
- const yMin = this.SIZE / 2 - this.RECT_HEIGHT_MIN / 2;
75
- const yMax = this.SIZE / 2 - this.RECT_HEIGHT_MAX / 2;
76
- return {
77
- x,
78
- yMin,
79
- yMax,
80
- };
81
- });
82
- },
83
- },
84
- };
85
- </script>
86
-
87
- <style scoped></style>
@@ -1,41 +0,0 @@
1
- <template>
2
- <div class="el-x-send-button">
3
- <el-button
4
- circle
5
- size="small"
6
- @click="onClick"
7
- >
8
- <speech-loading class="loading-svg" />
9
- </el-button>
10
- </div>
11
- </template>
12
-
13
- <script>
14
- import SpeechLoading from './SpeechLoading.vue';
15
-
16
- export default {
17
- name: 'SpeechLoadingButton',
18
- components: { SpeechLoading },
19
- methods: {
20
- onClick() {
21
- this.$emit('click');
22
- },
23
- },
24
- };
25
- </script>
26
-
27
- <style scoped lang="scss">
28
- @import '../../../../theme/var.scss';
29
-
30
- .el-x-send-button {
31
- .el-button {
32
- padding: 0;
33
- width: 32px;
34
- height: 32px;
35
- }
36
- .loading-svg {
37
- color: $--color-primary;
38
- width: 16px;
39
- }
40
- }
41
- </style>