@cometchat/chat-uikit-react 6.3.13 → 6.4.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/assets/bin.svg +1 -0
- package/dist/assets/format_blockquote.svg +3 -0
- package/dist/assets/format_bold.svg +5 -0
- package/dist/assets/format_code.svg +3 -0
- package/dist/assets/format_code_block.svg +5 -0
- package/dist/assets/format_italic.svg +3 -0
- package/dist/assets/format_link.svg +3 -0
- package/dist/assets/format_ordered_list.svg +5 -0
- package/dist/assets/format_strikethrough.svg +5 -0
- package/dist/assets/format_toggle.svg +1 -0
- package/dist/assets/format_underline.svg +5 -0
- package/dist/assets/format_unordered_list.svg +5 -0
- package/dist/assets/pause_circle.svg +1 -0
- package/dist/assets/warning-small.svg +0 -0
- package/dist/index.d.ts +360 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/CometChatCompactMessageComposer.css +1111 -0
- package/dist/styles/CometChatConversations.css +37 -1
- package/dist/styles/CometChatDocumentBubble.css +0 -1
- package/dist/styles/CometChatFormattingToolbar.css +257 -0
- package/dist/styles/CometChatLinkDialog.css +191 -0
- package/dist/styles/CometChatLinkPopover.css +128 -0
- package/dist/styles/CometChatMarkdownFormatter.css +141 -0
- package/dist/styles/CometChatMediaRecorder.css +73 -1
- package/dist/styles/CometChatMessageComposer.css +210 -3
- package/dist/styles/CometChatMessagePreview.css +10 -0
- package/dist/styles/CometChatSearch.css +11 -0
- package/dist/styles/CometChatTextBubble.css +267 -3
- package/dist/styles/LinkPreview.css +1 -1
- package/dist/styles/components/CometChatCompactMessageComposer.css +1111 -0
- package/dist/styles/components/CometChatConversations.css +37 -1
- package/dist/styles/components/CometChatDocumentBubble.css +0 -1
- package/dist/styles/components/CometChatFormattingToolbar.css +257 -0
- package/dist/styles/components/CometChatLinkDialog.css +191 -0
- package/dist/styles/components/CometChatLinkPopover.css +128 -0
- package/dist/styles/components/CometChatMarkdownFormatter.css +141 -0
- package/dist/styles/components/CometChatMediaRecorder.css +73 -1
- package/dist/styles/components/CometChatMessageComposer.css +210 -3
- package/dist/styles/components/CometChatMessagePreview.css +10 -0
- package/dist/styles/components/CometChatSearch.css +11 -0
- package/dist/styles/components/CometChatTextBubble.css +267 -3
- package/dist/styles/components/LinkPreview.css +1 -1
- package/dist/styles/components/index.css +6 -5
- package/dist/styles/css-variables.css +1 -0
- package/dist/styles/index.css +6 -5
- package/dist/types/CometChatUIKit/CometChatUIKitUtility.d.ts +13 -0
- package/dist/types/components/CometChatCompactMessageComposer/CometChatCompactMessageComposer.d.ts +247 -0
- package/dist/types/components/CometChatFormattingToolbar/CometChatFormattingToolbar.d.ts +29 -0
- package/dist/types/components/CometChatLinkDialog/CometChatLinkDialog.d.ts +22 -0
- package/dist/types/components/CometChatLinkPopover/CometChatLinkPopover.d.ts +24 -0
- package/dist/types/components/CometChatLinkPopover/index.d.ts +1 -0
- package/dist/types/components/useRichTextComposer/useRichTextComposer.d.ts +138 -0
- package/dist/types/formatters/CometChatFormatters/CometChatMarkdownFormatter/CometChatMarkdownFormatter.d.ts +109 -0
- package/dist/types/formatters/CometChatFormatters/CometChatRichTextFormatter.d.ts +32 -0
- package/dist/types/formatters/CometChatFormatters/CometChatUrlsFormatter/CometChatUrlsFormatter.d.ts +9 -3
- package/dist/types/formatters/index.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/EmojiShortcodeUtils.d.ts +11 -0
- package/dist/types/utils/HtmlToMarkdown.d.ts +52 -0
- package/dist/types/utils/MarkdownPatternDetector.d.ts +108 -0
- package/dist/types/utils/RichTextFormatting.d.ts +143 -0
- package/dist/types/utils/util.d.ts +1 -1
- package/package.json +1 -1
|
@@ -16,12 +16,33 @@
|
|
|
16
16
|
word-break: break-word;
|
|
17
17
|
text-align: left;
|
|
18
18
|
white-space: pre-line;
|
|
19
|
-
overflow:
|
|
19
|
+
overflow: hidden;
|
|
20
20
|
display: -webkit-box;
|
|
21
21
|
-webkit-box-orient: vertical;
|
|
22
|
-
overflow: hidden;
|
|
23
22
|
padding-top:var(--cometchat-padding-1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* When text contains block-level elements like lists or blockquotes,
|
|
26
|
+
switch from -webkit-box to block display so list markers render properly.
|
|
27
|
+
Use max-height for truncation since -webkit-line-clamp doesn't work with display: block */
|
|
28
|
+
.cometchat-text-bubble__body-text:has(ol),
|
|
29
|
+
.cometchat-text-bubble__body-text:has(ul),
|
|
30
|
+
.cometchat-text-bubble__body-text:has(blockquote),
|
|
31
|
+
.cometchat-text-bubble__body-text:has(pre) {
|
|
32
|
+
display: block;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
white-space: normal;
|
|
35
|
+
/* 4 lines * line-height (~22px for body-regular) = ~88px */
|
|
36
|
+
max-height: 88px;
|
|
37
|
+
}
|
|
24
38
|
|
|
39
|
+
/* When expanded, remove max-height restriction for block-level content */
|
|
40
|
+
.cometchat-text-bubble__body-text.cometchat-text-bubble__body-text--expanded:has(ol),
|
|
41
|
+
.cometchat-text-bubble__body-text.cometchat-text-bubble__body-text--expanded:has(ul),
|
|
42
|
+
.cometchat-text-bubble__body-text.cometchat-text-bubble__body-text--expanded:has(blockquote),
|
|
43
|
+
.cometchat-text-bubble__body-text.cometchat-text-bubble__body-text--expanded:has(pre) {
|
|
44
|
+
max-height: none;
|
|
45
|
+
overflow: visible;
|
|
25
46
|
}
|
|
26
47
|
|
|
27
48
|
/* Incoming text bubble specific styles */
|
|
@@ -94,4 +115,247 @@
|
|
|
94
115
|
.cometchat-text-bubble {
|
|
95
116
|
max-width: 280px;
|
|
96
117
|
}
|
|
97
|
-
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Rich Text Formatting Styles */
|
|
121
|
+
|
|
122
|
+
/* Bold */
|
|
123
|
+
.cometchat-text-bubble__body-text b,
|
|
124
|
+
.cometchat-text-bubble__body-text strong {
|
|
125
|
+
font-weight: var(--cometchat-font-weight-bold, 700);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Italic */
|
|
129
|
+
.cometchat-text-bubble__body-text i,
|
|
130
|
+
.cometchat-text-bubble__body-text em {
|
|
131
|
+
font-style: italic;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Strikethrough */
|
|
135
|
+
.cometchat-text-bubble__body-text s,
|
|
136
|
+
.cometchat-text-bubble__body-text strike,
|
|
137
|
+
.cometchat-text-bubble__body-text del {
|
|
138
|
+
text-decoration: line-through;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Underline */
|
|
142
|
+
.cometchat-text-bubble__body-text u {
|
|
143
|
+
text-decoration: underline;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* Inline code */
|
|
147
|
+
.cometchat-text-bubble__body-text code {
|
|
148
|
+
font-family: 'Roboto Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
|
|
149
|
+
font-size: 14px;
|
|
150
|
+
font-weight: 400;
|
|
151
|
+
font-style: normal;
|
|
152
|
+
background: var(--cometchat-background-color-03);
|
|
153
|
+
color: var(--cometchat-text-color-highlight);
|
|
154
|
+
padding: 0 var(--cometchat-padding);
|
|
155
|
+
border-radius: var(--cometchat-radius);
|
|
156
|
+
border: 1px solid var(--cometchat-border-color-default);
|
|
157
|
+
white-space: pre-wrap;
|
|
158
|
+
word-break: break-word;
|
|
159
|
+
display: inline-flex;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
align-items: center;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Code color for incoming messages */
|
|
165
|
+
.cometchat-text-bubble-incoming .cometchat-text-bubble__body-text code {
|
|
166
|
+
color: var(--cometchat-text-color-highlight);
|
|
167
|
+
border-radius: var(--cometchat-radius);
|
|
168
|
+
border: 1px solid var(--cometchat-border-color-dark);
|
|
169
|
+
background: var(--cometchat-background-color-03);
|
|
170
|
+
font-family: 'Roboto Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
|
|
171
|
+
font-size: 14px;
|
|
172
|
+
font-weight: 400;
|
|
173
|
+
font-style: normal;
|
|
174
|
+
padding: 0 var(--cometchat-padding);
|
|
175
|
+
display: inline-flex;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
align-items: center;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* Code color for outgoing messages */
|
|
181
|
+
.cometchat-text-bubble-outgoing .cometchat-text-bubble__body-text code {
|
|
182
|
+
color: var(--cometchat-static-white);
|
|
183
|
+
background: rgba(255, 255, 255, 0.20);
|
|
184
|
+
border: 1px solid rgba(245, 245, 245, 0.10);
|
|
185
|
+
border-radius: var(--cometchat-radius);
|
|
186
|
+
padding: 0 var(--cometchat-padding);
|
|
187
|
+
font-family: 'Roboto Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
|
|
188
|
+
font-size: 14px;
|
|
189
|
+
font-weight: 400;
|
|
190
|
+
font-style: normal;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Code block */
|
|
194
|
+
.cometchat-text-bubble__body-text pre {
|
|
195
|
+
display: block;
|
|
196
|
+
font-family: 'Roboto Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
|
|
197
|
+
font-size: 14px;
|
|
198
|
+
font-weight: 400;
|
|
199
|
+
font-style: normal;
|
|
200
|
+
background: var(--cometchat-background-color-02);
|
|
201
|
+
border: 1px solid var(--cometchat-border-color-light);
|
|
202
|
+
border-radius: var(--cometchat-radius-2, 8px);
|
|
203
|
+
padding: var(--cometchat-padding-2, 8px) var(--cometchat-padding-3, 12px);
|
|
204
|
+
margin: 0;
|
|
205
|
+
white-space: pre-wrap;
|
|
206
|
+
word-wrap: break-word;
|
|
207
|
+
overflow-x: auto;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.cometchat-text-bubble-outgoing .cometchat-text-bubble__body-text pre {
|
|
211
|
+
background: rgba(255, 255, 255, 0.10);
|
|
212
|
+
border: none;
|
|
213
|
+
border-radius: var(--cometchat-radius-2, 8px);
|
|
214
|
+
color: var(--cometchat-static-white);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.cometchat-text-bubble__body-text pre code,
|
|
218
|
+
.cometchat-text-bubble-incoming .cometchat-text-bubble__body-text pre code,
|
|
219
|
+
.cometchat-text-bubble-outgoing .cometchat-text-bubble__body-text pre code {
|
|
220
|
+
background: transparent;
|
|
221
|
+
color: inherit;
|
|
222
|
+
padding: 0;
|
|
223
|
+
border: none;
|
|
224
|
+
border-radius: 0;
|
|
225
|
+
display: inline;
|
|
226
|
+
font-family: inherit !important;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* Blockquote */
|
|
230
|
+
.cometchat-text-bubble__body-text blockquote {
|
|
231
|
+
display: block;
|
|
232
|
+
border-left: 3px solid var(--cometchat-border-color-default);
|
|
233
|
+
padding: var(--cometchat-padding-2);
|
|
234
|
+
border-radius: var(--cometchat-radius-1);
|
|
235
|
+
margin: 0;
|
|
236
|
+
font-style: normal;
|
|
237
|
+
min-width: 100px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.cometchat-text-bubble-incoming .cometchat-text-bubble__body-text blockquote {
|
|
241
|
+
color: var(--cometchat-text-color-secondary);
|
|
242
|
+
background: var(--cometchat-neutral-color-400);
|
|
243
|
+
border-left-color: var(--cometchat-primary-color);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.cometchat-text-bubble-outgoing .cometchat-text-bubble__body-text blockquote {
|
|
247
|
+
color: rgba(255, 255, 255, 0.8);
|
|
248
|
+
background: rgba(255, 255, 255, 0.10);
|
|
249
|
+
border-left-color: var(--cometchat-static-white);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Links */
|
|
253
|
+
.cometchat-text-bubble__body-text a {
|
|
254
|
+
text-decoration: underline;
|
|
255
|
+
cursor: pointer;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.cometchat-text-bubble-incoming .cometchat-text-bubble__body-text a {
|
|
259
|
+
color: var(--cometchat-primary-color, #3399ff);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.cometchat-text-bubble-outgoing .cometchat-text-bubble__body-text a {
|
|
263
|
+
color: var(--cometchat-static-white);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.cometchat-text-bubble__body-text a:hover {
|
|
267
|
+
text-decoration: underline;
|
|
268
|
+
opacity: 0.8;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/* List items */
|
|
272
|
+
.cometchat-text-bubble__body-text li {
|
|
273
|
+
display: list-item;
|
|
274
|
+
margin: 0;
|
|
275
|
+
padding: 0;
|
|
276
|
+
white-space: normal;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.cometchat-text-bubble__body-text ol,
|
|
280
|
+
.cometchat-text-bubble__body-text ul {
|
|
281
|
+
margin: 0;
|
|
282
|
+
padding: 0;
|
|
283
|
+
padding-left: var(--cometchat-padding-3, 12px);
|
|
284
|
+
white-space: normal;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* Nested list styling progression */
|
|
288
|
+
.cometchat-text-bubble__body-text ol { list-style-type: decimal; }
|
|
289
|
+
.cometchat-text-bubble__body-text ol ol { list-style-type: lower-alpha; }
|
|
290
|
+
.cometchat-text-bubble__body-text ol ol ol { list-style-type: lower-roman; }
|
|
291
|
+
.cometchat-text-bubble__body-text ul { list-style-type: disc; }
|
|
292
|
+
.cometchat-text-bubble__body-text ul ul { list-style-type: circle; }
|
|
293
|
+
.cometchat-text-bubble__body-text ul ul ul { list-style-type: square; }
|
|
294
|
+
.cometchat-text-bubble__body-text li > ol,
|
|
295
|
+
.cometchat-text-bubble__body-text li > ul {
|
|
296
|
+
margin-top: 0;
|
|
297
|
+
margin-bottom: 0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
/* Mention styles in text bubbles */
|
|
302
|
+
|
|
303
|
+
/* Base mention styling - incoming bubbles */
|
|
304
|
+
.cometchat-text-bubble-incoming .cometchat-text-bubble__body-text .cometchat-mentions {
|
|
305
|
+
border-radius: var(--cometchat-radius, 2px);
|
|
306
|
+
background: rgba(104, 82, 214, 0.20);
|
|
307
|
+
padding: 0px var(--cometchat-padding, 2px);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.cometchat-text-bubble-incoming .cometchat-text-bubble__body-text .cometchat-mentions > span {
|
|
311
|
+
color: var(--cometchat-text-color-highlight, #6852D6);
|
|
312
|
+
font: var(--cometchat-font-body-regular);
|
|
313
|
+
font-weight: normal;
|
|
314
|
+
font-style: normal;
|
|
315
|
+
text-decoration: none;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* "You" mention styling - incoming bubbles */
|
|
319
|
+
.cometchat-text-bubble-incoming .cometchat-text-bubble__body-text .cometchat-mentions-you {
|
|
320
|
+
border-radius: var(--cometchat-radius, 2px);
|
|
321
|
+
background: rgba(255, 171, 0, 0.20);
|
|
322
|
+
padding: 0px var(--cometchat-padding, 2px);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.cometchat-text-bubble-incoming .cometchat-text-bubble__body-text .cometchat-mentions-you > span {
|
|
326
|
+
color: var(--cometchat-warning-color, #FFAB00);
|
|
327
|
+
font: var(--cometchat-font-body-regular);
|
|
328
|
+
font-weight: normal;
|
|
329
|
+
font-style: normal;
|
|
330
|
+
text-decoration: none;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* Base mention styling - outgoing bubbles */
|
|
334
|
+
.cometchat-text-bubble-outgoing .cometchat-text-bubble__body-text .cometchat-mentions {
|
|
335
|
+
border-radius: var(--cometchat-radius, 2px);
|
|
336
|
+
background: rgba(255, 255, 255, 0.20);
|
|
337
|
+
padding: 0px var(--cometchat-padding, 2px);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.cometchat-text-bubble-outgoing .cometchat-text-bubble__body-text .cometchat-mentions > span {
|
|
341
|
+
color: var(--cometchat-static-white);
|
|
342
|
+
font: var(--cometchat-font-body-regular);
|
|
343
|
+
font-weight: normal;
|
|
344
|
+
font-style: normal;
|
|
345
|
+
text-decoration: none;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* "You" mention styling - outgoing bubbles */
|
|
349
|
+
.cometchat-text-bubble-outgoing .cometchat-text-bubble__body-text .cometchat-mentions-you {
|
|
350
|
+
border-radius: var(--cometchat-radius, 2px);
|
|
351
|
+
background: rgba(255, 255, 255, 0.20);
|
|
352
|
+
padding: 0px var(--cometchat-padding, 2px);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.cometchat-text-bubble-outgoing .cometchat-text-bubble__body-text .cometchat-mentions-you > span {
|
|
356
|
+
color: var(--cometchat-static-white);
|
|
357
|
+
font: var(--cometchat-font-body-regular);
|
|
358
|
+
font-weight: normal;
|
|
359
|
+
font-style: normal;
|
|
360
|
+
text-decoration: none;
|
|
361
|
+
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
font-style: normal;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
.cometchat-link-bubble-incoming .cometchat-link-bubble__preview-body-content-
|
|
70
|
+
.cometchat-link-bubble-incoming .cometchat-link-bubble__preview-body-content-description {
|
|
71
71
|
color: var(--cometchat-neutral-color-900, #141414);
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
@import url('./CometChatGroups.css');
|
|
43
43
|
@import url('./CometChatMessageHeader.css');
|
|
44
44
|
@import url('./CometChatMessageComposer.css');
|
|
45
|
+
@import url('./CometChatCompactMessageComposer.css');
|
|
45
46
|
@import url('./CometChatMessageList.css');
|
|
46
47
|
@import url('./CometChatOutgoingCall.css');
|
|
47
48
|
@import url('./CometChatActionBubble.css');
|
|
@@ -64,6 +65,10 @@
|
|
|
64
65
|
@import url('./CometChatMessagePreview.css');
|
|
65
66
|
@import url('./CometChatFlagMessageDialog.css');
|
|
66
67
|
@import url('./CometChatUserMemberWrapper.css');
|
|
68
|
+
@import url('./CometChatFormattingToolbar.css');
|
|
69
|
+
@import url('./CometChatLinkDialog.css');
|
|
70
|
+
@import url('./CometChatLinkPopover.css');
|
|
71
|
+
@import url('./CometChatMarkdownFormatter.css');
|
|
67
72
|
/* @import url('./CometChatToolCallResultBubble.css');
|
|
68
73
|
@import url('./CometChatToolCallArgumentBubble.css'); */
|
|
69
74
|
.cometchat * {
|
|
@@ -73,7 +78,7 @@
|
|
|
73
78
|
|
|
74
79
|
.cometchat-mentions > span{
|
|
75
80
|
color: var(--cometchat-text-color-highlight);
|
|
76
|
-
font:var(--cometchat-font-body-regular);
|
|
81
|
+
font: var(--cometchat-font-body-regular);
|
|
77
82
|
}
|
|
78
83
|
.cometchat-mentions{
|
|
79
84
|
display: inline-block;
|
|
@@ -101,19 +106,15 @@ font:var(--cometchat-font-body-regular);
|
|
|
101
106
|
}
|
|
102
107
|
.cometchat-mentions-outgoing.cometchat-mentions-you > span{
|
|
103
108
|
color: var(--cometchat-warning-color);
|
|
104
|
-
|
|
105
109
|
}
|
|
106
110
|
.cometchat-mentions-outgoing.cometchat-mentions-other > span{
|
|
107
111
|
color: var(--cometchat-static-white);
|
|
108
|
-
|
|
109
112
|
}
|
|
110
113
|
.cometchat-mentions-incoming.cometchat-mentions-you > span{
|
|
111
114
|
color: var(--cometchat-warning-color);
|
|
112
|
-
|
|
113
115
|
}
|
|
114
116
|
.cometchat-mentions-incoming.cometchat-mentions-other > span{
|
|
115
117
|
color: var(--cometchat-text-color-highlight);
|
|
116
|
-
|
|
117
118
|
}
|
|
118
119
|
.cometchat-text-bubble-incoming .cometchat-url{
|
|
119
120
|
color: var(--cometchat-info-color);
|
package/dist/styles/index.css
CHANGED
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
@import url('./CometChatGroups.css');
|
|
43
43
|
@import url('./CometChatMessageHeader.css');
|
|
44
44
|
@import url('./CometChatMessageComposer.css');
|
|
45
|
+
@import url('./CometChatCompactMessageComposer.css');
|
|
45
46
|
@import url('./CometChatMessageList.css');
|
|
46
47
|
@import url('./CometChatOutgoingCall.css');
|
|
47
48
|
@import url('./CometChatActionBubble.css');
|
|
@@ -64,6 +65,10 @@
|
|
|
64
65
|
@import url('./CometChatMessagePreview.css');
|
|
65
66
|
@import url('./CometChatFlagMessageDialog.css');
|
|
66
67
|
@import url('./CometChatUserMemberWrapper.css');
|
|
68
|
+
@import url('./CometChatFormattingToolbar.css');
|
|
69
|
+
@import url('./CometChatLinkDialog.css');
|
|
70
|
+
@import url('./CometChatLinkPopover.css');
|
|
71
|
+
@import url('./CometChatMarkdownFormatter.css');
|
|
67
72
|
/* @import url('./CometChatToolCallResultBubble.css');
|
|
68
73
|
@import url('./CometChatToolCallArgumentBubble.css'); */
|
|
69
74
|
.cometchat * {
|
|
@@ -73,7 +78,7 @@
|
|
|
73
78
|
|
|
74
79
|
.cometchat-mentions > span{
|
|
75
80
|
color: var(--cometchat-text-color-highlight);
|
|
76
|
-
font:var(--cometchat-font-body-regular);
|
|
81
|
+
font: var(--cometchat-font-body-regular);
|
|
77
82
|
}
|
|
78
83
|
.cometchat-mentions{
|
|
79
84
|
display: inline-block;
|
|
@@ -101,19 +106,15 @@ font:var(--cometchat-font-body-regular);
|
|
|
101
106
|
}
|
|
102
107
|
.cometchat-mentions-outgoing.cometchat-mentions-you > span{
|
|
103
108
|
color: var(--cometchat-warning-color);
|
|
104
|
-
|
|
105
109
|
}
|
|
106
110
|
.cometchat-mentions-outgoing.cometchat-mentions-other > span{
|
|
107
111
|
color: var(--cometchat-static-white);
|
|
108
|
-
|
|
109
112
|
}
|
|
110
113
|
.cometchat-mentions-incoming.cometchat-mentions-you > span{
|
|
111
114
|
color: var(--cometchat-warning-color);
|
|
112
|
-
|
|
113
115
|
}
|
|
114
116
|
.cometchat-mentions-incoming.cometchat-mentions-other > span{
|
|
115
117
|
color: var(--cometchat-text-color-highlight);
|
|
116
|
-
|
|
117
118
|
}
|
|
118
119
|
.cometchat-text-bubble-incoming .cometchat-url{
|
|
119
120
|
color: var(--cometchat-info-color);
|
|
@@ -60,12 +60,25 @@ export declare class CometChatUIKitUtility {
|
|
|
60
60
|
* @returns The extension data if found.
|
|
61
61
|
*/
|
|
62
62
|
static checkMessageForExtensionsData: (message: CometChat.BaseMessage | null, extensionKey: string) => (object & MessageExtensionType) | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Convert known rich-text HTML formatting tags to markdown.
|
|
65
|
+
* This handles messages that arrive with raw HTML (from other platforms or older clients)
|
|
66
|
+
* so they can be processed by the markdown formatter on the bubble side.
|
|
67
|
+
* Also handles HTML-entity-escaped tags (e.g., <i>text</i>).
|
|
68
|
+
* Only converts recognized formatting tags; unknown/dangerous HTML is left for sanitizeText.
|
|
69
|
+
*/
|
|
70
|
+
static convertFormattingHtmlToMarkdown(text: string): string;
|
|
63
71
|
/**
|
|
64
72
|
* Process and sanitize text to escape dangerous HTML while preserving mention formatting
|
|
65
73
|
* @param text The text string that may contain HTML and mentions
|
|
66
74
|
* @returns Sanitized string with dangerous HTML escaped but mentions preserved
|
|
67
75
|
*/
|
|
68
76
|
static sanitizeText(text: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Strips markdown formatting syntax from text, leaving only the plain text content.
|
|
79
|
+
* Preserves mention tokens (<@uid:...> and <@all:...>) and line breaks.
|
|
80
|
+
*/
|
|
81
|
+
static stripMarkdownFormatting(text: string): string;
|
|
69
82
|
static convertBlobToWav: (audioBlob: {
|
|
70
83
|
arrayBuffer: () => any;
|
|
71
84
|
}) => Promise<{
|
package/dist/types/components/CometChatCompactMessageComposer/CometChatCompactMessageComposer.d.ts
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { JSX } from "react";
|
|
2
|
+
import { CometChatTextFormatter } from "../../formatters/CometChatFormatters/CometChatTextFormatter";
|
|
3
|
+
import { CometChatMessageComposerAction } from "../../modals";
|
|
4
|
+
import { EnterKeyBehavior, PreviewMessageMode } from "../../Enums/Enums";
|
|
5
|
+
export type ContentToDisplay = "attachments" | "emojiKeyboard" | "voiceRecording" | "ai" | "none";
|
|
6
|
+
export type ActionOnClickType = (() => void) | null;
|
|
7
|
+
interface MessageComposerProps {
|
|
8
|
+
/**
|
|
9
|
+
* The initial text pre-filled in the message input when the component mounts.
|
|
10
|
+
* @defaultValue ""
|
|
11
|
+
*/
|
|
12
|
+
initialComposerText?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Disables the typing indicator for the current message composer.
|
|
15
|
+
* @defaultValue `false`
|
|
16
|
+
*/
|
|
17
|
+
disableTypingEvents?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Disables the mentions functionality in the message composer.
|
|
20
|
+
* @defaultValue `false`
|
|
21
|
+
*/
|
|
22
|
+
disableMentions?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Hides the image attachment option in the message composer.
|
|
25
|
+
* @defaultValue `false`
|
|
26
|
+
*/
|
|
27
|
+
hideImageAttachmentOption?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Hides the video attachment option in the message composer.
|
|
30
|
+
* @defaultValue `false`
|
|
31
|
+
*/
|
|
32
|
+
hideVideoAttachmentOption?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Hides the audio attachment option in the message composer.
|
|
35
|
+
* @defaultValue `false`
|
|
36
|
+
*/
|
|
37
|
+
hideAudioAttachmentOption?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Hides the file attachment option in the message composer.
|
|
40
|
+
* @defaultValue `false`
|
|
41
|
+
*/
|
|
42
|
+
hideFileAttachmentOption?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Hides the polls option in the message composer.
|
|
45
|
+
* @defaultValue `false`
|
|
46
|
+
*/
|
|
47
|
+
hidePollsOption?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Hides the collaborative document option in the message composer.
|
|
50
|
+
* @defaultValue `false`
|
|
51
|
+
*/
|
|
52
|
+
hideCollaborativeDocumentOption?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Hides the collaborative whiteboard option in the message composer.
|
|
55
|
+
* @defaultValue `false`
|
|
56
|
+
*/
|
|
57
|
+
hideCollaborativeWhiteboardOption?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Hides the attachment button in the message composer.
|
|
60
|
+
* @defaultValue `false`
|
|
61
|
+
*/
|
|
62
|
+
hideAttachmentButton?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Hides the voice recording button in the message composer.
|
|
65
|
+
* @defaultValue `false`
|
|
66
|
+
*/
|
|
67
|
+
hideVoiceRecordingButton?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Hides the emoji keyboard button in the message composer.
|
|
70
|
+
* @defaultValue `false`
|
|
71
|
+
*/
|
|
72
|
+
hideEmojiKeyboardButton?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Hides the stickers button in the message composer.
|
|
75
|
+
* @defaultValue `false`
|
|
76
|
+
*/
|
|
77
|
+
hideStickersButton?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Hides the send button in the message composer.
|
|
80
|
+
* @defaultValue `false`
|
|
81
|
+
*/
|
|
82
|
+
hideSendButton?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The user to send messages to. This prop specifies the recipient of the message.
|
|
85
|
+
*/
|
|
86
|
+
user?: CometChat.User;
|
|
87
|
+
/**
|
|
88
|
+
* The group to send messages to.
|
|
89
|
+
* @remarks This prop is used if the `user` prop is not provided.
|
|
90
|
+
*/
|
|
91
|
+
group?: CometChat.Group;
|
|
92
|
+
/**
|
|
93
|
+
* The ID of the parent message. This is used for threading or replying to a specific message.
|
|
94
|
+
*/
|
|
95
|
+
parentMessageId?: number;
|
|
96
|
+
/**
|
|
97
|
+
* Options for default attachments, including various attachment types available in the composer.
|
|
98
|
+
*/
|
|
99
|
+
attachmentOptions?: CometChatMessageComposerAction[];
|
|
100
|
+
/**
|
|
101
|
+
* Array of text formatters to apply to the message text for customization and styling.
|
|
102
|
+
*/
|
|
103
|
+
textFormatters?: Array<CometChatTextFormatter>;
|
|
104
|
+
/**
|
|
105
|
+
* Determines the behavior of the Enter key in the composer (e.g., send message or add a new line).
|
|
106
|
+
* @default EnterKeyBehavior.SendMessage
|
|
107
|
+
*/
|
|
108
|
+
enterKeyBehavior?: EnterKeyBehavior;
|
|
109
|
+
/**
|
|
110
|
+
* Disables sound for incoming messages.
|
|
111
|
+
* @defaultValue `false`
|
|
112
|
+
*/
|
|
113
|
+
disableSoundForMessage?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Custom audio sound for incoming messages.
|
|
116
|
+
*/
|
|
117
|
+
customSoundForMessage?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Callback function triggered when the message input text changes.
|
|
120
|
+
* @param text - The current text value of the message input.
|
|
121
|
+
* @returns void
|
|
122
|
+
*/
|
|
123
|
+
onTextChange?: (text: string) => void;
|
|
124
|
+
/**
|
|
125
|
+
* Callback function triggered when the message composer encounters an error.
|
|
126
|
+
* @param error - An instance of `CometChat.CometChatException` representing the error.
|
|
127
|
+
* @returns void
|
|
128
|
+
*/
|
|
129
|
+
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
130
|
+
/**
|
|
131
|
+
* Callback function triggered when the send button is clicked.
|
|
132
|
+
* @param message - The message that was sent.
|
|
133
|
+
* @param previewMessageMode - Optionally, specify if the message is in preview mode.
|
|
134
|
+
*/
|
|
135
|
+
onSendButtonClick?: (message: CometChat.BaseMessage, previewMessageMode?: PreviewMessageMode) => void;
|
|
136
|
+
/**
|
|
137
|
+
* A custom view for the send button to customize its appearance or behavior.
|
|
138
|
+
*/
|
|
139
|
+
sendButtonView?: JSX.Element;
|
|
140
|
+
/**
|
|
141
|
+
* A custom view for an auxiliary button, which can be used alongside the send button.
|
|
142
|
+
*/
|
|
143
|
+
auxiliaryButtonView?: JSX.Element;
|
|
144
|
+
/**
|
|
145
|
+
* A custom header section displayed at the top of the message composer.
|
|
146
|
+
*/
|
|
147
|
+
headerView?: JSX.Element;
|
|
148
|
+
/**
|
|
149
|
+
* Controls the visibility of the scrollbar in the list.
|
|
150
|
+
* @defaultValue `false`
|
|
151
|
+
*/
|
|
152
|
+
showScrollbar?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* The placeholder text to display in the message input field when it is empty.
|
|
155
|
+
* @defaultValue ""
|
|
156
|
+
*/
|
|
157
|
+
placeholderText?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Boolean to show or hide "@all" mention functionality in group chats.
|
|
160
|
+
* @defaultValue `false`
|
|
161
|
+
*/
|
|
162
|
+
disableMentionAll?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* The mentionAll label for the app used to render "@all" mentions
|
|
165
|
+
* @defaultValue "all"
|
|
166
|
+
*/
|
|
167
|
+
mentionAllLabel?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Custom request builder for mentions user list.
|
|
170
|
+
* @defaultValue `undefined` - Uses default internal request builder.
|
|
171
|
+
*/
|
|
172
|
+
mentionsUsersRequestBuilder?: CometChat.UsersRequestBuilder;
|
|
173
|
+
/**
|
|
174
|
+
* Custom request builder for mentions group members list.
|
|
175
|
+
* @defaultValue `undefined` - Uses default internal request builder
|
|
176
|
+
*/
|
|
177
|
+
mentionsGroupMembersRequestBuilder?: CometChat.GroupMembersRequestBuilder;
|
|
178
|
+
/**
|
|
179
|
+
* Enables rich text editing capabilities in the message composer.
|
|
180
|
+
* @defaultValue `true`
|
|
181
|
+
*/
|
|
182
|
+
enableRichTextEditor?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Show floating toolbar when text is selected.
|
|
185
|
+
* NOTE: Ignored on mobile devices - falls back to fixed toolbar.
|
|
186
|
+
* @defaultValue false
|
|
187
|
+
*/
|
|
188
|
+
showToolbarOnSelection?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Hides the rich text formatting options (e.g., bold, italic, lists, links)
|
|
191
|
+
* in the message composer.
|
|
192
|
+
* @defaultValue false
|
|
193
|
+
*/
|
|
194
|
+
hideRichTextFormattingOptions?: boolean;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Represents the state of the message composer.
|
|
198
|
+
*/
|
|
199
|
+
type State = {
|
|
200
|
+
text: string;
|
|
201
|
+
addToMsgInputText: string;
|
|
202
|
+
textMessageToEdit: CometChat.TextMessage | null;
|
|
203
|
+
messageToReply: CometChat.BaseMessage | null;
|
|
204
|
+
contentToDisplay: ContentToDisplay;
|
|
205
|
+
loggedInUser: CometChat.User | null;
|
|
206
|
+
showPoll: boolean;
|
|
207
|
+
showMentionsCountWarning: boolean;
|
|
208
|
+
showValidationError: boolean;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Represents the possible actions that can be dispatched to update the state.
|
|
212
|
+
*/
|
|
213
|
+
export type Action = {
|
|
214
|
+
type: "setText";
|
|
215
|
+
text: State["text"];
|
|
216
|
+
} | {
|
|
217
|
+
type: "setAddToMsgInputText";
|
|
218
|
+
addToMsgInputText: State["addToMsgInputText"];
|
|
219
|
+
} | {
|
|
220
|
+
type: "setTextMessageToEdit";
|
|
221
|
+
textMessageToEdit: State["textMessageToEdit"];
|
|
222
|
+
} | {
|
|
223
|
+
type: "setMessageToReply";
|
|
224
|
+
messageToReply: State["messageToReply"];
|
|
225
|
+
} | {
|
|
226
|
+
type: "setContentToDisplay";
|
|
227
|
+
contentToDisplay: ContentToDisplay;
|
|
228
|
+
} | {
|
|
229
|
+
type: "setLoggedInUser";
|
|
230
|
+
loggedInUser: CometChat.User;
|
|
231
|
+
} | {
|
|
232
|
+
type: "setShowPoll";
|
|
233
|
+
showPoll: boolean;
|
|
234
|
+
} | {
|
|
235
|
+
type: "setShowMentionsCountWarning";
|
|
236
|
+
showMentionsCountWarning: boolean;
|
|
237
|
+
} | {
|
|
238
|
+
type: "setShowValidationError";
|
|
239
|
+
showValidationError: boolean;
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* CometChatCompactMessageComposer - A single-line horizontal layout variant of the message composer.
|
|
243
|
+
* All UI elements (attachment button, text input, emoji button, voice recording button, stickers button,
|
|
244
|
+
* and send button) are arranged horizontally in one line.
|
|
245
|
+
*/
|
|
246
|
+
export declare function CometChatCompactMessageComposer(props: MessageComposerProps): import("react/jsx-runtime").JSX.Element;
|
|
247
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { JSX } from 'react';
|
|
2
|
+
import { FormatType, createRichTextFormatter } from '../../utils/RichTextFormatting';
|
|
3
|
+
export interface FormattingToolbarProps {
|
|
4
|
+
/** Reference to the text input element for applying formatting */
|
|
5
|
+
textInputRef: React.RefObject<HTMLDivElement>;
|
|
6
|
+
/** Rich text formatter instance - can be null if rich text is disabled */
|
|
7
|
+
richTextFormatter: ReturnType<typeof createRichTextFormatter> | null;
|
|
8
|
+
/** Whether the toolbar is in floating mode (vs fixed) */
|
|
9
|
+
isFloating?: boolean;
|
|
10
|
+
/** Position for floating toolbar */
|
|
11
|
+
position?: {
|
|
12
|
+
top: number;
|
|
13
|
+
left: number;
|
|
14
|
+
};
|
|
15
|
+
/** Callback when toolbar visibility should change */
|
|
16
|
+
onVisibilityChange?: (visible: boolean) => void;
|
|
17
|
+
/** Currently active formats at caret position */
|
|
18
|
+
activeFormats?: FormatType[];
|
|
19
|
+
/** Callback when link button is clicked (to show link input) */
|
|
20
|
+
onLinkClick?: () => void;
|
|
21
|
+
/** Callback when formatting is applied - parent should update activeFormats */
|
|
22
|
+
onFormatApplied?: () => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* CometChatFormattingToolbar - A formatting toolbar component
|
|
26
|
+
* Provides rich text formatting options including bold, italic, underline,
|
|
27
|
+
* strikethrough, links, lists, blockquote, and code formatting.
|
|
28
|
+
*/
|
|
29
|
+
export declare function CometChatFormattingToolbar(props: FormattingToolbarProps): JSX.Element | null;
|