stream-chat-react-native-core 6.0.0-rc.8 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (571) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/components/AITypingIndicatorView/AITypingIndicatorView.js +53 -0
  3. package/lib/commonjs/components/AITypingIndicatorView/AITypingIndicatorView.js.map +1 -0
  4. package/lib/commonjs/components/AITypingIndicatorView/hooks/useAIState.js +59 -0
  5. package/lib/commonjs/components/AITypingIndicatorView/hooks/useAIState.js.map +1 -0
  6. package/lib/commonjs/components/AITypingIndicatorView/index.js +26 -0
  7. package/lib/commonjs/components/AITypingIndicatorView/index.js.map +1 -0
  8. package/lib/commonjs/components/Attachment/AudioAttachment.js +27 -22
  9. package/lib/commonjs/components/Attachment/AudioAttachment.js.map +1 -1
  10. package/lib/commonjs/components/Attachment/Gallery.js +3 -1
  11. package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
  12. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +2 -2
  13. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  14. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js +37 -133
  15. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
  16. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerSelectionBar.js +6 -4
  17. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerSelectionBar.js.map +1 -1
  18. package/lib/commonjs/components/Channel/Channel.js +483 -1056
  19. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  20. package/lib/commonjs/components/Channel/hooks/useChannelDataState.js +174 -0
  21. package/lib/commonjs/components/Channel/hooks/useChannelDataState.js.map +1 -0
  22. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +0 -6
  23. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  24. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -0
  25. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  26. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +4 -0
  27. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  28. package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js +3 -3
  29. package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
  30. package/lib/commonjs/components/Channel/hooks/useMessageListPagination.js +324 -0
  31. package/lib/commonjs/components/Channel/hooks/useMessageListPagination.js.map +1 -0
  32. package/lib/commonjs/components/ChannelList/Skeleton.js +7 -3
  33. package/lib/commonjs/components/ChannelList/Skeleton.js.map +1 -1
  34. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +85 -45
  35. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  36. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +17 -91
  37. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
  38. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +3 -24
  39. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
  40. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +2 -2
  41. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -1
  42. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewData.js +121 -0
  43. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewData.js.map +1 -0
  44. package/lib/commonjs/components/ChannelPreview/hooks/useIsChannelMuted.js +35 -0
  45. package/lib/commonjs/components/ChannelPreview/hooks/useIsChannelMuted.js.map +1 -0
  46. package/lib/commonjs/components/Chat/Chat.js +5 -1
  47. package/lib/commonjs/components/Chat/Chat.js.map +1 -1
  48. package/lib/commonjs/components/Chat/hooks/useAppSettings.js +15 -9
  49. package/lib/commonjs/components/Chat/hooks/useAppSettings.js.map +1 -1
  50. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +2 -0
  51. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  52. package/lib/commonjs/components/Chat/hooks/useIsOnline.js +0 -4
  53. package/lib/commonjs/components/Chat/hooks/useIsOnline.js.map +1 -1
  54. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  55. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +46 -46
  56. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  57. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +3 -4
  58. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  59. package/lib/commonjs/components/ImageGallery/hooks/useAnimatedGalleryStyle.js +2 -2
  60. package/lib/commonjs/components/ImageGallery/hooks/useAnimatedGalleryStyle.js.map +1 -1
  61. package/lib/commonjs/components/Message/Message.js +7 -0
  62. package/lib/commonjs/components/Message/Message.js.map +1 -1
  63. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +17 -4
  64. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
  65. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +15 -6
  66. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
  67. package/lib/commonjs/components/Message/MessageSimple/StreamingMessageView.js +36 -0
  68. package/lib/commonjs/components/Message/MessageSimple/StreamingMessageView.js.map +1 -0
  69. package/lib/commonjs/components/Message/MessageSimple/utils/generateMarkdownText.js +9 -1
  70. package/lib/commonjs/components/Message/MessageSimple/utils/generateMarkdownText.js.map +1 -1
  71. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +209 -23
  72. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  73. package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js +2 -0
  74. package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js.map +1 -1
  75. package/lib/commonjs/components/Message/hooks/useStreamingMessage.js +43 -0
  76. package/lib/commonjs/components/Message/hooks/useStreamingMessage.js.map +1 -0
  77. package/lib/commonjs/components/MessageInput/MessageInput.js +41 -21
  78. package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
  79. package/lib/commonjs/components/MessageInput/StopMessageStreamingButton.js +39 -0
  80. package/lib/commonjs/components/MessageInput/StopMessageStreamingButton.js.map +1 -0
  81. package/lib/commonjs/components/MessageList/MessageList.js +74 -73
  82. package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
  83. package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +1 -1
  84. package/lib/commonjs/components/MessageList/ScrollToBottomButton.js.map +1 -1
  85. package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
  86. package/lib/commonjs/components/MessageList/utils/getReadStates.js.map +1 -1
  87. package/lib/commonjs/components/MessageMenu/MessageUserReactions.js +1 -1
  88. package/lib/commonjs/components/MessageMenu/MessageUserReactions.js.map +1 -1
  89. package/lib/commonjs/components/MessageMenu/MessageUserReactionsItem.js +4 -2
  90. package/lib/commonjs/components/MessageMenu/MessageUserReactionsItem.js.map +1 -1
  91. package/lib/commonjs/components/MessageMenu/hooks/useFetchReactions.js +3 -2
  92. package/lib/commonjs/components/MessageMenu/hooks/useFetchReactions.js.map +1 -1
  93. package/lib/commonjs/components/Poll/CreatePollContent.js +14 -9
  94. package/lib/commonjs/components/Poll/CreatePollContent.js.map +1 -1
  95. package/lib/commonjs/components/Poll/Poll.js +2 -8
  96. package/lib/commonjs/components/Poll/Poll.js.map +1 -1
  97. package/lib/commonjs/components/Poll/components/Button.js +9 -474
  98. package/lib/commonjs/components/Poll/components/Button.js.map +1 -1
  99. package/lib/commonjs/components/Poll/components/CreatePollIcon.js +2 -2
  100. package/lib/commonjs/components/Poll/components/CreatePollIcon.js.map +1 -1
  101. package/lib/commonjs/components/Poll/components/CreatePollOptions.js +9 -4
  102. package/lib/commonjs/components/Poll/components/CreatePollOptions.js.map +1 -1
  103. package/lib/commonjs/components/Poll/components/PollAnswersList.js +99 -26
  104. package/lib/commonjs/components/Poll/components/PollAnswersList.js.map +1 -1
  105. package/lib/commonjs/components/Poll/components/PollButtons.js +291 -0
  106. package/lib/commonjs/components/Poll/components/PollButtons.js.map +1 -0
  107. package/lib/commonjs/components/Poll/components/PollInputDialog.js +14 -4
  108. package/lib/commonjs/components/Poll/components/PollInputDialog.js.map +1 -1
  109. package/lib/commonjs/components/Poll/components/PollModalHeader.js +7 -1
  110. package/lib/commonjs/components/Poll/components/PollModalHeader.js.map +1 -1
  111. package/lib/commonjs/components/Poll/components/PollOption.js +88 -6
  112. package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
  113. package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js +2 -2
  114. package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
  115. package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js +62 -67
  116. package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
  117. package/lib/commonjs/components/Poll/components/PollResults/PollVote.js +89 -0
  118. package/lib/commonjs/components/Poll/components/PollResults/PollVote.js.map +1 -0
  119. package/lib/commonjs/components/Poll/components/index.js +11 -0
  120. package/lib/commonjs/components/Poll/components/index.js.map +1 -1
  121. package/lib/commonjs/components/ThreadList/ThreadList.js +0 -3
  122. package/lib/commonjs/components/ThreadList/ThreadList.js.map +1 -1
  123. package/lib/commonjs/components/UIComponents/BottomSheetModal.js +11 -5
  124. package/lib/commonjs/components/UIComponents/BottomSheetModal.js.map +1 -1
  125. package/lib/commonjs/components/index.js +66 -0
  126. package/lib/commonjs/components/index.js.map +1 -1
  127. package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
  128. package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +0 -35
  129. package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
  130. package/lib/commonjs/contexts/channelsStateContext/useChannelState.js +7 -84
  131. package/lib/commonjs/contexts/channelsStateContext/useChannelState.js.map +1 -1
  132. package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
  133. package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
  134. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +4 -2
  135. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  136. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -0
  137. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  138. package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
  139. package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
  140. package/lib/commonjs/contexts/themeContext/utils/theme.js +15 -0
  141. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  142. package/lib/commonjs/i18n/en.json +2 -0
  143. package/lib/commonjs/i18n/es.json +2 -0
  144. package/lib/commonjs/i18n/fr.json +2 -0
  145. package/lib/commonjs/i18n/he.json +2 -0
  146. package/lib/commonjs/i18n/hi.json +2 -0
  147. package/lib/commonjs/i18n/it.json +2 -0
  148. package/lib/commonjs/i18n/ja.json +2 -0
  149. package/lib/commonjs/i18n/ko.json +2 -0
  150. package/lib/commonjs/i18n/nl.json +2 -0
  151. package/lib/commonjs/i18n/pt-br.json +2 -0
  152. package/lib/commonjs/i18n/ru.json +2 -0
  153. package/lib/commonjs/i18n/tr.json +2 -0
  154. package/lib/commonjs/mock-builders/event/notificationChannelMutesUpdated.js +14 -0
  155. package/lib/commonjs/mock-builders/event/notificationChannelMutesUpdated.js.map +1 -0
  156. package/lib/commonjs/mock-builders/event/notificationMarkRead.js +14 -0
  157. package/lib/commonjs/mock-builders/event/notificationMarkRead.js.map +1 -0
  158. package/lib/commonjs/mock-builders/event/notificationMarkUnread.js +17 -0
  159. package/lib/commonjs/mock-builders/event/notificationMarkUnread.js.map +1 -0
  160. package/lib/commonjs/mock-builders/generator/channel.js +1 -0
  161. package/lib/commonjs/mock-builders/generator/channel.js.map +1 -1
  162. package/lib/commonjs/store/SqliteClient.js +11 -2
  163. package/lib/commonjs/store/SqliteClient.js.map +1 -1
  164. package/lib/commonjs/utils/getTrimmedAttachmentTitle.js +8 -2
  165. package/lib/commonjs/utils/getTrimmedAttachmentTitle.js.map +1 -1
  166. package/lib/commonjs/utils/utils.js +3 -2
  167. package/lib/commonjs/utils/utils.js.map +1 -1
  168. package/lib/commonjs/version.json +1 -1
  169. package/lib/module/components/AITypingIndicatorView/AITypingIndicatorView.js +53 -0
  170. package/lib/module/components/AITypingIndicatorView/AITypingIndicatorView.js.map +1 -0
  171. package/lib/module/components/AITypingIndicatorView/hooks/useAIState.js +59 -0
  172. package/lib/module/components/AITypingIndicatorView/hooks/useAIState.js.map +1 -0
  173. package/lib/module/components/AITypingIndicatorView/index.js +26 -0
  174. package/lib/module/components/AITypingIndicatorView/index.js.map +1 -0
  175. package/lib/module/components/Attachment/AudioAttachment.js +27 -22
  176. package/lib/module/components/Attachment/AudioAttachment.js.map +1 -1
  177. package/lib/module/components/Attachment/Gallery.js +3 -1
  178. package/lib/module/components/Attachment/Gallery.js.map +1 -1
  179. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +2 -2
  180. package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  181. package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js +37 -133
  182. package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
  183. package/lib/module/components/AttachmentPicker/components/AttachmentPickerSelectionBar.js +6 -4
  184. package/lib/module/components/AttachmentPicker/components/AttachmentPickerSelectionBar.js.map +1 -1
  185. package/lib/module/components/Channel/Channel.js +483 -1056
  186. package/lib/module/components/Channel/Channel.js.map +1 -1
  187. package/lib/module/components/Channel/hooks/useChannelDataState.js +174 -0
  188. package/lib/module/components/Channel/hooks/useChannelDataState.js.map +1 -0
  189. package/lib/module/components/Channel/hooks/useCreateChannelContext.js +0 -6
  190. package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  191. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -0
  192. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  193. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +4 -0
  194. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  195. package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js +3 -3
  196. package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
  197. package/lib/module/components/Channel/hooks/useMessageListPagination.js +324 -0
  198. package/lib/module/components/Channel/hooks/useMessageListPagination.js.map +1 -0
  199. package/lib/module/components/ChannelList/Skeleton.js +7 -3
  200. package/lib/module/components/ChannelList/Skeleton.js.map +1 -1
  201. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +85 -45
  202. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  203. package/lib/module/components/ChannelPreview/ChannelPreview.js +17 -91
  204. package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
  205. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +3 -24
  206. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
  207. package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +2 -2
  208. package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -1
  209. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewData.js +121 -0
  210. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewData.js.map +1 -0
  211. package/lib/module/components/ChannelPreview/hooks/useIsChannelMuted.js +35 -0
  212. package/lib/module/components/ChannelPreview/hooks/useIsChannelMuted.js.map +1 -0
  213. package/lib/module/components/Chat/Chat.js +5 -1
  214. package/lib/module/components/Chat/Chat.js.map +1 -1
  215. package/lib/module/components/Chat/hooks/useAppSettings.js +15 -9
  216. package/lib/module/components/Chat/hooks/useAppSettings.js.map +1 -1
  217. package/lib/module/components/Chat/hooks/useCreateChatContext.js +2 -0
  218. package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  219. package/lib/module/components/Chat/hooks/useIsOnline.js +0 -4
  220. package/lib/module/components/Chat/hooks/useIsOnline.js.map +1 -1
  221. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  222. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +46 -46
  223. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  224. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +3 -4
  225. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  226. package/lib/module/components/ImageGallery/hooks/useAnimatedGalleryStyle.js +2 -2
  227. package/lib/module/components/ImageGallery/hooks/useAnimatedGalleryStyle.js.map +1 -1
  228. package/lib/module/components/Message/Message.js +7 -0
  229. package/lib/module/components/Message/Message.js.map +1 -1
  230. package/lib/module/components/Message/MessageSimple/MessageContent.js +17 -4
  231. package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
  232. package/lib/module/components/Message/MessageSimple/MessageFooter.js +15 -6
  233. package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
  234. package/lib/module/components/Message/MessageSimple/StreamingMessageView.js +36 -0
  235. package/lib/module/components/Message/MessageSimple/StreamingMessageView.js.map +1 -0
  236. package/lib/module/components/Message/MessageSimple/utils/generateMarkdownText.js +9 -1
  237. package/lib/module/components/Message/MessageSimple/utils/generateMarkdownText.js.map +1 -1
  238. package/lib/module/components/Message/MessageSimple/utils/renderText.js +209 -23
  239. package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  240. package/lib/module/components/Message/hooks/useCreateMessageContext.js +2 -0
  241. package/lib/module/components/Message/hooks/useCreateMessageContext.js.map +1 -1
  242. package/lib/module/components/Message/hooks/useStreamingMessage.js +43 -0
  243. package/lib/module/components/Message/hooks/useStreamingMessage.js.map +1 -0
  244. package/lib/module/components/MessageInput/MessageInput.js +41 -21
  245. package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
  246. package/lib/module/components/MessageInput/StopMessageStreamingButton.js +39 -0
  247. package/lib/module/components/MessageInput/StopMessageStreamingButton.js.map +1 -0
  248. package/lib/module/components/MessageList/MessageList.js +74 -73
  249. package/lib/module/components/MessageList/MessageList.js.map +1 -1
  250. package/lib/module/components/MessageList/ScrollToBottomButton.js +1 -1
  251. package/lib/module/components/MessageList/ScrollToBottomButton.js.map +1 -1
  252. package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
  253. package/lib/module/components/MessageList/utils/getReadStates.js.map +1 -1
  254. package/lib/module/components/MessageMenu/MessageUserReactions.js +1 -1
  255. package/lib/module/components/MessageMenu/MessageUserReactions.js.map +1 -1
  256. package/lib/module/components/MessageMenu/MessageUserReactionsItem.js +4 -2
  257. package/lib/module/components/MessageMenu/MessageUserReactionsItem.js.map +1 -1
  258. package/lib/module/components/MessageMenu/hooks/useFetchReactions.js +3 -2
  259. package/lib/module/components/MessageMenu/hooks/useFetchReactions.js.map +1 -1
  260. package/lib/module/components/Poll/CreatePollContent.js +14 -9
  261. package/lib/module/components/Poll/CreatePollContent.js.map +1 -1
  262. package/lib/module/components/Poll/Poll.js +2 -8
  263. package/lib/module/components/Poll/Poll.js.map +1 -1
  264. package/lib/module/components/Poll/components/Button.js +9 -474
  265. package/lib/module/components/Poll/components/Button.js.map +1 -1
  266. package/lib/module/components/Poll/components/CreatePollIcon.js +2 -2
  267. package/lib/module/components/Poll/components/CreatePollIcon.js.map +1 -1
  268. package/lib/module/components/Poll/components/CreatePollOptions.js +9 -4
  269. package/lib/module/components/Poll/components/CreatePollOptions.js.map +1 -1
  270. package/lib/module/components/Poll/components/PollAnswersList.js +99 -26
  271. package/lib/module/components/Poll/components/PollAnswersList.js.map +1 -1
  272. package/lib/module/components/Poll/components/PollButtons.js +291 -0
  273. package/lib/module/components/Poll/components/PollButtons.js.map +1 -0
  274. package/lib/module/components/Poll/components/PollInputDialog.js +14 -4
  275. package/lib/module/components/Poll/components/PollInputDialog.js.map +1 -1
  276. package/lib/module/components/Poll/components/PollModalHeader.js +7 -1
  277. package/lib/module/components/Poll/components/PollModalHeader.js.map +1 -1
  278. package/lib/module/components/Poll/components/PollOption.js +88 -6
  279. package/lib/module/components/Poll/components/PollOption.js.map +1 -1
  280. package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js +2 -2
  281. package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
  282. package/lib/module/components/Poll/components/PollResults/PollResultItem.js +62 -67
  283. package/lib/module/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
  284. package/lib/module/components/Poll/components/PollResults/PollVote.js +89 -0
  285. package/lib/module/components/Poll/components/PollResults/PollVote.js.map +1 -0
  286. package/lib/module/components/Poll/components/index.js +11 -0
  287. package/lib/module/components/Poll/components/index.js.map +1 -1
  288. package/lib/module/components/ThreadList/ThreadList.js +0 -3
  289. package/lib/module/components/ThreadList/ThreadList.js.map +1 -1
  290. package/lib/module/components/UIComponents/BottomSheetModal.js +11 -5
  291. package/lib/module/components/UIComponents/BottomSheetModal.js.map +1 -1
  292. package/lib/module/components/index.js +66 -0
  293. package/lib/module/components/index.js.map +1 -1
  294. package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
  295. package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +0 -35
  296. package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
  297. package/lib/module/contexts/channelsStateContext/useChannelState.js +7 -84
  298. package/lib/module/contexts/channelsStateContext/useChannelState.js.map +1 -1
  299. package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
  300. package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
  301. package/lib/module/contexts/messageInputContext/MessageInputContext.js +4 -2
  302. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  303. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -0
  304. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  305. package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
  306. package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
  307. package/lib/module/contexts/themeContext/utils/theme.js +15 -0
  308. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  309. package/lib/module/i18n/en.json +2 -0
  310. package/lib/module/i18n/es.json +2 -0
  311. package/lib/module/i18n/fr.json +2 -0
  312. package/lib/module/i18n/he.json +2 -0
  313. package/lib/module/i18n/hi.json +2 -0
  314. package/lib/module/i18n/it.json +2 -0
  315. package/lib/module/i18n/ja.json +2 -0
  316. package/lib/module/i18n/ko.json +2 -0
  317. package/lib/module/i18n/nl.json +2 -0
  318. package/lib/module/i18n/pt-br.json +2 -0
  319. package/lib/module/i18n/ru.json +2 -0
  320. package/lib/module/i18n/tr.json +2 -0
  321. package/lib/module/mock-builders/event/notificationChannelMutesUpdated.js +14 -0
  322. package/lib/module/mock-builders/event/notificationChannelMutesUpdated.js.map +1 -0
  323. package/lib/module/mock-builders/event/notificationMarkRead.js +14 -0
  324. package/lib/module/mock-builders/event/notificationMarkRead.js.map +1 -0
  325. package/lib/module/mock-builders/event/notificationMarkUnread.js +17 -0
  326. package/lib/module/mock-builders/event/notificationMarkUnread.js.map +1 -0
  327. package/lib/module/mock-builders/generator/channel.js +1 -0
  328. package/lib/module/mock-builders/generator/channel.js.map +1 -1
  329. package/lib/module/store/SqliteClient.js +11 -2
  330. package/lib/module/store/SqliteClient.js.map +1 -1
  331. package/lib/module/utils/getTrimmedAttachmentTitle.js +8 -2
  332. package/lib/module/utils/getTrimmedAttachmentTitle.js.map +1 -1
  333. package/lib/module/utils/utils.js +3 -2
  334. package/lib/module/utils/utils.js.map +1 -1
  335. package/lib/module/version.json +1 -1
  336. package/lib/typescript/components/AITypingIndicatorView/AITypingIndicatorView.d.ts +11 -0
  337. package/lib/typescript/components/AITypingIndicatorView/AITypingIndicatorView.d.ts.map +1 -0
  338. package/lib/typescript/components/AITypingIndicatorView/hooks/useAIState.d.ts +18 -0
  339. package/lib/typescript/components/AITypingIndicatorView/hooks/useAIState.d.ts.map +1 -0
  340. package/lib/typescript/components/AITypingIndicatorView/index.d.ts +3 -0
  341. package/lib/typescript/components/AITypingIndicatorView/index.d.ts.map +1 -0
  342. package/lib/typescript/components/Attachment/AudioAttachment.d.ts.map +1 -1
  343. package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts.map +1 -1
  344. package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerItem.d.ts.map +1 -1
  345. package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerSelectionBar.d.ts.map +1 -1
  346. package/lib/typescript/components/Channel/Channel.d.ts +7 -6
  347. package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
  348. package/lib/typescript/components/Channel/hooks/useChannelDataState.d.ts +75 -0
  349. package/lib/typescript/components/Channel/hooks/useChannelDataState.d.ts.map +1 -0
  350. package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
  351. package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts.map +1 -1
  352. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +1 -1
  353. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts.map +1 -1
  354. package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +128 -1
  355. package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts.map +1 -1
  356. package/lib/typescript/components/Channel/hooks/useCreatePaginatedMessageListContext.d.ts +1 -1
  357. package/lib/typescript/components/Channel/hooks/useCreatePaginatedMessageListContext.d.ts.map +1 -1
  358. package/lib/typescript/components/Channel/hooks/useMessageListPagination.d.ts +28 -0
  359. package/lib/typescript/components/Channel/hooks/useMessageListPagination.d.ts.map +1 -0
  360. package/lib/typescript/components/ChannelList/Skeleton.d.ts.map +1 -1
  361. package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts.map +1 -1
  362. package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts +1 -2
  363. package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts.map +1 -1
  364. package/lib/typescript/components/ChannelPreview/ChannelPreviewMessenger.d.ts +2 -0
  365. package/lib/typescript/components/ChannelPreview/ChannelPreviewMessenger.d.ts.map +1 -1
  366. package/lib/typescript/components/ChannelPreview/ChannelPreviewMutedStatus.d.ts.map +1 -1
  367. package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewData.d.ts +8 -0
  368. package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewData.d.ts.map +1 -0
  369. package/lib/typescript/components/ChannelPreview/hooks/useIsChannelMuted.d.ts +8 -0
  370. package/lib/typescript/components/ChannelPreview/hooks/useIsChannelMuted.d.ts.map +1 -0
  371. package/lib/typescript/components/Chat/Chat.d.ts +7 -1
  372. package/lib/typescript/components/Chat/Chat.d.ts.map +1 -1
  373. package/lib/typescript/components/Chat/hooks/useAppSettings.d.ts.map +1 -1
  374. package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
  375. package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts.map +1 -1
  376. package/lib/typescript/components/Chat/hooks/useIsOnline.d.ts.map +1 -1
  377. package/lib/typescript/components/ImageGallery/ImageGallery.d.ts.map +1 -1
  378. package/lib/typescript/components/Message/Message.d.ts +1 -1
  379. package/lib/typescript/components/Message/Message.d.ts.map +1 -1
  380. package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts +1 -1
  381. package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts.map +1 -1
  382. package/lib/typescript/components/Message/MessageSimple/MessageFooter.d.ts.map +1 -1
  383. package/lib/typescript/components/Message/MessageSimple/StreamingMessageView.d.ts +12 -0
  384. package/lib/typescript/components/Message/MessageSimple/StreamingMessageView.d.ts.map +1 -0
  385. package/lib/typescript/components/Message/MessageSimple/utils/generateMarkdownText.d.ts.map +1 -1
  386. package/lib/typescript/components/Message/MessageSimple/utils/renderText.d.ts +16 -1
  387. package/lib/typescript/components/Message/MessageSimple/utils/renderText.d.ts.map +1 -1
  388. package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts +1 -1
  389. package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts.map +1 -1
  390. package/lib/typescript/components/Message/hooks/useStreamingMessage.d.ts +17 -0
  391. package/lib/typescript/components/Message/hooks/useStreamingMessage.d.ts.map +1 -0
  392. package/lib/typescript/components/MessageInput/MessageInput.d.ts +1 -1
  393. package/lib/typescript/components/MessageInput/MessageInput.d.ts.map +1 -1
  394. package/lib/typescript/components/MessageInput/StopMessageStreamingButton.d.ts +10 -0
  395. package/lib/typescript/components/MessageInput/StopMessageStreamingButton.d.ts.map +1 -0
  396. package/lib/typescript/components/MessageList/MessageList.d.ts +1 -1
  397. package/lib/typescript/components/MessageList/MessageList.d.ts.map +1 -1
  398. package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts.map +1 -1
  399. package/lib/typescript/components/MessageList/utils/getReadStates.d.ts +1 -1
  400. package/lib/typescript/components/MessageList/utils/getReadStates.d.ts.map +1 -1
  401. package/lib/typescript/components/MessageMenu/MessageUserReactionsItem.d.ts.map +1 -1
  402. package/lib/typescript/components/MessageMenu/hooks/useFetchReactions.d.ts +3 -2
  403. package/lib/typescript/components/MessageMenu/hooks/useFetchReactions.d.ts.map +1 -1
  404. package/lib/typescript/components/Poll/Poll.d.ts +0 -1
  405. package/lib/typescript/components/Poll/Poll.d.ts.map +1 -1
  406. package/lib/typescript/components/Poll/components/Button.d.ts +0 -17
  407. package/lib/typescript/components/Poll/components/Button.d.ts.map +1 -1
  408. package/lib/typescript/components/Poll/components/CreatePollOptions.d.ts.map +1 -1
  409. package/lib/typescript/components/Poll/components/PollAnswersList.d.ts +2 -0
  410. package/lib/typescript/components/Poll/components/PollAnswersList.d.ts.map +1 -1
  411. package/lib/typescript/components/Poll/components/PollButtons.d.ts +10 -0
  412. package/lib/typescript/components/Poll/components/PollButtons.d.ts.map +1 -0
  413. package/lib/typescript/components/Poll/components/PollInputDialog.d.ts.map +1 -1
  414. package/lib/typescript/components/Poll/components/PollOption.d.ts +2 -0
  415. package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
  416. package/lib/typescript/components/Poll/components/PollResults/PollResultItem.d.ts +11 -4
  417. package/lib/typescript/components/Poll/components/PollResults/PollResultItem.d.ts.map +1 -1
  418. package/lib/typescript/components/Poll/components/PollResults/PollVote.d.ts +6 -0
  419. package/lib/typescript/components/Poll/components/PollResults/PollVote.d.ts.map +1 -0
  420. package/lib/typescript/components/Poll/components/index.d.ts +1 -0
  421. package/lib/typescript/components/Poll/components/index.d.ts.map +1 -1
  422. package/lib/typescript/components/ThreadList/ThreadList.d.ts.map +1 -1
  423. package/lib/typescript/components/UIComponents/BottomSheetModal.d.ts.map +1 -1
  424. package/lib/typescript/components/index.d.ts +6 -0
  425. package/lib/typescript/components/index.d.ts.map +1 -1
  426. package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +27 -37
  427. package/lib/typescript/contexts/channelContext/ChannelContext.d.ts.map +1 -1
  428. package/lib/typescript/contexts/channelsStateContext/ChannelsStateContext.d.ts +0 -16
  429. package/lib/typescript/contexts/channelsStateContext/ChannelsStateContext.d.ts.map +1 -1
  430. package/lib/typescript/contexts/channelsStateContext/useChannelState.d.ts +7 -13
  431. package/lib/typescript/contexts/channelsStateContext/useChannelState.d.ts.map +1 -1
  432. package/lib/typescript/contexts/chatContext/ChatContext.d.ts +2 -1
  433. package/lib/typescript/contexts/chatContext/ChatContext.d.ts.map +1 -1
  434. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +4 -0
  435. package/lib/typescript/contexts/messageContext/MessageContext.d.ts.map +1 -1
  436. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +2 -1
  437. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
  438. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
  439. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts.map +1 -1
  440. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +8 -4
  441. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts.map +1 -1
  442. package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts +17 -16
  443. package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts.map +1 -1
  444. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +16 -1
  445. package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
  446. package/lib/typescript/i18n/en.json +2 -0
  447. package/lib/typescript/i18n/es.json +2 -0
  448. package/lib/typescript/i18n/fr.json +2 -0
  449. package/lib/typescript/i18n/he.json +2 -0
  450. package/lib/typescript/i18n/hi.json +2 -0
  451. package/lib/typescript/i18n/it.json +2 -0
  452. package/lib/typescript/i18n/ja.json +2 -0
  453. package/lib/typescript/i18n/ko.json +2 -0
  454. package/lib/typescript/i18n/nl.json +2 -0
  455. package/lib/typescript/i18n/pt-br.json +2 -0
  456. package/lib/typescript/i18n/ru.json +2 -0
  457. package/lib/typescript/i18n/tr.json +2 -0
  458. package/lib/typescript/store/SqliteClient.d.ts.map +1 -1
  459. package/lib/typescript/types/types.d.ts +3 -0
  460. package/lib/typescript/types/types.d.ts.map +1 -1
  461. package/lib/typescript/utils/getTrimmedAttachmentTitle.d.ts.map +1 -1
  462. package/lib/typescript/utils/i18n/Streami18n.d.ts +2 -0
  463. package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
  464. package/lib/typescript/utils/utils.d.ts.map +1 -1
  465. package/package.json +5 -5
  466. package/src/components/AITypingIndicatorView/AITypingIndicatorView.tsx +50 -0
  467. package/src/components/AITypingIndicatorView/hooks/useAIState.ts +68 -0
  468. package/src/components/AITypingIndicatorView/index.ts +2 -0
  469. package/src/components/Attachment/AudioAttachment.tsx +20 -19
  470. package/src/components/Attachment/Gallery.tsx +1 -1
  471. package/src/components/AttachmentPicker/AttachmentPicker.tsx +7 -2
  472. package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +16 -32
  473. package/src/components/AttachmentPicker/components/AttachmentPickerSelectionBar.tsx +3 -5
  474. package/src/components/Channel/Channel.tsx +262 -835
  475. package/src/components/Channel/__tests__/Channel.test.js +244 -13
  476. package/src/components/Channel/__tests__/useMessageListPagination.test.js +419 -0
  477. package/src/components/Channel/hooks/useChannelDataState.ts +235 -0
  478. package/src/components/Channel/hooks/useCreateChannelContext.ts +0 -6
  479. package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +2 -0
  480. package/src/components/Channel/hooks/useCreateMessagesContext.ts +4 -0
  481. package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts +3 -10
  482. package/src/components/Channel/hooks/useMessageListPagination.tsx +246 -0
  483. package/src/components/ChannelList/Skeleton.tsx +9 -1
  484. package/src/components/ChannelList/hooks/usePaginatedChannels.ts +37 -30
  485. package/src/components/ChannelPreview/ChannelPreview.tsx +28 -107
  486. package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +5 -15
  487. package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx +2 -7
  488. package/src/components/ChannelPreview/__tests__/ChannelPreview.test.tsx +226 -10
  489. package/src/components/ChannelPreview/hooks/__tests__/useChannelPreviewDisplayName.test.tsx +1 -1
  490. package/src/components/ChannelPreview/hooks/__tests__/useChannelPreviewMuted.test.tsx +62 -0
  491. package/src/components/ChannelPreview/hooks/useChannelPreviewData.ts +138 -0
  492. package/src/components/ChannelPreview/hooks/useIsChannelMuted.ts +29 -0
  493. package/src/components/Chat/Chat.tsx +11 -2
  494. package/src/components/Chat/hooks/__tests__/useAppSettings.test.tsx +1 -0
  495. package/src/components/Chat/hooks/useAppSettings.ts +2 -0
  496. package/src/components/Chat/hooks/useCreateChatContext.ts +2 -0
  497. package/src/components/Chat/hooks/useIsOnline.ts +0 -5
  498. package/src/components/ImageGallery/ImageGallery.tsx +1 -0
  499. package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +32 -32
  500. package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +5 -6
  501. package/src/components/ImageGallery/hooks/useAnimatedGalleryStyle.tsx +2 -2
  502. package/src/components/Message/Message.tsx +16 -2
  503. package/src/components/Message/MessageSimple/MessageContent.tsx +22 -2
  504. package/src/components/Message/MessageSimple/MessageFooter.tsx +16 -5
  505. package/src/components/Message/MessageSimple/StreamingMessageView.tsx +34 -0
  506. package/src/components/Message/MessageSimple/utils/generateMarkdownText.ts +15 -1
  507. package/src/components/Message/MessageSimple/utils/renderText.tsx +207 -3
  508. package/src/components/Message/hooks/useCreateMessageContext.ts +2 -0
  509. package/src/components/Message/hooks/useStreamingMessage.ts +54 -0
  510. package/src/components/MessageInput/MessageInput.tsx +38 -20
  511. package/src/components/MessageInput/StopMessageStreamingButton.tsx +34 -0
  512. package/src/components/MessageInput/__tests__/MessageInput.test.js +116 -2
  513. package/src/components/MessageList/MessageList.tsx +53 -85
  514. package/src/components/MessageList/ScrollToBottomButton.tsx +1 -1
  515. package/src/components/MessageList/__tests__/MessageList.test.js +174 -2
  516. package/src/components/MessageList/__tests__/ScrollToBottomButton.test.js +3 -3
  517. package/src/components/MessageList/__tests__/__snapshots__/ScrollToBottomButton.test.js.snap +1 -1
  518. package/src/components/MessageList/hooks/useMessageList.ts +2 -5
  519. package/src/components/MessageList/utils/getReadStates.ts +3 -2
  520. package/src/components/MessageMenu/MessageUserReactions.tsx +1 -1
  521. package/src/components/MessageMenu/MessageUserReactionsItem.tsx +4 -2
  522. package/src/components/MessageMenu/hooks/useFetchReactions.ts +6 -3
  523. package/src/components/Poll/CreatePollContent.tsx +4 -4
  524. package/src/components/Poll/Poll.tsx +1 -20
  525. package/src/components/Poll/components/Button.tsx +8 -420
  526. package/src/components/Poll/components/CreatePollIcon.tsx +1 -1
  527. package/src/components/Poll/components/CreatePollOptions.tsx +9 -4
  528. package/src/components/Poll/components/PollAnswersList.tsx +66 -3
  529. package/src/components/Poll/components/PollButtons.tsx +241 -0
  530. package/src/components/Poll/components/PollInputDialog.tsx +9 -6
  531. package/src/components/Poll/components/PollModalHeader.tsx +3 -3
  532. package/src/components/Poll/components/PollOption.tsx +74 -4
  533. package/src/components/Poll/components/PollResults/PollOptionFullResults.tsx +1 -1
  534. package/src/components/Poll/components/PollResults/PollResultItem.tsx +68 -52
  535. package/src/components/Poll/components/PollResults/PollVote.tsx +68 -0
  536. package/src/components/Poll/components/index.ts +1 -0
  537. package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +37 -4
  538. package/src/components/ThreadList/ThreadList.tsx +0 -2
  539. package/src/components/UIComponents/BottomSheetModal.tsx +7 -3
  540. package/src/components/index.ts +7 -0
  541. package/src/contexts/channelContext/ChannelContext.tsx +35 -37
  542. package/src/contexts/channelsStateContext/ChannelsStateContext.tsx +1 -67
  543. package/src/contexts/channelsStateContext/useChannelState.ts +6 -108
  544. package/src/contexts/chatContext/ChatContext.tsx +2 -1
  545. package/src/contexts/messageContext/MessageContext.tsx +4 -0
  546. package/src/contexts/messageInputContext/MessageInputContext.tsx +5 -1
  547. package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +2 -0
  548. package/src/contexts/messagesContext/MessagesContext.tsx +8 -3
  549. package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +17 -16
  550. package/src/contexts/themeContext/utils/theme.ts +30 -1
  551. package/src/i18n/en.json +2 -0
  552. package/src/i18n/es.json +2 -0
  553. package/src/i18n/fr.json +2 -0
  554. package/src/i18n/he.json +2 -0
  555. package/src/i18n/hi.json +2 -0
  556. package/src/i18n/it.json +2 -0
  557. package/src/i18n/ja.json +2 -0
  558. package/src/i18n/ko.json +2 -0
  559. package/src/i18n/nl.json +2 -0
  560. package/src/i18n/pt-br.json +2 -0
  561. package/src/i18n/ru.json +2 -0
  562. package/src/i18n/tr.json +2 -0
  563. package/src/mock-builders/event/notificationChannelMutesUpdated.js +7 -0
  564. package/src/mock-builders/event/notificationMarkRead.js +7 -0
  565. package/src/mock-builders/event/notificationMarkUnread.js +9 -0
  566. package/src/mock-builders/generator/channel.ts +1 -0
  567. package/src/store/SqliteClient.ts +5 -1
  568. package/src/types/types.ts +3 -0
  569. package/src/utils/getTrimmedAttachmentTitle.ts +10 -2
  570. package/src/utils/utils.ts +5 -2
  571. package/src/version.json +1 -1
@@ -126,10 +126,7 @@ type MessageListPropsWithContext<
126
126
  > &
127
127
  Pick<ChatContextValue<StreamChatGenerics>, 'client'> &
128
128
  Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setMessages'> &
129
- Pick<
130
- PaginatedMessageListContextValue<StreamChatGenerics>,
131
- 'hasNoMoreRecentMessagesToLoad' | 'loadMore' | 'loadMoreRecent'
132
- > &
129
+ Pick<PaginatedMessageListContextValue<StreamChatGenerics>, 'loadMore' | 'loadMoreRecent'> &
133
130
  Pick<OverlayContextValue, 'overlay'> &
134
131
  Pick<
135
132
  MessagesContextValue<StreamChatGenerics>,
@@ -239,7 +236,6 @@ const MessageListWithContext = <
239
236
  EmptyStateIndicator,
240
237
  FlatList,
241
238
  FooterComponent = InlineLoadingMoreIndicator,
242
- hasNoMoreRecentMessagesToLoad,
243
239
  HeaderComponent = LoadingMoreRecentIndicator,
244
240
  hideStickyDateHeader,
245
241
  initialScrollToFirstUnreadMessage,
@@ -440,6 +436,9 @@ const MessageListWithContext = <
440
436
  }
441
437
  }, [disabled]);
442
438
 
439
+ /**
440
+ * Effect to mark the channel as read when the user scrolls to the bottom of the message list.
441
+ */
443
442
  useEffect(() => {
444
443
  const getShouldMarkReadAutomatically = (): boolean => {
445
444
  if (loading || !channel) {
@@ -519,34 +518,16 @@ const MessageListWithContext = <
519
518
  }
520
519
  };
521
520
 
522
- if (threadList || hasNoMoreRecentMessagesToLoad) {
521
+ if (threadList) {
523
522
  scrollToBottomIfNeeded();
524
523
  } else {
525
524
  setScrollToBottomButtonVisible(false);
526
525
  }
527
526
 
528
- if (
529
- !hasNoMoreRecentMessagesToLoad &&
530
- flatListRef.current &&
531
- messageListLengthBeforeUpdate.current === 0 &&
532
- messageListLengthAfterUpdate < 10
533
- ) {
534
- /**
535
- * Trigger onStartReached on first load, if messages are not enough to fill the screen.
536
- * This is important especially for android, where you can't overscroll.
537
- */
538
- maybeCallOnStartReached(10);
539
- }
540
-
541
527
  messageListLengthBeforeUpdate.current = messageListLengthAfterUpdate;
542
528
  topMessageBeforeUpdate.current = topMessageAfterUpdate;
543
529
  // eslint-disable-next-line react-hooks/exhaustive-deps
544
- }, [
545
- threadList,
546
- hasNoMoreRecentMessagesToLoad,
547
- messageListLengthAfterUpdate,
548
- topMessageAfterUpdate?.id,
549
- ]);
530
+ }, [threadList, messageListLengthAfterUpdate, topMessageAfterUpdate?.id]);
550
531
 
551
532
  useEffect(() => {
552
533
  if (!rawMessageList.length) return;
@@ -670,9 +651,19 @@ const MessageListWithContext = <
670
651
  threadList={threadList}
671
652
  />
672
653
  );
673
- return wrapMessageInTheme ? (
654
+ return (
674
655
  <>
675
- <ThemeProvider mergedStyle={modifiedTheme}>
656
+ {wrapMessageInTheme ? (
657
+ <ThemeProvider mergedStyle={modifiedTheme}>
658
+ <View
659
+ style={[shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined]}
660
+ testID={`message-list-item-${index}`}
661
+ >
662
+ {shouldApplyAndroidWorkaround && renderDateSeperator}
663
+ {renderMessage}
664
+ </View>
665
+ </ThemeProvider>
666
+ ) : (
676
667
  <View
677
668
  style={[shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined]}
678
669
  testID={`message-list-item-${index}`}
@@ -680,23 +671,12 @@ const MessageListWithContext = <
680
671
  {shouldApplyAndroidWorkaround && renderDateSeperator}
681
672
  {renderMessage}
682
673
  </View>
683
- </ThemeProvider>
674
+ )}
684
675
  {!shouldApplyAndroidWorkaround && renderDateSeperator}
685
676
  {/* Adding indicator below the messages, since the list is inverted */}
686
- {insertInlineUnreadIndicator && <InlineUnreadIndicator />}
687
- </>
688
- ) : (
689
- <>
690
- <View
691
- style={[shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined]}
692
- testID={`message-list-item-${index}`}
693
- >
694
- {shouldApplyAndroidWorkaround && renderDateSeperator}
695
- {renderMessage}
677
+ <View style={[shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined]}>
678
+ {insertInlineUnreadIndicator && <InlineUnreadIndicator />}
696
679
  </View>
697
- {!shouldApplyAndroidWorkaround && renderDateSeperator}
698
- {/* Adding indicator below the messages, since the list is inverted */}
699
- {insertInlineUnreadIndicator && <InlineUnreadIndicator />}
700
680
  </>
701
681
  );
702
682
  };
@@ -724,7 +704,7 @@ const MessageListWithContext = <
724
704
  * 2. Ensures that we call `loadMoreRecent`, once per content length
725
705
  * 3. If the call to `loadMore` is in progress, we wait for it to finish to make sure scroll doesn't jump.
726
706
  */
727
- const maybeCallOnStartReached = async (limit?: number) => {
707
+ const maybeCallOnStartReached = async () => {
728
708
  // If onStartReached has already been called for given data length, then ignore.
729
709
  if (
730
710
  processedMessageList?.length &&
@@ -756,8 +736,8 @@ const MessageListWithContext = <
756
736
  }
757
737
  onStartReachedInPromise.current = (
758
738
  threadList && !!threadInstance && loadMoreRecentThread
759
- ? loadMoreRecentThread({ limit })
760
- : loadMoreRecent(limit)
739
+ ? loadMoreRecentThread({})
740
+ : loadMoreRecent()
761
741
  )
762
742
  .then(callback)
763
743
  .catch(onError);
@@ -831,8 +811,7 @@ const MessageListWithContext = <
831
811
  const notLatestSet = channel.state.messages !== channel.state.latestMessages;
832
812
 
833
813
  const showScrollToBottomButton =
834
- messageListHasMessages &&
835
- ((!threadList && notLatestSet) || !isScrollAtBottom || !hasNoMoreRecentMessagesToLoad);
814
+ messageListHasMessages && ((!threadList && notLatestSet) || !isScrollAtBottom);
836
815
 
837
816
  /**
838
817
  * 1. If I scroll up -> show scrollToBottom button.
@@ -842,12 +821,7 @@ const MessageListWithContext = <
842
821
  */
843
822
  setScrollToBottomButtonVisible(showScrollToBottomButton);
844
823
 
845
- const shouldMarkRead =
846
- !threadList &&
847
- !notLatestSet &&
848
- offset <= 0 &&
849
- hasNoMoreRecentMessagesToLoad &&
850
- channel.countUnread() > 0;
824
+ const shouldMarkRead = !threadList && !notLatestSet && offset <= 0 && channel.countUnread() > 0;
851
825
 
852
826
  if (shouldMarkRead) {
853
827
  markRead();
@@ -862,9 +836,8 @@ const MessageListWithContext = <
862
836
 
863
837
  const goToNewMessages = async () => {
864
838
  const isNotLatestSet = channel.state.messages !== channel.state.latestMessages;
865
- if (isNotLatestSet && hasNoMoreRecentMessagesToLoad) {
866
- loadChannelAroundMessage({});
867
- } else if (!hasNoMoreRecentMessagesToLoad) {
839
+
840
+ if (isNotLatestSet) {
868
841
  resetPaginationTrackersRef.current();
869
842
  await reloadChannel();
870
843
  } else if (flatListRef.current) {
@@ -927,7 +900,7 @@ const MessageListWithContext = <
927
900
  // this onScrollToIndexFailed will be called again
928
901
  });
929
902
 
930
- const goToMessage = (messageId: string) => {
903
+ const goToMessage = async (messageId: string) => {
931
904
  const indexOfParentInMessageList = processedMessageList.findIndex(
932
905
  (message) => message?.id === messageId,
933
906
  );
@@ -946,7 +919,7 @@ const MessageListWithContext = <
946
919
  return;
947
920
  }
948
921
  // the message we want was not loaded yet, so lets load it
949
- loadChannelAroundMessage({ messageId });
922
+ await loadChannelAroundMessage({ messageId });
950
923
  };
951
924
 
952
925
  /**
@@ -987,6 +960,7 @@ const MessageListWithContext = <
987
960
  viewPosition: 0.5, // try to place message in the center of the screen
988
961
  });
989
962
  }
963
+
990
964
  // the message we want to scroll to has not been loaded in the state yet
991
965
  if (indexOfParentInMessageList === -1) {
992
966
  loadChannelAroundMessage({ messageId: messageIdToScroll });
@@ -1049,11 +1023,12 @@ const MessageListWithContext = <
1049
1023
  ]);
1050
1024
 
1051
1025
  const dismissImagePicker = () => {
1052
- if (!hasMoved && selectedPicker) {
1026
+ if (selectedPicker) {
1053
1027
  setSelectedPicker(undefined);
1054
1028
  closePicker();
1055
1029
  }
1056
1030
  };
1031
+
1057
1032
  const onScrollBeginDrag: ScrollViewProps['onScrollBeginDrag'] = (event) => {
1058
1033
  !hasMoved && selectedPicker && setHasMoved(true);
1059
1034
  onUserScrollEvent(event);
@@ -1157,17 +1132,17 @@ const MessageListWithContext = <
1157
1132
  ]}
1158
1133
  /** Disables the MessageList UI. Which means, message actions, reactions won't work. */
1159
1134
  data={processedMessageList}
1160
- extraData={disabled || !hasNoMoreRecentMessagesToLoad}
1135
+ extraData={disabled}
1161
1136
  inverted={shouldApplyAndroidWorkaround ? false : inverted}
1162
1137
  ItemSeparatorComponent={WrappedItemSeparatorComponent}
1163
1138
  keyboardShouldPersistTaps='handled'
1164
1139
  keyExtractor={keyExtractor}
1165
1140
  ListFooterComponent={ListFooterComponent}
1166
1141
  /**
1167
- if autoscrollToTopThreshold is 10, we scroll to recent if before new list update it was already at the bottom (10 offset or below)
1168
- minIndexForVisible = 1 means that beyond item at index 1 will not change position on list updates
1169
- minIndexForVisible is not used when autoscrollToTopThreshold = 10
1170
- */
1142
+ if autoscrollToTopThreshold is 10, we scroll to recent if before new list update it was already at the bottom (10 offset or below)
1143
+ minIndexForVisible = 1 means that beyond item at index 1 will not change position on list updates
1144
+ minIndexForVisible is not used when autoscrollToTopThreshold = 10
1145
+ */
1171
1146
  ListHeaderComponent={ListHeaderComponent}
1172
1147
  maintainVisibleContentPosition={{
1173
1148
  autoscrollToTopThreshold: autoscrollToRecent ? 10 : undefined,
@@ -1196,26 +1171,21 @@ const MessageListWithContext = <
1196
1171
  {...additionalFlatListPropsExcludingStyle}
1197
1172
  />
1198
1173
  )}
1199
-
1200
- {!loading && (
1201
- <>
1202
- <View style={styles.stickyHeader}>
1203
- {messageListLengthAfterUpdate && StickyHeader ? (
1204
- <StickyHeader date={stickyHeaderDate} DateHeader={DateHeader} />
1205
- ) : null}
1206
- </View>
1207
- {!disableTypingIndicator && TypingIndicator && (
1208
- <TypingIndicatorContainer>
1209
- <TypingIndicator />
1210
- </TypingIndicatorContainer>
1211
- )}
1212
- <ScrollToBottomButton
1213
- onPress={goToNewMessages}
1214
- showNotification={scrollToBottomButtonVisible}
1215
- unreadCount={threadList ? 0 : channel?.countUnread()}
1216
- />
1217
- </>
1174
+ <View style={styles.stickyHeader}>
1175
+ {messageListLengthAfterUpdate && StickyHeader ? (
1176
+ <StickyHeader date={stickyHeaderDate} DateHeader={DateHeader} />
1177
+ ) : null}
1178
+ </View>
1179
+ {!disableTypingIndicator && TypingIndicator && (
1180
+ <TypingIndicatorContainer>
1181
+ <TypingIndicator />
1182
+ </TypingIndicatorContainer>
1218
1183
  )}
1184
+ <ScrollToBottomButton
1185
+ onPress={goToNewMessages}
1186
+ showNotification={scrollToBottomButtonVisible}
1187
+ unreadCount={threadList ? 0 : channel?.countUnread()}
1188
+ />
1219
1189
  <NetworkDownIndicator />
1220
1190
  </View>
1221
1191
  );
@@ -1269,8 +1239,7 @@ export const MessageList = <
1269
1239
  TypingIndicator,
1270
1240
  TypingIndicatorContainer,
1271
1241
  } = useMessagesContext<StreamChatGenerics>();
1272
- const { hasNoMoreRecentMessagesToLoad, loadMore, loadMoreRecent } =
1273
- usePaginatedMessageListContext<StreamChatGenerics>();
1242
+ const { loadMore, loadMoreRecent } = usePaginatedMessageListContext<StreamChatGenerics>();
1274
1243
  const { overlay } = useOverlayContext();
1275
1244
  const { loadMoreRecentThread, loadMoreThread, thread, threadInstance } =
1276
1245
  useThreadContext<StreamChatGenerics>();
@@ -1288,7 +1257,6 @@ export const MessageList = <
1288
1257
  enableMessageGroupingByUser,
1289
1258
  error,
1290
1259
  FlatList,
1291
- hasNoMoreRecentMessagesToLoad,
1292
1260
  hideStickyDateHeader,
1293
1261
  initialScrollToFirstUnreadMessage,
1294
1262
  InlineDateSeparator,
@@ -80,7 +80,7 @@ export const ScrollToBottomButton = (props: ScrollToBottomButtonProps) => {
80
80
  <TouchableOpacity
81
81
  onPress={onPress}
82
82
  style={[styles.touchable, touchable]}
83
- testID='message-notification'
83
+ testID='scroll-to-bottom-button'
84
84
  >
85
85
  <View style={[styles.wrapper, wrapper]}>
86
86
  <View style={[styles.container, { backgroundColor: white, shadowColor: black }, container]}>
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { act, cleanup, render, screen, waitFor } from '@testing-library/react-native';
3
+ import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react-native';
4
4
 
5
5
  import { OverlayProvider } from '../../../contexts/overlayContext/OverlayProvider';
6
6
  import { getOrCreateChannelApi } from '../../../mock-builders/api/getOrCreateChannel';
@@ -14,6 +14,8 @@ import { generateMessage } from '../../../mock-builders/generator/message';
14
14
  import { generateUser } from '../../../mock-builders/generator/user';
15
15
  import { getTestClientWithUser } from '../../../mock-builders/mock';
16
16
  import { Channel } from '../../Channel/Channel';
17
+ import { channelInitialState } from '../../Channel/hooks/useChannelDataState';
18
+ import * as MessageListPaginationHook from '../../Channel/hooks/useMessageListPagination';
17
19
  import { Chat } from '../../Chat/Chat';
18
20
  import { MessageList } from '../MessageList';
19
21
 
@@ -47,7 +49,7 @@ describe('MessageList', () => {
47
49
  act(() => dispatchMessageNewEvent(chatClient, newMessage, mockedChannel.channel));
48
50
 
49
51
  await waitFor(() => {
50
- expect(queryAllByTestId('message-notification')).toHaveLength(0);
52
+ expect(queryAllByTestId('scroll-to-bottom-button')).toHaveLength(0);
51
53
  expect(getByText(newMessage.text)).toBeTruthy();
52
54
  });
53
55
  }, 10000);
@@ -381,3 +383,173 @@ describe('MessageList', () => {
381
383
  });
382
384
  });
383
385
  });
386
+
387
+ describe('MessageList pagination', () => {
388
+ afterEach(() => {
389
+ cleanup();
390
+ jest.clearAllMocks();
391
+ });
392
+
393
+ const mockedHook = (values) => {
394
+ const messages = Array.from({ length: 100 }, (_, i) =>
395
+ generateMessage({ text: `message-${i}` }),
396
+ );
397
+ return jest
398
+ .spyOn(MessageListPaginationHook, 'useMessageListPagination')
399
+ .mockImplementation(() => ({
400
+ copyMessagesStateFromChannel: jest.fn(),
401
+ loadChannelAroundMessage: jest.fn(),
402
+ loadChannelAtFirstUnreadMessage: jest.fn(),
403
+ loadInitialMessagesStateFromChannel: jest.fn(),
404
+ loadLatestMessages: jest.fn(),
405
+ loadMore: jest.fn(),
406
+ loadMoreRecent: jest.fn(),
407
+ state: { ...channelInitialState, messages },
408
+ ...values,
409
+ }));
410
+ };
411
+
412
+ it('should load more recent messages when the user scrolls to the start of the list', async () => {
413
+ const user1 = generateUser();
414
+ const mockedChannel = generateChannelResponse({
415
+ members: [generateMember({ user: user1 })],
416
+ messages: Array.from({ length: 100 }, (_, i) => generateMessage({ text: `message-${i}` })),
417
+ });
418
+
419
+ const chatClient = await getTestClientWithUser({ id: 'testID' });
420
+ useMockedApis(chatClient, [getOrCreateChannelApi(mockedChannel)]);
421
+ const channel = chatClient.channel('messaging', mockedChannel.id);
422
+ await channel.watch();
423
+
424
+ const loadMoreRecent = jest.fn(() => Promise.resolve());
425
+ mockedHook({ loadMoreRecent });
426
+
427
+ const { getByTestId } = render(
428
+ <OverlayProvider>
429
+ <Chat client={chatClient}>
430
+ <Channel channel={channel}>
431
+ <MessageList />
432
+ </Channel>
433
+ </Chat>
434
+ </OverlayProvider>,
435
+ );
436
+
437
+ act(() => {
438
+ // scroll to the top of the list
439
+ const flatList = getByTestId('message-flat-list');
440
+ fireEvent(flatList, 'momentumScrollEnd', {
441
+ nativeEvent: {
442
+ contentOffset: { y: 0 }, // Scroll position at the top
443
+ contentSize: { height: 2000, width: 200 }, // Total content size
444
+ layoutMeasurement: { height: 400, width: 200 }, // Visible area size
445
+ },
446
+ });
447
+ });
448
+
449
+ await waitFor(() => {
450
+ expect(loadMoreRecent).toHaveBeenCalledTimes(1);
451
+ });
452
+ });
453
+
454
+ it('should load more messages when the user scrolls to the end of the list', async () => {
455
+ const user1 = generateUser();
456
+ const mockedChannel = generateChannelResponse({
457
+ members: [generateMember({ user: user1 })],
458
+ messages: Array.from({ length: 100 }, (_, i) => generateMessage({ text: `message-${i}` })),
459
+ });
460
+
461
+ const chatClient = await getTestClientWithUser({ id: 'testID' });
462
+ useMockedApis(chatClient, [getOrCreateChannelApi(mockedChannel)]);
463
+ const channel = chatClient.channel('messaging', mockedChannel.id);
464
+ await channel.watch();
465
+
466
+ const loadMore = jest.fn(() => Promise.resolve());
467
+ mockedHook({ loadMore });
468
+
469
+ const { getByTestId } = render(
470
+ <OverlayProvider>
471
+ <Chat client={chatClient}>
472
+ <Channel channel={channel}>
473
+ <MessageList />
474
+ </Channel>
475
+ </Chat>
476
+ </OverlayProvider>,
477
+ );
478
+
479
+ act(() => {
480
+ // scroll to the top of the list
481
+ const flatList = getByTestId('message-flat-list');
482
+ fireEvent(flatList, 'momentumScrollEnd', {
483
+ nativeEvent: {
484
+ contentOffset: { y: 1900 }, // Scroll position at the top
485
+ contentSize: { height: 2000, width: 200 }, // Total content size
486
+ layoutMeasurement: { height: 400, width: 200 }, // Visible area size
487
+ },
488
+ });
489
+ });
490
+
491
+ await waitFor(() => {
492
+ expect(loadMore).toHaveBeenCalledTimes(1);
493
+ });
494
+ });
495
+
496
+ it('should call load latest messages when the scroll to bottom button is pressed', async () => {
497
+ const user1 = generateUser();
498
+ const messages = Array.from({ length: 10 }, (_, i) =>
499
+ generateMessage({ text: `message-${i}` }),
500
+ );
501
+ const mockedChannel = generateChannelResponse({
502
+ members: [generateMember({ user: user1 })],
503
+ messages,
504
+ });
505
+
506
+ const chatClient = await getTestClientWithUser({ id: 'testID' });
507
+ useMockedApis(chatClient, [getOrCreateChannelApi(mockedChannel)]);
508
+ const channel = chatClient.channel('messaging', mockedChannel.id);
509
+ await channel.watch();
510
+
511
+ channel.state = {
512
+ ...channelInitialState,
513
+ latestMessages: [],
514
+ members: Object.fromEntries(
515
+ Array.from({ length: 10 }, (_, i) => [i, generateMember({ id: i })]),
516
+ ),
517
+ messages: Array.from({ length: 10 }, (_, i) => generateMessage({ id: i })),
518
+ messageSets: [{ isCurrent: true, isLatest: true }],
519
+ };
520
+
521
+ const loadLatestMessages = jest.fn(() => Promise.resolve());
522
+ mockedHook({ loadLatestMessages });
523
+
524
+ const { getByTestId } = render(
525
+ <OverlayProvider>
526
+ <Chat client={chatClient}>
527
+ <Channel channel={channel}>
528
+ <MessageList />
529
+ </Channel>
530
+ </Chat>
531
+ </OverlayProvider>,
532
+ );
533
+
534
+ act(() => {
535
+ // scroll to the top of the list
536
+ const flatList = getByTestId('message-flat-list');
537
+ fireEvent(flatList, 'scroll', {
538
+ nativeEvent: {
539
+ contentOffset: { y: 1900 }, // Scroll position at the top
540
+ contentSize: { height: 2000, width: 200 }, // Total content size
541
+ layoutMeasurement: { height: 400, width: 200 }, // Visible area size
542
+ },
543
+ });
544
+ });
545
+
546
+ await waitFor(() => {
547
+ const scrollToBottomButton = getByTestId('scroll-to-bottom-button');
548
+ expect(scrollToBottomButton).toBeTruthy();
549
+
550
+ fireEvent.press(scrollToBottomButton);
551
+
552
+ expect(loadLatestMessages).toHaveBeenCalledTimes(1);
553
+ });
554
+ });
555
+ });
@@ -22,7 +22,7 @@ describe('ScrollToBottomButton', () => {
22
22
  );
23
23
 
24
24
  await waitFor(() => {
25
- expect(queryByTestId('message-notification')).toBeFalsy();
25
+ expect(queryByTestId('scroll-to-bottom-button')).toBeFalsy();
26
26
  });
27
27
  });
28
28
 
@@ -38,7 +38,7 @@ describe('ScrollToBottomButton', () => {
38
38
  );
39
39
 
40
40
  await waitFor(() => {
41
- expect(queryByTestId('message-notification')).toBeTruthy();
41
+ expect(queryByTestId('scroll-to-bottom-button')).toBeTruthy();
42
42
  });
43
43
  });
44
44
 
@@ -53,7 +53,7 @@ describe('ScrollToBottomButton', () => {
53
53
  </TranslationProvider>
54
54
  </ThemeProvider>,
55
55
  );
56
- fireEvent.press(getByTestId('message-notification'));
56
+ fireEvent.press(getByTestId('scroll-to-bottom-button'));
57
57
  expect(onPress).toHaveBeenCalledTimes(1);
58
58
  });
59
59
 
@@ -37,7 +37,7 @@ exports[`ScrollToBottomButton should render the message notification and match s
37
37
  "right": 20,
38
38
  }
39
39
  }
40
- testID="message-notification"
40
+ testID="scroll-to-bottom-button"
41
41
  >
42
42
  <View
43
43
  style={
@@ -1,9 +1,6 @@
1
1
  import type { ChannelState, MessageResponse } from 'stream-chat';
2
2
 
3
- import {
4
- ChannelContextValue,
5
- useChannelContext,
6
- } from '../../../contexts/channelContext/ChannelContext';
3
+ import { useChannelContext } from '../../../contexts/channelContext/ChannelContext';
7
4
  import { useChatContext } from '../../../contexts/chatContext/ChatContext';
8
5
  import {
9
6
  DeletedMessagesVisibilityType,
@@ -61,7 +58,7 @@ export const useMessageList = <
61
58
  const { threadMessages } = useThreadContext<StreamChatGenerics>();
62
59
 
63
60
  const messageList = threadList ? threadMessages : messages;
64
- const readList: ChannelContextValue<StreamChatGenerics>['read'] | undefined = threadList
61
+ const readList: ChannelState<StreamChatGenerics>['read'] | undefined = threadList
65
62
  ? undefined
66
63
  : read;
67
64
 
@@ -1,4 +1,5 @@
1
- import type { ChannelContextValue } from '../../../contexts/channelContext/ChannelContext';
1
+ import { ChannelState } from 'stream-chat';
2
+
2
3
  import type { PaginatedMessageListContextValue } from '../../../contexts/paginatedMessageListContext/PaginatedMessageListContext';
3
4
  import type { ThreadContextValue } from '../../../contexts/threadContext/ThreadContext';
4
5
  import type { DefaultStreamChatGenerics } from '../../../types/types';
@@ -10,7 +11,7 @@ export const getReadStates = <
10
11
  messages:
11
12
  | PaginatedMessageListContextValue<StreamChatGenerics>['messages']
12
13
  | ThreadContextValue<StreamChatGenerics>['threadMessages'],
13
- read?: ChannelContextValue<StreamChatGenerics>['read'],
14
+ read?: ChannelState<StreamChatGenerics>['read'],
14
15
  ) => {
15
16
  const readData: Record<string, number> = {};
16
17
 
@@ -98,7 +98,7 @@ export const MessageUserReactions = (props: MessageUserReactionsProps) => {
98
98
  loadNextPage,
99
99
  reactions: fetchedReactions,
100
100
  } = useFetchReactions({
101
- messageId: message?.id,
101
+ message,
102
102
  reactionType: selectedReaction,
103
103
  sort,
104
104
  });
@@ -37,7 +37,9 @@ export const MessageUserReactionsItem = <
37
37
  messageMenu: {
38
38
  userReactions: {
39
39
  avatarContainer,
40
+ avatarInnerContainer,
40
41
  avatarName,
42
+ avatarNameContainer,
41
43
  avatarSize,
42
44
  radius,
43
45
  reactionBubbleBackground,
@@ -69,7 +71,7 @@ export const MessageUserReactionsItem = <
69
71
  accessibilityLabel='Individual User Reaction on long press message'
70
72
  style={[styles.avatarContainer, avatarContainer]}
71
73
  >
72
- <View style={styles.avatarInnerContainer}>
74
+ <View style={[styles.avatarInnerContainer, avatarInnerContainer]}>
73
75
  <MessageUserReactionsAvatar reaction={reaction} size={avatarSize} />
74
76
  <View
75
77
  style={[
@@ -91,7 +93,7 @@ export const MessageUserReactionsItem = <
91
93
  />
92
94
  </View>
93
95
  </View>
94
- <View style={styles.avatarNameContainer}>
96
+ <View style={[styles.avatarNameContainer, avatarNameContainer]}>
95
97
  <Text numberOfLines={2} style={[styles.avatarName, { color: black }, avatarName]}>
96
98
  {name}
97
99
  </Text>
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
2
2
 
3
3
  import { ReactionResponse, ReactionSort } from 'stream-chat';
4
4
 
5
+ import { MessageType } from '../../../components/MessageList/hooks/useMessageList';
5
6
  import { useChatContext } from '../../../contexts/chatContext/ChatContext';
6
7
  import { getReactionsForFilterSort } from '../../../store/apis/getReactionsforFilterSort';
7
8
  import { DefaultStreamChatGenerics } from '../../../types/types';
@@ -10,7 +11,7 @@ export type UseFetchReactionParams<
10
11
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
11
12
  > = {
12
13
  limit?: number;
13
- messageId?: string;
14
+ message?: MessageType<StreamChatGenerics>;
14
15
  reactionType?: string;
15
16
  sort?: ReactionSort<StreamChatGenerics>;
16
17
  };
@@ -19,13 +20,14 @@ export const useFetchReactions = <
19
20
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
20
21
  >({
21
22
  limit = 25,
22
- messageId,
23
+ message,
23
24
  reactionType,
24
25
  sort,
25
26
  }: UseFetchReactionParams) => {
26
27
  const [reactions, setReactions] = useState<ReactionResponse<StreamChatGenerics>[]>([]);
27
28
  const [loading, setLoading] = useState(true);
28
29
  const [next, setNext] = useState<string | undefined>(undefined);
30
+ const messageId = message?.id;
29
31
 
30
32
  const { client, enableOfflineSupport } = useChatContext();
31
33
 
@@ -61,7 +63,8 @@ export const useFetchReactions = <
61
63
  };
62
64
 
63
65
  try {
64
- if (enableOfflineSupport) {
66
+ // TODO: Threads are not supported for the offline use case as we don't store the thread messages currently, and this will change in the future.
67
+ if (enableOfflineSupport && !message?.parent_id) {
65
68
  await loadOfflineReactions();
66
69
  } else {
67
70
  await loadOnlineReactions();