vue-element-ui-x 1.0.41-beta → 1.0.43-beta

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 (92) 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.ssr.js +90 -0
  7. package/lib/index.umd.js +1 -1
  8. package/package.json +5 -5
  9. package/src/components/Attachments/index.js +0 -8
  10. package/src/components/Attachments/src/main.vue +0 -529
  11. package/src/components/Bubble/index.js +0 -6
  12. package/src/components/Bubble/src/main.vue +0 -288
  13. package/src/components/BubbleList/index.js +0 -8
  14. package/src/components/BubbleList/src/loading.vue +0 -75
  15. package/src/components/BubbleList/src/main.vue +0 -444
  16. package/src/components/Conversations/index.js +0 -8
  17. package/src/components/Conversations/src/components/item.vue +0 -350
  18. package/src/components/Conversations/src/main.vue +0 -587
  19. package/src/components/FilesCard/index.js +0 -8
  20. package/src/components/FilesCard/src/fileSvg/audio.vue +0 -38
  21. package/src/components/FilesCard/src/fileSvg/changeFileName.bat +0 -18
  22. package/src/components/FilesCard/src/fileSvg/code.vue +0 -35
  23. package/src/components/FilesCard/src/fileSvg/database.vue +0 -94
  24. package/src/components/FilesCard/src/fileSvg/excel.vue +0 -38
  25. package/src/components/FilesCard/src/fileSvg/file.vue +0 -40
  26. package/src/components/FilesCard/src/fileSvg/image.vue +0 -40
  27. package/src/components/FilesCard/src/fileSvg/index.js +0 -46
  28. package/src/components/FilesCard/src/fileSvg/link.vue +0 -54
  29. package/src/components/FilesCard/src/fileSvg/mark.vue +0 -38
  30. package/src/components/FilesCard/src/fileSvg/pdf.vue +0 -38
  31. package/src/components/FilesCard/src/fileSvg/ppt.vue +0 -38
  32. package/src/components/FilesCard/src/fileSvg/three.vue +0 -38
  33. package/src/components/FilesCard/src/fileSvg/txt.vue +0 -38
  34. package/src/components/FilesCard/src/fileSvg/unknown.vue +0 -54
  35. package/src/components/FilesCard/src/fileSvg/video.vue +0 -38
  36. package/src/components/FilesCard/src/fileSvg/word.vue +0 -38
  37. package/src/components/FilesCard/src/fileSvg/zip.vue +0 -38
  38. package/src/components/FilesCard/src/main.vue +0 -403
  39. package/src/components/FilesCard/src/options.js +0 -18
  40. package/src/components/Prompts/index.js +0 -8
  41. package/src/components/Prompts/src/main.vue +0 -248
  42. package/src/components/Sender/index.js +0 -8
  43. package/src/components/Sender/src/components/ClearButton.vue +0 -28
  44. package/src/components/Sender/src/components/Loading.vue +0 -53
  45. package/src/components/Sender/src/components/LoadingButton.vue +0 -37
  46. package/src/components/Sender/src/components/SendButton.vue +0 -26
  47. package/src/components/Sender/src/components/SpeechButton.vue +0 -24
  48. package/src/components/Sender/src/components/SpeechLoading.vue +0 -87
  49. package/src/components/Sender/src/components/SpeechLoadingButton.vue +0 -41
  50. package/src/components/Sender/src/main.vue +0 -803
  51. package/src/components/Thinking/index.js +0 -8
  52. package/src/components/Thinking/src/main.vue +0 -199
  53. package/src/components/ThoughtChain/index.js +0 -8
  54. package/src/components/ThoughtChain/src/main.vue +0 -291
  55. package/src/components/Typewriter/index.js +0 -8
  56. package/src/components/Typewriter/src/main.vue +0 -255
  57. package/src/components/Welcome/index.js +0 -8
  58. package/src/components/Welcome/src/main.vue +0 -151
  59. package/src/index.js +0 -104
  60. package/src/locale/index.js +0 -97
  61. package/src/locale/lang/ar.js +0 -18
  62. package/src/locale/lang/de.js +0 -18
  63. package/src/locale/lang/en.js +0 -18
  64. package/src/locale/lang/es.js +0 -18
  65. package/src/locale/lang/fr.js +0 -18
  66. package/src/locale/lang/index.js +0 -62
  67. package/src/locale/lang/it.js +0 -18
  68. package/src/locale/lang/ja.js +0 -18
  69. package/src/locale/lang/ko.js +0 -18
  70. package/src/locale/lang/pt-br.js +0 -18
  71. package/src/locale/lang/ru-RU.js +0 -18
  72. package/src/locale/lang/zh-CN.js +0 -18
  73. package/src/locale/lang/zh-TW.js +0 -18
  74. package/src/locale/mixin.js +0 -9
  75. package/src/mixins/index.js +0 -49
  76. package/src/mixins/recordMixin.js +0 -117
  77. package/src/mixins/sendMixin.js +0 -450
  78. package/src/mixins/streamMixin.js +0 -497
  79. package/src/styles/Attachments.scss +0 -236
  80. package/src/styles/Bubble.scss +0 -158
  81. package/src/styles/BubbleList.scss +0 -148
  82. package/src/styles/Conversations.scss +0 -283
  83. package/src/styles/FilesCard.scss +0 -222
  84. package/src/styles/Prompts.scss +0 -197
  85. package/src/styles/Sender.scss +0 -207
  86. package/src/styles/Thinking.scss +0 -142
  87. package/src/styles/ThoughtChain.scss +0 -113
  88. package/src/styles/Typewriter.scss +0 -66
  89. package/src/styles/Welcome.scss +0 -283
  90. package/src/theme/var.scss +0 -183
  91. package/src/utils/index.js +0 -199
  92. package/src/utils/scrollDetector.js +0 -34
@@ -1,8 +0,0 @@
1
- import ElXThinking from './src/main.vue';
2
-
3
- /* istanbul ignore next */
4
- ElXThinking.install = function (Vue) {
5
- Vue.component(ElXThinking.name, ElXThinking);
6
- };
7
-
8
- export default ElXThinking;
@@ -1,199 +0,0 @@
1
- <template>
2
- <div
3
- class="el-x-thinking"
4
- :style="{
5
- '--el-x-thinking-button-width': buttonWidth,
6
- '--el-x-thinking-animation-duration': duration,
7
- '--el-x-thinking-content-wrapper-width': maxWidth,
8
- '--el-x-thinking-content-wrapper-background-color': backgroundColor,
9
- '--el-x-thinking-content-wrapper-color': color,
10
- }"
11
- >
12
- <button
13
- class="trigger"
14
- :class="[localStatus, { disabled: !disabled }]"
15
- :disabled="disabled"
16
- @click="changeExpand"
17
- >
18
- <span class="status-icon">
19
- <slot
20
- name="status-icon"
21
- :status="localStatus"
22
- >
23
- <i
24
- v-if="localStatus === 'thinking'"
25
- class="is-loading el-icon-center el-icon-loading"
26
- ></i>
27
- <i
28
- v-if="localStatus === 'start'"
29
- class="el-icon-center start-color el-icon-opportunity"
30
- ></i>
31
- <i
32
- v-if="localStatus === 'end'"
33
- class="el-icon-center end-color el-icon-success"
34
- ></i>
35
- <i
36
- v-if="localStatus === 'error'"
37
- class="el-icon-center error-color el-icon-circle-close"
38
- ></i>
39
- </slot>
40
- </span>
41
-
42
- <span class="label">
43
- <slot
44
- name="label"
45
- :status="localStatus"
46
- >
47
- {{
48
- localStatus === 'thinking'
49
- ? elXt('el_x.thinking.processing')
50
- : localStatus === 'error'
51
- ? elXt('el_x.thinking.error')
52
- : localStatus === 'end'
53
- ? elXt('el_x.thinking.completed')
54
- : elXt('el_x.thinking.start')
55
- }}
56
- </slot>
57
- </span>
58
-
59
- <transition name="rotate">
60
- <span
61
- v-if="!disabled"
62
- class="thinking-arrow el-icon-center"
63
- :class="{ expanded: isExpanded }"
64
- >
65
- <slot name="arrow">
66
- <i class="el-icon-center el-icon-arrow-up"></i>
67
- </slot>
68
- </span>
69
- </transition>
70
- </button>
71
-
72
- <transition name="slide">
73
- <div
74
- v-if="isExpanded && displayedContent"
75
- class="content-wrapper"
76
- :class="{ 'error-state': localStatus === 'error' }"
77
- >
78
- <div class="content">
79
- <slot
80
- v-if="localStatus !== 'error'"
81
- name="content"
82
- :content="displayedContent"
83
- >
84
- <pre>{{ displayedContent }}</pre>
85
- </slot>
86
-
87
- <slot
88
- v-else
89
- name="error"
90
- :error-content="displayedContent"
91
- >
92
- <div class="error-message">{{ displayedContent }}</div>
93
- </slot>
94
- </div>
95
- </div>
96
- </transition>
97
- </div>
98
- </template>
99
-
100
- <script>
101
- import Locale from '../../../locale/mixin';
102
-
103
- export default {
104
- name: 'ElXThinking',
105
- mixins: [Locale],
106
- props: {
107
- content: {
108
- type: String,
109
- default: '',
110
- },
111
- modelValue: {
112
- type: Boolean,
113
- default: true,
114
- },
115
- status: {
116
- type: String,
117
- default: 'start',
118
- validator: function (value) {
119
- return ['start', 'thinking', 'end', 'error'].indexOf(value) !== -1;
120
- },
121
- },
122
- disabled: {
123
- type: Boolean,
124
- default: false,
125
- },
126
- autoCollapse: {
127
- type: Boolean,
128
- default: false,
129
- },
130
- buttonWidth: {
131
- type: String,
132
- default: '160px',
133
- },
134
- duration: {
135
- type: String,
136
- default: '0.2s',
137
- },
138
- maxWidth: {
139
- type: String,
140
- default: '500px',
141
- },
142
- backgroundColor: {
143
- type: String,
144
- default: '#fcfcfc',
145
- },
146
- color: {
147
- type: String,
148
- default: '#909399',
149
- },
150
- },
151
- data() {
152
- return {
153
- isExpanded: this.modelValue,
154
- localStatus: this.status,
155
- };
156
- },
157
- computed: {
158
- displayedContent() {
159
- return this.localStatus === 'error'
160
- ? this.elXt('el_x.thinking.errorContent')
161
- : this.content;
162
- },
163
- },
164
- watch: {
165
- modelValue(newVal) {
166
- this.isExpanded = newVal;
167
- },
168
- status(newVal) {
169
- this.localStatus = newVal;
170
- if (newVal === 'end' && this.autoCollapse) {
171
- this.isExpanded = false;
172
- }
173
- },
174
- $attrs: {
175
- handler(newVal) {
176
- if (newVal['onUpdate:status']) {
177
- this.$emit('update:status', this.localStatus);
178
- }
179
- },
180
- immediate: true,
181
- },
182
- },
183
- methods: {
184
- changeExpand() {
185
- if (this.disabled) return;
186
- this.isExpanded = !this.isExpanded;
187
- this.$emit('change', {
188
- value: this.isExpanded,
189
- status: this.localStatus,
190
- });
191
- this.$emit('update:expanded', this.isExpanded);
192
- },
193
- },
194
- };
195
- </script>
196
-
197
- <style lang="scss" scoped>
198
- @import '../../../styles/Thinking.scss';
199
- </style>
@@ -1,8 +0,0 @@
1
- import ElXThoughtChain from './src/main.vue';
2
-
3
- /* istanbul ignore next */
4
- ElXThoughtChain.install = function (Vue) {
5
- Vue.component(ElXThoughtChain.name, ElXThoughtChain);
6
- };
7
-
8
- export default ElXThoughtChain;
@@ -1,291 +0,0 @@
1
- <template>
2
- <div class="el-x-thoughtchain">
3
- <el-timeline
4
- ref="timelineRef"
5
- :style="{
6
- maxWidth: maxWidth,
7
- }"
8
- >
9
- <transition-group
10
- name="thought-chain"
11
- tag="div"
12
- >
13
- <el-timeline-item
14
- v-for="item in thinkingItems"
15
- :key="getId(item)"
16
- :type="getType(item)"
17
- :icon="dotIsIcon ? item.icon : 'el-icon-more'"
18
- :color="dotIsIcon ? item.iconColor : null"
19
- :size="dotIsIcon ? item.iconSize : 'normal'"
20
- :timestamp="getTitle(item)"
21
- :hide-timestamp="item.hideTitle"
22
- :placement="item.placement || 'top'"
23
- >
24
- <div v-if="!item.isCanExpand">
25
- <el-x-typewriter
26
- :content="getThinkTitle(item)"
27
- :is-markdown="item.isMarkdown"
28
- :typing="item.typing"
29
- />
30
- </div>
31
- <el-collapse
32
- v-else-if="!item.isDefaultExpand"
33
- @change="() => onExpand(item)"
34
- >
35
- <el-collapse-item :title="getThinkTitle(item)">
36
- <el-x-typewriter
37
- :content="getThinkContent(item)"
38
- :is-markdown="item.isMarkdown"
39
- :typing="item.typing"
40
- />
41
- </el-collapse-item>
42
- </el-collapse>
43
- <el-collapse
44
- v-else
45
- v-model="defaultActiveNodes"
46
- @change="() => onExpand(item)"
47
- >
48
- <el-collapse-item
49
- :title="getThinkTitle(item)"
50
- :name="String(getId(item))"
51
- >
52
- <el-x-typewriter
53
- :content="getThinkContent(item)"
54
- :is-markdown="item.isMarkdown"
55
- :typing="item.typing"
56
- />
57
- </el-collapse-item>
58
- </el-collapse>
59
-
60
- <template
61
- v-if="!dotIsIcon"
62
- slot="dot"
63
- >
64
- <div
65
- class="el-x-thoughtchain-item-dot"
66
- :style="{ margin: dotMargin }"
67
- >
68
- <slot
69
- name="icon"
70
- :item="item"
71
- >
72
- <el-button
73
- circle
74
- :type="getType(item)"
75
- :loading="isLoading(item)"
76
- :size="dotSize"
77
- >
78
- <template slot="loading">
79
- <i class="el-icon-loading el-x-thoughtchain-loading"></i>
80
- </template>
81
-
82
- <i
83
- v-if="!isLoading(item) && !isError(item)"
84
- class="el-icon-check"
85
- ></i>
86
- <i
87
- v-if="!isLoading(item) && isError(item)"
88
- class="el-icon-close"
89
- ></i>
90
- </el-button>
91
- </slot>
92
- </div>
93
- </template>
94
- </el-timeline-item>
95
- </transition-group>
96
- </el-timeline>
97
- </div>
98
- </template>
99
-
100
- <script>
101
- import { get } from 'lodash';
102
- import ElXTypewriter from '../../Typewriter/index.js';
103
- export default {
104
- name: 'ElXThoughtChain',
105
- components: { ElXTypewriter },
106
- props: {
107
- thinkingItems: {
108
- type: Array,
109
- default: () => [],
110
- },
111
- dotIsIcon: {
112
- type: Boolean,
113
- default: false,
114
- },
115
- dotSize: {
116
- type: String,
117
- default: 'small',
118
- },
119
- maxWidth: {
120
- type: String,
121
- default: '600px',
122
- },
123
- lineGradient: {
124
- type: Boolean,
125
- default: false,
126
- },
127
- rowKey: {
128
- type: String,
129
- default: 'id',
130
- },
131
- statusKey: {
132
- type: String,
133
- default: 'status',
134
- },
135
- statusEnum: {
136
- type: Object,
137
- default: () => ({
138
- loading: {
139
- value: 'loading',
140
- type: 'warning',
141
- },
142
- error: {
143
- value: 'error',
144
- type: 'danger',
145
- },
146
- success: {
147
- value: 'success',
148
- type: 'success',
149
- },
150
- }),
151
- },
152
- titleKey: {
153
- type: String,
154
- default: 'title',
155
- },
156
- thinkTitleKey: {
157
- type: String,
158
- default: 'thinkTitle',
159
- },
160
- thinkContentKey: {
161
- type: String,
162
- default: 'thinkContent',
163
- },
164
- },
165
- data() {
166
- return {
167
- colorArr: {
168
- // 使用与SCSS变量对应的字符串表示
169
- info: 'var(--color-info, #909399)',
170
- success: 'var(--color-success, #67C23A)',
171
- warning: 'var(--color-warning, #E6A23C)',
172
- danger: 'var(--color-danger, #F56C6C)',
173
- primary: 'var(--color-primary, #409EFF)',
174
- },
175
- defaultActiveNodes: [],
176
- };
177
- },
178
- computed: {
179
- dotMargin() {
180
- switch (this.dotSize) {
181
- case 'mini':
182
- return '-8px 0 0 -9px';
183
- case 'small':
184
- return '-8px 0 0 -11px';
185
- case 'medium':
186
- return '-8px 0 0 -13px';
187
- default:
188
- return '-8px 0 0 -16px';
189
- }
190
- },
191
- getLineColor() {
192
- if (this.thinkingItems.length) {
193
- const arr = this.thinkingItems.map(item => {
194
- const _type_ = this.getType(item);
195
- if (_type_) {
196
- return this.colorArr[_type_];
197
- }
198
- return '';
199
- });
200
- return arr;
201
- }
202
- return [];
203
- },
204
- activeNamesComputed() {
205
- return this.thinkingItems
206
- .filter(item => item.isCanExpand && item.isDefaultExpand)
207
- .map(item => String(this.getId(item)));
208
- },
209
- },
210
- watch: {
211
- activeNamesComputed: {
212
- handler(v) {
213
- this.defaultActiveNodes = [...v];
214
- },
215
- immediate: true,
216
- },
217
- getLineColor() {
218
- this.$nextTick(() => {
219
- this.getEle();
220
- });
221
- },
222
- },
223
- mounted() {
224
- this.$nextTick(() => {
225
- this.getEle();
226
- });
227
- },
228
- methods: {
229
- onExpand(item) {
230
- this.$emit('handle-expand', item);
231
- },
232
- setRadialGradient(colors, ele) {
233
- const length = ele.length;
234
- Array.from(ele).forEach((item, index) => {
235
- const line = item.children[0];
236
- if (line) {
237
- line.setAttribute(
238
- 'style',
239
- `
240
- border: none;
241
- width:2px;
242
- background: linear-gradient(to bottom, ${colors[index]} 0% , ${
243
- colors[index < length ? index + 1 : index]
244
- } 100%);
245
- `,
246
- );
247
- }
248
- });
249
- },
250
- getEle() {
251
- if (this.getLineColor && this.$refs.timelineRef && this.lineGradient) {
252
- const ele = this.$refs.timelineRef.$el.children[0].children;
253
- this.setRadialGradient(this.getLineColor, ele);
254
- }
255
- },
256
- isLoading(item) {
257
- const status = this.getStatus(item);
258
- return status === this.statusEnum.loading.value;
259
- },
260
- isError(item) {
261
- const status = this.getStatus(item);
262
- return status === this.statusEnum.error.value;
263
- },
264
- getId(item) {
265
- return get(item, this.rowKey);
266
- },
267
- getType(item) {
268
- const status = this.getStatus(item);
269
- // 优先查找statusEnum中value匹配的项
270
- const matchedStatus = Object.values(this.statusEnum).find(s => s.value === status);
271
- return matchedStatus ? matchedStatus.type : 'success';
272
- },
273
-
274
- getTitle(item) {
275
- return get(item, this.titleKey) || '';
276
- },
277
- getThinkTitle(item) {
278
- return get(item, this.thinkTitleKey) || '';
279
- },
280
- getThinkContent(item) {
281
- return get(item, this.thinkContentKey) || '';
282
- },
283
- getStatus(item) {
284
- return get(item, this.statusKey);
285
- },
286
- },
287
- };
288
- </script>
289
- <style lang="scss" scoped>
290
- @import '../../../styles/ThoughtChain.scss';
291
- </style>
@@ -1,8 +0,0 @@
1
- import ElXTypewriter from './src/main.vue';
2
-
3
- /* istanbul ignore next */
4
- ElXTypewriter.install = function (Vue) {
5
- Vue.component(ElXTypewriter.name, ElXTypewriter);
6
- };
7
-
8
- export default ElXTypewriter;