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
@@ -1,195 +1,197 @@
1
- @import '../theme/var.scss';
2
-
3
- // 移动设备断点
4
- $--mobile-breakpoint: 768px;
5
-
6
- // Prompts 组件样式
7
- .el-x-prompts {
8
- // 基础样式
9
- &,
10
- & * {
11
- box-sizing: border-box;
12
- }
13
-
14
- max-width: 100%;
15
-
16
- // RTL 支持
17
- &.el-x-prompts-rtl {
18
- direction: rtl;
19
- }
20
-
21
- // 标题样式
22
- .el-x-prompts-title {
23
- font-weight: normal;
24
- font-size: $--el-x-font-size-medium;
25
- color: $--color-text-secondary;
26
- margin-top: 0;
27
- margin-bottom: 0.5em;
28
- }
29
-
30
- // 列表样式
31
- .el-x-prompts-list {
32
- display: flex;
33
- gap: $--el-x-padding-sm;
34
- overflow-x: auto;
35
- // 隐藏滚动条
36
- scrollbar-width: none;
37
- -ms-overflow-style: none;
38
- &::-webkit-scrollbar {
39
- display: none;
40
- }
41
- list-style: none;
42
- padding-left: 0;
43
- margin: 0;
44
- align-items: stretch;
45
-
46
- // 换行
47
- &-wrap {
48
- flex-wrap: wrap;
49
- }
50
-
51
- // 垂直排列
52
- &-vertical {
53
- flex-direction: column;
54
- align-items: flex-start;
55
- }
56
-
57
- // 移动设备响应式
58
- @media screen and (max-width: $--mobile-breakpoint) {
59
- flex-wrap: wrap;
60
- gap: 8px;
61
-
62
- &-wrap {
63
- justify-content: space-between;
64
- }
65
- }
66
- }
67
-
68
- // 项目样式
69
- .el-x-prompts-item {
70
- flex: none;
71
- display: flex;
72
- gap: 4px;
73
- height: auto;
74
- padding: $--el-x-padding-md $--el-x-padding-lg;
75
- align-items: flex-start;
76
- justify-content: flex-start;
77
- background: $--color-white;
78
- border-radius: $--el-x-border-radius-md;
79
- transition: border $--all-transition, background $--all-transition;
80
- border: $--border-width-base $--border-style-base $--border-color-lighter;
81
-
82
- // 移动设备响应式
83
- @media screen and (max-width: $--mobile-breakpoint) {
84
- width: calc(50% - 4px); // 小屏幕上默认两列布局
85
- min-width: 150px;
86
- padding: $--el-x-padding-sm $--el-x-padding-md;
87
-
88
- .el-x-prompts-list-wrap & {
89
- width: calc(50% - 4px);
90
- margin-bottom: 8px;
91
- }
92
-
93
- .el-x-prompts-list-vertical & {
94
- width: 100%;
95
- }
96
- }
97
-
98
- &:not(.el-x-prompts-item-has-nest) {
99
- &:hover {
100
- cursor: pointer;
101
- background: $--background-color-base;
102
- }
103
-
104
- &:active {
105
- background: $--color-primary-light-9;
106
- }
107
- }
108
-
109
- // 内容样式
110
- .el-x-prompts-content {
111
- flex: auto;
112
- min-width: 0;
113
- display: flex;
114
- gap: 4px;
115
- flex-direction: column;
116
- align-items: flex-start;
117
-
118
- // 移动设备响应式
119
- @media screen and (max-width: $--mobile-breakpoint) {
120
- width: 100%;
121
- gap: 2px;
122
- }
123
- }
124
-
125
- // 图标、标签和描述共同样式
126
- .el-x-prompts-icon,
127
- .el-x-prompts-label,
128
- .el-x-prompts-desc {
129
- margin: 0;
130
- padding: 0;
131
- font-size: $--el-x-font-size-base;
132
- line-height: $--el-x-font-line-height-primary;
133
- text-align: start;
134
- white-space: normal;
135
-
136
- // 移动设备响应式
137
- @media screen and (max-width: $--mobile-breakpoint) {
138
- font-size: 14px;
139
- line-height: 1.4;
140
- overflow: hidden;
141
- text-overflow: ellipsis;
142
- display: -webkit-box;
143
- -webkit-line-clamp: 2;
144
- -webkit-box-orient: vertical;
145
- }
146
- }
147
-
148
- // 标签样式
149
- .el-x-prompts-label {
150
- color: $--color-text-primary;
151
- font-weight: 500;
152
- }
153
-
154
- // 描述样式
155
- .el-x-prompts-label + .el-x-prompts-desc {
156
- color: $--color-text-secondary;
157
- }
158
-
159
- // 禁用状态
160
- &.el-x-prompts-item-disabled {
161
- pointer-events: none;
162
- background: $--background-color-base;
163
-
164
- .el-x-prompts-label,
165
- .el-x-prompts-desc {
166
- color: $--color-text-secondary;
167
- }
168
- }
169
- }
170
-
171
- // 嵌套样式
172
- .el-x-prompts-item-has-nest {
173
- > .el-x-prompts-content {
174
- > .el-x-prompts-label {
175
- font-size: $--font-size-large;
176
- line-height: $--font-line-height-primary;
177
- }
178
- }
179
- }
180
-
181
- // 嵌套组件样式
182
- &.el-x-prompts-nested {
183
- margin-top: 5px;
184
- align-self: stretch;
185
-
186
- .el-x-prompts-list {
187
- align-items: stretch;
188
- }
189
-
190
- .el-x-prompts-item {
191
- border: 0;
192
- background: $--background-color-base;
193
- }
194
- }
195
- }
1
+ @import '../theme/var.scss';
2
+
3
+ // 移动设备断点
4
+ $--mobile-breakpoint: 768px;
5
+
6
+ // Prompts 组件样式
7
+ .el-x-prompts {
8
+ max-width: 100%;
9
+
10
+ &,
11
+ & * {
12
+ box-sizing: border-box;
13
+ }
14
+
15
+
16
+ // RTL 支持
17
+ &.el-x-prompts-rtl {
18
+ direction: rtl;
19
+ }
20
+
21
+ // 标题样式
22
+ .el-x-prompts-title {
23
+ font-weight: normal;
24
+ font-size: $--el-x-font-size-medium;
25
+ color: $--color-text-secondary;
26
+ margin-top: 0;
27
+ margin-bottom: 0.5em;
28
+ }
29
+
30
+ // 列表样式
31
+ .el-x-prompts-list {
32
+ display: flex;
33
+ gap: $--el-x-padding-sm;
34
+ overflow-x: auto;
35
+ // 隐藏滚动条
36
+ scrollbar-width: none;
37
+ -ms-overflow-style: none;
38
+
39
+ &::-webkit-scrollbar {
40
+ display: none;
41
+ }
42
+
43
+ list-style: none;
44
+ padding-left: 0;
45
+ margin: 0;
46
+ align-items: stretch;
47
+
48
+ // 换行
49
+ &-wrap {
50
+ flex-wrap: wrap;
51
+ }
52
+
53
+ // 垂直排列
54
+ &-vertical {
55
+ flex-direction: column;
56
+ align-items: flex-start;
57
+ }
58
+
59
+ // 移动设备响应式
60
+ @media screen and (max-width: $--mobile-breakpoint) {
61
+ flex-wrap: wrap;
62
+ gap: 8px;
63
+
64
+ &-wrap {
65
+ justify-content: space-between;
66
+ }
67
+ }
68
+ }
69
+
70
+ // 项目样式
71
+ .el-x-prompts-item {
72
+ flex: none;
73
+ display: flex;
74
+ gap: 4px;
75
+ height: auto;
76
+ padding: $--el-x-padding-md $--el-x-padding-lg;
77
+ align-items: flex-start;
78
+ justify-content: flex-start;
79
+ background: $--color-white;
80
+ border-radius: $--el-x-border-radius-md;
81
+ transition: border $--all-transition, background $--all-transition;
82
+ border: $--border-width-base $--border-style-base $--border-color-lighter;
83
+
84
+ // 移动设备响应式
85
+ @media screen and (max-width: $--mobile-breakpoint) {
86
+ width: calc(50% - 4px); // 小屏幕上默认两列布局
87
+ min-width: 150px;
88
+ padding: $--el-x-padding-sm $--el-x-padding-md;
89
+
90
+ .el-x-prompts-list-wrap & {
91
+ width: calc(50% - 4px);
92
+ margin-bottom: 8px;
93
+ }
94
+
95
+ .el-x-prompts-list-vertical & {
96
+ width: 100%;
97
+ }
98
+ }
99
+
100
+ &:not(.el-x-prompts-item-has-nest) {
101
+ &:hover {
102
+ cursor: pointer;
103
+ background: $--background-color-base;
104
+ }
105
+
106
+ &:active {
107
+ background: $--color-primary-light-9;
108
+ }
109
+ }
110
+
111
+ // 内容样式
112
+ .el-x-prompts-content {
113
+ flex: auto;
114
+ min-width: 0;
115
+ display: flex;
116
+ gap: 4px;
117
+ flex-direction: column;
118
+ align-items: flex-start;
119
+
120
+ // 移动设备响应式
121
+ @media screen and (max-width: $--mobile-breakpoint) {
122
+ width: 100%;
123
+ gap: 2px;
124
+ }
125
+ }
126
+
127
+ // 图标、标签和描述共同样式
128
+ .el-x-prompts-icon,
129
+ .el-x-prompts-label,
130
+ .el-x-prompts-desc {
131
+ margin: 0;
132
+ padding: 0;
133
+ font-size: $--el-x-font-size-base;
134
+ line-height: $--el-x-font-line-height-primary;
135
+ text-align: start;
136
+ white-space: normal;
137
+
138
+ // 移动设备响应式
139
+ @media screen and (max-width: $--mobile-breakpoint) {
140
+ font-size: 14px;
141
+ line-height: 1.4;
142
+ overflow: hidden;
143
+ text-overflow: ellipsis;
144
+ display: -webkit-box;
145
+ -webkit-line-clamp: 2;
146
+ -webkit-box-orient: vertical;
147
+ }
148
+ }
149
+
150
+ // 标签样式
151
+ .el-x-prompts-label {
152
+ color: $--color-text-primary;
153
+ font-weight: 500;
154
+ }
155
+
156
+ // 描述样式
157
+ .el-x-prompts-label+.el-x-prompts-desc {
158
+ color: $--color-text-secondary;
159
+ }
160
+
161
+ // 禁用状态
162
+ &.el-x-prompts-item-disabled {
163
+ pointer-events: none;
164
+ background: $--background-color-base;
165
+
166
+ .el-x-prompts-label,
167
+ .el-x-prompts-desc {
168
+ color: $--color-text-secondary;
169
+ }
170
+ }
171
+ }
172
+
173
+ // 嵌套样式
174
+ .el-x-prompts-item-has-nest {
175
+ >.el-x-prompts-content {
176
+ >.el-x-prompts-label {
177
+ font-size: $--font-size-large;
178
+ line-height: $--font-line-height-primary;
179
+ }
180
+ }
181
+ }
182
+
183
+ // 嵌套组件样式
184
+ &.el-x-prompts-nested {
185
+ margin-top: 5px;
186
+ align-self: stretch;
187
+
188
+ .el-x-prompts-list {
189
+ align-items: stretch;
190
+ }
191
+
192
+ .el-x-prompts-item {
193
+ border: 0;
194
+ background: $--background-color-base;
195
+ }
196
+ }
197
+ }
@@ -1,15 +1,16 @@
1
1
  @import '../theme/var.scss';
2
2
 
3
3
  // 设置全局CSS变量默认值
4
- :root {
5
- --el-x-sender-trigger-popover-width: fit-content;
6
- --el-x-sender-trigger-popover-left: 0px;
7
- }
4
+ // :root {
5
+ // --el-x-sender-trigger-popover-width: fit-content;
6
+ // --el-x-sender-trigger-popover-left: 0px;
7
+ // }
8
8
 
9
9
  $--el-x-sender-box-shadow-tertiary: 0 1px 2px 0 rgba(0, 0, 0, 0.03),
10
- 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
10
+ 0 1px 6px -1px rgba(0, 0, 0, 0.02),
11
+ 0 2px 4px 0 rgba(0, 0, 0, 0.02);
11
12
  $--el-x-sender-input-font-size: 14px;
12
- $--el-x-sender-header-animation-duration: 300ms;
13
+ // $--el-x-sender-header-animation-duration: 300ms;
13
14
  $--el-x-border-width: $--border-width-base;
14
15
  $--el-x-padding-xs: 8px;
15
16
  $--el-x-padding-sm: 12px;
@@ -36,7 +37,7 @@ $--el-x-fill-color: $--background-color-base;
36
37
  border-color: $--el-x-border-color;
37
38
  border-width: 0;
38
39
  border-style: solid;
39
- transition: width $--el-x-sender-header-animation-duration;
40
+ transition: width var(--el-x-sender-header-animation-duration);
40
41
 
41
42
  &:after {
42
43
  content: '';
@@ -68,25 +69,35 @@ $--el-x-fill-color: $--background-color-base;
68
69
  padding: 0;
69
70
  }
70
71
 
71
- // 展开收起动画
72
+ // 展开收起动画 - calc-size:解决无法对某些非固定尺寸(如 auto、min-content、max-content 等)进行动画过渡的新特性
72
73
  .slide-enter-active,
73
74
  .slide-leave-active {
74
- transition: height $--el-x-sender-header-animation-duration,
75
- opacity $--el-x-sender-header-animation-duration,
76
- border $--el-x-sender-header-animation-duration;
75
+ height: calc-size(max-content, size);
76
+ opacity: 1;
77
+ transition:
78
+ height var(--el-x-sender-header-animation-duration),
79
+ opacity var(--el-x-sender-header-animation-duration),
80
+ border var(--el-x-sender-header-animation-duration);
77
81
  overflow: hidden;
78
82
  }
79
83
 
80
- // .slide-enter-from,
81
- // .slide-leave-to {
82
- // height: 0;
83
- // opacity: 0;
84
- // }
85
-
86
84
  .slide-enter,
87
85
  .slide-leave-to {
88
86
  height: 0;
89
- opacity: 0;
87
+ opacity: 0 !important;
88
+ }
89
+
90
+ .slide-enter-to,
91
+ .slide-leave {
92
+ height: calc-size(max-content, size);
93
+ opacity: 1;
94
+ }
95
+
96
+ // 确保内部内容能够正确收缩
97
+ .slide-enter-active .el-x-sender-header-wrap,
98
+ .slide-leave-active .el-x-sender-header-wrap {
99
+ min-height: 0;
100
+ overflow: hidden;
90
101
  }
91
102
 
92
103
  .el-x-sender-header {
@@ -66,18 +66,48 @@
66
66
  transform: rotate(180deg);
67
67
  }
68
68
 
69
+ // .slide-enter-active,
70
+ // .slide-leave-active {
71
+ // transition: max-height var(--el-x-thinking-animation-duration) ease-out,
72
+ // transform var(--el-x-thinking-animation-duration) ease-out,
73
+ // opacity var(--el-x-thinking-animation-duration) ease-out;
74
+ // overflow: hidden;
75
+ // }
76
+
77
+ // .slide-enter,
78
+ // .slide-leave-to {
79
+ // max-height: 0;
80
+ // transform: translateY(-10px);
81
+ // opacity: 0;
82
+ // }
83
+
84
+ // .slide-enter-to,
85
+ // .slide-leave {
86
+ // max-height: 200px;
87
+ // transform: translateY(0);
88
+ // opacity: 1;
89
+ // }
69
90
  .slide-enter-active,
70
91
  .slide-leave-active {
71
- height: max-content;
72
- transition: height var(--el-x-thinking-animation-duration) ease-in-out,
73
- opacity var(--el-x-thinking-animation-duration) ease-in-out;
92
+ height: calc-size(max-content, size);
93
+ opacity: 1;
94
+ transition:
95
+ height var(--el-x-thinking-animation-duration),
96
+ opacity var(--el-x-thinking-animation-duration),
97
+ border var(--el-x-thinking-animation-duration);
74
98
  overflow: hidden;
75
99
  }
76
100
 
77
- .slide-enter-from,
101
+ .slide-enter,
78
102
  .slide-leave-to {
79
- height: 0 !important;
80
- opacity: 0;
103
+ height: 0;
104
+ opacity: 0 !important;
105
+ }
106
+
107
+ .slide-enter-to,
108
+ .slide-leave {
109
+ height: calc-size(max-content, size);
110
+ opacity: 1;
81
111
  }
82
112
 
83
113
  .content-wrapper {