stream-chat-react 10.1.1 → 10.2.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/dist/browser.full-bundle.js +328 -202
- package/dist/browser.full-bundle.js.map +1 -1
- package/dist/browser.full-bundle.min.js +5 -5
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/components/Attachment/AttachmentContainer.d.ts.map +1 -1
- package/dist/components/Attachment/AttachmentContainer.js +67 -15
- package/dist/components/Attachment/attachment-sizing.d.ts +9 -0
- package/dist/components/Attachment/attachment-sizing.d.ts.map +1 -0
- package/dist/components/Attachment/attachment-sizing.js +72 -0
- package/dist/components/Channel/Channel.d.ts +7 -1
- package/dist/components/Channel/Channel.d.ts.map +1 -1
- package/dist/components/Channel/Channel.js +2 -1
- package/dist/components/Channel/hooks/useCreateChannelStateContext.d.ts.map +1 -1
- package/dist/components/Channel/hooks/useCreateChannelStateContext.js +5 -1
- package/dist/components/ChannelPreview/ChannelPreview.d.ts +0 -2
- package/dist/components/ChannelPreview/ChannelPreview.d.ts.map +1 -1
- package/dist/components/ChannelPreview/hooks/index.d.ts +2 -0
- package/dist/components/ChannelPreview/hooks/index.d.ts.map +1 -0
- package/dist/components/ChannelPreview/hooks/index.js +1 -0
- package/dist/components/ChannelPreview/index.d.ts +1 -0
- package/dist/components/ChannelPreview/index.d.ts.map +1 -1
- package/dist/components/ChannelPreview/index.js +1 -0
- package/dist/components/Gallery/Gallery.d.ts +7 -2
- package/dist/components/Gallery/Gallery.d.ts.map +1 -1
- package/dist/components/Gallery/Gallery.js +16 -5
- package/dist/components/Gallery/Image.d.ts +4 -0
- package/dist/components/Gallery/Image.d.ts.map +1 -1
- package/dist/components/Gallery/Image.js +3 -3
- package/dist/components/LoadMore/LoadMorePaginator.d.ts +4 -1
- package/dist/components/LoadMore/LoadMorePaginator.d.ts.map +1 -1
- package/dist/components/Message/hooks/usePinHandler.d.ts.map +1 -1
- package/dist/components/Message/hooks/usePinHandler.js +3 -5
- package/dist/components/MessageInput/hooks/useFileUploads.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useFileUploads.js +1 -0
- package/dist/components/MessageInput/hooks/useMessageInputState.d.ts +2 -0
- package/dist/components/MessageInput/hooks/useMessageInputState.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useMessageInputState.js +2 -1
- package/dist/components/MessageInput/hooks/useSubmitHandler.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useSubmitHandler.js +1 -0
- package/dist/components/MessageInput/index.d.ts +2 -1
- package/dist/components/MessageInput/index.d.ts.map +1 -1
- package/dist/components/MessageInput/index.js +2 -1
- package/dist/components/MessageList/MessageList.d.ts.map +1 -1
- package/dist/components/MessageList/MessageList.js +1 -2
- package/dist/components/MessageList/VirtualizedMessageList.d.ts.map +1 -1
- package/dist/components/MessageList/VirtualizedMessageList.js +0 -1
- package/dist/components/MessageList/hooks/useMessageListElements.d.ts +0 -1
- package/dist/components/MessageList/hooks/useMessageListElements.d.ts.map +1 -1
- package/dist/components/MessageList/hooks/useMessageListElements.js +2 -3
- package/dist/components/MessageList/hooks/useScrollLocationLogic.d.ts +0 -1
- package/dist/components/MessageList/hooks/useScrollLocationLogic.d.ts.map +1 -1
- package/dist/components/MessageList/hooks/useScrollLocationLogic.js +0 -10
- package/dist/components/Thread/Thread.d.ts.map +1 -1
- package/dist/components/Thread/Thread.js +7 -2
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/TypingIndicator/TypingIndicator.d.ts +1 -1
- package/dist/components/TypingIndicator/TypingIndicator.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/context/ChannelStateContext.d.ts +5 -2
- package/dist/context/ChannelStateContext.d.ts.map +1 -1
- package/dist/css/index.css +1 -1
- package/dist/css/index.css.map +1 -1
- package/dist/css/v2/index.css +1 -1
- package/dist/css/v2/index.css.map +1 -1
- package/dist/css/v2/index.layout.css +1 -1
- package/dist/css/v2/index.layout.css.map +1 -1
- package/dist/index.cjs.js +324 -202
- package/dist/index.cjs.js.map +1 -1
- package/dist/scss/Attachment.scss +49 -20
- package/dist/scss/Audio.scss +1 -0
- package/dist/scss/Message.scss +44 -41
- package/dist/scss/MessageCommerce.scss +1 -1
- package/dist/scss/Thread.scss +39 -2
- package/dist/scss/VirtualMessage.scss +2 -6
- package/dist/scss/v2/AttachmentList/AttachmentList-layout.scss +33 -19
- package/dist/scss/v2/Message/Message-layout.scss +12 -0
- package/dist/scss/v2/Message/Message-theme.scss +20 -0
- package/dist/scss/v2/MessageList/MessageList-layout.scss +1 -4
- package/dist/scss/v2/MessageList/VirtualizedMessageList-layout.scss +21 -0
- package/dist/scss/v2/MessageList/VirtualizedMessageList-theme.scss +9 -0
- package/dist/scss/v2/Notification/NotificationList-theme.scss +2 -2
- package/dist/scss/v2/_utils.scss +8 -0
- package/dist/stories/attachment-sizing.stories.d.ts +2 -0
- package/dist/stories/attachment-sizing.stories.d.ts.map +1 -0
- package/dist/stories/attachment-sizing.stories.js +179 -0
- package/dist/stories/edit-message.stories.d.ts.map +1 -1
- package/dist/stories/edit-message.stories.js +0 -4
- package/dist/stories/pin-message.stories.d.ts +2 -0
- package/dist/stories/pin-message.stories.d.ts.map +1 -0
- package/dist/stories/pin-message.stories.js +98 -0
- package/dist/stories/utils.d.ts +1 -1
- package/dist/stories/utils.d.ts.map +1 -1
- package/dist/stories/utils.js +30 -19
- package/dist/types/types.d.ts +9 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/components/MessageList/Center.d.ts +0 -3
- package/dist/components/MessageList/Center.d.ts.map +0 -1
- package/dist/components/MessageList/Center.js +0 -6
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
@mixin clamped-height-from-original-image-dimensions($max-height-css-var, $max-width-css-var) {
|
|
2
|
+
height: min(
|
|
3
|
+
var(#{$max-height-css-var}),
|
|
4
|
+
min(var(#{$max-width-css-var}, 1000000) / var(--original-width, 1000000), 1px) *
|
|
5
|
+
var(--original-height, 1000000)
|
|
6
|
+
);
|
|
3
7
|
}
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
.str-chat__attachment,
|
|
10
|
+
.str-chat__message-attachment {
|
|
11
|
+
--attachment-max-width: 450px;
|
|
12
|
+
--video-width: 300px;
|
|
13
|
+
|
|
14
|
+
max-width: var(--attachment-max-width);
|
|
15
|
+
}
|
|
6
16
|
|
|
7
|
-
.str-chat__message-attachment--video:not(.str-chat__message-attachment--card) {
|
|
8
|
-
width:
|
|
17
|
+
.str-chat__message-attachment.str-chat__message-attachment--video:not(.str-chat__message-attachment--card) {
|
|
18
|
+
--attachment-max-width: var(--video-width);
|
|
19
|
+
width: var(--video-width);
|
|
9
20
|
}
|
|
10
21
|
|
|
11
22
|
.str-chat__player-wrapper {
|
|
12
23
|
position: relative;
|
|
13
24
|
padding-top: 56.25%; /* Player ratio: 100 / (1280 / 720) */
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
|
|
14
28
|
.react-player,
|
|
15
29
|
.str-chat__video-angular {
|
|
16
30
|
position: absolute;
|
|
@@ -18,23 +32,33 @@ $video-width: 300px;
|
|
|
18
32
|
left: 0;
|
|
19
33
|
width: 100%;
|
|
20
34
|
height: 100%;
|
|
35
|
+
min-height: 0;
|
|
36
|
+
max-height: 100%;
|
|
21
37
|
}
|
|
22
38
|
}
|
|
23
39
|
|
|
24
40
|
.str-chat__message-attachment-dynamic-size {
|
|
25
|
-
|
|
41
|
+
--video-max-height: 300px;
|
|
26
42
|
|
|
27
|
-
max-height:
|
|
43
|
+
max-height: var(--video-max-height);
|
|
28
44
|
|
|
29
45
|
.str-chat__player-wrapper {
|
|
46
|
+
@include clamped-height-from-original-image-dimensions(
|
|
47
|
+
'--video-max-height',
|
|
48
|
+
'--attachment-max-width'
|
|
49
|
+
);
|
|
30
50
|
padding-top: 0;
|
|
31
51
|
position: static;
|
|
52
|
+
// CDN resize requires to have max-height/height and max-width set on this element - React
|
|
53
|
+
max-height: var(--video-max-height);
|
|
54
|
+
max-width: var(--attachment-max-width);
|
|
32
55
|
|
|
33
|
-
.str-chat__video-angular
|
|
56
|
+
.str-chat__video-angular,
|
|
57
|
+
.react-player {
|
|
34
58
|
position: static;
|
|
35
|
-
// CDN resize requires to have max-height/height and max-width set on this element
|
|
36
|
-
max-height:
|
|
37
|
-
max-width:
|
|
59
|
+
// CDN resize requires to have max-height/height and max-width set on this element - Angular
|
|
60
|
+
max-height: var(--video-max-height);
|
|
61
|
+
max-width: var(--attachment-max-width);
|
|
38
62
|
}
|
|
39
63
|
}
|
|
40
64
|
}
|
|
@@ -52,12 +76,11 @@ $video-width: 300px;
|
|
|
52
76
|
|
|
53
77
|
.str-chat__message {
|
|
54
78
|
&-attachment {
|
|
79
|
+
--attachment-max-width: 375px;
|
|
55
80
|
width: 100%;
|
|
56
|
-
max-width: 375px;
|
|
57
81
|
|
|
58
82
|
border-radius: var(--border-radius);
|
|
59
|
-
|
|
60
|
-
padding: 0;
|
|
83
|
+
padding: var(--xs-m) auto var(--xs-m) 0;
|
|
61
84
|
}
|
|
62
85
|
|
|
63
86
|
/** Let giphies stretch their containers */
|
|
@@ -65,17 +88,20 @@ $video-width: 300px;
|
|
|
65
88
|
max-width: unset;
|
|
66
89
|
}
|
|
67
90
|
|
|
91
|
+
.str-chat__message-attachment {
|
|
92
|
+
margin: var(--xs-m) 0 var(--xs-m) auto;
|
|
93
|
+
}
|
|
94
|
+
|
|
68
95
|
&--me {
|
|
69
96
|
.str-chat__message-attachment {
|
|
70
97
|
padding-left: 0;
|
|
71
|
-
margin: var(--xs-m) 0 var(--xs-m) auto;
|
|
72
98
|
}
|
|
73
99
|
}
|
|
74
100
|
}
|
|
75
101
|
|
|
76
102
|
.str-chat__message-team.thread-list {
|
|
77
103
|
.str-chat__message-attachment {
|
|
78
|
-
max-width: 200px;
|
|
104
|
+
--attachment-max-width: 200px;
|
|
79
105
|
}
|
|
80
106
|
}
|
|
81
107
|
|
|
@@ -183,9 +209,9 @@ $video-width: 300px;
|
|
|
183
209
|
}
|
|
184
210
|
|
|
185
211
|
&--image {
|
|
186
|
-
height:
|
|
187
|
-
max-height:
|
|
188
|
-
max-width:
|
|
212
|
+
--image-max-height: 300px;
|
|
213
|
+
max-height: var(--image-max-height);
|
|
214
|
+
max-width: var(--attachment-max-width);
|
|
189
215
|
border-radius: 0;
|
|
190
216
|
|
|
191
217
|
&:hover {
|
|
@@ -193,7 +219,10 @@ $video-width: 300px;
|
|
|
193
219
|
}
|
|
194
220
|
|
|
195
221
|
img {
|
|
196
|
-
height
|
|
222
|
+
@include clamped-height-from-original-image-dimensions(
|
|
223
|
+
'--image-max-height',
|
|
224
|
+
'--attachment-max-width'
|
|
225
|
+
);
|
|
197
226
|
width: auto;
|
|
198
227
|
max-height: inherit;
|
|
199
228
|
display: block;
|
package/dist/scss/Audio.scss
CHANGED
package/dist/scss/Message.scss
CHANGED
|
@@ -8,6 +8,24 @@
|
|
|
8
8
|
*/
|
|
9
9
|
.str-chat__message-inner {
|
|
10
10
|
min-width: 0;
|
|
11
|
+
|
|
12
|
+
.str-chat__translation-notice {
|
|
13
|
+
button {
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
padding: 0.25rem 0;
|
|
16
|
+
margin: 0;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
line-height: 16px;
|
|
19
|
+
color: var(--lighten-grey);
|
|
20
|
+
border: none;
|
|
21
|
+
background: none;
|
|
22
|
+
|
|
23
|
+
&:active,
|
|
24
|
+
&:hover {
|
|
25
|
+
background: var(--grey-whisper);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
11
29
|
}
|
|
12
30
|
|
|
13
31
|
.quoted-message {
|
|
@@ -65,7 +83,7 @@
|
|
|
65
83
|
/* group styling */
|
|
66
84
|
&--top,
|
|
67
85
|
&--single {
|
|
68
|
-
|
|
86
|
+
padding-top: calc(var(--md-p)/2);
|
|
69
87
|
|
|
70
88
|
.str-chat__message {
|
|
71
89
|
&-attachment--img,
|
|
@@ -158,7 +176,7 @@
|
|
|
158
176
|
}
|
|
159
177
|
|
|
160
178
|
&--bottom {
|
|
161
|
-
|
|
179
|
+
padding-bottom: calc(var(--md-p)/2);
|
|
162
180
|
|
|
163
181
|
.str-chat__message {
|
|
164
182
|
&-attachment--img,
|
|
@@ -199,7 +217,7 @@
|
|
|
199
217
|
}
|
|
200
218
|
|
|
201
219
|
&--single {
|
|
202
|
-
|
|
220
|
+
padding-bottom: calc(var(--md-m)/2);
|
|
203
221
|
}
|
|
204
222
|
|
|
205
223
|
&--top,
|
|
@@ -215,16 +233,14 @@
|
|
|
215
233
|
.str-chat__message {
|
|
216
234
|
&-text {
|
|
217
235
|
&-inner {
|
|
218
|
-
border-radius: var(--border-radius) var(--border-radius) var(--border-radius)
|
|
219
|
-
calc(var(--border-radius-sm) / 2);
|
|
236
|
+
border-radius: var(--border-radius) var(--border-radius) var(--border-radius) calc(var(--border-radius-sm) / 2);
|
|
220
237
|
}
|
|
221
238
|
}
|
|
222
239
|
|
|
223
240
|
&--me {
|
|
224
241
|
.str-chat__message-text {
|
|
225
242
|
&-inner {
|
|
226
|
-
border-radius: var(--border-radius) var(--border-radius)
|
|
227
|
-
calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
243
|
+
border-radius: var(--border-radius) var(--border-radius) calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
228
244
|
}
|
|
229
245
|
}
|
|
230
246
|
}
|
|
@@ -235,12 +251,10 @@
|
|
|
235
251
|
.str-chat__message {
|
|
236
252
|
&-text {
|
|
237
253
|
&-inner {
|
|
238
|
-
border-radius: var(--border-radius) var(--border-radius) var(--border-radius)
|
|
239
|
-
calc(var(--border-radius-sm) / 2);
|
|
254
|
+
border-radius: var(--border-radius) var(--border-radius) var(--border-radius) calc(var(--border-radius-sm) / 2);
|
|
240
255
|
|
|
241
256
|
&--has-attachment {
|
|
242
|
-
border-radius: calc(var(--border-radius-sm) / 2) var(--border-radius)
|
|
243
|
-
var(--border-radius) calc(var(--border-radius-sm) / 2);
|
|
257
|
+
border-radius: calc(var(--border-radius-sm) / 2) var(--border-radius) var(--border-radius) calc(var(--border-radius-sm) / 2);
|
|
244
258
|
}
|
|
245
259
|
}
|
|
246
260
|
}
|
|
@@ -248,12 +262,10 @@
|
|
|
248
262
|
&--me {
|
|
249
263
|
.str-chat__message-text {
|
|
250
264
|
&-inner {
|
|
251
|
-
border-radius: var(--border-radius) var(--border-radius)
|
|
252
|
-
calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
265
|
+
border-radius: var(--border-radius) var(--border-radius) calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
253
266
|
|
|
254
267
|
&--has-attachment {
|
|
255
|
-
border-radius: var(--border-radius) calc(var(--border-radius-sm) / 2)
|
|
256
|
-
calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
268
|
+
border-radius: var(--border-radius) calc(var(--border-radius-sm) / 2) calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
257
269
|
}
|
|
258
270
|
}
|
|
259
271
|
}
|
|
@@ -266,16 +278,14 @@
|
|
|
266
278
|
.str-chat__message {
|
|
267
279
|
&-text {
|
|
268
280
|
&-inner {
|
|
269
|
-
border-radius: calc(var(--border-radius-sm) / 2) var(--border-radius) var(--border-radius)
|
|
270
|
-
calc(var(--border-radius-sm) / 2);
|
|
281
|
+
border-radius: calc(var(--border-radius-sm) / 2) var(--border-radius) var(--border-radius) calc(var(--border-radius-sm) / 2);
|
|
271
282
|
}
|
|
272
283
|
}
|
|
273
284
|
|
|
274
285
|
&--me {
|
|
275
286
|
.str-chat__message-text {
|
|
276
287
|
&-inner {
|
|
277
|
-
border-radius: var(--border-radius) calc(var(--border-radius-sm) / 2)
|
|
278
|
-
calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
288
|
+
border-radius: var(--border-radius) calc(var(--border-radius-sm) / 2) calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
279
289
|
|
|
280
290
|
&--has-attachment {
|
|
281
291
|
margin: 0;
|
|
@@ -286,8 +296,7 @@
|
|
|
286
296
|
.str-chat__message-attachment-card {
|
|
287
297
|
margin: 0;
|
|
288
298
|
padding: 0;
|
|
289
|
-
border-radius: var(--border-radius) calc(var(--border-radius-sm) / 2)
|
|
290
|
-
calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
299
|
+
border-radius: var(--border-radius) calc(var(--border-radius-sm) / 2) calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
291
300
|
}
|
|
292
301
|
}
|
|
293
302
|
}
|
|
@@ -301,7 +310,8 @@
|
|
|
301
310
|
align-items: flex-end;
|
|
302
311
|
padding: 0;
|
|
303
312
|
position: relative;
|
|
304
|
-
|
|
313
|
+
padding-top: var(--xxs-p);
|
|
314
|
+
padding-bottom: var(--xxs-p);
|
|
305
315
|
width: 100%;
|
|
306
316
|
transition: background-color 0.5s ease-out;
|
|
307
317
|
|
|
@@ -425,11 +435,11 @@
|
|
|
425
435
|
}
|
|
426
436
|
|
|
427
437
|
&-attachment {
|
|
438
|
+
--attachment-max-width: 480px;
|
|
439
|
+
|
|
428
440
|
&--img {
|
|
429
441
|
width: 100%;
|
|
430
|
-
max-width: 480px;
|
|
431
442
|
display: block;
|
|
432
|
-
height: inherit;
|
|
433
443
|
cursor: -moz-zoom-in;
|
|
434
444
|
cursor: -webkit-zoom-in;
|
|
435
445
|
cursor: zoom-in;
|
|
@@ -463,7 +473,6 @@
|
|
|
463
473
|
/* me */
|
|
464
474
|
&--me {
|
|
465
475
|
display: inline-flex;
|
|
466
|
-
margin: var(--xxs-m) 0;
|
|
467
476
|
justify-content: flex-end;
|
|
468
477
|
|
|
469
478
|
.str-chat__message {
|
|
@@ -534,7 +543,6 @@
|
|
|
534
543
|
// CDN resize requires max-width to be set on this element
|
|
535
544
|
max-width: inherit;
|
|
536
545
|
display: block;
|
|
537
|
-
height: inherit;
|
|
538
546
|
object-fit: cover;
|
|
539
547
|
border: none;
|
|
540
548
|
}
|
|
@@ -549,7 +557,7 @@
|
|
|
549
557
|
}
|
|
550
558
|
|
|
551
559
|
&--with-reactions {
|
|
552
|
-
|
|
560
|
+
padding-top: var(--md-p);
|
|
553
561
|
}
|
|
554
562
|
|
|
555
563
|
&--highlighted {
|
|
@@ -578,20 +586,16 @@
|
|
|
578
586
|
.str-chat {
|
|
579
587
|
&__message,
|
|
580
588
|
&__message--me {
|
|
581
|
-
margin: calc(var(--xxs-m) / 2) 0;
|
|
582
|
-
|
|
583
589
|
&--with-reactions {
|
|
584
|
-
|
|
590
|
+
padding-top: var(--lg-p);
|
|
585
591
|
}
|
|
586
592
|
}
|
|
587
593
|
|
|
588
594
|
&__message-attachment--image {
|
|
589
|
-
margin: calc(var(--xxs-m) / 2) 0;
|
|
590
595
|
max-width: 480px;
|
|
591
596
|
}
|
|
592
597
|
|
|
593
598
|
&__message-attachment--card {
|
|
594
|
-
margin: calc(var(--xxs-m) / 2) 0;
|
|
595
599
|
line-height: normal;
|
|
596
600
|
}
|
|
597
601
|
|
|
@@ -844,8 +848,8 @@
|
|
|
844
848
|
flex-direction: row-reverse;
|
|
845
849
|
}
|
|
846
850
|
|
|
847
|
-
.str-chat__message-attachment
|
|
848
|
-
max-width: 460px;
|
|
851
|
+
.str-chat__message-attachment {
|
|
852
|
+
--attachment-max-width: 460px;
|
|
849
853
|
}
|
|
850
854
|
|
|
851
855
|
&-text-inner {
|
|
@@ -945,7 +949,6 @@
|
|
|
945
949
|
}
|
|
946
950
|
|
|
947
951
|
.str-chat__message-attachment--file {
|
|
948
|
-
margin: 0;
|
|
949
952
|
background: var(--white);
|
|
950
953
|
border-color: transparent;
|
|
951
954
|
border: 1px solid var(--grey-gainsboro);
|
|
@@ -1194,20 +1197,20 @@
|
|
|
1194
1197
|
}
|
|
1195
1198
|
|
|
1196
1199
|
@media screen and (max-width: 375px) {
|
|
1197
|
-
.str-chat__message .str-chat__message-attachment
|
|
1198
|
-
max-width: 235px;
|
|
1200
|
+
.str-chat__message .str-chat__message-attachment {
|
|
1201
|
+
--attachment-max-width: 235px;
|
|
1199
1202
|
}
|
|
1200
1203
|
}
|
|
1201
1204
|
|
|
1202
1205
|
@media screen and (max-width: 414px) {
|
|
1203
|
-
.str-chat__message .str-chat__message-attachment
|
|
1204
|
-
max-width:
|
|
1206
|
+
.str-chat__message .str-chat__message-attachment {
|
|
1207
|
+
--attachment-max-width: 235px;
|
|
1205
1208
|
}
|
|
1206
1209
|
}
|
|
1207
1210
|
|
|
1208
1211
|
@media only screen and (device-width: 375px) and (-webkit-device-pixel-ratio: 3) {
|
|
1209
|
-
.str-chat__message .str-chat__message-attachment
|
|
1210
|
-
max-width:
|
|
1212
|
+
.str-chat__message .str-chat__message-attachment {
|
|
1213
|
+
--attachment-max-width: 235px;
|
|
1211
1214
|
}
|
|
1212
1215
|
}
|
|
1213
1216
|
|
package/dist/scss/Thread.scss
CHANGED
|
@@ -10,11 +10,48 @@
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
padding-top: 0;
|
|
12
12
|
|
|
13
|
-
.str-
|
|
14
|
-
|
|
13
|
+
.str-chat__virtual-list .str-chat__virtual-list-message-wrapper {
|
|
14
|
+
padding-left: var(--md-p);
|
|
15
|
+
padding-right: var(--md-p);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.str-chat__thread-container {
|
|
19
|
+
max-height: 100%;
|
|
15
20
|
display: flex;
|
|
16
21
|
flex-direction: column;
|
|
17
22
|
width: 100%;
|
|
23
|
+
|
|
24
|
+
.str-chat__parent-message-li {
|
|
25
|
+
.str-chat__message {
|
|
26
|
+
padding-left: var(--md-p);
|
|
27
|
+
padding-right: var(--md-p);
|
|
28
|
+
|
|
29
|
+
.str-chat__message-inner {
|
|
30
|
+
min-width: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.str-chat__message-attachment--image,
|
|
34
|
+
.str-chat__message-attachment-card {
|
|
35
|
+
border-radius: var(--border-radius) var(--border-radius) var(--border-radius) calc(var(--border-radius-sm) / 2) ;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.str-chat__message--me {
|
|
40
|
+
.str-chat__message-attachment--img,
|
|
41
|
+
.str-chat__message-attachment-card {
|
|
42
|
+
border-radius: var(--border-radius) var(--border-radius) calc(var(--border-radius-sm) / 2) var(--border-radius);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.str-chat__message--with-reactions {
|
|
47
|
+
padding-top: var(--xl-p);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.str-chat__message:not(.str-chat__message--has-attachment) {
|
|
51
|
+
padding-top: var(--xs-p);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
}
|
|
18
55
|
}
|
|
19
56
|
|
|
20
57
|
&--full {
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
font-size: 0;
|
|
4
4
|
|
|
5
5
|
.str-chat__virtual-list-message-wrapper {
|
|
6
|
-
padding:
|
|
6
|
+
padding-left: var(--xl-p);
|
|
7
|
+
padding-right: var(--xl-p);
|
|
7
8
|
width: 100%;
|
|
8
9
|
|
|
9
10
|
.str-chat__message-simple {
|
|
10
|
-
padding-bottom: var(--sm-p);
|
|
11
|
-
|
|
12
11
|
&.str-chat__virtual-message__wrapper--first {
|
|
13
12
|
padding-bottom: 0;
|
|
14
13
|
padding-left: var(--xl-p);
|
|
@@ -40,7 +39,6 @@
|
|
|
40
39
|
|
|
41
40
|
&.str-chat__virtual-message__wrapper--group {
|
|
42
41
|
align-items: center;
|
|
43
|
-
padding-bottom: 0;
|
|
44
42
|
padding-left: var(--xl-p);
|
|
45
43
|
|
|
46
44
|
&.str-chat__message-simple--me {
|
|
@@ -254,8 +252,6 @@
|
|
|
254
252
|
}
|
|
255
253
|
|
|
256
254
|
.str-chat__virtual-message__wrapper--group {
|
|
257
|
-
padding-top: 0;
|
|
258
|
-
|
|
259
255
|
> .str-chat__avatar {
|
|
260
256
|
display: none;
|
|
261
257
|
}
|
|
@@ -4,31 +4,23 @@
|
|
|
4
4
|
/* The margin applied to every attachment in the attachment list */
|
|
5
5
|
--str-chat__attachment-margin: var(--str-chat__spacing-0_5);
|
|
6
6
|
|
|
7
|
-
/* The maximum allowed width and height of attachments, in case of gallery images this is the maximum size of the whole gallery (not just for a single image inside the gallery). In case of Angular, there are some [constraints](https://getstream.io/chat/docs/sdk/angular/components/AttachmentListComponent/#maximum-size) for the acceptable values you can provide for this variable. */
|
|
8
|
-
--str-chat__attachment-max-width: unset;
|
|
9
|
-
|
|
10
|
-
/* The height of scraped images, the default value is optimized for 1.91:1 aspect ratio */
|
|
11
|
-
--str-chat__scraped-image-height: unset;
|
|
12
|
-
|
|
13
|
-
/* The height of scraped videos, the default value is optimized for 16:9 aspect ratio */
|
|
14
|
-
--str-chat__scraped-video-height: unset;
|
|
15
|
-
|
|
16
7
|
/* The height of GIFs */
|
|
17
8
|
--str-chat__gif-height: calc(var(--str-chat__spacing-px) * 200);
|
|
18
|
-
|
|
19
|
-
/* The height of videos, the default value is the mase as `--str-chat__attachment-max-width`. In Angular SDK this is the maximum height, the video can be smaller based on the aspect ratio */
|
|
20
|
-
--str-chat__video-height: unset;
|
|
21
9
|
}
|
|
22
10
|
|
|
23
11
|
.str-chat__attachment-list {
|
|
12
|
+
/* The maximum allowed width and height of attachments, in case of gallery images this is the maximum size of the whole gallery (not just for a single image inside the gallery). There are some constraints for the acceptable values you can provide for this variable, [Angular documentation](https://getstream.io/chat/docs/sdk/angular/components/AttachmentListComponent/#maximum-size), [React documentation](https://getstream.io/chat/docs/sdk/react/message-components/attachment/#image-and-video-sizing). */
|
|
24
13
|
--str-chat__attachment-max-width: calc(
|
|
25
14
|
var(--str-chat__message-max-width) - calc(2 * var(--str-chat__attachment-margin))
|
|
26
15
|
);
|
|
27
16
|
|
|
17
|
+
/* The maximum height of videos, the default value is the mase as `--str-chat__attachment-max-width`. The rendered video can be smaller based on the aspect ratio */
|
|
28
18
|
--str-chat__video-height: var(--str-chat__attachment-max-width);
|
|
29
19
|
|
|
20
|
+
/* The height of scraped images, the default value is optimized for 1.91:1 aspect ratio */
|
|
30
21
|
--str-chat__scraped-image-height: calc(var(--str-chat__attachment-max-width) * calc(1 / 1.91));
|
|
31
22
|
|
|
23
|
+
/* The height of scraped videos, the default value is optimized for 16:9 aspect ratio */
|
|
32
24
|
--str-chat__scraped-video-height: calc(var(--str-chat__attachment-max-width) * calc(9 / 16));
|
|
33
25
|
|
|
34
26
|
display: flex;
|
|
@@ -104,12 +96,16 @@
|
|
|
104
96
|
// Images uploaded from files
|
|
105
97
|
.str-chat__message-attachment--image:not(.str-chat__message-attachment--card) {
|
|
106
98
|
img {
|
|
99
|
+
@include utils.clamped-height-from-original-image-dimensions(
|
|
100
|
+
'--str-chat__attachment-max-width',
|
|
101
|
+
'--str-chat__attachment-max-width'
|
|
102
|
+
);
|
|
103
|
+
|
|
107
104
|
// CDN resize requires max-width and height/max-height to be present on this element
|
|
108
105
|
max-width: var(--str-chat__attachment-max-width);
|
|
109
106
|
max-height: var(--str-chat__attachment-max-width);
|
|
110
107
|
object-fit: cover;
|
|
111
108
|
width: 100%;
|
|
112
|
-
height: 100%;
|
|
113
109
|
cursor: zoom-in;
|
|
114
110
|
}
|
|
115
111
|
}
|
|
@@ -117,20 +113,27 @@
|
|
|
117
113
|
// Video files: uploaded from files and scraped
|
|
118
114
|
.str-chat__message-attachment--video:not(.str-chat__message-attachment--card),
|
|
119
115
|
.str-chat__message-attachment-card--video .str-chat__message-attachment-card--header {
|
|
120
|
-
|
|
116
|
+
$maxWidth: var(--str-chat__attachment-max-width);
|
|
117
|
+
max-width: $maxWidth;
|
|
121
118
|
display: flex;
|
|
122
119
|
|
|
123
120
|
.str-chat__player-wrapper {
|
|
124
121
|
height: 100%;
|
|
125
122
|
width: 100%;
|
|
126
123
|
min-width: 0;
|
|
124
|
+
// CDN resize requires max-width to be present on this element - React
|
|
125
|
+
max-width: $maxWidth;
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
127
128
|
|
|
128
129
|
.react-player,
|
|
129
130
|
.str-chat__video-angular {
|
|
130
131
|
height: 100%;
|
|
131
132
|
width: 100%;
|
|
132
|
-
// CDN resize requires max-width to be present on this element
|
|
133
|
-
max-width:
|
|
133
|
+
// CDN resize requires max-width to be present on this element - Angular
|
|
134
|
+
max-width: $maxWidth;
|
|
135
|
+
max-height: 100%;
|
|
136
|
+
min-height: 0;
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
}
|
|
@@ -140,11 +143,22 @@
|
|
|
140
143
|
}
|
|
141
144
|
|
|
142
145
|
.str-chat__message-attachment--video.str-chat__message-attachment-dynamic-size:not(.str-chat__message-attachment--card) {
|
|
143
|
-
|
|
146
|
+
$maxHeight: var(--str-chat__video-height);
|
|
147
|
+
|
|
148
|
+
max-height: $maxHeight;
|
|
149
|
+
|
|
150
|
+
.str-chat__player-wrapper {
|
|
151
|
+
@include utils.clamped-height-from-original-image-dimensions(
|
|
152
|
+
'--str-chat__video-height',
|
|
153
|
+
'--str-chat__attachment-max-width'
|
|
154
|
+
);
|
|
155
|
+
// CDN resize requires max-height to be present on this element - React
|
|
156
|
+
max-height: $maxHeight;
|
|
157
|
+
}
|
|
144
158
|
|
|
145
159
|
.str-chat__video-angular {
|
|
146
|
-
// CDN resize requires max-height to be present on this element
|
|
147
|
-
max-height:
|
|
160
|
+
// CDN resize requires max-height to be present on this element - Angular
|
|
161
|
+
max-height: $maxHeight;
|
|
148
162
|
}
|
|
149
163
|
}
|
|
150
164
|
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
grid-template-areas:
|
|
72
72
|
'avatar message'
|
|
73
73
|
'. replies'
|
|
74
|
+
'. translation-notice'
|
|
74
75
|
'. metadata';
|
|
75
76
|
column-gap: var(--str-chat__spacing-2);
|
|
76
77
|
grid-template-columns: auto 1fr;
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
grid-template-areas:
|
|
82
83
|
'message'
|
|
83
84
|
'replies'
|
|
85
|
+
'translation-notice'
|
|
84
86
|
'metadata';
|
|
85
87
|
justify-items: end;
|
|
86
88
|
|
|
@@ -166,6 +168,16 @@
|
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
|
|
171
|
+
.str-chat__translation-notice {
|
|
172
|
+
grid-area: translation-notice;
|
|
173
|
+
|
|
174
|
+
button {
|
|
175
|
+
cursor: pointer;
|
|
176
|
+
padding: var(--str-chat__spacing-1) 0;
|
|
177
|
+
margin: 0;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
169
181
|
.str-chat__message-metadata {
|
|
170
182
|
grid-area: metadata;
|
|
171
183
|
display: flex;
|
|
@@ -165,6 +165,12 @@
|
|
|
165
165
|
|
|
166
166
|
/* Box shadow applied to a date separator */
|
|
167
167
|
--str-chat__date-separator-box-shadow: none;
|
|
168
|
+
|
|
169
|
+
/* The text color of the translation notice that is displayed if a message is translated with auto-translation */
|
|
170
|
+
--str-chat__translation-notice-color: var(--str-chat__text-low-emphasis-color);
|
|
171
|
+
|
|
172
|
+
/* The hover color of the translation notice that is displayed if a message is translated with auto-translation */
|
|
173
|
+
--str-chat__translation-notice-active-background-color: var(--str-chat__tertiary-surface-color);
|
|
168
174
|
}
|
|
169
175
|
|
|
170
176
|
.str-chat__message--system {
|
|
@@ -237,6 +243,20 @@
|
|
|
237
243
|
}
|
|
238
244
|
}
|
|
239
245
|
|
|
246
|
+
.str-chat__translation-notice {
|
|
247
|
+
button {
|
|
248
|
+
font: var(--str-chat__body2-text);
|
|
249
|
+
color: var(--str-chat__translation-notice-color);
|
|
250
|
+
border: none;
|
|
251
|
+
background: none;
|
|
252
|
+
|
|
253
|
+
&:active,
|
|
254
|
+
&:hover {
|
|
255
|
+
background: var(--str-chat__translation-notice-active-background-color);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
240
260
|
.str-chat__message-metadata {
|
|
241
261
|
color: var(--str-chat__message-secondary-color);
|
|
242
262
|
font: var(--str-chat__caption-text);
|
|
@@ -32,12 +32,9 @@
|
|
|
32
32
|
|
|
33
33
|
.str-chat__thread-start {
|
|
34
34
|
text-align: start;
|
|
35
|
+
padding-top: var(--str-chat__spacing-3);
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
.str-chat__parent-message-li .str-chat__thread-start {
|
|
39
|
-
padding-top: var(--str-chat__spacing-3);
|
|
40
|
-
}
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
.str-chat__jump-to-latest-message {
|