@ermis-network/ermis-chat-react 2.0.0 → 2.0.1

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 (72) hide show
  1. package/README.md +144 -0
  2. package/dist/index.cjs +5087 -11279
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.css +632 -152
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.d.mts +273 -9
  7. package/dist/index.d.ts +273 -9
  8. package/dist/index.mjs +5085 -11295
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +2 -2
  11. package/src/components/Channel.tsx +0 -3
  12. package/src/components/ChannelActions.tsx +6 -1
  13. package/src/components/ChannelHeader.tsx +8 -32
  14. package/src/components/ChannelInfo/AddMemberModal.tsx +7 -1
  15. package/src/components/ChannelInfo/ChannelInfo.tsx +82 -2
  16. package/src/components/ChannelInfo/EditChannelModal.tsx +2 -2
  17. package/src/components/ChannelInfo/MediaGridItem.tsx +215 -78
  18. package/src/components/ChannelInfo/useChannelInfoTabs.tsx +170 -129
  19. package/src/components/ChannelList.tsx +72 -13
  20. package/src/components/CreateChannelModal.tsx +131 -12
  21. package/src/components/FilesPreview.tsx +8 -12
  22. package/src/components/FlatTopicGroupItem.tsx +27 -16
  23. package/src/components/ForwardMessageModal.tsx +11 -3
  24. package/src/components/MediaLightbox.tsx +444 -304
  25. package/src/components/MessageActionsBox.tsx +2 -0
  26. package/src/components/MessageInput.tsx +41 -12
  27. package/src/components/MessageItem.tsx +70 -25
  28. package/src/components/MessageQuickReactions.tsx +131 -128
  29. package/src/components/MessageReactions.tsx +47 -2
  30. package/src/components/MessageRenderers.tsx +1030 -433
  31. package/src/components/PinnedMessages.tsx +40 -12
  32. package/src/components/QuotedMessagePreview.tsx +99 -8
  33. package/src/components/RecoveryPin/RecoveryPin.tsx +279 -0
  34. package/src/components/RecoveryPin/index.ts +19 -0
  35. package/src/components/TopicList.tsx +20 -5
  36. package/src/components/TypingIndicator.tsx +3 -3
  37. package/src/components/UserPicker.tsx +26 -25
  38. package/src/components/VirtualMessageList.tsx +345 -125
  39. package/src/context/ChatProvider.tsx +27 -1
  40. package/src/hooks/useChannelListUpdates.ts +22 -1
  41. package/src/hooks/useChannelMessages.ts +338 -51
  42. package/src/hooks/useChannelRowUpdates.ts +18 -6
  43. package/src/hooks/useChatUser.ts +9 -1
  44. package/src/hooks/useE2eeAttachmentRenderer.ts +204 -0
  45. package/src/hooks/useE2eeFileUpload.ts +38 -0
  46. package/src/hooks/useFileUpload.ts +25 -5
  47. package/src/hooks/useForwardMessage.ts +210 -13
  48. package/src/hooks/useLoadMessages.ts +16 -4
  49. package/src/hooks/useMentions.ts +60 -6
  50. package/src/hooks/useMessageActions.ts +14 -8
  51. package/src/hooks/useMessageSend.ts +64 -12
  52. package/src/hooks/usePendingE2eeSends.ts +29 -0
  53. package/src/hooks/useRecoveryPin.ts +287 -0
  54. package/src/hooks/useScrollToMessage.ts +29 -4
  55. package/src/hooks/useTopicGroupUpdates.ts +49 -11
  56. package/src/index.ts +23 -0
  57. package/src/messageTypeUtils.ts +14 -0
  58. package/src/styles/_channel-info.css +9 -0
  59. package/src/styles/_channel-list.css +37 -14
  60. package/src/styles/_media-lightbox.css +36 -3
  61. package/src/styles/_message-bubble.css +381 -41
  62. package/src/styles/_message-input.css +8 -0
  63. package/src/styles/_message-list.css +67 -10
  64. package/src/styles/_message-quick-reactions.css +101 -59
  65. package/src/styles/_message-reactions.css +18 -32
  66. package/src/styles/_recovery-pin.css +97 -0
  67. package/src/styles/_tokens.css +5 -5
  68. package/src/styles/_typing-indicator.css +23 -13
  69. package/src/styles/index.css +1 -0
  70. package/src/types.ts +115 -1
  71. package/src/utils/avatarColors.ts +1 -1
  72. package/src/utils.ts +38 -18
@@ -10,19 +10,31 @@
10
10
  cursor: pointer;
11
11
  max-width: 100%;
12
12
  transition: background-color 0.15s;
13
- margin-top: var(--ermis-spacing-sm);
14
13
  }
15
14
 
16
15
  .ermis-quoted-message:hover {
17
16
  background-color: var(--ermis-quote-other-bg-hover);
18
17
  }
19
18
 
19
+ .ermis-quoted-message--unavailable {
20
+ border-left-color: var(--ermis-text-muted);
21
+ background-color: var(--ermis-bg-hover);
22
+ }
23
+
24
+ .ermis-quoted-message--unavailable:hover {
25
+ background-color: var(--ermis-bg-hover);
26
+ }
27
+
20
28
  .ermis-quoted-message__author {
21
29
  font-size: var(--ermis-font-size-xs);
22
30
  font-weight: 600;
23
31
  color: var(--ermis-accent);
24
32
  }
25
33
 
34
+ .ermis-quoted-message--unavailable .ermis-quoted-message__author {
35
+ color: var(--ermis-text-muted);
36
+ }
37
+
26
38
  .ermis-quoted-message__text {
27
39
  font-size: var(--ermis-font-size-xs);
28
40
  color: var(--ermis-text-muted);
@@ -31,18 +43,25 @@
31
43
  white-space: nowrap;
32
44
  }
33
45
 
46
+ .ermis-quoted-message--unavailable .ermis-quoted-message__text {
47
+ font-style: italic;
48
+ }
49
+
34
50
  /* Light theme: same approach works since we darken the accent bg */
35
51
 
36
- /* Avatar column: fixed width for consistent alignment */
52
+ /* Avatar column: fixed width for consistent alignment + sticky for long messages */
37
53
  .ermis-message-list__item-avatar {
38
54
  flex-shrink: 0;
55
+ position: sticky;
56
+ bottom: 0;
57
+ align-self: flex-end;
39
58
  }
40
59
 
41
60
  .ermis-message-list__item-content {
42
61
  display: flex;
43
62
  flex-direction: column;
44
63
  min-width: 0;
45
- max-width: 75%;
64
+ max-width: 100%;
46
65
  gap: 2px;
47
66
  }
48
67
 
@@ -52,19 +71,18 @@
52
71
 
53
72
  .ermis-message-list__bubble-wrapper {
54
73
  display: flex;
55
- flex-wrap: wrap;
56
- flex-direction: row;
57
- align-items: center; /* Center actions vertically with the bubble */
74
+ flex-direction: column;
75
+ align-items: flex-start;
58
76
  position: relative;
59
77
  width: 100%;
60
78
  }
61
79
 
62
80
  .ermis-message-list__item--own .ermis-message-list__bubble-wrapper {
63
- flex-direction: row-reverse;
81
+ align-items: flex-end;
64
82
  }
65
83
 
66
84
  .ermis-message-list__item-user {
67
- font-size: var(--ermis-font-size-xs);
85
+ font-size: var(--ermis-font-size-sm);
68
86
  font-weight: 600;
69
87
  color: var(--ermis-accent);
70
88
  margin-bottom: 1px;
@@ -79,20 +97,28 @@
79
97
  opacity: 0.7;
80
98
  }
81
99
 
82
- /* Timestamp inside bubble — bottom right */
100
+ /* Timestamp inside bubble — inline float (WhatsApp-style) */
83
101
  .ermis-message-list__item-time {
84
- font-size: 0.625rem;
102
+ font-size: 0.6875rem;
85
103
  color: var(--ermis-text-muted);
86
- margin-left: 0;
87
- padding-top: 4px;
88
104
  white-space: nowrap;
89
105
  line-height: 1;
90
- align-self: flex-start;
91
- text-align: left;
92
106
  display: inline-flex;
93
107
  align-items: center;
94
- justify-content: flex-start;
95
- gap: 3px;
108
+ gap: 2px;
109
+ float: right;
110
+ margin-left: 6px;
111
+ margin-top: 4px;
112
+ position: relative;
113
+ }
114
+
115
+ /* Invisible spacer at end of text — ONLY when time is shown (sibling selector) */
116
+ .ermis-message-list__item-time ~ .ermis-message-list__item-text::after,
117
+ .ermis-message-list__item-time ~ * .ermis-message-list__item-text::after {
118
+ content: '';
119
+ display: inline-block;
120
+ width: 15px;
121
+ height: 0;
96
122
  }
97
123
 
98
124
  .ermis-message-list__edited-indicator {
@@ -131,11 +157,52 @@
131
157
  color: var(--ermis-color-danger);
132
158
  }
133
159
 
160
+ .ermis-attachment-upload-overlay {
161
+ position: absolute;
162
+ inset: 0;
163
+ z-index: 3;
164
+ display: inline-flex;
165
+ flex-direction: column;
166
+ align-items: center;
167
+ justify-content: center;
168
+ gap: 6px;
169
+ color: #fff;
170
+ font-size: 12px;
171
+ font-weight: 700;
172
+ line-height: 1;
173
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.36);
174
+ background: rgba(17, 24, 39, 0.34);
175
+ pointer-events: none;
176
+ }
177
+
178
+ .ermis-voice-upload-wrap {
179
+ position: relative;
180
+ }
181
+
182
+ .ermis-voice-upload-progress {
183
+ position: absolute;
184
+ top: -6px;
185
+ right: -6px;
186
+ min-width: 30px;
187
+ padding: 3px 6px;
188
+ border-radius: 999px;
189
+ background: rgba(17, 24, 39, 0.72);
190
+ color: #fff;
191
+ font-size: 11px;
192
+ font-weight: 700;
193
+ line-height: 1;
194
+ }
195
+
134
196
  .ermis-message-bubble--own .ermis-message-list__item-time {
135
197
  color: var(--ermis-bubble-own-text);
136
198
  opacity: 0.6;
137
199
  }
138
200
 
201
+ .ermis-message-bubble--own .ermis-message-list__item-time ~ .ermis-message-list__item-text::after,
202
+ .ermis-message-bubble--own .ermis-message-list__item-time ~ * .ermis-message-list__item-text::after {
203
+ width: 30px;
204
+ }
205
+
139
206
  .ermis-message-list__item-text {
140
207
  font-size: var(--ermis-font-size-sm);
141
208
  line-height: 1.5;
@@ -194,14 +261,13 @@
194
261
  /* --- Message Bubble --- */
195
262
  .ermis-message-bubble {
196
263
  position: relative;
197
- display: flex;
198
- flex-direction: column;
199
- align-items: flex-start;
200
- padding: var(--ermis-spacing-sm) var(--ermis-spacing-md);
264
+ display: flow-root;
265
+ /* contains floats, allowing bottom-right time alignment */
266
+ padding: 8px 10px;
201
267
  border-radius: var(--ermis-radius-lg);
202
268
  /* width: 100%; */
203
269
  word-break: break-word;
204
- border: 1px solid var(--ermis-border);
270
+ overflow: visible;
205
271
  }
206
272
 
207
273
  .ermis-message-bubble--own {
@@ -210,25 +276,34 @@
210
276
  border-color: var(--ermis-bubble-own-bg);
211
277
  }
212
278
 
279
+ /* Text selection inside own bubble: white bg + black text for readability */
280
+ .ermis-message-bubble--own ::selection {
281
+ background-color: rgba(255, 255, 255, 0.9);
282
+ color: #111827;
283
+ }
284
+
285
+ .ermis-message-bubble--own::selection {
286
+ background-color: rgba(255, 255, 255, 0.9);
287
+ color: #111827;
288
+ }
289
+
213
290
  /* --- Override muted text inside own bubble --- */
214
291
  .ermis-message-bubble--own .ermis-attachment__file-size,
215
292
  .ermis-message-bubble--own .ermis-attachment__link-url,
216
293
  .ermis-message-bubble--own .ermis-attachment__link-description,
217
294
  .ermis-message-bubble--own .ermis-attachment__voice-duration,
218
- .ermis-message-bubble--own .ermis-message-list__forwarded-indicator,
219
- .ermis-message-bubble--own .ermis-attachment--file {
295
+ .ermis-message-bubble--own .ermis-message-list__forwarded-indicator {
220
296
  color: var(--ermis-bubble-own-text);
221
297
  opacity: 0.8;
222
298
  }
223
299
 
224
300
  .ermis-message-bubble--own .ermis-attachment--link-preview {
225
- border-color: var(--ermis-bubble-own-text);
226
- opacity: 0.3;
301
+ border-color: color-mix(in srgb, var(--ermis-bubble-own-text) 30%, transparent);
227
302
  }
228
303
 
229
304
  .ermis-message-bubble--own .ermis-attachment--file {
230
- background-color: var(--ermis-bubble-own-text);
231
- opacity: 0.1;
305
+ background-color: color-mix(in srgb, var(--ermis-bubble-own-text) 10%, transparent);
306
+ color: var(--ermis-bubble-own-text);
232
307
  }
233
308
 
234
309
  .ermis-message-bubble--other {
@@ -241,10 +316,12 @@
241
316
  .ermis-message-list__item--own.ermis-message-list__item--group-top .ermis-message-bubble {
242
317
  border-bottom-right-radius: 4px;
243
318
  }
319
+
244
320
  .ermis-message-list__item--own.ermis-message-list__item--group-middle .ermis-message-bubble {
245
321
  border-top-right-radius: 4px;
246
322
  border-bottom-right-radius: 4px;
247
323
  }
324
+
248
325
  .ermis-message-list__item--own.ermis-message-list__item--group-bottom .ermis-message-bubble {
249
326
  border-top-right-radius: 4px;
250
327
  }
@@ -253,12 +330,63 @@
253
330
  .ermis-message-list__item--other.ermis-message-list__item--group-top .ermis-message-bubble {
254
331
  border-bottom-left-radius: 4px;
255
332
  }
333
+
256
334
  .ermis-message-list__item--other.ermis-message-list__item--group-middle .ermis-message-bubble {
257
335
  border-top-left-radius: 4px;
258
336
  border-bottom-left-radius: 4px;
259
337
  }
338
+
260
339
  .ermis-message-list__item--other.ermis-message-list__item--group-bottom .ermis-message-bubble {
261
340
  border-top-left-radius: 4px;
341
+ border-bottom-left-radius: 0;
342
+ }
343
+
344
+ /* --- Pointed Tail (Telegram-style curved SVG) --- */
345
+ /* Tail for OTHER messages (left curved tail) — last in group */
346
+ .ermis-message-list__item--other.ermis-message-list__item--group-bottom .ermis-message-bubble::after,
347
+ .ermis-message-list__item--other.ermis-message-list__item--group-single .ermis-message-bubble::after {
348
+ content: '';
349
+ position: absolute;
350
+ bottom: 0px;
351
+ left: -9px;
352
+ width: 9px;
353
+ height: 17px;
354
+ background-color: var(--ermis-bubble-other-bg);
355
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='9' height='17' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z'/%3E%3C/svg%3E");
356
+ mask-image: url("data:image/svg+xml,%3Csvg width='9' height='17' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z'/%3E%3C/svg%3E");
357
+ -webkit-mask-size: 9px 17px;
358
+ mask-size: 9px 17px;
359
+ -webkit-mask-repeat: no-repeat;
360
+ mask-repeat: no-repeat;
361
+ }
362
+
363
+ /* Tail for OWN messages (right curved tail) — last in group */
364
+ .ermis-message-list__item--own.ermis-message-list__item--group-bottom .ermis-message-bubble::after,
365
+ .ermis-message-list__item--own.ermis-message-list__item--group-single .ermis-message-bubble::after {
366
+ content: '';
367
+ position: absolute;
368
+ bottom: 0px;
369
+ right: -9px;
370
+ width: 9px;
371
+ height: 17px;
372
+ background-color: var(--ermis-bubble-own-bg);
373
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='9' height='17' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z'/%3E%3C/svg%3E");
374
+ mask-image: url("data:image/svg+xml,%3Csvg width='9' height='17' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z'/%3E%3C/svg%3E");
375
+ -webkit-mask-size: 9px 17px;
376
+ mask-size: 9px 17px;
377
+ -webkit-mask-repeat: no-repeat;
378
+ mask-repeat: no-repeat;
379
+ }
380
+
381
+ /* Remove border-radius and border at tail corner for seamless connection */
382
+ .ermis-message-list__item--other.ermis-message-list__item--group-bottom .ermis-message-bubble,
383
+ .ermis-message-list__item--other.ermis-message-list__item--group-single .ermis-message-bubble {
384
+ border-bottom-left-radius: 0;
385
+ }
386
+
387
+ .ermis-message-list__item--own.ermis-message-list__item--group-bottom .ermis-message-bubble,
388
+ .ermis-message-list__item--own.ermis-message-list__item--group-single .ermis-message-bubble {
389
+ border-bottom-right-radius: 0;
262
390
  }
263
391
 
264
392
  /* --- System messages --- */
@@ -315,7 +443,8 @@
315
443
  flex-direction: column;
316
444
  gap: 1px;
317
445
  min-width: 0;
318
- padding-right: 40px; /* Space for timestamp */
446
+ padding-right: 40px;
447
+ /* Space for timestamp */
319
448
  }
320
449
 
321
450
  .ermis-signal-message__text {
@@ -355,6 +484,11 @@
355
484
  border: none !important;
356
485
  }
357
486
 
487
+ /* No tail on signal messages */
488
+ .ermis-message-list__item--signal .ermis-message-bubble::after {
489
+ display: none;
490
+ }
491
+
358
492
  /* --- Attachments --- */
359
493
 
360
494
  /* When message has attachments, constrain entire content column (quote + bubble) */
@@ -366,11 +500,27 @@
366
500
  width: 100%;
367
501
  }
368
502
 
503
+ .ermis-message-list__item-content--has-attachments:has(.ermis-message-content--with-e2ee-attachments) {
504
+ width: fit-content;
505
+ max-width: min(86vw, 350px);
506
+ }
507
+
508
+ .ermis-message-list__item-content--has-attachments:has(.ermis-message-content--with-e2ee-attachments)
509
+ .ermis-message-bubble {
510
+ width: auto;
511
+ max-width: 100%;
512
+ }
513
+
369
514
  /* Container for messages with both text + attachments */
370
515
  .ermis-message-content--with-attachments {
371
516
  display: flex;
372
517
  flex-direction: column;
373
518
  width: 100%;
519
+ max-width: 100%;
520
+ }
521
+
522
+ .ermis-message-content--with-e2ee-attachments {
523
+ width: fit-content;
374
524
  }
375
525
 
376
526
  .ermis-message-content--with-attachments .ermis-message-list__item-text {
@@ -384,6 +534,11 @@
384
534
  gap: var(--ermis-spacing-xs);
385
535
  margin-top: var(--ermis-spacing-xs);
386
536
  width: 100%;
537
+ max-width: 100%;
538
+ }
539
+
540
+ .ermis-message-content--with-e2ee-attachments .ermis-attachment-list {
541
+ width: fit-content;
387
542
  }
388
543
 
389
544
  /* Media grid (images + videos) */
@@ -459,7 +614,8 @@
459
614
  height: 100%;
460
615
  object-fit: cover;
461
616
  filter: blur(20px);
462
- transform: scale(1.1); /* hide blur edges */
617
+ transform: scale(1.1);
618
+ /* hide blur edges */
463
619
  z-index: 1;
464
620
  }
465
621
 
@@ -480,6 +636,7 @@
480
636
  0% {
481
637
  background-position: 200% 0;
482
638
  }
639
+
483
640
  100% {
484
641
  background-position: -200% 0;
485
642
  }
@@ -626,14 +783,114 @@
626
783
  color: var(--ermis-accent);
627
784
  }
628
785
 
786
+ .ermis-attachment--e2ee {
787
+ width: min(320px, calc(100vw - 96px));
788
+ min-width: 220px;
789
+ max-width: 320px;
790
+ border: 1px solid color-mix(in srgb, var(--ermis-accent) 20%, transparent);
791
+ }
792
+
793
+ .ermis-e2ee-attachment__open {
794
+ padding: 0;
795
+ border: 0;
796
+ background: transparent;
797
+ color: inherit;
798
+ text-align: left;
799
+ cursor: pointer;
800
+ }
801
+
802
+ .ermis-e2ee-attachment__open:disabled,
803
+ .ermis-attachment__file-download:disabled {
804
+ cursor: wait;
805
+ opacity: 0.6;
806
+ }
807
+
808
+ .ermis-e2ee-attachment-media {
809
+ display: flex;
810
+ flex-direction: column;
811
+ gap: var(--ermis-spacing-xs);
812
+ width: fit-content;
813
+ max-width: min(100%, 340px);
814
+ }
815
+
816
+ .ermis-e2ee-attachment-media .ermis-attachment-aspect-box {
817
+ max-width: 100%;
818
+ }
819
+
820
+ .ermis-e2ee-attachment-placeholder {
821
+ padding: 0;
822
+ border: 0;
823
+ color: var(--ermis-text-primary);
824
+ cursor: pointer;
825
+ }
826
+
827
+ .ermis-e2ee-attachment-placeholder:disabled {
828
+ cursor: wait;
829
+ }
830
+
831
+ .ermis-e2ee-attachment-placeholder__center {
832
+ position: absolute;
833
+ inset: 0;
834
+ z-index: 3;
835
+ display: flex;
836
+ flex-direction: column;
837
+ align-items: center;
838
+ justify-content: center;
839
+ gap: 6px;
840
+ padding: var(--ermis-spacing-md);
841
+ text-align: center;
842
+ }
843
+
844
+ .ermis-e2ee-attachment-placeholder__icon {
845
+ display: flex;
846
+ align-items: center;
847
+ justify-content: center;
848
+ width: 44px;
849
+ height: 44px;
850
+ border-radius: var(--ermis-radius-full);
851
+ background: color-mix(in srgb, var(--ermis-accent) 14%, var(--ermis-bg-secondary));
852
+ color: var(--ermis-accent);
853
+ }
854
+
855
+ .ermis-e2ee-attachment-placeholder__title {
856
+ max-width: 100%;
857
+ overflow: hidden;
858
+ color: var(--ermis-text-primary);
859
+ font-size: var(--ermis-font-size-sm);
860
+ font-weight: 600;
861
+ text-overflow: ellipsis;
862
+ white-space: nowrap;
863
+ }
864
+
865
+ .ermis-e2ee-attachment-placeholder__meta,
866
+ .ermis-e2ee-attachment-actions__label {
867
+ color: var(--ermis-text-muted);
868
+ font-size: var(--ermis-font-size-xs);
869
+ }
870
+
871
+ .ermis-e2ee-attachment-actions {
872
+ display: flex;
873
+ align-items: center;
874
+ justify-content: space-between;
875
+ gap: var(--ermis-spacing-xs);
876
+ width: 100%;
877
+ min-width: 0;
878
+ }
879
+
880
+ .ermis-e2ee-attachment-actions__label {
881
+ min-width: 0;
882
+ overflow: hidden;
883
+ text-overflow: ellipsis;
884
+ white-space: nowrap;
885
+ }
886
+
629
887
  .ermis-message-bubble--own .ermis-attachment__file-name {
630
888
  color: var(--ermis-bubble-own-text);
631
889
  }
632
890
 
633
891
  .ermis-message-bubble--own .ermis-attachment__file-icon {
634
- background: var(--ermis-bubble-own-text);
635
- opacity: 0.2;
636
- color: inherit;
892
+ background: color-mix(in srgb, var(--ermis-bubble-own-text) 20%, transparent);
893
+ color: var(--ermis-bubble-own-text);
637
894
  }
638
895
 
639
896
  .ermis-message-bubble--own .ermis-attachment__file-ext {
@@ -647,18 +904,60 @@
647
904
  }
648
905
 
649
906
  .ermis-message-bubble--own .ermis-attachment__file-download:hover {
650
- background-color: var(--ermis-bubble-own-text);
651
- opacity: 0.15;
907
+ background-color: color-mix(in srgb, var(--ermis-bubble-own-text) 15%, transparent);
652
908
  color: inherit;
653
909
  }
654
910
 
911
+ .ermis-message-bubble--own .ermis-attachment--e2ee {
912
+ border-color: color-mix(in srgb, var(--ermis-bubble-own-text) 25%, transparent);
913
+ }
914
+
915
+ .ermis-message-bubble--own .ermis-e2ee-attachment-placeholder,
916
+ .ermis-message-bubble--own .ermis-e2ee-attachment-placeholder__title {
917
+ color: var(--ermis-bubble-own-text);
918
+ }
919
+
920
+ .ermis-message-bubble--own .ermis-e2ee-attachment-placeholder__meta,
921
+ .ermis-message-bubble--own .ermis-e2ee-attachment-actions__label {
922
+ color: var(--ermis-bubble-own-text);
923
+ opacity: 0.8;
924
+ }
925
+
926
+ .ermis-message-bubble--own .ermis-e2ee-attachment-placeholder__icon {
927
+ background: color-mix(in srgb, var(--ermis-bubble-own-text) 20%, transparent);
928
+ color: var(--ermis-bubble-own-text);
929
+ }
930
+
655
931
  /* --- Custom Audio Player --- */
656
932
  .ermis-custom-audio-player {
657
933
  display: flex;
658
934
  align-items: center;
659
935
  gap: var(--ermis-spacing-sm);
660
- min-width: 240px; /* base comfortable width */
661
- width: 100%; /* stretch to fill bubble if text makes it wider */
936
+ min-width: 240px;
937
+ width: 100%;
938
+ }
939
+
940
+ .ermis-e2ee-voice-attachment {
941
+ width: min(320px, calc(100vw - 96px));
942
+ max-width: 100%;
943
+ }
944
+
945
+ .ermis-e2ee-voice-attachment .ermis-custom-audio-player {
946
+ width: min(320px, calc(100vw - 96px));
947
+ min-width: 260px;
948
+ max-width: 100%;
949
+ }
950
+
951
+ .ermis-custom-audio-player--placeholder {
952
+ padding: 0;
953
+ border: 0;
954
+ background: transparent;
955
+ color: inherit;
956
+ cursor: pointer;
957
+ }
958
+
959
+ .ermis-custom-audio-player--placeholder:disabled {
960
+ cursor: wait;
662
961
  }
663
962
 
664
963
  .ermis-custom-audio-play-btn {
@@ -671,7 +970,8 @@
671
970
  background-color: var(--ermis-accent);
672
971
  border: none;
673
972
  cursor: pointer;
674
- color: white; /* solid white icon */
973
+ color: white;
974
+ /* solid white icon */
675
975
  flex-shrink: 0;
676
976
  transition: opacity 0.2s, transform 0.1s;
677
977
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
@@ -695,7 +995,8 @@
695
995
  display: flex;
696
996
  align-items: center;
697
997
  height: 24px;
698
- padding: 0 6px; /* prevent thumb cutoff */
998
+ padding: 0 6px;
999
+ /* prevent thumb cutoff */
699
1000
  }
700
1001
 
701
1002
  .ermis-custom-audio-progress-bg {
@@ -748,13 +1049,42 @@
748
1049
  flex-shrink: 0;
749
1050
  min-width: 32px;
750
1051
  text-align: right;
751
- opacity: 0.7;
752
1052
  }
753
1053
 
754
1054
  .ermis-message-bubble--own .ermis-custom-audio-duration {
755
1055
  color: var(--ermis-bubble-own-text);
756
1056
  }
757
1057
 
1058
+ .ermis-custom-audio-download-btn {
1059
+ display: flex;
1060
+ align-items: center;
1061
+ justify-content: center;
1062
+ width: 32px;
1063
+ height: 32px;
1064
+ border-radius: 50%;
1065
+ background: transparent;
1066
+ color: var(--ermis-colors-text-muted, #72767d);
1067
+ border: none;
1068
+ cursor: pointer;
1069
+ transition: background-color 0.2s, color 0.2s;
1070
+ flex-shrink: 0;
1071
+ margin-left: 8px;
1072
+ }
1073
+
1074
+ .ermis-custom-audio-download-btn:hover {
1075
+ background-color: var(--ermis-colors-bg-hover, rgba(0, 0, 0, 0.05));
1076
+ color: var(--ermis-colors-text-normal, #36393f);
1077
+ }
1078
+
1079
+ .ermis-message-bubble--own .ermis-custom-audio-download-btn {
1080
+ color: rgba(255, 255, 255, 0.8);
1081
+ }
1082
+
1083
+ .ermis-message-bubble--own .ermis-custom-audio-download-btn:hover {
1084
+ background-color: rgba(255, 255, 255, 0.15);
1085
+ color: #fff;
1086
+ }
1087
+
758
1088
  .ermis-custom-audio-hidden {
759
1089
  display: none;
760
1090
  }
@@ -879,7 +1209,13 @@
879
1209
  border: none !important;
880
1210
  position: relative;
881
1211
  border-radius: 0;
882
- display: inline-block; /* Ensure bubble shrinks to fit sticker */
1212
+ display: inline-block;
1213
+ /* Ensure bubble shrinks to fit sticker */
1214
+ }
1215
+
1216
+ /* No tail on sticker messages */
1217
+ .ermis-message-list__item--sticker .ermis-message-bubble::after {
1218
+ display: none;
883
1219
  }
884
1220
 
885
1221
  /* Timestamp overlay for stickers */
@@ -927,7 +1263,7 @@
927
1263
 
928
1264
  .ermis-read-receipts--other {
929
1265
  justify-content: flex-start;
930
- padding-left: 36px; /* align with message content (avatar width 28px + gap 8px) */
1266
+ padding-left: 2.75rem;
931
1267
  }
932
1268
 
933
1269
  @keyframes ermis-receipt-pop {
@@ -935,6 +1271,7 @@
935
1271
  opacity: 0;
936
1272
  transform: scale(0.5) translateY(5px);
937
1273
  }
1274
+
938
1275
  100% {
939
1276
  opacity: 1;
940
1277
  transform: scale(1) translateY(0);
@@ -1013,6 +1350,7 @@
1013
1350
  opacity: 0;
1014
1351
  transform: translateY(6px);
1015
1352
  }
1353
+
1016
1354
  to {
1017
1355
  opacity: 1;
1018
1356
  transform: translateY(0);
@@ -1044,9 +1382,11 @@
1044
1382
  .ermis-read-receipts__tooltip::-webkit-scrollbar {
1045
1383
  width: 4px;
1046
1384
  }
1385
+
1047
1386
  .ermis-read-receipts__tooltip::-webkit-scrollbar-track {
1048
1387
  background: transparent;
1049
1388
  }
1389
+
1050
1390
  .ermis-read-receipts__tooltip::-webkit-scrollbar-thumb {
1051
1391
  background: var(--ermis-border);
1052
1392
  border-radius: 4px;
@@ -320,6 +320,14 @@
320
320
  justify-content: center;
321
321
  }
322
322
 
323
+ .ermis-files-preview__progress {
324
+ color: #fff;
325
+ font-size: 11px;
326
+ font-weight: 600;
327
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
328
+ z-index: 2;
329
+ }
330
+
323
331
  .ermis-files-preview__spinner {
324
332
  width: 20px;
325
333
  height: 20px;