@@ -446,12 +446,24 @@ const Docs: () => JSX.Element = () => {
446
446
< SingleLineBetaBanner />
447
447
< Description >
448
448
The following examples show how to enable image insert functionality for message editing with rich text
449
- editor. Under the `richTextEditorOptions` prop, an `onInsertInlineImage` callback to handle an inline image
450
- that is inserted into the MessageThread component. This callback can be used to implement custom logic, such
451
- as uploading the image to a server. After processing each inserted image in the callback, the results should
452
- be passed back to the component through the `messagesInlineImagesWithProgress` prop for each message that has
453
- inserted inline images. This prop will be used to render inline images in the MessageThread and submit them
454
- with the message.
449
+ editor. Under the `richTextEditorOptions` prop, the `onInsertInlineImage` callback is used to handle each
450
+ inline image that is inserted into the editor. When not provided, pasting images into the rich text editor
451
+ will be disabled. This callback can be used to manipulate the imageAttributes src URL (which is a local blob
452
+ URL), and implement any other custom logic. After processing each inserted image in the callback, the results
453
+ should be passed back to the component through the `messagesInlineImagesWithProgress` prop. This prop will be
454
+ used to render the error bar to the end user. Note that for the error of content exceeds the maximum length,
455
+ the `id` and `url` props provided in the `inlineImagesWithProgress` will be used in the calculation to achieve
456
+ a more accurate result. The content provided in the `onSendMessage` does not contain any information from the
457
+ `inlineImagesWithProgress`. To add or replace image attributes, manually parse the HTML content and update the
458
+ image attributes. After an inline image is removed from the editor, the `onRemoveInlineImage` callback will be
459
+ triggered. At this point, the image is already removed from the UI and the local blob of the image has already
460
+ been revoked. This callback can be used to implement custom logic such as deleting the image from the server.
461
+ When the inline images are displayed in the message thread, we restrict the max-width on each image, but not
462
+ the height. Long images will take up vertical space in the message thread. Also, when inserting images between
463
+ text, images will be on the same line as the text. If you wish to change this behavior so that each image is
464
+ always on a new line, you can set the display property to block for all image tags. For certain Android
465
+ devices, pasting of a single image is only supported by long pressing on the rich text editor and choosing
466
+ paste. Selecting from the clipboard view from keyboard may not be supported.
455
467
</ Description >
456
468
< Canvas mdxSource = { MessageThreadWithRichTextEditorInlineImagesText } >
457
469
< MessageThreadWithRichTextEditorInlineImagesExample />
0 commit comments