@cometchat/chat-uikit-react 6.3.1 → 6.3.2
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 +45 -32
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/styles/CometChatAIAssistantChat.css +21 -0
- package/dist/styles/CometChatAIAssistantMessageBubble.css +21 -4
- package/dist/styles/CometChatStreamMessageBubble.css +21 -5
- package/dist/styles/components/CometChatAIAssistantChat.css +21 -0
- package/dist/styles/components/CometChatAIAssistantMessageBubble.css +21 -4
- package/dist/styles/components/CometChatStreamMessageBubble.css +21 -5
- package/dist/types/constants/CometChatUIKitConstants.d.ts +5 -0
- package/dist/types/services/stream-message.service.d.ts +1 -0
- package/dist/types/utils/util.d.ts +7 -0
- package/package.json +1 -1
|
@@ -106,6 +106,19 @@
|
|
|
106
106
|
width: auto;
|
|
107
107
|
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
.cometchat-ai-assistant-chat .cometchat-message-bubble__status-info-view-receipts-sent .cometchat-message-list__receipt {
|
|
111
|
+
background-color: var(--cometchat-icon-color-secondary);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.cometchat-ai-assistant-chat .cometchat-message-bubble__status-info-view-receipts-wait .cometchat-message-list__receipt {
|
|
115
|
+
background-color: var(--cometchat-icon-color-secondary);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.cometchat-ai-assistant-chat .cometchat-message-bubble__status-info-view-receipts-delivered .cometchat-message-list__receipt {
|
|
119
|
+
background-color: var(--cometchat-icon-color-secondary);
|
|
120
|
+
}
|
|
121
|
+
|
|
109
122
|
.cometchat-ai-assistant-chat .cometchat-message-bubble__status-info-view .cometchat-message-bubble__status-info-view-receipts-error {
|
|
110
123
|
height: 12px;
|
|
111
124
|
width: 12px;
|
|
@@ -399,6 +412,14 @@ background: var(--cometchat-error-color);
|
|
|
399
412
|
background: var(--cometchat-icon-color-secondary);
|
|
400
413
|
|
|
401
414
|
}
|
|
415
|
+
.cometchat-ai-assistant-chat .cometchat-message-bubble-outgoing .cometchat-message-bubble__status-info-view{
|
|
416
|
+
display: flex;
|
|
417
|
+
flex-direction: row;
|
|
418
|
+
align-items: center;
|
|
419
|
+
}
|
|
420
|
+
.cometchat-ai-assistant-chat .cometchat-message-bubble-outgoing .cometchat-message-bubble__status-info-view .cometchat{
|
|
421
|
+
display: flex;
|
|
422
|
+
}
|
|
402
423
|
.cometchat-ai-assistant-chat__sidebar-overlay {
|
|
403
424
|
position: absolute;
|
|
404
425
|
top: 0;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
margin-bottom: var(--cometchat-margin-2);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.cometchat-ai-assistant-message-bubble {
|
|
20
|
+
.cometchat:has(> .cometchat-ai-assistant-message-bubble) {
|
|
21
21
|
margin-top: calc(var(--cometchat-margin-1) * -1)
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -40,10 +40,22 @@
|
|
|
40
40
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.cometchat-ai-assistant-message-bubble
|
|
43
|
+
.cometchat-ai-assistant-message-bubble img,
|
|
44
|
+
.cometchat-ai-assistant-message-bubble pre,
|
|
45
|
+
.cometchat-ai-assistant-message-bubble canvas,
|
|
46
|
+
.cometchat-ai-assistant-message-bubble svg,
|
|
47
|
+
.cometchat-ai-assistant-message-bubble video,
|
|
48
|
+
.cometchat-ai-assistant-message-bubble figure,
|
|
49
|
+
.cometchat-ai-assistant-message-bubble table {
|
|
44
50
|
vertical-align: top;
|
|
45
51
|
}
|
|
46
52
|
|
|
53
|
+
.cometchat-ai-assistant-message-bubble input[type="checkbox"] {
|
|
54
|
+
margin-right: var(--cometchat-margin-1);
|
|
55
|
+
position: relative;
|
|
56
|
+
top: 1px;
|
|
57
|
+
}
|
|
58
|
+
|
|
47
59
|
.cometchat-ai-assistant-message-bubble ol:not([class]),.cometchat-ai-assistant-message-bubble ul:not([class]) {
|
|
48
60
|
padding-left: var(--cometchat-padding-5) !important;
|
|
49
61
|
text-align: left !important;
|
|
@@ -192,17 +204,22 @@
|
|
|
192
204
|
max-height: 300px;
|
|
193
205
|
width: fit-content;
|
|
194
206
|
border-radius: var(--cometchat-radius-2);
|
|
195
|
-
margin-
|
|
207
|
+
margin-top: var(--cometchat-margin-2);
|
|
196
208
|
}
|
|
197
209
|
|
|
198
210
|
.cometchat-ai-assistant-message-bubble__image-intersection-start, .cometchat-ai-assistant-message-bubble__image-intersection-end{
|
|
199
211
|
display: none;
|
|
200
212
|
}
|
|
201
213
|
|
|
202
|
-
.cometchat-ai-assistant-message-bubble .cometchat-ai-assistant-message-bubble__image-intersection-start:not(.cometchat-ai-assistant-message-bubble__image-intersection-end ~ .cometchat-ai-assistant-message-bubble__image-intersection-start) {
|
|
214
|
+
.cometchat-ai-assistant-message-bubble .cometchat-ai-assistant-message-bubble__image-intersection-start:not(.cometchat-ai-assistant-message-bubble__image-intersection-end ~ .cometchat-ai-assistant-message-bubble__image-intersection-start, input[type="checkbox"] ~ .cometchat-ai-assistant-message-bubble__image-intersection-start) {
|
|
203
215
|
display: block;
|
|
204
216
|
margin-top: -0.5em;
|
|
205
217
|
}
|
|
218
|
+
|
|
219
|
+
.cometchat-ai-assistant-message-bubble .cometchat-ai-assistant-message-bubble__image-intersection-start:is(input[type="checkbox"] ~ .cometchat-ai-assistant-message-bubble__image-intersection-start) ~ img{
|
|
220
|
+
margin-top: var(--cometchat-margin-1);
|
|
221
|
+
}
|
|
222
|
+
|
|
206
223
|
.cometchat-ai-assistant-message-bubble .cometchat-ai-assistant-message-bubble__image-intersection-end:not(:has(+ .cometchat-ai-assistant-message-bubble__image-intersection-start)) {
|
|
207
224
|
display: block;
|
|
208
225
|
}
|
|
@@ -16,14 +16,13 @@
|
|
|
16
16
|
display: flex;
|
|
17
17
|
justify-content: flex-start;
|
|
18
18
|
align-items: flex-start;
|
|
19
|
-
margin-top: var(--cometchat-margin-3);
|
|
20
19
|
height: 20px;
|
|
21
20
|
width: 20px;
|
|
22
21
|
background: var(--cometchat-icon-color-secondary);
|
|
23
22
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
.cometchat-stream-message-bubble {
|
|
25
|
+
.cometchat:has(> .cometchat-stream-message-bubble) {
|
|
27
26
|
margin-top: calc(var(--cometchat-margin-1) * -1)
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -49,10 +48,22 @@
|
|
|
49
48
|
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
.cometchat-stream-message-bubble
|
|
51
|
+
.cometchat-stream-message-bubble img,
|
|
52
|
+
.cometchat-stream-message-bubble pre,
|
|
53
|
+
.cometchat-stream-message-bubble canvas,
|
|
54
|
+
.cometchat-stream-message-bubble svg,
|
|
55
|
+
.cometchat-stream-message-bubble video,
|
|
56
|
+
.cometchat-stream-message-bubble figure,
|
|
57
|
+
.cometchat-stream-message-bubble table {
|
|
53
58
|
vertical-align: top;
|
|
54
59
|
}
|
|
55
60
|
|
|
61
|
+
.cometchat-stream-message-bubble input[type="checkbox"] {
|
|
62
|
+
margin-right: var(--cometchat-margin-1);
|
|
63
|
+
position: relative;
|
|
64
|
+
top: 1px;
|
|
65
|
+
}
|
|
66
|
+
|
|
56
67
|
.cometchat-stream-message-bubble li:not([class]) {
|
|
57
68
|
text-align: left !important;
|
|
58
69
|
|
|
@@ -227,7 +238,7 @@
|
|
|
227
238
|
max-height: 300px;
|
|
228
239
|
width: fit-content;
|
|
229
240
|
border-radius: var(--cometchat-radius-2);
|
|
230
|
-
margin-
|
|
241
|
+
margin-top: var(--cometchat-margin-2);
|
|
231
242
|
}
|
|
232
243
|
|
|
233
244
|
.cometchat-stream-message-bubble > *:first-child *:first-child:not(:has(*)) ~ img{
|
|
@@ -238,10 +249,15 @@
|
|
|
238
249
|
display: none;
|
|
239
250
|
}
|
|
240
251
|
|
|
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) {
|
|
252
|
+
.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, input[type="checkbox"] ~ .cometchat-stream-message-bubble__image-intersection-start) {
|
|
242
253
|
display: block;
|
|
243
254
|
margin-top: -0.5em;
|
|
244
255
|
}
|
|
256
|
+
|
|
257
|
+
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__image-intersection-start:is(input[type="checkbox"] ~ .cometchat-stream-message-bubble__image-intersection-start) ~ img{
|
|
258
|
+
margin-top: var(--cometchat-margin-1);
|
|
259
|
+
}
|
|
260
|
+
|
|
245
261
|
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__image-intersection-end:not(:has(+ .cometchat-stream-message-bubble__image-intersection-start)) {
|
|
246
262
|
display: block;
|
|
247
263
|
}
|
|
@@ -106,6 +106,19 @@
|
|
|
106
106
|
width: auto;
|
|
107
107
|
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
.cometchat-ai-assistant-chat .cometchat-message-bubble__status-info-view-receipts-sent .cometchat-message-list__receipt {
|
|
111
|
+
background-color: var(--cometchat-icon-color-secondary);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.cometchat-ai-assistant-chat .cometchat-message-bubble__status-info-view-receipts-wait .cometchat-message-list__receipt {
|
|
115
|
+
background-color: var(--cometchat-icon-color-secondary);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.cometchat-ai-assistant-chat .cometchat-message-bubble__status-info-view-receipts-delivered .cometchat-message-list__receipt {
|
|
119
|
+
background-color: var(--cometchat-icon-color-secondary);
|
|
120
|
+
}
|
|
121
|
+
|
|
109
122
|
.cometchat-ai-assistant-chat .cometchat-message-bubble__status-info-view .cometchat-message-bubble__status-info-view-receipts-error {
|
|
110
123
|
height: 12px;
|
|
111
124
|
width: 12px;
|
|
@@ -399,6 +412,14 @@ background: var(--cometchat-error-color);
|
|
|
399
412
|
background: var(--cometchat-icon-color-secondary);
|
|
400
413
|
|
|
401
414
|
}
|
|
415
|
+
.cometchat-ai-assistant-chat .cometchat-message-bubble-outgoing .cometchat-message-bubble__status-info-view{
|
|
416
|
+
display: flex;
|
|
417
|
+
flex-direction: row;
|
|
418
|
+
align-items: center;
|
|
419
|
+
}
|
|
420
|
+
.cometchat-ai-assistant-chat .cometchat-message-bubble-outgoing .cometchat-message-bubble__status-info-view .cometchat{
|
|
421
|
+
display: flex;
|
|
422
|
+
}
|
|
402
423
|
.cometchat-ai-assistant-chat__sidebar-overlay {
|
|
403
424
|
position: absolute;
|
|
404
425
|
top: 0;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
margin-bottom: var(--cometchat-margin-2);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.cometchat-ai-assistant-message-bubble {
|
|
20
|
+
.cometchat:has(> .cometchat-ai-assistant-message-bubble) {
|
|
21
21
|
margin-top: calc(var(--cometchat-margin-1) * -1)
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -40,10 +40,22 @@
|
|
|
40
40
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.cometchat-ai-assistant-message-bubble
|
|
43
|
+
.cometchat-ai-assistant-message-bubble img,
|
|
44
|
+
.cometchat-ai-assistant-message-bubble pre,
|
|
45
|
+
.cometchat-ai-assistant-message-bubble canvas,
|
|
46
|
+
.cometchat-ai-assistant-message-bubble svg,
|
|
47
|
+
.cometchat-ai-assistant-message-bubble video,
|
|
48
|
+
.cometchat-ai-assistant-message-bubble figure,
|
|
49
|
+
.cometchat-ai-assistant-message-bubble table {
|
|
44
50
|
vertical-align: top;
|
|
45
51
|
}
|
|
46
52
|
|
|
53
|
+
.cometchat-ai-assistant-message-bubble input[type="checkbox"] {
|
|
54
|
+
margin-right: var(--cometchat-margin-1);
|
|
55
|
+
position: relative;
|
|
56
|
+
top: 1px;
|
|
57
|
+
}
|
|
58
|
+
|
|
47
59
|
.cometchat-ai-assistant-message-bubble ol:not([class]),.cometchat-ai-assistant-message-bubble ul:not([class]) {
|
|
48
60
|
padding-left: var(--cometchat-padding-5) !important;
|
|
49
61
|
text-align: left !important;
|
|
@@ -192,17 +204,22 @@
|
|
|
192
204
|
max-height: 300px;
|
|
193
205
|
width: fit-content;
|
|
194
206
|
border-radius: var(--cometchat-radius-2);
|
|
195
|
-
margin-
|
|
207
|
+
margin-top: var(--cometchat-margin-2);
|
|
196
208
|
}
|
|
197
209
|
|
|
198
210
|
.cometchat-ai-assistant-message-bubble__image-intersection-start, .cometchat-ai-assistant-message-bubble__image-intersection-end{
|
|
199
211
|
display: none;
|
|
200
212
|
}
|
|
201
213
|
|
|
202
|
-
.cometchat-ai-assistant-message-bubble .cometchat-ai-assistant-message-bubble__image-intersection-start:not(.cometchat-ai-assistant-message-bubble__image-intersection-end ~ .cometchat-ai-assistant-message-bubble__image-intersection-start) {
|
|
214
|
+
.cometchat-ai-assistant-message-bubble .cometchat-ai-assistant-message-bubble__image-intersection-start:not(.cometchat-ai-assistant-message-bubble__image-intersection-end ~ .cometchat-ai-assistant-message-bubble__image-intersection-start, input[type="checkbox"] ~ .cometchat-ai-assistant-message-bubble__image-intersection-start) {
|
|
203
215
|
display: block;
|
|
204
216
|
margin-top: -0.5em;
|
|
205
217
|
}
|
|
218
|
+
|
|
219
|
+
.cometchat-ai-assistant-message-bubble .cometchat-ai-assistant-message-bubble__image-intersection-start:is(input[type="checkbox"] ~ .cometchat-ai-assistant-message-bubble__image-intersection-start) ~ img{
|
|
220
|
+
margin-top: var(--cometchat-margin-1);
|
|
221
|
+
}
|
|
222
|
+
|
|
206
223
|
.cometchat-ai-assistant-message-bubble .cometchat-ai-assistant-message-bubble__image-intersection-end:not(:has(+ .cometchat-ai-assistant-message-bubble__image-intersection-start)) {
|
|
207
224
|
display: block;
|
|
208
225
|
}
|
|
@@ -16,14 +16,13 @@
|
|
|
16
16
|
display: flex;
|
|
17
17
|
justify-content: flex-start;
|
|
18
18
|
align-items: flex-start;
|
|
19
|
-
margin-top: var(--cometchat-margin-3);
|
|
20
19
|
height: 20px;
|
|
21
20
|
width: 20px;
|
|
22
21
|
background: var(--cometchat-icon-color-secondary);
|
|
23
22
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
.cometchat-stream-message-bubble {
|
|
25
|
+
.cometchat:has(> .cometchat-stream-message-bubble) {
|
|
27
26
|
margin-top: calc(var(--cometchat-margin-1) * -1)
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -49,10 +48,22 @@
|
|
|
49
48
|
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
.cometchat-stream-message-bubble
|
|
51
|
+
.cometchat-stream-message-bubble img,
|
|
52
|
+
.cometchat-stream-message-bubble pre,
|
|
53
|
+
.cometchat-stream-message-bubble canvas,
|
|
54
|
+
.cometchat-stream-message-bubble svg,
|
|
55
|
+
.cometchat-stream-message-bubble video,
|
|
56
|
+
.cometchat-stream-message-bubble figure,
|
|
57
|
+
.cometchat-stream-message-bubble table {
|
|
53
58
|
vertical-align: top;
|
|
54
59
|
}
|
|
55
60
|
|
|
61
|
+
.cometchat-stream-message-bubble input[type="checkbox"] {
|
|
62
|
+
margin-right: var(--cometchat-margin-1);
|
|
63
|
+
position: relative;
|
|
64
|
+
top: 1px;
|
|
65
|
+
}
|
|
66
|
+
|
|
56
67
|
.cometchat-stream-message-bubble li:not([class]) {
|
|
57
68
|
text-align: left !important;
|
|
58
69
|
|
|
@@ -227,7 +238,7 @@
|
|
|
227
238
|
max-height: 300px;
|
|
228
239
|
width: fit-content;
|
|
229
240
|
border-radius: var(--cometchat-radius-2);
|
|
230
|
-
margin-
|
|
241
|
+
margin-top: var(--cometchat-margin-2);
|
|
231
242
|
}
|
|
232
243
|
|
|
233
244
|
.cometchat-stream-message-bubble > *:first-child *:first-child:not(:has(*)) ~ img{
|
|
@@ -238,10 +249,15 @@
|
|
|
238
249
|
display: none;
|
|
239
250
|
}
|
|
240
251
|
|
|
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) {
|
|
252
|
+
.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, input[type="checkbox"] ~ .cometchat-stream-message-bubble__image-intersection-start) {
|
|
242
253
|
display: block;
|
|
243
254
|
margin-top: -0.5em;
|
|
244
255
|
}
|
|
256
|
+
|
|
257
|
+
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__image-intersection-start:is(input[type="checkbox"] ~ .cometchat-stream-message-bubble__image-intersection-start) ~ img{
|
|
258
|
+
margin-top: var(--cometchat-margin-1);
|
|
259
|
+
}
|
|
260
|
+
|
|
245
261
|
.cometchat-stream-message-bubble .cometchat-stream-message-bubble__image-intersection-end:not(:has(+ .cometchat-stream-message-bubble__image-intersection-start)) {
|
|
246
262
|
display: block;
|
|
247
263
|
}
|
|
@@ -157,6 +157,11 @@ export declare class CometChatUIKitConstants {
|
|
|
157
157
|
changeScope: "changeScope";
|
|
158
158
|
groupMembers: "groupMembers";
|
|
159
159
|
}>;
|
|
160
|
+
static mimeTypes: Readonly<{
|
|
161
|
+
audio: "audio/*, .aac, .aif, .aiff, .caf, .mp3, .mp4, .wav, .m4a, .wma, .flac, .alac, .oga, .ra, .ram, .mid, .midi, .mka, .opus, .ac3, .amr, .ape, .dts, .wv, .tta, .pcm, .snd, .au, .cda, .vox, .m4b, .m3u, .pls, .ogg";
|
|
162
|
+
video: "video/*, .mov, .mp4, .m4v, .avi, .mpg, .mpeg, .m2ts, .mts, .3gp, .3g2, .flv, .wmv, .vob, .ts, .webm, .f4v, .f4a, .f4b, .swf, .rm, .rmvb, .divx, .xvid, .mxf, .asf, .amv, .smv, .avchd, .qt";
|
|
163
|
+
image: "image/*, .heic, .heif, .jpg, .jpeg, .png, .gif, .bmp, .tiff, .tif, .psd, .svg, .ico, .raw, .dng, .eps, .webp, .jfif, .jp2, .jpf, .jpx, .jpm, .mj2, .hdr, .exr, .pbm, .pgm, .ppm, .pnm, .tga, .dds, .svgz, .djvu, .ai, .cdr";
|
|
164
|
+
}>;
|
|
160
165
|
static streamMessageTypes: Readonly<{
|
|
161
166
|
run_started: string;
|
|
162
167
|
text_message_start: string;
|
|
@@ -42,3 +42,4 @@ export declare const setAIAssistantTools: (actions: CometChatAIAssistantTools) =
|
|
|
42
42
|
* Unsubscribes from the message processor and resets accumulated content
|
|
43
43
|
*/
|
|
44
44
|
export declare const stopStreamingMessage: () => void;
|
|
45
|
+
export declare const emitStreamingState: (state: boolean) => void;
|
|
@@ -62,10 +62,17 @@ export declare const useDebouncedCallback: (callback: () => void, delay: number)
|
|
|
62
62
|
cleanup: () => void;
|
|
63
63
|
};
|
|
64
64
|
export declare function createMessageCopy(msg: CometChat.AIAssistantBaseEvent, user: CometChat.User, category?: string, type?: string): CometChat.BaseMessage;
|
|
65
|
+
export declare function createMessageCopyFromBaseMessage(msg: CometChat.BaseMessage, user: CometChat.User | undefined): CometChat.BaseMessage;
|
|
65
66
|
export declare function isDarkMode(): boolean;
|
|
66
67
|
/**
|
|
67
68
|
* Sanitizes HTML content to only allow span tags while keeping everything else as plain text
|
|
68
69
|
* Also removes any script or executable content
|
|
69
70
|
*/
|
|
70
71
|
export declare const sanitizeToSpanOnly: (htmlString: string, regexPatterns: RegExp[][]) => string;
|
|
72
|
+
/**
|
|
73
|
+
* @function shouldShowCustomMimeTypes
|
|
74
|
+
* @description Returns true if the device is running either iOS (iPhone, iPad, iPod) or macOS.
|
|
75
|
+
* @returns {boolean} True if the device is an Apple device (iOS or macOS), false otherwise.
|
|
76
|
+
*/
|
|
77
|
+
export declare const shouldShowCustomMimeTypes: () => boolean;
|
|
71
78
|
export {};
|