Commit fa2519b
feat: message composer (#2669)
### 🎯 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:
- GetStream/stream-chat-js#1495
- GetStream/stream-chat-css#328
### 🛠 Implementation details
The message composition now relies on `MessageComposer `instance. The
instance is available for the channel message list, thread message list
and for editing a specific message. The `MessageComposer` instance
should be accessed via `useMessageComposer` hook, that identifies the
correct context (channel, thread, message).
### 🎨 UI Changes
No changes
BREAKING CHANGE: `Channel` props `dragAndDropWindow` &
`optionalMessageInputProps` have been removed, use
`WithDragAndDropUpload` component 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
---------
Co-authored-by: Anton Arnautov <arnautov.anton@gmail.com>1 parent a9cb4e0 commit fa2519b
File tree
177 files changed
+6660
-9806
lines changed- examples/vite
- src
- src
- components
- Attachment
- AutoCompleteTextarea
- ChannelPreview
- hooks
- Channel
- __tests__
- hooks
- ChatAutoComplete
- __tests__
- CommandItem
- Dialog
- EmoticonItem
- EventComponent
- MediaRecorder
- AudioRecorder
- __tests__
- hooks
- classes
- hooks
- __tests__
- MessageActions
- __tests__
- MessageInput
- AttachmentPreviewList
- __tests__
- __snapshots__
- hooks
- __tests__
- MessageList
- __tests__
- hooks
- MessageList
- VirtualizedMessageList
- Message
- __tests__
- hooks
- Poll
- PollCreationDialog
- __tests__
- ReactFileUtilities
- TextareaComposer
- SuggestionList
- __tests__
- Threads
- ThreadList
- Thread
- __tests__
- UserItem
- __tests__
- Window
- context
- experimental/MessageActions
- i18n
- mock-builders
- api
- event
- generator
- plugins/Emojis
- middleware
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
177 files changed
+6660
-9806
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
2 | 9 | | |
3 | 10 | | |
4 | 11 | | |
| |||
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
11 | | - | |
| 18 | + | |
12 | 19 | | |
13 | 20 | | |
14 | 21 | | |
| 22 | + | |
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
18 | 31 | | |
19 | 32 | | |
20 | 33 | | |
| |||
40 | 53 | | |
41 | 54 | | |
42 | 55 | | |
43 | | - | |
| 56 | + | |
| 57 | + | |
44 | 58 | | |
45 | 59 | | |
46 | 60 | | |
| |||
49 | 63 | | |
50 | 64 | | |
51 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
52 | 80 | | |
53 | 81 | | |
54 | 82 | | |
| |||
64 | 92 | | |
65 | 93 | | |
66 | 94 | | |
67 | | - | |
| 95 | + | |
68 | 96 | | |
69 | 97 | | |
70 | 98 | | |
71 | 99 | | |
72 | | - | |
| 100 | + | |
73 | 101 | | |
74 | 102 | | |
75 | 103 | | |
| |||
0 commit comments