@ermis-network/ermis-chat-react 1.0.8 → 2.0.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/index.cjs +15295 -4209
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +701 -195
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +862 -94
- package/dist/index.d.ts +862 -94
- package/dist/index.mjs +15246 -4186
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -4
- package/src/channelTypeUtils.ts +1 -1
- package/src/components/Avatar.tsx +2 -1
- package/src/components/Channel.tsx +6 -2
- package/src/components/ChannelActions.tsx +61 -2
- package/src/components/ChannelHeader.tsx +19 -5
- package/src/components/ChannelInfo/AddMemberModal.tsx +5 -1
- package/src/components/ChannelInfo/ChannelInfo.tsx +330 -187
- package/src/components/ChannelInfo/ChannelInfoTabs.tsx +59 -297
- package/src/components/ChannelInfo/ChannelSettingsPanel.tsx +30 -174
- package/src/components/ChannelInfo/EditChannelModal.tsx +4 -1
- package/src/components/ChannelInfo/MediaGridItem.tsx +12 -2
- package/src/components/ChannelInfo/MemberListItem.tsx +2 -3
- package/src/components/ChannelInfo/MessageSearchPanel.tsx +27 -126
- package/src/components/ChannelInfo/States.tsx +1 -1
- package/src/components/ChannelInfo/index.ts +3 -0
- package/src/components/ChannelInfo/useChannelInfoTabs.tsx +386 -0
- package/src/components/ChannelInfo/useChannelSettings.ts +212 -0
- package/src/components/ChannelInfo/useMessageSearch.tsx +141 -0
- package/src/components/ChannelList.tsx +177 -290
- package/src/components/CreateChannelModal.tsx +166 -88
- package/src/components/Dropdown.tsx +1 -16
- package/src/components/EditPreview.tsx +1 -0
- package/src/components/ErmisCallProvider.tsx +72 -17
- package/src/components/ErmisCallUI.tsx +43 -20
- package/src/components/FlatTopicGroupItem.tsx +232 -0
- package/src/components/ForwardMessageModal.tsx +31 -77
- package/src/components/MediaLightbox.tsx +62 -40
- package/src/components/MentionSuggestions.tsx +47 -35
- package/src/components/MessageActionsBox.tsx +4 -1
- package/src/components/MessageInput.tsx +137 -16
- package/src/components/MessageInputDefaults.tsx +127 -1
- package/src/components/MessageItem.tsx +93 -26
- package/src/components/MessageQuickReactions.tsx +153 -26
- package/src/components/MessageReactions.tsx +2 -1
- package/src/components/MessageRenderers.tsx +111 -39
- package/src/components/Panel.tsx +1 -14
- package/src/components/PinnedMessages.tsx +17 -5
- package/src/components/PreviewOverlay.tsx +24 -0
- package/src/components/ReadReceipts.tsx +2 -1
- package/src/components/TopicList.tsx +221 -0
- package/src/components/TopicModal.tsx +4 -1
- package/src/components/TypingIndicator.tsx +14 -5
- package/src/components/UserPicker.tsx +87 -10
- package/src/components/VirtualMessageList.tsx +106 -20
- package/src/context/ChatComponentsContext.tsx +14 -0
- package/src/context/ChatProvider.tsx +18 -14
- package/src/context/ErmisCallContext.tsx +4 -0
- package/src/hooks/useChannelCapabilities.ts +7 -4
- package/src/hooks/useChannelData.ts +10 -3
- package/src/hooks/useChannelListUpdates.ts +72 -20
- package/src/hooks/useChannelMessages.ts +72 -10
- package/src/hooks/useChannelRowUpdates.ts +24 -5
- package/src/hooks/useChatUser.ts +31 -0
- package/src/hooks/useContactChannels.ts +45 -0
- package/src/hooks/useContactCount.ts +50 -0
- package/src/hooks/useDownloadHandler.ts +36 -0
- package/src/hooks/useDragAndDrop.ts +79 -0
- package/src/hooks/useForwardMessage.ts +112 -0
- package/src/hooks/useInviteChannels.ts +88 -0
- package/src/hooks/useInviteCount.ts +104 -0
- package/src/hooks/useMentions.ts +0 -1
- package/src/hooks/useMessageActions.ts +13 -10
- package/src/hooks/usePendingState.ts +21 -4
- package/src/hooks/usePreviewState.ts +69 -0
- package/src/hooks/useStickerPicker.ts +62 -0
- package/src/hooks/useTopicGroupUpdates.ts +197 -0
- package/src/index.ts +56 -6
- package/src/messageTypeUtils.ts +13 -1
- package/src/styles/_base.css +0 -1
- package/src/styles/_call-ui.css +59 -2
- package/src/styles/_channel-info.css +41 -4
- package/src/styles/_channel-list.css +97 -57
- package/src/styles/_create-channel-modal.css +10 -0
- package/src/styles/_forward-modal.css +16 -1
- package/src/styles/_media-lightbox.css +32 -0
- package/src/styles/_mentions.css +1 -1
- package/src/styles/_message-actions.css +3 -4
- package/src/styles/_message-bubble.css +286 -107
- package/src/styles/_message-input.css +131 -0
- package/src/styles/_message-list.css +33 -17
- package/src/styles/_message-quick-reactions.css +40 -9
- package/src/styles/_message-reactions.css +4 -0
- package/src/styles/_modal.css +2 -1
- package/src/styles/_preview-overlay.css +38 -0
- package/src/styles/_tokens.css +17 -15
- package/src/styles/_typing-indicator.css +7 -1
- package/src/styles/index.css +1 -0
- package/src/types.ts +362 -14
- package/src/utils/avatarColors.ts +48 -0
- package/src/utils.ts +193 -10
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
|
|
246
246
|
.ermis-channel-list__pinned-icon {
|
|
247
247
|
position: absolute;
|
|
248
|
-
top:
|
|
248
|
+
top: 0px;
|
|
249
249
|
right: 0px;
|
|
250
250
|
color: var(--ermis-color-danger, #ef4444);
|
|
251
251
|
display: inline-flex;
|
|
@@ -265,6 +265,11 @@
|
|
|
265
265
|
color: var(--ermis-text-secondary);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
.ermis-channel-list__item-last-message-source {
|
|
269
|
+
color: var(--ermis-accent);
|
|
270
|
+
font-weight: 500;
|
|
271
|
+
}
|
|
272
|
+
|
|
268
273
|
.ermis-channel-list__item-actions-wrapper,
|
|
269
274
|
.ermis-channel-list__topic-actions-wrapper {
|
|
270
275
|
position: absolute;
|
|
@@ -397,91 +402,126 @@
|
|
|
397
402
|
transform: rotate(0deg);
|
|
398
403
|
}
|
|
399
404
|
|
|
400
|
-
/* --- Topic
|
|
401
|
-
.ermis-channel-list__topic-
|
|
405
|
+
/* --- Topic Hashtag Avatar (used by TopicList) --- */
|
|
406
|
+
.ermis-channel-list__topic-hashtag {
|
|
402
407
|
display: flex;
|
|
403
|
-
|
|
408
|
+
align-items: center;
|
|
409
|
+
justify-content: center;
|
|
410
|
+
width: 24px;
|
|
411
|
+
height: 24px;
|
|
412
|
+
background-color: transparent;
|
|
413
|
+
color: var(--ermis-text-muted);
|
|
414
|
+
border-radius: var(--ermis-radius-full);
|
|
415
|
+
font-size: 0.95rem;
|
|
416
|
+
font-weight: 600;
|
|
417
|
+
flex-shrink: 0;
|
|
404
418
|
}
|
|
405
419
|
|
|
406
|
-
|
|
420
|
+
/* --- Topic Pills (FlatTopicGroupItem) --- */
|
|
421
|
+
.ermis-channel-list__topic-pills {
|
|
407
422
|
display: flex;
|
|
408
423
|
align-items: center;
|
|
409
|
-
gap: var(--ermis-spacing-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
transition: background-color var(--ermis-transition);
|
|
414
|
-
position: relative;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
.ermis-channel-list__topic-header:hover {
|
|
418
|
-
background-color: var(--ermis-bg-hover);
|
|
424
|
+
gap: var(--ermis-spacing-xs);
|
|
425
|
+
flex: 1;
|
|
426
|
+
min-width: 0;
|
|
427
|
+
overflow: hidden;
|
|
419
428
|
}
|
|
420
429
|
|
|
421
|
-
.ermis-channel-list__topic-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
text-overflow: ellipsis;
|
|
428
|
-
flex: 1;
|
|
430
|
+
.ermis-channel-list__topic-pill {
|
|
431
|
+
display: inline-flex;
|
|
432
|
+
align-items: center;
|
|
433
|
+
gap: 2px;
|
|
434
|
+
max-width: 80px;
|
|
435
|
+
flex-shrink: 0;
|
|
429
436
|
}
|
|
430
437
|
|
|
431
|
-
.ermis-channel-
|
|
438
|
+
.ermis-channel-list__topic-pill-avatar {
|
|
439
|
+
width: 16px;
|
|
440
|
+
height: 16px;
|
|
441
|
+
min-width: 16px;
|
|
432
442
|
display: flex;
|
|
433
443
|
align-items: center;
|
|
434
444
|
justify-content: center;
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
border-radius: var(--ermis-radius-sm);
|
|
445
|
+
font-size: 0.7rem;
|
|
446
|
+
border-radius: var(--ermis-radius-full);
|
|
438
447
|
background-color: transparent;
|
|
439
|
-
color: var(--ermis-text-muted);
|
|
440
|
-
border: none;
|
|
441
|
-
cursor: pointer;
|
|
442
|
-
transition: all var(--ermis-transition);
|
|
443
448
|
}
|
|
444
449
|
|
|
445
|
-
.ermis-channel-
|
|
446
|
-
|
|
447
|
-
color: var(--ermis-
|
|
450
|
+
.ermis-channel-list__topic-pill-name {
|
|
451
|
+
font-size: var(--ermis-font-size-xs);
|
|
452
|
+
color: var(--ermis-text-muted);
|
|
453
|
+
white-space: nowrap;
|
|
454
|
+
overflow: hidden;
|
|
455
|
+
text-overflow: ellipsis;
|
|
456
|
+
max-width: 60px;
|
|
448
457
|
}
|
|
449
458
|
|
|
450
|
-
.ermis-channel-list__topic-
|
|
451
|
-
|
|
459
|
+
.ermis-channel-list__topic-overflow {
|
|
460
|
+
font-size: var(--ermis-font-size-xs);
|
|
461
|
+
color: var(--ermis-text-muted);
|
|
462
|
+
flex-shrink: 0;
|
|
463
|
+
font-weight: 600;
|
|
452
464
|
}
|
|
453
465
|
|
|
454
|
-
|
|
466
|
+
/* --- Topics Row (third row in FlatTopicGroupItem) --- */
|
|
467
|
+
.ermis-channel-list__item-topics-row {
|
|
455
468
|
display: flex;
|
|
456
|
-
|
|
457
|
-
|
|
469
|
+
align-items: center;
|
|
470
|
+
gap: var(--ermis-spacing-xs);
|
|
471
|
+
margin-top: 2px;
|
|
458
472
|
}
|
|
459
473
|
|
|
460
|
-
/*
|
|
461
|
-
.ermis-channel-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
474
|
+
/* --- Error Indicator --- */
|
|
475
|
+
.ermis-channel-list__error {
|
|
476
|
+
display: flex;
|
|
477
|
+
flex-direction: column;
|
|
478
|
+
align-items: center;
|
|
479
|
+
justify-content: center;
|
|
480
|
+
padding: var(--ermis-spacing-xl, 32px) var(--ermis-spacing-lg);
|
|
481
|
+
text-align: center;
|
|
482
|
+
height: 100%;
|
|
465
483
|
}
|
|
466
484
|
|
|
467
|
-
.ermis-channel-
|
|
468
|
-
|
|
485
|
+
.ermis-channel-list__error-icon {
|
|
486
|
+
color: var(--ermis-color-danger, #ef4444);
|
|
487
|
+
margin-bottom: var(--ermis-spacing-md);
|
|
488
|
+
opacity: 0.8;
|
|
469
489
|
}
|
|
470
490
|
|
|
471
|
-
.ermis-channel-
|
|
472
|
-
|
|
491
|
+
.ermis-channel-list__error-text {
|
|
492
|
+
font-size: var(--ermis-font-size-sm);
|
|
493
|
+
color: var(--ermis-text-primary);
|
|
494
|
+
font-weight: 500;
|
|
495
|
+
margin-bottom: var(--ermis-spacing-lg);
|
|
496
|
+
max-width: 220px;
|
|
497
|
+
line-height: 1.5;
|
|
473
498
|
}
|
|
474
499
|
|
|
475
|
-
.ermis-channel-
|
|
476
|
-
display: flex;
|
|
500
|
+
.ermis-channel-list__error-retry {
|
|
501
|
+
display: inline-flex;
|
|
477
502
|
align-items: center;
|
|
478
503
|
justify-content: center;
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
border-radius: var(--ermis-radius-
|
|
484
|
-
font-size:
|
|
504
|
+
padding: var(--ermis-spacing-sm, 8px) var(--ermis-spacing-lg, 16px);
|
|
505
|
+
background-color: var(--ermis-bg-primary, #fff);
|
|
506
|
+
color: var(--ermis-text-primary, #111);
|
|
507
|
+
border: 1px solid var(--ermis-border, #e5e7eb);
|
|
508
|
+
border-radius: var(--ermis-radius-md, 8px);
|
|
509
|
+
font-size: var(--ermis-font-size-sm);
|
|
485
510
|
font-weight: 600;
|
|
486
|
-
|
|
511
|
+
cursor: pointer;
|
|
512
|
+
transition: all var(--ermis-transition, 0.2s ease);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.ermis-channel-list__error-retry:hover {
|
|
516
|
+
background-color: var(--ermis-bg-hover, #f3f4f6);
|
|
517
|
+
border-color: var(--ermis-accent);
|
|
518
|
+
color: var(--ermis-accent);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.ermis-channel-list__error-retry svg {
|
|
522
|
+
transition: transform 0.5s ease;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.ermis-channel-list__error-retry:hover svg {
|
|
526
|
+
transform: rotate(180deg);
|
|
487
527
|
}
|
|
@@ -121,8 +121,18 @@
|
|
|
121
121
|
/* User Picker Wrap */
|
|
122
122
|
.ermis-create-channel__users {
|
|
123
123
|
margin-top: var(--ermis-spacing-sm, 0.5rem);
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
124
126
|
}
|
|
125
127
|
|
|
128
|
+
/* .ermis-create-channel__users--team {
|
|
129
|
+
height: 280px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.ermis-create-channel__users--messaging {
|
|
133
|
+
height: 400px;
|
|
134
|
+
} */
|
|
135
|
+
|
|
126
136
|
.ermis-create-channel__users-title {
|
|
127
137
|
font-size: var(--ermis-font-size-sm, 0.875rem);
|
|
128
138
|
font-weight: 500;
|
|
@@ -89,8 +89,14 @@
|
|
|
89
89
|
background: var(--ermis-bg-active);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
.ermis-forward-modal__channel-name {
|
|
92
|
+
.ermis-forward-modal__channel-name-container {
|
|
93
93
|
flex: 1;
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ermis-forward-modal__channel-name {
|
|
94
100
|
font-size: var(--ermis-font-size-sm);
|
|
95
101
|
color: var(--ermis-text-primary);
|
|
96
102
|
overflow: hidden;
|
|
@@ -98,6 +104,15 @@
|
|
|
98
104
|
white-space: nowrap;
|
|
99
105
|
}
|
|
100
106
|
|
|
107
|
+
.ermis-forward-modal__channel-parent-name {
|
|
108
|
+
font-size: var(--ermis-font-size-xs);
|
|
109
|
+
color: var(--ermis-text-muted);
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
text-overflow: ellipsis;
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
margin-bottom: 2px;
|
|
114
|
+
}
|
|
115
|
+
|
|
101
116
|
/* Checkbox */
|
|
102
117
|
.ermis-forward-modal__checkbox {
|
|
103
118
|
width: 20px;
|
|
@@ -120,6 +120,13 @@
|
|
|
120
120
|
/* ----------------------------------------------------------
|
|
121
121
|
Video
|
|
122
122
|
---------------------------------------------------------- */
|
|
123
|
+
.ermis-lightbox__video-wrapper {
|
|
124
|
+
position: relative;
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
justify-content: center;
|
|
128
|
+
}
|
|
129
|
+
|
|
123
130
|
.ermis-lightbox__video {
|
|
124
131
|
max-width: 90vw;
|
|
125
132
|
max-height: 80vh;
|
|
@@ -129,6 +136,31 @@
|
|
|
129
136
|
animation: ermis-lightbox-zoom-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
|
|
130
137
|
}
|
|
131
138
|
|
|
139
|
+
/* Retry overlay + spinner shown when video fails to load (CDN not ready) */
|
|
140
|
+
.ermis-lightbox__video-retry {
|
|
141
|
+
position: absolute;
|
|
142
|
+
inset: 0;
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: center;
|
|
146
|
+
background: rgba(0, 0, 0, 0.5);
|
|
147
|
+
border-radius: 4px;
|
|
148
|
+
pointer-events: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ermis-lightbox__video-spinner {
|
|
152
|
+
width: 36px;
|
|
153
|
+
height: 36px;
|
|
154
|
+
border: 3px solid rgba(255, 255, 255, 0.2);
|
|
155
|
+
border-top-color: #fff;
|
|
156
|
+
border-radius: 50%;
|
|
157
|
+
animation: ermis-lightbox-spin 0.8s linear infinite;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@keyframes ermis-lightbox-spin {
|
|
161
|
+
to { transform: rotate(360deg); }
|
|
162
|
+
}
|
|
163
|
+
|
|
132
164
|
/* ----------------------------------------------------------
|
|
133
165
|
Navigation buttons
|
|
134
166
|
---------------------------------------------------------- */
|
package/src/styles/_mentions.css
CHANGED
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
|
|
28
28
|
/* Position container for other (left) vs own (right) */
|
|
29
29
|
.ermis-message-list__item--own .ermis-message-list__actions {
|
|
30
|
-
right: 100
|
|
30
|
+
right: calc(100% + 12px);
|
|
31
31
|
flex-direction: row-reverse;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.ermis-message-list__item--other .ermis-message-list__actions {
|
|
35
|
-
left: 100
|
|
35
|
+
left: calc(100% + 12px);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/* Individual action buttons */
|
|
@@ -57,5 +57,4 @@
|
|
|
57
57
|
.ermis-message-list__actions-trigger:hover:not(:disabled) {
|
|
58
58
|
background-color: var(--ermis-bg-hover);
|
|
59
59
|
color: var(--ermis-text-primary);
|
|
60
|
-
}
|
|
61
|
-
|
|
60
|
+
}
|