vue-element-ui-x 0.1.5 → 0.1.7-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/attachments.js +3082 -0
  2. package/lib/bubble-list.js +13840 -0
  3. package/lib/bubble.js +13125 -0
  4. package/lib/components/Attachments/index.js +6 -6
  5. package/lib/components/Bubble/index.js +188 -192
  6. package/lib/components/BubbleList/index.js +189 -194
  7. package/lib/components/Conversations/index.js +6 -6
  8. package/lib/components/FilesCard/index.js +5 -5
  9. package/lib/components/Prompts/index.js +21 -21
  10. package/lib/components/Sender/index.js +4 -4
  11. package/lib/components/Think/index.js +1 -1
  12. package/lib/components/Thinking/index.js +1 -1
  13. package/lib/components/ThoughtChain/index.js +186 -191
  14. package/lib/components/Typewriter/index.js +182 -186
  15. package/lib/components/Welcome/index.js +1 -1
  16. package/lib/conversations.js +18825 -0
  17. package/lib/files-card.js +2471 -0
  18. package/lib/index.common.js +1 -1
  19. package/lib/index.esm.js +1 -1
  20. package/lib/index.js +1707 -1691
  21. package/lib/index.umd.js +1 -1
  22. package/lib/mixins/index.js +2 -2
  23. package/lib/mixins.js +1016 -0
  24. package/lib/prompts.js +832 -0
  25. package/lib/sender.js +1911 -0
  26. package/lib/think.js +799 -0
  27. package/lib/thinking.js +809 -0
  28. package/lib/thought-chain.js +30391 -0
  29. package/lib/typewriter.js +12788 -0
  30. package/lib/welcome.js +755 -0
  31. package/package.json +3 -4
  32. package/src/components/Attachments/index.js +8 -8
  33. package/src/components/Bubble/index.js +6 -6
  34. package/src/components/Bubble/src/main.vue +299 -299
  35. package/src/components/BubbleList/index.js +8 -8
  36. package/src/components/BubbleList/src/loading.vue +75 -75
  37. package/src/components/BubbleList/src/main.vue +466 -466
  38. package/src/components/Conversations/index.js +8 -8
  39. package/src/components/Conversations/src/main.vue +635 -635
  40. package/src/components/FilesCard/index.js +8 -8
  41. package/src/components/FilesCard/src/fileSvg/audio.vue +38 -38
  42. package/src/components/FilesCard/src/fileSvg/code.vue +35 -35
  43. package/src/components/FilesCard/src/fileSvg/database.vue +94 -94
  44. package/src/components/FilesCard/src/fileSvg/excel.vue +38 -38
  45. package/src/components/FilesCard/src/fileSvg/file.vue +40 -40
  46. package/src/components/FilesCard/src/fileSvg/image.vue +40 -40
  47. package/src/components/FilesCard/src/fileSvg/index.js +46 -46
  48. package/src/components/FilesCard/src/fileSvg/link.vue +54 -54
  49. package/src/components/FilesCard/src/fileSvg/mark.vue +38 -38
  50. package/src/components/FilesCard/src/fileSvg/pdf.vue +38 -38
  51. package/src/components/FilesCard/src/fileSvg/ppt.vue +38 -38
  52. package/src/components/FilesCard/src/fileSvg/three.vue +38 -38
  53. package/src/components/FilesCard/src/fileSvg/txt.vue +38 -38
  54. package/src/components/FilesCard/src/fileSvg/unknown.vue +54 -54
  55. package/src/components/FilesCard/src/fileSvg/video.vue +38 -38
  56. package/src/components/FilesCard/src/fileSvg/word.vue +38 -38
  57. package/src/components/FilesCard/src/fileSvg/zip.vue +38 -38
  58. package/src/components/FilesCard/src/options.js +18 -18
  59. package/src/components/Prompts/index.js +8 -8
  60. package/src/components/Prompts/src/main.vue +248 -248
  61. package/src/components/Sender/index.js +8 -8
  62. package/src/components/Sender/src/components/ClearButton.vue +28 -28
  63. package/src/components/Sender/src/components/Loading.vue +53 -53
  64. package/src/components/Sender/src/components/LoadingButton.vue +39 -39
  65. package/src/components/Sender/src/components/SendButton.vue +26 -26
  66. package/src/components/Sender/src/components/SpeechButton.vue +24 -24
  67. package/src/components/Sender/src/components/SpeechLoading.vue +87 -87
  68. package/src/components/Sender/src/components/SpeechLoadingButton.vue +43 -43
  69. package/src/components/Think/index.js +8 -8
  70. package/src/components/Think/src/main.vue +190 -190
  71. package/src/components/Thinking/index.js +8 -8
  72. package/src/components/Thinking/src/main.vue +195 -195
  73. package/src/components/ThoughtChain/index.js +8 -8
  74. package/src/components/ThoughtChain/src/main.vue +293 -293
  75. package/src/components/Typewriter/index.js +8 -8
  76. package/src/components/Welcome/index.js +8 -8
  77. package/src/components/Welcome/src/main.vue +151 -151
  78. package/src/index.js +23 -3
  79. package/src/styles/Attachments.scss +236 -236
  80. package/src/styles/Bubble.scss +157 -157
  81. package/src/styles/BubbleList.scss +148 -148
  82. package/src/styles/Conversations.scss +260 -260
  83. package/src/styles/FilesCard.scss +221 -221
  84. package/src/styles/Prompts.scss +195 -195
  85. package/src/styles/Sender.scss +199 -199
  86. package/src/styles/Think.scss +134 -134
  87. package/src/styles/Thinking.scss +112 -112
  88. package/src/styles/ThoughtChain.scss +113 -113
  89. package/src/styles/Typewriter.scss +66 -66
  90. package/src/styles/button.scss +302 -0
  91. package/src/styles/var.scss +1052 -0
  92. package/src/theme/var.scss +72 -72
@@ -1,195 +1,195 @@
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
- ? '思考中...'
50
- : localStatus === 'error'
51
- ? '思考遇到问题'
52
- : localStatus === 'end'
53
- ? '思考完成'
54
- : '开始思考'
55
- }}
56
- </slot>
57
- </span>
58
-
59
- <transition name="rotate">
60
- <span
61
- v-if="!disabled"
62
- class="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-show="isExpanded"
75
- v-if="displayedContent"
76
- class="content-wrapper"
77
- :class="{ 'error-state': localStatus === 'error' }"
78
- >
79
- <div class="content">
80
- <slot
81
- v-if="localStatus !== 'error'"
82
- name="content"
83
- :content="displayedContent"
84
- >
85
- <pre>{{ displayedContent }}</pre>
86
- </slot>
87
-
88
- <slot
89
- v-else
90
- name="error"
91
- :error-content="displayedContent"
92
- >
93
- <div class="error-message">{{ displayedContent }}</div>
94
- </slot>
95
- </div>
96
- </div>
97
- </Transition>
98
- </div>
99
- </template>
100
-
101
- <script>
102
- export default {
103
- name: 'ElXThinking',
104
- props: {
105
- content: {
106
- type: String,
107
- default: '',
108
- },
109
- modelValue: {
110
- type: Boolean,
111
- default: true,
112
- },
113
- status: {
114
- type: String,
115
- default: 'start',
116
- validator: function (value) {
117
- return ['start', 'thinking', 'end', 'error'].indexOf(value) !== -1;
118
- },
119
- },
120
- disabled: {
121
- type: Boolean,
122
- default: false,
123
- },
124
- autoCollapse: {
125
- type: Boolean,
126
- default: false,
127
- },
128
- buttonWidth: {
129
- type: String,
130
- default: '160px',
131
- },
132
- duration: {
133
- type: String,
134
- default: '0.2s',
135
- },
136
- maxWidth: {
137
- type: String,
138
- default: '500px',
139
- },
140
- backgroundColor: {
141
- type: String,
142
- default: '#fcfcfc',
143
- },
144
- color: {
145
- type: String,
146
- default: '#909399',
147
- },
148
- },
149
- data() {
150
- return {
151
- isExpanded: this.modelValue,
152
- localStatus: this.status,
153
- };
154
- },
155
- computed: {
156
- displayedContent() {
157
- return this.localStatus === 'error' ? '思考过程中出现错误' : this.content;
158
- },
159
- },
160
- watch: {
161
- modelValue(newVal) {
162
- this.isExpanded = newVal;
163
- },
164
- status(newVal) {
165
- this.localStatus = newVal;
166
- if (newVal === 'end' && this.autoCollapse) {
167
- this.isExpanded = false;
168
- }
169
- },
170
- $attrs: {
171
- handler(newVal) {
172
- if (newVal['onUpdate:status']) {
173
- this.$emit('update:status', this.localStatus);
174
- }
175
- },
176
- immediate: true,
177
- },
178
- },
179
- methods: {
180
- changeExpand() {
181
- if (this.disabled) return;
182
- this.isExpanded = !this.isExpanded;
183
- this.$emit('change', {
184
- value: this.isExpanded,
185
- status: this.localStatus,
186
- });
187
- this.$emit('update:expanded', this.isExpanded);
188
- },
189
- },
190
- };
191
- </script>
192
-
193
- <style lang="scss" scoped>
194
- @import '../../../styles/Thinking.scss';
195
- </style>
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
+ ? '思考中...'
50
+ : localStatus === 'error'
51
+ ? '思考遇到问题'
52
+ : localStatus === 'end'
53
+ ? '思考完成'
54
+ : '开始思考'
55
+ }}
56
+ </slot>
57
+ </span>
58
+
59
+ <transition name="rotate">
60
+ <span
61
+ v-if="!disabled"
62
+ class="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-show="isExpanded"
75
+ v-if="displayedContent"
76
+ class="content-wrapper"
77
+ :class="{ 'error-state': localStatus === 'error' }"
78
+ >
79
+ <div class="content">
80
+ <slot
81
+ v-if="localStatus !== 'error'"
82
+ name="content"
83
+ :content="displayedContent"
84
+ >
85
+ <pre>{{ displayedContent }}</pre>
86
+ </slot>
87
+
88
+ <slot
89
+ v-else
90
+ name="error"
91
+ :error-content="displayedContent"
92
+ >
93
+ <div class="error-message">{{ displayedContent }}</div>
94
+ </slot>
95
+ </div>
96
+ </div>
97
+ </Transition>
98
+ </div>
99
+ </template>
100
+
101
+ <script>
102
+ export default {
103
+ name: 'ElXThinking',
104
+ props: {
105
+ content: {
106
+ type: String,
107
+ default: '',
108
+ },
109
+ modelValue: {
110
+ type: Boolean,
111
+ default: true,
112
+ },
113
+ status: {
114
+ type: String,
115
+ default: 'start',
116
+ validator: function (value) {
117
+ return ['start', 'thinking', 'end', 'error'].indexOf(value) !== -1;
118
+ },
119
+ },
120
+ disabled: {
121
+ type: Boolean,
122
+ default: false,
123
+ },
124
+ autoCollapse: {
125
+ type: Boolean,
126
+ default: false,
127
+ },
128
+ buttonWidth: {
129
+ type: String,
130
+ default: '160px',
131
+ },
132
+ duration: {
133
+ type: String,
134
+ default: '0.2s',
135
+ },
136
+ maxWidth: {
137
+ type: String,
138
+ default: '500px',
139
+ },
140
+ backgroundColor: {
141
+ type: String,
142
+ default: '#fcfcfc',
143
+ },
144
+ color: {
145
+ type: String,
146
+ default: '#909399',
147
+ },
148
+ },
149
+ data() {
150
+ return {
151
+ isExpanded: this.modelValue,
152
+ localStatus: this.status,
153
+ };
154
+ },
155
+ computed: {
156
+ displayedContent() {
157
+ return this.localStatus === 'error' ? '思考过程中出现错误' : this.content;
158
+ },
159
+ },
160
+ watch: {
161
+ modelValue(newVal) {
162
+ this.isExpanded = newVal;
163
+ },
164
+ status(newVal) {
165
+ this.localStatus = newVal;
166
+ if (newVal === 'end' && this.autoCollapse) {
167
+ this.isExpanded = false;
168
+ }
169
+ },
170
+ $attrs: {
171
+ handler(newVal) {
172
+ if (newVal['onUpdate:status']) {
173
+ this.$emit('update:status', this.localStatus);
174
+ }
175
+ },
176
+ immediate: true,
177
+ },
178
+ },
179
+ methods: {
180
+ changeExpand() {
181
+ if (this.disabled) return;
182
+ this.isExpanded = !this.isExpanded;
183
+ this.$emit('change', {
184
+ value: this.isExpanded,
185
+ status: this.localStatus,
186
+ });
187
+ this.$emit('update:expanded', this.isExpanded);
188
+ },
189
+ },
190
+ };
191
+ </script>
192
+
193
+ <style lang="scss" scoped>
194
+ @import '../../../styles/Thinking.scss';
195
+ </style>
@@ -1,8 +1,8 @@
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
+ 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;