@douyinfe/semi-foundation 2.62.0 → 2.63.0-beta.0
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.
- package/chat/chat.scss +598 -0
- package/chat/chatBoxActionFoundation.ts +64 -0
- package/chat/constants.ts +68 -0
- package/chat/foundation.ts +306 -0
- package/chat/inputboxFoundation.ts +98 -0
- package/chat/rtl.scss +22 -0
- package/chat/variables.scss +125 -0
- package/input/textareaFoundation.ts +5 -0
- package/lib/cjs/chat/chat.css +484 -0
- package/lib/cjs/chat/chat.scss +598 -0
- package/lib/cjs/chat/chatBoxActionFoundation.d.ts +24 -0
- package/lib/cjs/chat/chatBoxActionFoundation.js +49 -0
- package/lib/cjs/chat/constants.d.ts +41 -0
- package/lib/cjs/chat/constants.js +56 -0
- package/lib/cjs/chat/foundation.d.ts +76 -0
- package/lib/cjs/chat/foundation.js +275 -0
- package/lib/cjs/chat/inputboxFoundation.d.ts +20 -0
- package/lib/cjs/chat/inputboxFoundation.js +118 -0
- package/lib/cjs/chat/rtl.scss +22 -0
- package/lib/cjs/chat/variables.scss +125 -0
- package/lib/cjs/input/textareaFoundation.js +7 -0
- package/lib/cjs/treeSelect/foundation.d.ts +3 -3
- package/lib/cjs/treeSelect/foundation.js +2 -6
- package/lib/cjs/upload/foundation.d.ts +1 -0
- package/lib/cjs/upload/foundation.js +3 -1
- package/lib/cjs/upload/upload.css +4 -0
- package/lib/cjs/upload/upload.scss +9 -0
- package/lib/es/chat/chat.css +484 -0
- package/lib/es/chat/chat.scss +598 -0
- package/lib/es/chat/chatBoxActionFoundation.d.ts +24 -0
- package/lib/es/chat/chatBoxActionFoundation.js +41 -0
- package/lib/es/chat/constants.d.ts +41 -0
- package/lib/es/chat/constants.js +51 -0
- package/lib/es/chat/foundation.d.ts +76 -0
- package/lib/es/chat/foundation.js +267 -0
- package/lib/es/chat/inputboxFoundation.d.ts +20 -0
- package/lib/es/chat/inputboxFoundation.js +110 -0
- package/lib/es/chat/rtl.scss +22 -0
- package/lib/es/chat/variables.scss +125 -0
- package/lib/es/input/textareaFoundation.js +7 -0
- package/lib/es/treeSelect/foundation.d.ts +3 -3
- package/lib/es/treeSelect/foundation.js +2 -6
- package/lib/es/upload/foundation.d.ts +1 -0
- package/lib/es/upload/foundation.js +3 -1
- package/lib/es/upload/upload.css +4 -0
- package/lib/es/upload/upload.scss +9 -0
- package/package.json +3 -3
- package/treeSelect/foundation.ts +3 -9
- package/upload/foundation.ts +4 -2
- package/upload/upload.scss +9 -0
package/chat/chat.scss
ADDED
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
@import './variables.scss';
|
|
2
|
+
|
|
3
|
+
$module: #{$prefix}-chat;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@mixin loading-circle-common() {
|
|
7
|
+
border-radius: 50%;
|
|
8
|
+
height: $width-chat_chatBox_loading;
|
|
9
|
+
width: $width-chat_chatBox_loading;
|
|
10
|
+
background-color: $color-chat_chatBox_loading-bg;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.#{$module} {
|
|
14
|
+
padding-top: $spacing-chat_paddingY;
|
|
15
|
+
padding-bottom: $spacing-chat_paddingY;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
height: 100%;
|
|
19
|
+
max-width: $width-chat_max;
|
|
20
|
+
position: relative;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
|
|
23
|
+
&-inner {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-dropArea {
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 0;
|
|
32
|
+
left: 0;
|
|
33
|
+
right: 0;
|
|
34
|
+
bottom: 0;
|
|
35
|
+
background: $color-chat_dropArea-bg;
|
|
36
|
+
z-index: $z-chat_dropArea;
|
|
37
|
+
border: $width-chat_dropArea-border dotted $color-chat_dropArea-border;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
border-radius: $radius-chat_dropArea;
|
|
42
|
+
|
|
43
|
+
&-text {
|
|
44
|
+
font-size: $font-chat_dropArea_text;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&-content {
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
flex: 1 1;
|
|
51
|
+
position: relative;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&-toast {
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 0;
|
|
57
|
+
left: 50%;
|
|
58
|
+
transform: translateX(-50%);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&-container {
|
|
62
|
+
padding-left: $spacing-chat_container-paddingX;
|
|
63
|
+
padding-right: $spacing-chat_container-paddingX;
|
|
64
|
+
height: 100%;
|
|
65
|
+
overflow: scroll;
|
|
66
|
+
|
|
67
|
+
&-scroll-hidden {
|
|
68
|
+
&::-webkit-scrollbar {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&-action {
|
|
76
|
+
position: relative;
|
|
77
|
+
z-index: $z-chat_action;
|
|
78
|
+
|
|
79
|
+
&-content.#{$prefix}-button {
|
|
80
|
+
position: absolute;
|
|
81
|
+
bottom: $spacing-chat_action_content-bottom;
|
|
82
|
+
left: 50%;
|
|
83
|
+
transform: translateX(-50%);
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
align-items: center;
|
|
87
|
+
background: $color-chat_action_content-bg;
|
|
88
|
+
border: $width-chat_action_content-border solid $color-chat_action_content-border;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&-content.#{$prefix}-button-light:not(.#{$prefix}-button-disabled):hover {
|
|
92
|
+
background: $color-chat_action_content-bg-hover;
|
|
93
|
+
border: $width-chat_action_content-border solid $color-chat_action_content-border;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&-backBottom.#{$prefix}-button {
|
|
97
|
+
width: $width-chat_backBottom_wrapper;
|
|
98
|
+
height: $width-chat_backBottom_wrapper;
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&-stop.#{$prefix}-button {
|
|
103
|
+
user-select: none;
|
|
104
|
+
height: $height-chat_action_stop;
|
|
105
|
+
border-radius: calc($height-chat_action_stop / 2);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&-divider {
|
|
111
|
+
color: $color-chat_divider;
|
|
112
|
+
font-size: $font-chat_divider-fontSize;
|
|
113
|
+
margin-top: $spacing-chat_divider-marginY;
|
|
114
|
+
margin-bottom: $spacing-chat_divider-marginY;
|
|
115
|
+
font-weight: $font-chat_divider-fontWeight;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&-chatBox {
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: row;
|
|
121
|
+
margin-top: $spacing-chat_chatBox-marginY;
|
|
122
|
+
margin-Bottom: $spacing-chat_chatBox-marginY;
|
|
123
|
+
column-gap: $spacing-chat_chatBox-columnGap;
|
|
124
|
+
|
|
125
|
+
&:hover {
|
|
126
|
+
.#{$module}-chatBox-action:not(.#{$module}-chatBox-action-hidden) {
|
|
127
|
+
visibility: visible;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&-right {
|
|
132
|
+
flex-direction: row-reverse;
|
|
133
|
+
|
|
134
|
+
.#{$module}-chatBox-wrap {
|
|
135
|
+
align-items: end;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&-avatar {
|
|
140
|
+
flex-shrink: 0;
|
|
141
|
+
|
|
142
|
+
&-hidden {
|
|
143
|
+
visibility: hidden;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&-title {
|
|
148
|
+
line-height: $font-chat_chatBox_title-lineHeight;
|
|
149
|
+
font-size: $font-chat_chatBox_title-fontSize;
|
|
150
|
+
color: $color-chat_chatBox_title;
|
|
151
|
+
font-weight: $font-chat_chatBox_title-fontWeight;
|
|
152
|
+
text-overflow: ellipsis;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&-action {
|
|
156
|
+
visibility: hidden;
|
|
157
|
+
display: flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
position: relative;
|
|
160
|
+
column-gap: $spacing-chat_chatBox_action-columnGap;
|
|
161
|
+
margin-left: $spacing-chat_chatBox_action-marginX;
|
|
162
|
+
margin-right: $spacing-chat_chatBox_action-marginX;
|
|
163
|
+
|
|
164
|
+
&-btn {
|
|
165
|
+
&.#{$prefix}-button {
|
|
166
|
+
height: fit-content;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&.#{$prefix}-button.#{$prefix}-button-with-icon-only {
|
|
170
|
+
padding: $spacing-chat_chatBox_action_btn-padding;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&-icon-flip {
|
|
175
|
+
transform: scaleY(-1);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&-show {
|
|
179
|
+
visibility: visible;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&-delete-wrap {
|
|
183
|
+
display: inline-flex;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&.#{$module}-chatBox-action-hidden, &:hover.#{$module}-chatBox-action-hidden {
|
|
187
|
+
visibility: hidden;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.#{$prefix}-button-borderless:not(.#{$prefix}-button-disabled):hover {
|
|
191
|
+
background-color: $color-chat_chatBox_action-bg-hover;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.#{$prefix}-button-tertiary.#{$prefix}-button-borderless {
|
|
195
|
+
color: $color-chat_chatBox_action_icon;
|
|
196
|
+
|
|
197
|
+
&:hover {
|
|
198
|
+
color: $color-chat_chatBox_action-icon-hover;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
&-wrap {
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
align-items: start;
|
|
208
|
+
position: relative;
|
|
209
|
+
row-gap: $spacing-chat_chatBox_wrap;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
&-content {
|
|
214
|
+
|
|
215
|
+
&-bubble, &-userBubble {
|
|
216
|
+
padding: $spacing-chat_chatBox_content-paddingY $spacing-chat_chatBox_content-paddingX;
|
|
217
|
+
border-radius: $radius-chat_chatBox_content;
|
|
218
|
+
background-color: $color-chat_chatBox_content_bg;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
code {
|
|
222
|
+
white-space: pre-wrap;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.#{$prefix}-typography {
|
|
226
|
+
color: $color-chat_chatBox_content_text;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.#{$module}-attachment-file {
|
|
230
|
+
background: $color-chat_chatBox_other_attachment_file-bg;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.#{$module}-attachment-file, .#{$module}-attachment-img {
|
|
234
|
+
margin-top: $spacing-chat_chatBox_content_attachment-marginY;
|
|
235
|
+
margin-bottom: $spacing-chat_chatBox_content_attachment-marginY;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
&-user {
|
|
239
|
+
background: $color-chat_chatBox_content_user-bg;
|
|
240
|
+
color: $color-chat_chatBox_content_user-text;
|
|
241
|
+
|
|
242
|
+
.#{$module}-attachment-file {
|
|
243
|
+
background: $color-chat_chatBox_user_attachment_file-bg;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.#{$prefix}-typography, .#{$prefix}-typography code {
|
|
247
|
+
color: $color-chat_chatBox_content_user-text;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.#{$prefix}-markdownRender ul, .#{$prefix}-markdownRender li {
|
|
251
|
+
color: $color-chat_chatBox_content_user-text;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.#{$prefix}-typography a {
|
|
255
|
+
&, &:visited, &:hover {
|
|
256
|
+
color: $color-chat_chatBox_content_user-text;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&-error {
|
|
263
|
+
background: $color-chat_chatBox_content_error-bg;
|
|
264
|
+
.#{$prefix}-typography {
|
|
265
|
+
color: $color-chat_chatBox_content_error-text;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
&-loading {
|
|
270
|
+
display: flex;
|
|
271
|
+
align-items: baseline;
|
|
272
|
+
|
|
273
|
+
&-item {
|
|
274
|
+
@include loading-circle-common();
|
|
275
|
+
margin: $spacing-chat_chatBox_loading-item-marginY $spacing-chat_chatBox_loading-item-marginX;
|
|
276
|
+
|
|
277
|
+
overflow: visible;
|
|
278
|
+
position: relative;
|
|
279
|
+
|
|
280
|
+
animation: #{$module}-loading-flashing .8s infinite alternate;
|
|
281
|
+
animation-delay: -0.2s;
|
|
282
|
+
animation-timing-function: ease;
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
&::before {
|
|
286
|
+
content: '';
|
|
287
|
+
@include loading-circle-common();
|
|
288
|
+
|
|
289
|
+
position: absolute;
|
|
290
|
+
top: 0;
|
|
291
|
+
left: -$spacing-chat_chatBox_loading_item-gap;
|
|
292
|
+
|
|
293
|
+
animation: #{$module}-loading-flashing .8s infinite alternate;
|
|
294
|
+
animation-timing-function: ease;
|
|
295
|
+
animation-delay: -0.4s;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&::after {
|
|
299
|
+
content: '';
|
|
300
|
+
@include loading-circle-common();
|
|
301
|
+
position: absolute;
|
|
302
|
+
top: 0;
|
|
303
|
+
left: $spacing-chat_chatBox_loading_item-gap;
|
|
304
|
+
|
|
305
|
+
animation: #{$module}-loading-flashing .8s infinite alternate;
|
|
306
|
+
animation-delay: 0s;
|
|
307
|
+
animation-timing-function: ease;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
pre {
|
|
313
|
+
background-color: transparent;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
&-code {
|
|
317
|
+
border-radius: $radius-chat_chatBox_content_code;
|
|
318
|
+
overflow: hidden;
|
|
319
|
+
|
|
320
|
+
& .#{$prefix}-codeHighlight pre {
|
|
321
|
+
word-break: break-all;
|
|
322
|
+
white-space: pre-wrap;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
&-topSlot {
|
|
326
|
+
display: flex;
|
|
327
|
+
justify-content: space-between;
|
|
328
|
+
background-color: $color-chat_chatBox_code_topSlot-bg;
|
|
329
|
+
align-items: center;
|
|
330
|
+
padding: $spacing-chat_chatBox_content_code_topSlot-paddingX $spacing-chat_chatBox_content_code_topSlot-paddingY;
|
|
331
|
+
color: $color-chat_chatBox_code_topSlot;
|
|
332
|
+
font-size: $font-chat_chatBox_code_topSlot;
|
|
333
|
+
|
|
334
|
+
&-copy {
|
|
335
|
+
min-width: $width-chat_chatBox_content_code_topSlot_copy;
|
|
336
|
+
display: flex;
|
|
337
|
+
justify-content: flex-end;
|
|
338
|
+
|
|
339
|
+
&-wrapper {
|
|
340
|
+
display: flex;
|
|
341
|
+
align-items: center;
|
|
342
|
+
column-gap: $spacing-chat_chatBox_content_code_topSlot_copy-columnGap;
|
|
343
|
+
cursor: pointer;
|
|
344
|
+
background: transparent;
|
|
345
|
+
border: none;
|
|
346
|
+
color: $color-chat_chatBox_code_topSlot;
|
|
347
|
+
line-height: $font-chat_chatBox_code_topSlot-lineHeight;
|
|
348
|
+
padding: $spacing-chat_chatBox_content_code_topSlot_copy-padding;
|
|
349
|
+
border-radius: $radius-chat_chatBox_content_code_topSlot_copy;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
&-toCopy {
|
|
355
|
+
&:hover {
|
|
356
|
+
background: $color-chat_chatBox_code_topSlot_toCopy-bg-hover;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.semi-codeHighlight-defaultTheme pre[class*=language-] {
|
|
363
|
+
margin: 0px;
|
|
364
|
+
background: $color-chat_chatBox_code_content;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
&-inputBox {
|
|
371
|
+
padding-left: $spacing-chat_inputBox-paddingX;
|
|
372
|
+
padding-right: $spacing-chat_inputBox-paddingX;
|
|
373
|
+
padding-top: $spacing-chat_inputBox-paddingTop;
|
|
374
|
+
padding-bottom: $spacing-chat_inputBox-paddingBottom;
|
|
375
|
+
|
|
376
|
+
&-clearButton.#{$prefix}-button {
|
|
377
|
+
border-radius: 50%;
|
|
378
|
+
width: $width-chat_inputBottom_clearButton;
|
|
379
|
+
height: $width-chat_inputBottom_clearButton;
|
|
380
|
+
margin-top: $spacing-chat_inputBox-marginY;
|
|
381
|
+
margin-bottom: $spacing-chat_inputBox-marginY;
|
|
382
|
+
|
|
383
|
+
.#{$prefix}-icon {
|
|
384
|
+
font-size: $font-chat_inputBottom_clearButton_icon-fontSize;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
&.#{$prefix}-button-primary.#{$prefix}-button-borderless {
|
|
388
|
+
color: $color-chat_inputBottom_clearButton_icon;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
&-upload {
|
|
394
|
+
.#{$prefix}-upload-file-list {
|
|
395
|
+
display: none;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
&-uploadButton.#{$prefix}-button {
|
|
400
|
+
width: $width-chat_inputBottom_uploadButton;
|
|
401
|
+
height: $width-chat_inputBottom_uploadButton;
|
|
402
|
+
&.#{$prefix}-button-primary.#{$prefix}-button-borderless {
|
|
403
|
+
color: $color-chat_inputBottom_uploadButton_icon;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
&-sendButton.#{$prefix}-button{
|
|
408
|
+
width: $width-chat_inputBottom_sendButton;
|
|
409
|
+
height: $width-chat_inputBottom_sendButton;
|
|
410
|
+
&-icon {
|
|
411
|
+
transform: rotate(45deg);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
&.#{$prefix}-button-disabled.#{$prefix}-button-borderless {
|
|
415
|
+
color: $color-chat_inputBottom_sendButton_icon-disable;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
&-inner {
|
|
420
|
+
display: flex;
|
|
421
|
+
flex-direction: row;
|
|
422
|
+
align-items: flex-end;
|
|
423
|
+
column-gap: $spacing-chat_inputBox_inner-columnGap;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
&-container {
|
|
427
|
+
display: flex;
|
|
428
|
+
flex-direction: row;
|
|
429
|
+
flex-grow: 1;
|
|
430
|
+
border-radius: $radius-chat_inputBox_container;
|
|
431
|
+
padding: $spacing-chat_inputBox_container-padding;
|
|
432
|
+
border: $width-chat_inputBox_container-border solid $color-chat_inputBox_container-border;
|
|
433
|
+
align-items: end;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
&-inputArea {
|
|
437
|
+
flex-grow: 1;
|
|
438
|
+
display: flex;
|
|
439
|
+
flex-direction: column;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
&-textarea {
|
|
443
|
+
flex-grow: 1;
|
|
444
|
+
|
|
445
|
+
&.#{$prefix}-input-textarea-wrapper {
|
|
446
|
+
&, &:hover, &:active {
|
|
447
|
+
border: none;
|
|
448
|
+
background-color: transparent;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
&-attachment {
|
|
455
|
+
display: flex;
|
|
456
|
+
flex-direction: row;
|
|
457
|
+
flex-wrap: wrap;
|
|
458
|
+
column-gap: $spacing-chat_attachment-columnGap;
|
|
459
|
+
row-gap: $spacing-chat_attachment-RowGap;
|
|
460
|
+
|
|
461
|
+
&-item {
|
|
462
|
+
position: relative;
|
|
463
|
+
|
|
464
|
+
&:hover {
|
|
465
|
+
.#{$module}-inputBox-attachment-clear {
|
|
466
|
+
visibility: visible;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
&-img {
|
|
472
|
+
border-radius: $radius-chat_attachment_img;
|
|
473
|
+
vertical-align: top;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
a {
|
|
477
|
+
text-decoration: none;
|
|
478
|
+
color: inherit;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
&-clear {
|
|
482
|
+
position: absolute;
|
|
483
|
+
top: -1 * $spacing-chat_attachment_clear-top;
|
|
484
|
+
right: -1 * $spacing-chat_attachment_clear-right;
|
|
485
|
+
color: $color-chat_attachment_clear_icon;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
&-process.#{$prefix}-progress-circle {
|
|
489
|
+
position: absolute;
|
|
490
|
+
top: 50%;
|
|
491
|
+
left: 50%;
|
|
492
|
+
transform: translate(-50%, -50%);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
&-file {
|
|
496
|
+
display: flex;
|
|
497
|
+
flex-direction: row;
|
|
498
|
+
align-items: center;
|
|
499
|
+
height: $width-chat_attachment_file;
|
|
500
|
+
column-gap: $spacing-chat_attachment_file-columnGap;
|
|
501
|
+
padding: $spacing-chat_attachment_file-padding;
|
|
502
|
+
border-radius: $radius-chat_attachment_file;
|
|
503
|
+
background: $color-chat_attachment_file-bg;
|
|
504
|
+
text-decoration: none;
|
|
505
|
+
|
|
506
|
+
&-icon {
|
|
507
|
+
color: $color-chat_attachment_file_icon;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
&-info {
|
|
511
|
+
display: flex;
|
|
512
|
+
flex-direction: column;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
&-title {
|
|
516
|
+
font-size: $font-chat_attachment_file_title-fontSize;
|
|
517
|
+
color: $color-chat_attachment_file_title;
|
|
518
|
+
max-width: $width-chat_attachment_file_title;
|
|
519
|
+
text-overflow: ellipsis;
|
|
520
|
+
overflow: hidden;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
&-metadata {
|
|
524
|
+
font-size: $font-chat_attachment_file_metadata-fontSize;
|
|
525
|
+
color: $color-chat_attachment_file_metadata_text;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
&-type {
|
|
529
|
+
text-transform: uppercase;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.#{$prefix}-typography a.#{$module}-attachment-file {
|
|
536
|
+
display: flex;
|
|
537
|
+
|
|
538
|
+
.#{$module}-attachment-file-title {
|
|
539
|
+
color: $color-chat_attachment_file_title;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
&-hints {
|
|
545
|
+
display: flex;
|
|
546
|
+
flex-direction: column;
|
|
547
|
+
row-gap: $spacing-chat_hint-rowGap;
|
|
548
|
+
margin-top: $spacing-chat_hint-marginY;
|
|
549
|
+
margin-bottom: $spacing-chat_hint-marginY;
|
|
550
|
+
margin-left: $spacing-chat_hint-marginLeft;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
&-hint {
|
|
554
|
+
&-item {
|
|
555
|
+
cursor: pointer;
|
|
556
|
+
display: flex;
|
|
557
|
+
flex-direction: row;
|
|
558
|
+
column-gap: $spacing-chat_hint_item-columnGap;
|
|
559
|
+
width: fit-content;
|
|
560
|
+
// justify-content: space-between;
|
|
561
|
+
background: $color-chat_hint_item-bg;
|
|
562
|
+
align-items: center;
|
|
563
|
+
border: $width-chat_hint_item-border solid $color-chat_hint_item-border;
|
|
564
|
+
padding: $spacing-chat_hint_item-marginY $spacing-chat_hint_item-marginX;
|
|
565
|
+
border-radius: $radius-chat_hint_item;
|
|
566
|
+
|
|
567
|
+
&:hover {
|
|
568
|
+
background-color: $color-chat_hint_item-bg-hover;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
&-content {
|
|
573
|
+
font-size: $font-chat_hint_content-fontSize;
|
|
574
|
+
color: $color-chat_hint_content_text;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
&-icon {
|
|
578
|
+
// font-size: $font-chat_hint_icon;
|
|
579
|
+
color: $color-chat_hint_icon;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
@keyframes #{$module}-loading-flashing {
|
|
586
|
+
0% {
|
|
587
|
+
opacity: 1;;
|
|
588
|
+
}
|
|
589
|
+
50% {
|
|
590
|
+
opacity: 0.1;
|
|
591
|
+
}
|
|
592
|
+
to {
|
|
593
|
+
opacity: 1;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
@import './rtl.scss';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import BaseFoundation, { DefaultAdapter } from "../base/foundation";
|
|
2
|
+
|
|
3
|
+
export interface ChatBoxActionAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
4
|
+
notifyDeleteMessage: () => void;
|
|
5
|
+
notifyMessageCopy: () => void;
|
|
6
|
+
copyToClipboardAndToast: () => void;
|
|
7
|
+
notifyLikeMessage: () => void;
|
|
8
|
+
notifyDislikeMessage: () => void;
|
|
9
|
+
notifyResetMessage: () => void;
|
|
10
|
+
setVisible: (visible: boolean) => void;
|
|
11
|
+
setShowAction: (showAction: boolean) => void;
|
|
12
|
+
registerClickOutsideHandler(...args: any[]): void;
|
|
13
|
+
unregisterClickOutsideHandler(...args: any[]): void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default class ChatBoxActionFoundation <P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<ChatBoxActionAdapter<P, S>, P, S> {
|
|
17
|
+
constructor(adapter: ChatBoxActionAdapter<P, S>) {
|
|
18
|
+
super({ ...adapter });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
showDeletePopup = () => {
|
|
22
|
+
this._adapter.setVisible(true);
|
|
23
|
+
this._adapter.setShowAction(true);
|
|
24
|
+
this._adapter.registerClickOutsideHandler(this.hideDeletePopup);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
hideDeletePopup = () => {
|
|
28
|
+
/** visible 控制 popConfirm 的显隐
|
|
29
|
+
* showAction 控制在 popConfirm 显示时候,保证操作区显示
|
|
30
|
+
* 需要有时间间隔,用 visible 直接控制的话,在 popconfirm 通过取消按钮关闭时会导致操作区显示闪动
|
|
31
|
+
*/
|
|
32
|
+
this._adapter.setVisible(false);
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
this._adapter.setShowAction(false);
|
|
35
|
+
}, 150);
|
|
36
|
+
this._adapter.unregisterClickOutsideHandler();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
destroy = () => {
|
|
40
|
+
this._adapter.unregisterClickOutsideHandler();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
deleteMessage = () => {
|
|
44
|
+
this._adapter.notifyDeleteMessage();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
copyMessage = () => {
|
|
48
|
+
this._adapter.notifyMessageCopy();
|
|
49
|
+
this._adapter.copyToClipboardAndToast();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
likeMessage = () => {
|
|
53
|
+
this._adapter.notifyLikeMessage();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
dislikeMessage = () => {
|
|
57
|
+
this._adapter.notifyDislikeMessage();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
resetMessage = () => {
|
|
61
|
+
this._adapter.notifyResetMessage();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
}
|