You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(1) `current-user-id` is required to display UI and trigger actions according to the user using the chat (ex: messages position on the right, etc.)
197
198
198
199
(2) `loading-rooms` can be used to show/hide a spinner icon while rooms are loading
199
200
200
-
(3) `room-id` can be used to load a specific room at any time
201
+
(3) `rooms-loaded` must be set to `true` when all rooms have been loaded. Meaning the user cannot scroll to load more paginated rooms
201
202
202
-
(4) `load-first-room` can be used to remove the default behaviour of opening the first room at initialization
203
+
(4) `room-id` can be used to load a specific room at any time
203
204
204
-
(5) `room-message` can be used to add a default textarea value
205
+
(5) `load-first-room` can be used to remove the default behaviour of opening the first room at initialization
205
206
206
-
(6) `messages-loaded` must be manually set to `true` when all messages of a conversation have been loaded. Meaning the user cannot scroll on top anymore
207
+
(6) `room-message` can be used to add a default textarea value
207
208
208
-
(7) `menu-actions` can be used to display your own buttons when clicking the vertical dots icon inside a room.<br>
209
+
(7) `messages-loaded` must be set to `true` when all messages of a conversation have been loaded. Meaning the user cannot scroll on top to load more paginated messages
210
+
211
+
(8) `menu-actions` can be used to display your own buttons when clicking the vertical dots icon inside a room.<br>
209
212
You can then use the [menu-action-handler](#events-api) event to call your own action after clicking a button. Ex:
210
213
211
214
```javascript
@@ -225,7 +228,7 @@ menu-actions="[
225
228
]"
226
229
```
227
230
228
-
(8) `message-actions` can be used to display your own buttons when clicking the dropdown icon inside a message.<br>
231
+
(9) `message-actions` can be used to display your own buttons when clicking the dropdown icon inside a message.<br>
229
232
You can then use the [message-action-handler](#events-api) event to call your own action after clicking a button. Ex:
230
233
231
234
```javascript
@@ -265,11 +268,11 @@ messageActions="[
265
268
]"
266
269
```
267
270
268
-
(9) `show-new-messages-divider` can be used to show/hide the blue line divider between seen and unseen messages.
271
+
(10) `show-new-messages-divider` can be used to show/hide the blue line divider between seen and unseen messages.
269
272
270
-
(10) `show-footer` can be used to hide the room footer. For example to prevent users to send any message or media.
273
+
(11) `show-footer` can be used to hide the room footer. For example to prevent users to send any message or media.
271
274
272
-
(11) `text-messages` can be used to replace default i18n texts. Ex:
275
+
(12) `text-messages` can be used to replace default i18n texts. Ex:
273
276
274
277
```javascript
275
278
text-messages="{
@@ -287,7 +290,7 @@ text-messages="{
287
290
}"
288
291
```
289
292
290
-
(12) `text-formatting` can be used to add text formatting. Currently, bold, italic, strikethrough, underline, inline code and multiline code formatting are available and can be used in conjonction. You can disable text formatting by passing the prop as `:textFormatting="false"`.
293
+
(13) `text-formatting` can be used to add text formatting. Currently, bold, italic, strikethrough, underline, inline code and multiline code formatting are available and can be used in conjonction. You can disable text formatting by passing the prop as `:textFormatting="false"`.
(13) `responsive-breakpoint` can be used to collapse the rooms list on the left when then viewport size goes below the specified width.
320
+
(14) `responsive-breakpoint` can be used to collapse the rooms list on the left when then viewport size goes below the specified width.
318
321
319
-
(14) `single-room` can be used if you never want to show the rooms list on the left. You still need to pass the `rooms` prop as an array with a single element.
322
+
(15) `single-room` can be used if you never want to show the rooms list on the left. You still need to pass the `rooms` prop as an array with a single element.
320
323
321
-
(15) `theme` can be used to change the chat theme. Currently, only `light` and `dark` are available.
324
+
(16) `theme` can be used to change the chat theme. Currently, only `light` and `dark` are available.
322
325
323
-
(16) `accepted-files` can be used to set specifics file types allowed in chat. By default, all file types are allowed: `"*"`.
326
+
(17) `accepted-files` can be used to set specifics file types allowed in chat. By default, all file types are allowed: `"*"`.
324
327
325
328
Example: set `"accepted-files="image/png, image/jpeg, application/pdf"` to allow `JPG``PNG` and `PDF` files
326
329
327
-
(17) `styles` can be used to customize your own theme. Ex:
330
+
(18) `styles` can be used to customize your own theme. Ex:
| fetch-messages (1) |`{ room, options }`| A user has scrolled on top to load more messages |
569
-
| send-message |`{ roomId, content, file (5), replyMessage (6) }`| A user has sent a message |
570
-
| edit-message |`{ roomId, messageId, newContent, file (5), replyMessage (6) }`| A user has edited a message |
572
+
| fetch-more-rooms (2) | - | A user has scrolled to load more rooms |
573
+
| send-message |`{ roomId, content, file (6), replyMessage (7) }`| A user has sent a message |
574
+
| edit-message |`{ roomId, messageId, newContent, file (6), replyMessage (7) }`| A user has edited a message |
571
575
| delete-message |`{ roomId, messageId }`| A user has deleted a message |
572
576
| open-file |`{ message, action }`| A user has clicked to view or download a file |
573
577
| add-room | - | A user clicks on the plus icon next to searchbar |
574
-
| menu-action-handler (2) |`{ roomId, action }`| A user clicks on the vertical dots icon inside a room |
575
-
| message-action-handler (3) |`{ roomId, action, message }`| A user clicks on the dropdown icon inside a message |
578
+
| menu-action-handler (3) |`{ roomId, action }`| A user clicks on the vertical dots icon inside a room |
579
+
| message-action-handler (4) |`{ roomId, action, message }`| A user clicks on the dropdown icon inside a message |
576
580
| send-message-reaction |`{ roomId, messageId, reaction, remove }`| A user clicks on the emoji icon inside a message |
577
581
| room-info |`room`| A user clicks the room header bar |
578
-
| textarea-action-handler (4) |`{ roomId, message }`| A user clicks on custom icon inside the footer |
582
+
| textarea-action-handler (5) |`{ roomId, message }`| A user clicks on custom icon inside the footer |
579
583
| typing-message |`{ message, roomId }`| A user is typing a message |
580
584
581
585
(1) `fetch-messages` is triggered every time a room is opened. If the room is opened for the first time, the `options` param will hold `reset: true`.<br>
582
586
(1) `fetch-messages` should be a method implementing a pagination system. Its purpose is to load older messages of a conversation when the user scroll on top.
583
587
584
-
(2) `menu-action-handler` is the result of the `menuActions` prop.<br>
588
+
(3) `menu-action-handler` is the result of the `menuActions` prop.<br>
585
589
When clicking a button from your `menuActions` array, `menuActionHandler` will give you the name of the button that was click.
(3) `message-action-handler` is the result of the `message-actions` prop.<br>
605
+
(4) `message-action-handler` is the result of the `message-actions` prop.<br>
602
606
When clicking a message menu button from your `message-actions` array, `message-action-handler` will give you the name of the button that was click and the corresponding message data.
(4) `textarea-action-handler` can be used to add an extra icon on the right of the textarea, and recieve an event when clicking it.
620
+
(5) `textarea-action-handler` can be used to add an extra icon on the right of the textarea, and recieve an event when clicking it.
617
621
618
-
(5) All file params contain: `{ blob, localURL, name, size, type }`
622
+
(6) All file params contain: `{ blob, localURL, name, size, type }`
619
623
620
-
(6) `replyMessage` object is available when the user replied to another message by clicking the corresponding icon, and contains the message information that was clicked.
624
+
(7) `replyMessage` object is available when the user replied to another message by clicking the corresponding icon, and contains the message information that was clicked.
621
625
622
626
## Named Slots
623
627
@@ -727,6 +731,11 @@ messages: {
727
731
}
728
732
```
729
733
734
+
#### Notes
735
+
736
+
- You need to create a composite index to order rooms by last message received.
737
+
The easiest way to do it is to create a room, then click the error message url in the browser debugging console.
0 commit comments