@cometchat/chat-uikit-react 6.2.6 → 6.3.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.
- package/dist/index.d.ts +92 -23
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/styles/CometChatAIAssistantChat.css +1 -0
- package/dist/styles/CometChatAIAssistantMessageBubble.css +32 -6
- package/dist/styles/CometChatConversations.css +2 -2
- package/dist/styles/CometChatMessageBubble.css +5 -0
- package/dist/styles/CometChatMessageHeader.css +1 -1
- package/dist/styles/CometChatMessageList.css +8 -1
- package/dist/styles/CometChatMessagePreview.css +275 -0
- package/dist/styles/CometChatStreamMessageBubble.css +48 -6
- package/dist/styles/components/CometChatAIAssistantChat.css +1 -0
- package/dist/styles/components/CometChatAIAssistantMessageBubble.css +32 -6
- package/dist/styles/components/CometChatConversations.css +2 -2
- package/dist/styles/components/CometChatMessageBubble.css +5 -0
- package/dist/styles/components/CometChatMessageHeader.css +1 -1
- package/dist/styles/components/CometChatMessageList.css +8 -1
- package/dist/styles/components/CometChatMessagePreview.css +275 -0
- package/dist/styles/components/CometChatStreamMessageBubble.css +48 -6
- package/dist/styles/components/index.css +5 -0
- package/dist/styles/index.css +5 -0
- package/dist/types/components/BaseComponents/CometChatFullScreenViewer/CometChatFullScreenViewer.d.ts +1 -1
- package/dist/types/components/BaseComponents/CometChatMessagePreview/CometChatMessagePreview.d.ts +30 -0
- package/dist/types/components/CometChatAIAssistantChat/CometChatAIAssistantChat.d.ts +2 -0
- package/dist/types/components/CometChatMessageComposer/CometChatMessageComposer.d.ts +7 -0
- package/dist/types/components/CometChatMessageComposer/useCometChatMessageComposer.d.ts +1 -0
- package/dist/types/components/CometChatMessageList/CometChatMessageList.d.ts +20 -15
- package/dist/types/components/CometChatMessageList/useCometChatMessageList.d.ts +1 -1
- package/dist/types/components/Extensions/Polls/CreatePolls.d.ts +4 -0
- package/dist/types/components/Extensions/Polls/PollsExtensionDecorator.d.ts +2 -0
- package/dist/types/components/Extensions/Stickers/StickersExtensionDecorator.d.ts +3 -3
- package/dist/types/events/CometChatMessageEvents.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modals/CometChatMessageTemplate.d.ts +5 -0
- package/dist/types/utils/DataSource.d.ts +5 -1
- package/dist/types/utils/DataSourceDecorator.d.ts +5 -1
- package/dist/types/utils/MessagesDataSource.d.ts +20 -1
- package/package.json +2 -2
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Main container for the reply-message preview area.
|
|
3
|
+
*/
|
|
4
|
+
.cometchat-message-preview {
|
|
5
|
+
padding: var(--cometchat-padding-2, 8px);
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
align-items: flex-start;
|
|
10
|
+
margin: 0;
|
|
11
|
+
min-height: 30px;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
min-width: 100px;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
border: none;
|
|
17
|
+
border-radius: var(--cometchat-radius-1, 4px);
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
gap: var(--cometchat-padding-1, 4px);
|
|
20
|
+
position: relative;
|
|
21
|
+
background-color: var(--cometchat-background-color-03);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
.cometchat-message-bubble-incoming .cometchat-message-preview{
|
|
26
|
+
background-color: var(--cometchat-neutral-color-400);
|
|
27
|
+
color: var( --cometchat-primary-color);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.cometchat-message-bubble-outgoing .cometchat-message-preview{
|
|
31
|
+
background: var(--cometchat-extended-primary-color-700);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
Close button for the reply-message preview.
|
|
36
|
+
*/
|
|
37
|
+
.cometchat-message-preview__close {
|
|
38
|
+
mask: url("../../assets/close.svg") center center no-repeat;
|
|
39
|
+
-webkit-mask: url("../../assets/close.svg") center center no-repeat;
|
|
40
|
+
height: 20px;
|
|
41
|
+
width: 20px;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
background: var(--cometchat-icon-color-primary);
|
|
46
|
+
-webkit-mask-size: contain;
|
|
47
|
+
mask-size: contain;
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: var(--cometchat-padding-2, 8px);
|
|
50
|
+
right: var(--cometchat-padding-2, 8px);
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/*
|
|
55
|
+
Text shown when a message is deleted.
|
|
56
|
+
*/
|
|
57
|
+
.cometchat-message-bubble-outgoing .cometchat-message-preview-deleted__message{
|
|
58
|
+
color: var(--cometchat-static-white);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.cometchat-message-preview-deleted__message {
|
|
62
|
+
display: flex;
|
|
63
|
+
gap: 2px;
|
|
64
|
+
height: 100%;
|
|
65
|
+
justify-content: left;
|
|
66
|
+
width: 100%;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cometchat-message-preview-deleted__message__text{
|
|
70
|
+
font: var(--cometchat-font-caption1-regular, 12px);
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
text-overflow: ellipsis;
|
|
74
|
+
max-width: 100%;
|
|
75
|
+
}
|
|
76
|
+
.cometchat-message-bubble-incoming .cometchat-message-preview-deleted__message{
|
|
77
|
+
color: var(--cometchat-neutral-color-600);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
Title text inside the reply-message preview.
|
|
82
|
+
*/
|
|
83
|
+
.cometchat-message-preview__title {
|
|
84
|
+
font: var(--cometchat-font-caption1-regular, 12px);
|
|
85
|
+
width: 100%;
|
|
86
|
+
text-align: left;
|
|
87
|
+
color: var(--cometchat-primary-color);
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
text-overflow: ellipsis;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
Subtitle text inside the reply-message preview, containing the actual text being reply-messageed.
|
|
95
|
+
*/
|
|
96
|
+
.cometchat-message-preview__subtitle {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
gap: 5px;
|
|
100
|
+
font-style: normal;
|
|
101
|
+
width: 100%;
|
|
102
|
+
text-align: left;
|
|
103
|
+
color: var(--cometchat-text-color-secondary);
|
|
104
|
+
font: var(--cometchat-font-caption1-regular, 12px);
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.cometchat-message-bubble-outgoing .bubble-view{
|
|
109
|
+
border-left: 3px solid var(--cometchat-static-white);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.composer-view .cometchat-message-preview {
|
|
113
|
+
border-left: 3px solid var(--cometchat-primary-color);
|
|
114
|
+
}
|
|
115
|
+
.cometchat-message-bubble-outgoing .bubble-view .cometchat-message-preview__subtitle-icon{
|
|
116
|
+
background-color: var(--cometchat-static-white);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
.cometchat-message-bubble-incoming .bubble-view{
|
|
121
|
+
border-left: 3px solid var(--cometchat-primary-color);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.cometchat-message-bubble-outgoing .cometchat-message-preview__title, .cometchat-message-bubble-outgoing .cometchat-message-preview__subtitle{
|
|
125
|
+
color: var(--cometchat-static-white);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.bubble-view{
|
|
129
|
+
border-radius: 4px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.cometchat-message-preview_others{
|
|
133
|
+
border-left: 3px solid var(--cometchat-primary-color);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.cometchat-message-preview__subtitle-text{
|
|
137
|
+
text-align: left;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
font: var(--cometchat-font-caption1-regular, 12px);
|
|
140
|
+
text-overflow: ellipsis;
|
|
141
|
+
white-space: nowrap;
|
|
142
|
+
width: 100%;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.cometchat-message-preview__subtitle-icon {
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
-webkit-mask-size: contain;
|
|
150
|
+
mask-size: contain;
|
|
151
|
+
border: none;
|
|
152
|
+
align-self: center;
|
|
153
|
+
background: var(--cometchat-icon-color-secondary, #A1A1A1);
|
|
154
|
+
height: 16px;
|
|
155
|
+
width: 16px;
|
|
156
|
+
flex-shrink: 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.cometchat-message-preview__subtitle-icon-image {
|
|
160
|
+
-webkit-mask: url("../../assets/conversations_image-message.svg") center center no-repeat;
|
|
161
|
+
mask: url("../../assets/conversations_image-message.svg") center center no-repeat;
|
|
162
|
+
-webkit-mask-size: contain;
|
|
163
|
+
mask-size: contain;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.cometchat-message-bubble-incoming .cometchat-message-preview-deleted__message__icon{
|
|
167
|
+
background: var(--cometchat-neutral-color-600);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.cometchat-message-bubble-outgoing .cometchat-message-preview-deleted__message__icon{
|
|
171
|
+
background: var(--cometchat-static-white, #fff);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
.cometchat-message-preview-deleted__message__icon{
|
|
176
|
+
height: 14px;
|
|
177
|
+
width: 14px;
|
|
178
|
+
flex: 0 0 auto;
|
|
179
|
+
-webkit-mask: url("../../assets/message_delete.svg") center center no-repeat;
|
|
180
|
+
mask: url("../../assets/message_delete.svg") center center no-repeat;
|
|
181
|
+
-webkit-mask-size: contain;
|
|
182
|
+
mask-size: contain;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.cometchat-message-preview__subtitle-icon-meeting-incoming-audio{
|
|
186
|
+
-webkit-mask: url("../../assets/phone_incoming.svg") center center no-repeat;
|
|
187
|
+
mask: url("../../assets/phone_incoming.svg") center center no-repeat;
|
|
188
|
+
-webkit-mask-size: contain;
|
|
189
|
+
mask-size: contain;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.cometchat-message-preview__subtitle-icon-meeting-outgoing-audio{
|
|
193
|
+
-webkit-mask: url("../../assets/phone_outgoing.svg") center center no-repeat;
|
|
194
|
+
mask: url("../../assets/phone_outgoing.svg") center center no-repeat;
|
|
195
|
+
-webkit-mask-size: contain;
|
|
196
|
+
mask-size: contain;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.cometchat-message-preview__subtitle-icon-meeting-incoming-video {
|
|
200
|
+
-webkit-mask: url("../../assets/incoming_video.svg") center center no-repeat;
|
|
201
|
+
mask: url("../../assets/incoming_video.svg") center center no-repeat;
|
|
202
|
+
-webkit-mask-size: contain;
|
|
203
|
+
mask-size: contain;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.cometchat-message-preview__subtitle-icon-meeting-outgoing-video{
|
|
207
|
+
-webkit-mask: url("../../assets/outgoing_video.svg") center center no-repeat;
|
|
208
|
+
mask: url("../../assets/outgoing_video.svg") center center no-repeat;
|
|
209
|
+
-webkit-mask-size: contain;
|
|
210
|
+
mask-size: contain;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
.cometchat-message-preview__subtitle-icon-file {
|
|
215
|
+
-webkit-mask: url("../../assets/conversations_file-message.svg") center center no-repeat;
|
|
216
|
+
mask: url("../../assets/conversations_file-message.svg") center center no-repeat;
|
|
217
|
+
-webkit-mask-size: contain;
|
|
218
|
+
mask-size: contain;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.cometchat-message-preview__subtitle-icon-video {
|
|
222
|
+
-webkit-mask: url("../../assets/conversations_video-message.svg") center center no-repeat;
|
|
223
|
+
mask: url("../../assets/conversations_video-message.svg") center center no-repeat;
|
|
224
|
+
-webkit-mask-size: contain;
|
|
225
|
+
mask-size: contain;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.cometchat-message-preview__subtitle-icon-audio {
|
|
229
|
+
-webkit-mask: url("../../assets/conversations_audio-message.svg") center center no-repeat;
|
|
230
|
+
mask: url("../../assets/conversations_audio-message.svg") center center no-repeat;
|
|
231
|
+
-webkit-mask-size: contain;
|
|
232
|
+
mask-size: contain;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.cometchat-message-preview__subtitle-icon-poll {
|
|
236
|
+
-webkit-mask: url("../../assets/conversations_poll-message.svg") center center no-repeat;
|
|
237
|
+
mask: url("../../assets/conversations_poll-message.svg") center center no-repeat;
|
|
238
|
+
-webkit-mask-size: contain;
|
|
239
|
+
mask-size: contain;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
.cometchat-message-preview__subtitle-icon-sticker {
|
|
244
|
+
-webkit-mask: url("../../assets/conversations_sticker-message.svg") center center no-repeat;
|
|
245
|
+
mask: url("../../assets/conversations_sticker-message.svg") center center no-repeat;
|
|
246
|
+
-webkit-mask-size: contain;
|
|
247
|
+
mask-size: contain;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
.cometchat-message-preview__subtitle-icon-collaborative-document {
|
|
252
|
+
-webkit-mask: url("../../assets/conversations_collaborative-document-message.svg") center center no-repeat;
|
|
253
|
+
mask: url("../../assets/conversations_collaborative-document-message.svg") center center no-repeat;
|
|
254
|
+
-webkit-mask-size: contain;
|
|
255
|
+
mask-size: contain;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
.cometchat-message-preview__subtitle-icon-collaborative-whiteboard {
|
|
260
|
+
-webkit-mask: url("../../assets/collaborative_whiteboard.svg") center center no-repeat;
|
|
261
|
+
mask: url("../../assets/collaborative_whiteboard.svg") center center no-repeat;
|
|
262
|
+
-webkit-mask-size: contain;
|
|
263
|
+
mask-size: contain;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.cometchat-message-preview__subtitle-icon-link {
|
|
267
|
+
-webkit-mask: url("../../assets/conversations_link.svg") center center no-repeat;
|
|
268
|
+
mask: url("../../assets/conversations_link.svg") center center no-repeat;
|
|
269
|
+
-webkit-mask-size: contain;
|
|
270
|
+
mask-size: contain;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.cometchat-message-preview__subtitle-icon-none {
|
|
274
|
+
display: none;
|
|
275
|
+
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
max-width: 100%;
|
|
4
4
|
overflow: hidden;
|
|
5
|
+
line-height: 1.75;
|
|
6
|
+
margin: 0;
|
|
7
|
+
margin-bottom: var(--cometchat-margin-2);
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__copy {
|
|
@@ -20,6 +23,10 @@
|
|
|
20
23
|
|
|
21
24
|
}
|
|
22
25
|
|
|
26
|
+
.cometchat-stream-message-bubble {
|
|
27
|
+
margin-top: calc(var(--cometchat-margin-1) * -1)
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
.cometchat-stream-message-bubble {
|
|
24
31
|
overflow: hidden;
|
|
25
32
|
text-align: left;
|
|
@@ -42,6 +49,10 @@
|
|
|
42
49
|
|
|
43
50
|
}
|
|
44
51
|
|
|
52
|
+
.cometchat-stream-message-bubble li *{
|
|
53
|
+
vertical-align: top;
|
|
54
|
+
}
|
|
55
|
+
|
|
45
56
|
.cometchat-stream-message-bubble li:not([class]) {
|
|
46
57
|
text-align: left !important;
|
|
47
58
|
|
|
@@ -210,14 +221,35 @@
|
|
|
210
221
|
}
|
|
211
222
|
.cometchat-stream-message-bubble li{
|
|
212
223
|
overflow: visible !important;
|
|
213
|
-
|
|
214
|
-
padding: 0px 0px 6px 0px;
|
|
224
|
+
padding: 0;
|
|
215
225
|
}
|
|
216
226
|
.cometchat-stream-message-bubble img{
|
|
217
227
|
max-height: 300px;
|
|
218
228
|
width: fit-content;
|
|
219
229
|
border-radius: var(--cometchat-radius-2);
|
|
230
|
+
margin-block: var(--cometchat-margin-2) 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.cometchat-stream-message-bubble > *:first-child *:first-child:not(:has(*)) ~ img{
|
|
234
|
+
margin-top: var(--cometchat-margin-1);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.cometchat-stream-message-bubble__image-intersection-start, .cometchat-stream-message-bubble__image-intersection-end{
|
|
238
|
+
display: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__image-intersection-start:not(.cometchat-stream-message-bubble__image-intersection-end ~ .cometchat-stream-message-bubble__image-intersection-start) {
|
|
242
|
+
display: block;
|
|
243
|
+
margin-top: -0.5em;
|
|
220
244
|
}
|
|
245
|
+
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__image-intersection-end:not(:has(+ .cometchat-stream-message-bubble__image-intersection-start)) {
|
|
246
|
+
display: block;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__image-intersection-end:last-child {
|
|
250
|
+
margin-bottom: 0;
|
|
251
|
+
}
|
|
252
|
+
|
|
221
253
|
.cometchat-stream-message-bubble > ol:first-child > li:first-child,
|
|
222
254
|
.cometchat-stream-message-bubble > ul:first-child > li:first-child
|
|
223
255
|
{
|
|
@@ -230,7 +262,6 @@
|
|
|
230
262
|
.cometchat-stream-message-bubble h4,
|
|
231
263
|
.cometchat-stream-message-bubble h5,
|
|
232
264
|
.cometchat-stream-message-bubble h6 {
|
|
233
|
-
line-height: 20px;
|
|
234
265
|
font-size: initial;
|
|
235
266
|
padding: var(--cometchat-padding-2) 0px;
|
|
236
267
|
margin: 0;
|
|
@@ -244,9 +275,20 @@
|
|
|
244
275
|
padding-top: 0px;
|
|
245
276
|
}
|
|
246
277
|
|
|
247
|
-
.cometchat-stream-message-
|
|
248
|
-
|
|
249
|
-
|
|
278
|
+
.cometchat-stream-message-bubble__image-intersection-start, .cometchat-stream-message-bubble__image-intersection-end{
|
|
279
|
+
display: none;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__image-intersection-start:not(.cometchat-stream-message-bubble__image-intersection-end ~ .cometchat-stream-message-bubble__image-intersection-start) {
|
|
283
|
+
display: block;
|
|
284
|
+
margin-top: -0.5em;
|
|
285
|
+
}
|
|
286
|
+
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__image-intersection-end:not(:has(+ .cometchat-stream-message-bubble__image-intersection-start)) {
|
|
287
|
+
display: block;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__image-intersection-end:last-child {
|
|
291
|
+
margin-bottom: 0;
|
|
250
292
|
}
|
|
251
293
|
|
|
252
294
|
.cometchat-stream-message-bubble > ul:first-child li:first-child > p:first-child{
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
@import url('./CometChatStreamMessageBubble.css');
|
|
62
62
|
@import url('./CometChatAIAssistantChatHistory.css');
|
|
63
63
|
@import url('./CometChatErrorView.css');
|
|
64
|
+
@import url('./CometChatMessagePreview.css');
|
|
64
65
|
/* @import url('./CometChatToolCallResultBubble.css');
|
|
65
66
|
@import url('./CometChatToolCallArgumentBubble.css'); */
|
|
66
67
|
.cometchat * {
|
|
@@ -119,6 +120,10 @@ font:var(--cometchat-font-body-regular);
|
|
|
119
120
|
text-decoration: underline;
|
|
120
121
|
}
|
|
121
122
|
|
|
123
|
+
.cometchat-message-preview .cometchat-url{
|
|
124
|
+
text-decoration: underline;
|
|
125
|
+
}
|
|
126
|
+
|
|
122
127
|
.cometchat-text-bubble .cometchat-text-highlight {
|
|
123
128
|
font: var(--cometchat-font-body-bold);
|
|
124
129
|
}
|
package/dist/styles/index.css
CHANGED
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
@import url('./CometChatStreamMessageBubble.css');
|
|
62
62
|
@import url('./CometChatAIAssistantChatHistory.css');
|
|
63
63
|
@import url('./CometChatErrorView.css');
|
|
64
|
+
@import url('./CometChatMessagePreview.css');
|
|
64
65
|
/* @import url('./CometChatToolCallResultBubble.css');
|
|
65
66
|
@import url('./CometChatToolCallArgumentBubble.css'); */
|
|
66
67
|
.cometchat * {
|
|
@@ -119,6 +120,10 @@ font:var(--cometchat-font-body-regular);
|
|
|
119
120
|
text-decoration: underline;
|
|
120
121
|
}
|
|
121
122
|
|
|
123
|
+
.cometchat-message-preview .cometchat-url{
|
|
124
|
+
text-decoration: underline;
|
|
125
|
+
}
|
|
126
|
+
|
|
122
127
|
.cometchat-text-bubble .cometchat-text-highlight {
|
|
123
128
|
font: var(--cometchat-font-body-bold);
|
|
124
129
|
}
|
package/dist/types/components/BaseComponents/CometChatMessagePreview/CometChatMessagePreview.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CometChatTextFormatter } from '../../../formatters';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for the props used in the CometChatMessagePreview component.
|
|
5
|
+
*/
|
|
6
|
+
interface CometChatMessagePreviewProps {
|
|
7
|
+
/** The title to display in the preview, defaults to "Edit Message"*/
|
|
8
|
+
previewTitle?: JSX.Element | null;
|
|
9
|
+
/** To hide the close icon in the preview */
|
|
10
|
+
hideCloseButton?: boolean;
|
|
11
|
+
/** The subtitle to display in the preview, can be left empty. */
|
|
12
|
+
previewSubtitle?: JSX.Element | null;
|
|
13
|
+
/** Callback function that triggers when the close button is clicked. */
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
/** Message object replying to */
|
|
16
|
+
message?: CometChat.BaseMessage;
|
|
17
|
+
/** Moderation status of the message that is being replied */
|
|
18
|
+
isMessageModerated?: boolean;
|
|
19
|
+
/** Text formatters for message bubble */
|
|
20
|
+
textFormatters?: CometChatTextFormatter[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* CometChatMessagePreview Component
|
|
24
|
+
*
|
|
25
|
+
* A React component that displays a preview of a message that is being replied with a title and subtitle.
|
|
26
|
+
* @param {CometChatMessagePreviewProps} props - The props for the component.
|
|
27
|
+
* @returns {JSX.Element} A JSX element displaying the edit preview UI.
|
|
28
|
+
*/
|
|
29
|
+
declare const CometChatMessagePreview: FC<CometChatMessagePreviewProps>;
|
|
30
|
+
export { CometChatMessagePreview };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CometChatAIAssistantTools } from '../../modals/CometChatAIAssistantTools';
|
|
3
3
|
import { PreviewMessageMode } from '../../Enums/Enums';
|
|
4
|
+
import { CometChatMessageTemplate } from '../../modals';
|
|
4
5
|
interface AIAssistantChatProps {
|
|
5
6
|
hideChatHistory?: boolean;
|
|
6
7
|
hideNewChat?: boolean;
|
|
@@ -27,6 +28,7 @@ interface AIAssistantChatProps {
|
|
|
27
28
|
emptyChatIntroMessageView?: React.JSX.Element;
|
|
28
29
|
emptyChatImageView?: React.JSX.Element;
|
|
29
30
|
aiAssistantTools?: CometChatAIAssistantTools;
|
|
31
|
+
templates?: CometChatMessageTemplate[];
|
|
30
32
|
}
|
|
31
33
|
export declare const CometChatAIAssistantChat: React.MemoExoticComponent<(props: AIAssistantChatProps) => import("react/jsx-runtime").JSX.Element>;
|
|
32
34
|
export {};
|
|
@@ -171,6 +171,8 @@ type State = {
|
|
|
171
171
|
addToMsgInputText: string;
|
|
172
172
|
/** A reference to the text message that is currently being edited, or null if none. */
|
|
173
173
|
textMessageToEdit: CometChat.TextMessage | null;
|
|
174
|
+
/** A reference to the message that the user is currently replying to, or null if no reply is active. */
|
|
175
|
+
messageToReply: CometChat.BaseMessage | null;
|
|
174
176
|
/** The content that is currently being displayed in the composer (e.g., text, polls, media). */
|
|
175
177
|
contentToDisplay: ContentToDisplay;
|
|
176
178
|
/** The currently logged-in user, or null if no user is logged in. */
|
|
@@ -202,6 +204,11 @@ export type Action =
|
|
|
202
204
|
type: "setTextMessageToEdit";
|
|
203
205
|
textMessageToEdit: State["textMessageToEdit"];
|
|
204
206
|
}
|
|
207
|
+
/** Action to set the message that is being replied. */
|
|
208
|
+
| {
|
|
209
|
+
type: "setMessageToReply";
|
|
210
|
+
messageToReply: State["messageToReply"];
|
|
211
|
+
}
|
|
205
212
|
/** Action to change the content being displayed in the composer (e.g., text, polls). */
|
|
206
213
|
| {
|
|
207
214
|
type: "setContentToDisplay";
|
|
@@ -42,6 +42,7 @@ type Args = {
|
|
|
42
42
|
getCurrentWindow: () => Window;
|
|
43
43
|
getCurrentDocument: () => Document;
|
|
44
44
|
onTextChange: ((text: string) => void) | undefined;
|
|
45
|
+
messageToReplyRef: React.MutableRefObject<CometChat.BaseMessage | null>;
|
|
45
46
|
};
|
|
46
47
|
export declare function useCometChatMessageComposer(args: Args): void;
|
|
47
48
|
export {};
|
|
@@ -47,6 +47,11 @@ interface MessageListProps {
|
|
|
47
47
|
* @default false
|
|
48
48
|
*/
|
|
49
49
|
hideReplyInThreadOption?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Hides the reply option for a message.
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
hideReplyOption?: boolean;
|
|
50
55
|
/**
|
|
51
56
|
* Hides the option to translate messages.
|
|
52
57
|
* @default false
|
|
@@ -145,10 +150,10 @@ interface MessageListProps {
|
|
|
145
150
|
*/
|
|
146
151
|
customSoundForMessages?: string;
|
|
147
152
|
/**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
153
|
+
* Specifies the keywords in incoming messages that will trigger Smart Replies.
|
|
154
|
+
* If set to an empty array [], Smart Replies will be generated for all messages.
|
|
155
|
+
* @default ['what', 'when', 'why', 'who', 'where', 'how', '?']
|
|
156
|
+
*/
|
|
152
157
|
smartRepliesKeywords?: string[];
|
|
153
158
|
/**
|
|
154
159
|
* Specifies the delay in milliseconds before Smart Replies are displayed.
|
|
@@ -204,20 +209,20 @@ interface MessageListProps {
|
|
|
204
209
|
*/
|
|
205
210
|
footerView?: JSX.Element;
|
|
206
211
|
/**
|
|
207
|
-
|
|
208
|
-
|
|
212
|
+
* Format for the date separators in the message list.
|
|
213
|
+
*/
|
|
209
214
|
separatorDateTimeFormat?: CalendarObject;
|
|
210
215
|
/**
|
|
211
|
-
|
|
212
|
-
|
|
216
|
+
* Format for sticky date headers displayed in the message list.
|
|
217
|
+
*/
|
|
213
218
|
stickyDateTimeFormat?: CalendarObject;
|
|
214
219
|
/**
|
|
215
|
-
|
|
216
|
-
|
|
220
|
+
* Format for the timestamp displayed next to messages.
|
|
221
|
+
*/
|
|
217
222
|
messageSentAtDateTimeFormat?: CalendarObject;
|
|
218
223
|
/**
|
|
219
|
-
|
|
220
|
-
|
|
224
|
+
* Format for timestamps displayed in message details (e.g., delivery or read time).
|
|
225
|
+
*/
|
|
221
226
|
messageInfoDateTimeFormat?: CalendarObject;
|
|
222
227
|
/**
|
|
223
228
|
* ID of the message to automatically scroll to when the message list loads.
|
|
@@ -226,9 +231,9 @@ interface MessageListProps {
|
|
|
226
231
|
*/
|
|
227
232
|
goToMessageId?: string;
|
|
228
233
|
/**
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
234
|
+
* Controls the visibility of the scrollbar in the list.
|
|
235
|
+
* @defaultValue `false`
|
|
236
|
+
*/
|
|
232
237
|
showScrollbar?: boolean;
|
|
233
238
|
/**
|
|
234
239
|
* Toggles AI Agent functionality.
|
|
@@ -2,5 +2,5 @@ import { MutableRefObject } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* This Hooks function is a custom React hook designed to manage functionalities of CometChatMessageList component. It fetches the logged-in user, handles event subscriptions and tracks message IDs for new message retrieval. It plays a key role in maintaining real-time functionality and user interactions in the chat interface.
|
|
4
4
|
**/
|
|
5
|
-
declare function useCometChatMessageList(loggedInUserRef: MutableRefObject<CometChat.User | null>, messageListManagerRef: MutableRefObject<any>, fetchPreviousMessages: () => void, updateMessage: (key: string, mesage: CometChat.BaseMessage, group?: CometChat.Group) => void, messagesRequestBuilder: CometChat.MessagesRequestBuilder | undefined, user: CometChat.User | undefined, group: CometChat.Group | undefined, messageIdRef: MutableRefObject<any>, totalMessagesCountRef: MutableRefObject<any>, messageList: CometChat.BaseMessage[], errorHandler: (error: unknown, source?: string) => void, setMessageList: (messages: CometChat.BaseMessage[]) => void, setScrollListToBottom: (scrollToBottom: boolean) => void, smartReplyViewRef: MutableRefObject<any>, isOnBottomRef: MutableRefObject<boolean>, isFirstReloadRef: MutableRefObject<boolean>, subscribeToUIEvents: Function, showSmartRepliesRef: MutableRefObject<any>, addMessage: (message: CometChat.BaseMessage) => void, setDateHeader?: Function, parentMessageId?: number, hideGroupActionMessages?: boolean, showSmartReplies?: boolean, goToMessageId?: string, isAgentChat?: boolean): void;
|
|
5
|
+
declare function useCometChatMessageList(loggedInUserRef: MutableRefObject<CometChat.User | null>, messageListManagerRef: MutableRefObject<any>, fetchPreviousMessages: () => void, updateMessage: (key: string, mesage: CometChat.BaseMessage, group?: CometChat.Group) => void, messagesRequestBuilder: CometChat.MessagesRequestBuilder | undefined, user: CometChat.User | undefined, group: CometChat.Group | undefined, messageIdRef: MutableRefObject<any>, totalMessagesCountRef: MutableRefObject<any>, messageList: CometChat.BaseMessage[], errorHandler: (error: unknown, source?: string) => void, setMessageList: (messages: CometChat.BaseMessage[]) => void, setScrollListToBottom: (scrollToBottom: boolean) => void, smartReplyViewRef: MutableRefObject<any>, isOnBottomRef: MutableRefObject<boolean>, isFirstReloadRef: MutableRefObject<boolean>, subscribeToUIEvents: Function, showSmartRepliesRef: MutableRefObject<any>, addMessage: (message: CometChat.BaseMessage) => void, setDateHeader?: Function, parentMessageId?: number, hideGroupActionMessages?: boolean, showSmartReplies?: boolean, goToMessageId?: string, isAgentChat?: boolean, messageRepliedTo?: string): void;
|
|
6
6
|
export { useCometChatMessageList };
|
|
@@ -20,6 +20,10 @@ interface CreatePollProps {
|
|
|
20
20
|
* Optional.
|
|
21
21
|
*/
|
|
22
22
|
ccCloseClicked?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* The message that is being replied to.
|
|
25
|
+
*/
|
|
26
|
+
replyToMessage?: CometChat.BaseMessage | null;
|
|
23
27
|
/**
|
|
24
28
|
* Default number of answer options to display initially.
|
|
25
29
|
* Optional, defaults to 3.
|
|
@@ -14,6 +14,8 @@ export declare class PollsExtensionDecorator extends DataSourceDecorator {
|
|
|
14
14
|
configuration?: PollsConfiguration;
|
|
15
15
|
/** The data source used by this decorator. */
|
|
16
16
|
newDataSource: DataSource;
|
|
17
|
+
/** The message that is being replied to. */
|
|
18
|
+
replyToMessage: CometChat.BaseMessage | undefined;
|
|
17
19
|
/**
|
|
18
20
|
* Constructs a PollsExtensionDecorator instance.
|
|
19
21
|
* @param dataSource - The data source to decorate.
|
|
@@ -41,7 +41,7 @@ export declare class StickersExtensionDecorator extends DataSourceDecorator {
|
|
|
41
41
|
* @param group - Optional group object.
|
|
42
42
|
* @returns An array of auxiliary options.
|
|
43
43
|
*/
|
|
44
|
-
getStickerButton(id: ComposerId, user?: CometChat.User, group?: CometChat.Group): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
getStickerButton(id: ComposerId, user?: CometChat.User, group?: CometChat.Group, messageToReply?: CometChat.BaseMessage | null, closeReplyPreview?: () => void): import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
/**
|
|
46
46
|
* Creates the sticker auxiliary button component.
|
|
47
47
|
* @param id - A map containing relevant IDs.
|
|
@@ -50,12 +50,12 @@ export declare class StickersExtensionDecorator extends DataSourceDecorator {
|
|
|
50
50
|
* @param group - Optional group object.
|
|
51
51
|
* @returns The JSX element for the sticker auxiliary button.
|
|
52
52
|
*/
|
|
53
|
-
getStickerAuxiliaryButton: (id: ComposerId, user?: CometChat.User, group?: CometChat.Group) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
getStickerAuxiliaryButton: (id: ComposerId, user?: CometChat.User, group?: CometChat.Group, messageToReply?: CometChat.BaseMessage | null, onReplyPreviewClose?: () => void) => import("react/jsx-runtime").JSX.Element;
|
|
54
54
|
/**
|
|
55
55
|
* Sends a sticker message.
|
|
56
56
|
* @param event - The event object containing sticker details.
|
|
57
57
|
*/
|
|
58
|
-
sendSticker(event: any, closeSticker: Function, id: ComposerId): void;
|
|
58
|
+
sendSticker(event: any, closeSticker: Function, id: ComposerId, messageToReply?: CometChat.BaseMessage | null, onReplyPreviewClose?: () => void): void;
|
|
59
59
|
/**
|
|
60
60
|
* Sends a sticker message.
|
|
61
61
|
* @param event - The event object containing sticker details.
|
|
@@ -6,6 +6,7 @@ import { Subject } from 'rxjs';
|
|
|
6
6
|
export declare class CometChatMessageEvents {
|
|
7
7
|
static ccMessageSent: Subject<IMessages>;
|
|
8
8
|
static ccMessageEdited: Subject<IMessages>;
|
|
9
|
+
static ccReplyToMessage: Subject<IMessages>;
|
|
9
10
|
static ccMessageTranslated: Subject<IMessages>;
|
|
10
11
|
static ccMessageRead: Subject<CometChat.BaseMessage>;
|
|
11
12
|
static ccMessageDeleted: Subject<CometChat.BaseMessage>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ export { CometChatDropDown } from './components/BaseComponents/CometChatDropDown
|
|
|
95
95
|
export { CometChatDocumentBubble } from './components/BaseComponents/CometChatDocumentBubble/CometChatDocumentBubble';
|
|
96
96
|
export { CometChatDate } from './components/BaseComponents/CometChatDate/CometChatDate';
|
|
97
97
|
export { CometChatDeleteBubble } from './components/BaseComponents/CometChatDeleteBubble/CometChatDeleteBubble';
|
|
98
|
+
export { CometChatMessagePreview } from './components/BaseComponents/CometChatMessagePreview/CometChatMessagePreview';
|
|
98
99
|
export { CometChatReactionInfo } from './components/Reactions/CometChatReactionInfo/CometChatReactionInfo';
|
|
99
100
|
export { CometChatReactionList } from './components/Reactions/CometChatReactionList/CometChatReactionList';
|
|
100
101
|
export { CometChatReactions } from './components/Reactions/CometChatReactions/CometChatReactions';
|
|
@@ -34,6 +34,11 @@ declare class CometChatMessageTemplate {
|
|
|
34
34
|
* @type {(message:CometChat.BaseMessage,alignment:MessageBubbleAlignment)=> Element | JSX.Element | null}
|
|
35
35
|
*/
|
|
36
36
|
headerView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment) => Element | JSX.Element | null) | null;
|
|
37
|
+
/**
|
|
38
|
+
* Custom component to customize the reply view section for each message bubble.
|
|
39
|
+
* @type {(message:CometChat.BaseMessage,alignment:MessageBubbleAlignment)=> Element | JSX.Element | null}
|
|
40
|
+
*/
|
|
41
|
+
replyView: ((message: CometChat.BaseMessage, alignment?: MessageBubbleAlignment, onReplyViewClicked?: (messageToReply: CometChat.BaseMessage) => void, textFormatters?: CometChatTextFormatter[]) => Element | JSX.Element | null) | null;
|
|
37
42
|
/**
|
|
38
43
|
* Custom component to customize the footer section for each message bubble.
|
|
39
44
|
* By default, it displays the reactions.
|