Commit 0c07524
feat: message composer (#1495)
This PR introduces a new message composer system that provides a robust
foundation for message composition with support for drafts, middleware,
and various composition features.
- Message draft support for channels
- Text composition middleware system
- Command handling with case-insensitive search
- Link preview integration
- Mentions search with local member support
- Notification management system
- Local message type for better state management
- Introduces `MessageComposer` class for managing message composition
- Adds middleware system for text composition with extensible pipeline
- Implements draft message handling with proper state management
- Adds support for commands with trigger-based activation
- Integrates link preview functionality during composition
- Provides notification management for composition events
- Introduces `LocalMessage` type for improved state handling
Introduction of `LocalMessage` type. The `MessageResponse` is
automatically transformed into LocalMessage type before being submitted
to the state.
- Added comprehensive test coverage for:
- Message composition middleware
- Command handling
- Link preview integration
- Mentions search
- State management
- Draft handling
- Bundle size increase: +72.3 kB (+24.62%)
- dist/cjs/index.browser.cjs: +19.4 kB
- dist/cjs/index.node.cjs: +20 kB
- dist/esm/index.js: +32.9 kB
- Convert message composer into a plugin system
- Further optimize bundle size
- Add more middleware options for extensibility
- Encapsulate interaction with the UI element representing the text
editing area
- Related to stream-chat-react#2669
- `linkifyjs@^4.2.0`
BREAKING CHANGE: Replacement of FormatMessageResponse with LocalMessage
type
---------
Co-authored-by: Anton Arnautov <[email protected]>
Co-authored-by: Khushal Agarwal <[email protected]>
Co-authored-by: Zita Szupera <[email protected]>
Co-authored-by: Ivan Sekovanikj <[email protected]>1 parent 16cd81a commit 0c07524
87 files changed
Lines changed: 16395 additions & 161 deletions
File tree
- src
- messageComposer
- configuration
- middleware
- messageComposer
- pollComposer
- textComposer
- notifications
- utils
- mergeWith
- test/unit
- MessageComposer
- middleware
- messageComposer
- pollComposer
- textComposer
- test-utils
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
150 | 157 | | |
151 | 158 | | |
152 | 159 | | |
| |||
421 | 428 | | |
422 | 429 | | |
423 | 430 | | |
424 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
425 | 434 | | |
426 | 435 | | |
427 | 436 | | |
| |||
950 | 959 | | |
951 | 960 | | |
952 | 961 | | |
953 | | - | |
| 962 | + | |
954 | 963 | | |
955 | 964 | | |
956 | 965 | | |
| |||
1176 | 1185 | | |
1177 | 1186 | | |
1178 | 1187 | | |
1179 | | - | |
| 1188 | + | |
1180 | 1189 | | |
1181 | 1190 | | |
1182 | 1191 | | |
| |||
1285 | 1294 | | |
1286 | 1295 | | |
1287 | 1296 | | |
1288 | | - | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
1289 | 1300 | | |
1290 | 1301 | | |
1291 | 1302 | | |
| |||
1342 | 1353 | | |
1343 | 1354 | | |
1344 | 1355 | | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
1345 | 1360 | | |
1346 | 1361 | | |
1347 | 1362 | | |
| |||
1898 | 1913 | | |
1899 | 1914 | | |
1900 | 1915 | | |
1901 | | - | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
1902 | 1919 | | |
1903 | 1920 | | |
1904 | 1921 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | | - | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
158 | | - | |
| 160 | + | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
| |||
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
183 | | - | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
| |||
365 | 367 | | |
366 | 368 | | |
367 | 369 | | |
368 | | - | |
| 370 | + | |
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
| |||
757 | 759 | | |
758 | 760 | | |
759 | 761 | | |
760 | | - | |
| 762 | + | |
761 | 763 | | |
762 | 764 | | |
763 | 765 | | |
764 | | - | |
765 | | - | |
| 766 | + | |
766 | 767 | | |
767 | 768 | | |
768 | 769 | | |
| |||
0 commit comments