-
Notifications
You must be signed in to change notification settings - Fork 292
feat: message composer #2669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: message composer #2669
Conversation
41fe189 to
98fe4f2
Compare
dc919e7 to
0a7dc0f
Compare
0a7dc0f to
991b070
Compare
…textComposerEmojiMiddleware
…/message-composer
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rc #2669 +/- ##
==========================================
+ Coverage 81.06% 81.87% +0.80%
==========================================
Files 469 462 -7
Lines 9939 9185 -754
Branches 2411 2096 -315
==========================================
- Hits 8057 7520 -537
- Misses 1502 1560 +58
+ Partials 380 105 -275 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…m Channel props and ChannelStateContext
…equest from MessageInputProps
## [13.0.0-rc.1](v12.14.0...v13.0.0-rc.1) (2025-04-28) ### ⚠ BREAKING CHANGES * `Channel` props `dragAndDropWindow` & `optionalMessageInputProps` have been removed, use * Remove ChatAutoComplete, AutoCompleteTextarea, DefaultSuggestionList, DefaultSuggestionListItem and introduce TextareaComposer, SuggestionList, SuggestionListItem * Remove defaultScrollToItem function previously used by SuggestionList * Removed DefaultTriggerProvider component * Remove from Channel props - acceptedFiles, enrichURLForPreview, enrichURLForPreviewConfig, maxNumberOfFiles, multipleUploads, TriggerProvider * Removal of acceptedFiles, debounceURLEnrichmentMs, enrichURLForPreview, findURLFn, multipleUploads, onLinkPreviewDismissed, quotedMessage from ChannelStateContext * Changed signature for functions sendMessage and editMessage in ChannelActionContext * Changed signature for handleSubmit * Removed setQuotedMessage from ChannelActionContext * Removed types MessageToSend, StreamMessage, UpdatedMessage in favor of LocalMessage or RenderedMessage * Removed Trigger generics from ChannelProps * Message input state as well as the API is now kept within MessageComposer instead of MessageInputContext * Renamed useMessageInputState to useMessageInputControls as it does not handle the composition state anymore * Removed from MessageInputProps - disabled, disableMentions, doFileUploadRequest, doImageUploadRequest, errorHandler, getDefaultValue, mentionAllAppUsers, mentionQueryParams, message, noFiles, urlEnrichmentConfig, useMentionsTransliteration, additionalTextareaProps do not expect default value anymore * Changed the signature of MessageInput prop overrideSubmitHandler * Local attachment and link preview types moved to stream-chat * The SuggestionListItem UI components for TextareaComposer receive tokenizedDisplayName instead of itemNameParts * Removed duplicate types SendMessageOptions, UpdateMessageOptions which should be imported from stream-chat instead * Removed type LinkPreviewListProps - LinkPreviewList does not have any props anymore * dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types ### Bug Fixes * replace StreamChatGenerics with module augmentation ([#2634](#2634)) ([67bed79](67bed79)) ### Features * default data interfaces ([#2683](#2683)) ([a88e145](a88e145)) * introduce WithDragAndDropUpload component ([#2688](#2688)) ([6b03abd](6b03abd)) * message composer ([#2669](#2669)) ([fa2519b](fa2519b)), closes [#2688](#2688) ### Chores * **deps:** upgrade @stream-io/stream-chat-css to v5.8.1 ([#2689](#2689)) ([d0c32e3](d0c32e3)) ### Refactors * simplify WithDragAndDropUpload API ([#2691](#2691)) ([46c9add](46c9add))
|
🎉 This PR is included in version 13.0.0-rc.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [9.0.0](v8.60.0...v9.0.0) (2025-05-06) ### ⚠ BREAKING CHANGES * Replacement of FormatMessageResponse with LocalMessage type * `ErrorFromResponse` class constructor now requires second parameter (`status`, `response` and optionally `code`) * dropped jsDelivr bundle (#1468) * dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types * type `InviteOptions` has been renamed to `UpdateChannelOptions` * type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` * type `ThreadResponseCustomData` has been renamed to `CustomThreadData` * type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` * type `QueryFilter` no longer supports `$ne` and `$nin` operators * type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` * function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output ### Bug Fixes * [REACT-344] remove Agora & 100ms integrations ([#1519](#1519)) ([16cd81a](16cd81a)) * add image property to UserResponse type ([#1486](#1486)) ([2a57b7f](2a57b7f)) * adjust ChannelResponse, ChannelData & PollResponse ([#1493](#1493)) ([39091c7](39091c7)) * adjust ErrorFromResponse error class ([#1491](#1491)) ([ff32bd2](ff32bd2)) * increase package.json[engines.node] version ([6764bad](6764bad)) * multiple module augmentation fails in Angular ([#1488](#1488)) ([7f8a9a0](7f8a9a0)) * omit name from CustomChannelData for ChannelFilters ([#1494](#1494)) ([d7030c2](d7030c2)) * **qa:** adjust Event & ChannelData types ([#1524](#1524)) ([f1d73fd](f1d73fd)) * remove message composer bugs ([#1521](#1521)) ([8b324eb](8b324eb)) * replace StreamChatGenerics with module augmentation ([#1458](#1458)) ([feb97da](feb97da)) ### Features * add missing configuration parameters for AttachmentManager and TextComposer ([#1520](#1520)) ([44902e7](44902e7)) * disable link previews in message composer ([02cd9a8](02cd9a8)) * improve MessageComposer ergonomics ([2c0c639](2c0c639)) * make MessageComposer middleware executors public ([9aae032](9aae032)) * message composer ([#1495](#1495)) ([0c07524](0c07524)), closes [stream-chat-react#2669](GetStream/stream-chat-react#2669) * middleware handler API improvement ([#1523](#1523)) ([9d8992d](9d8992d))
## [13.0.0](v12.15.0...v13.0.0) (2025-05-06) ### ⚠ BREAKING CHANGES * `Channel` props `dragAndDropWindow` & `optionalMessageInputProps` have been removed, use * Remove ChatAutoComplete, AutoCompleteTextarea, DefaultSuggestionList, DefaultSuggestionListItem and introduce TextareaComposer, SuggestionList, SuggestionListItem * Remove defaultScrollToItem function previously used by SuggestionList * Removed DefaultTriggerProvider component * Remove from Channel props - acceptedFiles, enrichURLForPreview, enrichURLForPreviewConfig, maxNumberOfFiles, multipleUploads, TriggerProvider * Removal of acceptedFiles, debounceURLEnrichmentMs, enrichURLForPreview, findURLFn, multipleUploads, onLinkPreviewDismissed, quotedMessage from ChannelStateContext * Changed signature for functions sendMessage and editMessage in ChannelActionContext * Changed signature for handleSubmit * Removed setQuotedMessage from ChannelActionContext * Removed types MessageToSend, StreamMessage, UpdatedMessage in favor of LocalMessage or RenderedMessage * Removed Trigger generics from ChannelProps * Message input state as well as the API is now kept within MessageComposer instead of MessageInputContext * Renamed useMessageInputState to useMessageInputControls as it does not handle the composition state anymore * Removed from MessageInputProps - disabled, disableMentions, doFileUploadRequest, doImageUploadRequest, errorHandler, getDefaultValue, mentionAllAppUsers, mentionQueryParams, message, noFiles, urlEnrichmentConfig, useMentionsTransliteration, additionalTextareaProps do not expect default value anymore * Changed the signature of MessageInput prop overrideSubmitHandler * Local attachment and link preview types moved to stream-chat * The SuggestionListItem UI components for TextareaComposer receive tokenizedDisplayName instead of itemNameParts * Removed duplicate types SendMessageOptions, UpdateMessageOptions which should be imported from stream-chat instead * Removed type LinkPreviewListProps - LinkPreviewList does not have any props anymore * dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types ### Bug Fixes * make consistent use of message composition related props ([#2695](#2695)) ([2b789e5](2b789e5)) * replace StreamChatGenerics with module augmentation ([#2634](#2634)) ([67bed79](67bed79)) ### Features * default data interfaces ([#2683](#2683)) ([a88e145](a88e145)) * message composer ([#2669](#2669)) ([fa2519b](fa2519b)), closes [#2688](#2688) * replace SuggestionItem prop with suggestionItemComponents prop for SuggestionList ([#2693](#2693)) ([985f5e3](985f5e3)) ### Chores * **deps:** upgrade stream-chat to v9.0.0 ([666be5e](666be5e))
|
🎉 This PR is included in version 13.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎯 Goal
Provide a message composition API supported by reactive state layer from stream-chat. The message composition logic has been moved to stream-chat. The logic kept in stream-chat-react is related only to the browser event handling.
Depends on:
🛠 Implementation details
The message composition now relies on
MessageComposerinstance. The instance is available for the channel message list, thread message list and for editing a specific message. TheMessageComposerinstance should be accessed viauseMessageComposerhook, that identifies the correct context (channel, thread, message).🎨 UI Changes
No changes
BREAKING CHANGE:
ChannelpropsdragAndDropWindow&optionalMessageInputPropshave been removed, useWithDragAndDropUploadcomponent instead (#2688)BREAKING CHANGE: Attachment identity functions moved to stream-chat-js (e.g. isFileAttachment...)
BREAKING CHANGE: Remove ChatAutoComplete, AutoCompleteTextarea, DefaultSuggestionList, DefaultSuggestionListItem and introduce TextareaComposer, SuggestionList, SuggestionListItem
BREAKING CHANGE: Remove defaultScrollToItem function previously used by SuggestionList
BREAKING CHANGE: Removed DefaultTriggerProvider component
BREAKING CHANGE: Remove from Channel props - acceptedFiles, enrichURLForPreview, enrichURLForPreviewConfig, maxNumberOfFiles, multipleUploads, TriggerProvider
BREAKING CHANGE: Removal of acceptedFiles, debounceURLEnrichmentMs, enrichURLForPreview, findURLFn, multipleUploads, onLinkPreviewDismissed, quotedMessage from ChannelStateContext
BREAKING CHANGE: Changed signature for functions sendMessage and editMessage in ChannelActionContext
BREAKING CHANGE: Changed signature for handleSubmit
BREAKING CHANGE: Removed setQuotedMessage from ChannelActionContext
BREAKING CHANGE: Removed types MessageToSend, StreamMessage, UpdatedMessage in favor of LocalMessage or RenderedMessage
BREAKING CHANGE: Removed Trigger generics from ChannelProps
BREAKING CHANGE: Message input state as well as the API is now kept within MessageComposer instead of MessageInputContext
BREAKING CHANGE: Renamed useMessageInputState to useMessageInputControls as it does not handle the composition state anymore
BREAKING CHANGE: Removed from MessageInputProps - disabled, disableMentions, doFileUploadRequest, doImageUploadRequest, errorHandler, getDefaultValue, mentionAllAppUsers, mentionQueryParams, message, noFiles, urlEnrichmentConfig, useMentionsTransliteration, additionalTextareaProps do not expect default value anymore
BREAKING CHANGE: Changed the signature of MessageInput prop overrideSubmitHandler
BREAKING CHANGE: Local attachment and link preview types moved to stream-chat
BREAKING CHANGE: The SuggestionListItem UI components for TextareaComposer receive tokenizedDisplayName instead of itemNameParts
BREAKING CHANGE: Removed duplicate types SendMessageOptions, UpdateMessageOptions which should be imported from stream-chat instead
BREAKING CHANGE: Removed type LinkPreviewListProps - LinkPreviewList does not have any props anymore