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
@@ -0,0 +1,138 @@
1
+ import { useEffect, useMemo, useState } from 'react';
2
+
3
+ import throttle from 'lodash/throttle';
4
+ import type { Channel, ChannelState, Event, MessageResponse, StreamChat } from 'stream-chat';
5
+
6
+ import { useIsChannelMuted } from './useIsChannelMuted';
7
+
8
+ import { useLatestMessagePreview } from './useLatestMessagePreview';
9
+
10
+ import { useChannelsContext } from '../../../contexts';
11
+ import type { DefaultStreamChatGenerics } from '../../../types/types';
12
+
13
+ export const useChannelPreviewData = <
14
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
15
+ >(
16
+ channel: Channel<StreamChatGenerics>,
17
+ client: StreamChat<StreamChatGenerics>,
18
+ forceUpdateOverride?: number,
19
+ ) => {
20
+ const [forceUpdate, setForceUpdate] = useState(0);
21
+ const [lastMessage, setLastMessage] = useState<
22
+ | ReturnType<ChannelState<StreamChatGenerics>['formatMessage']>
23
+ | MessageResponse<StreamChatGenerics>
24
+ >(channel.state.messages[channel.state.messages.length - 1]);
25
+ const [unread, setUnread] = useState(channel.countUnread());
26
+ const { muted } = useIsChannelMuted(channel);
27
+ const { forceUpdate: contextForceUpdate } = useChannelsContext<StreamChatGenerics>();
28
+ const channelListForceUpdate = forceUpdateOverride ?? contextForceUpdate;
29
+
30
+ const channelLastMessage = channel.lastMessage();
31
+ const channelLastMessageString = `${channelLastMessage?.id}${channelLastMessage?.updated_at}`;
32
+
33
+ useEffect(() => {
34
+ const { unsubscribe } = client.on('notification.mark_read', () => {
35
+ setUnread(channel.countUnread());
36
+ });
37
+ return unsubscribe;
38
+ }, [channel, client]);
39
+
40
+ useEffect(() => {
41
+ if (
42
+ channelLastMessage &&
43
+ (channelLastMessage.id !== lastMessage?.id ||
44
+ channelLastMessage.updated_at !== lastMessage?.updated_at)
45
+ ) {
46
+ setLastMessage(channelLastMessage);
47
+ }
48
+ const newUnreadCount = channel.countUnread();
49
+ setUnread(newUnreadCount);
50
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51
+ }, [channel, channelLastMessageString, channelListForceUpdate]);
52
+
53
+ /**
54
+ * This effect listens for the `notification.mark_read` event and sets the unread count to 0
55
+ */
56
+ useEffect(() => {
57
+ const handleReadEvent = (event: Event) => {
58
+ if (!event.cid) return;
59
+ if (channel.cid !== event.cid) return;
60
+ if (event?.user?.id === client.userID) {
61
+ setUnread(0);
62
+ } else if (event?.user?.id) {
63
+ setForceUpdate((prev) => prev + 1);
64
+ }
65
+ };
66
+ const { unsubscribe } = client.on('message.read', handleReadEvent);
67
+ return unsubscribe;
68
+ }, [client, channel]);
69
+
70
+ /**
71
+ * This effect listens for the `notification.mark_unread` event and updates the unread count
72
+ */
73
+ useEffect(() => {
74
+ const handleUnreadEvent = (event: Event) => {
75
+ if (!event.cid) return;
76
+ if (channel.cid !== event.cid) return;
77
+ if (event.user?.id !== client.user?.id) return;
78
+ setUnread(channel.countUnread());
79
+ };
80
+ const { unsubscribe } = client.on('notification.mark_unread', handleUnreadEvent);
81
+ return unsubscribe;
82
+ }, [client, channel]);
83
+
84
+ const refreshUnreadCount = useMemo(
85
+ () =>
86
+ throttle(() => {
87
+ if (muted) {
88
+ setUnread(0);
89
+ } else {
90
+ setUnread(channel.countUnread());
91
+ }
92
+ }, 400),
93
+ [channel, muted],
94
+ );
95
+
96
+ /**
97
+ * This effect listens for the `message.new`, `message.updated`, `message.deleted`, `message.undeleted`, and `channel.truncated` events
98
+ */
99
+ useEffect(() => {
100
+ refreshUnreadCount();
101
+
102
+ const handleEvent = () => {
103
+ setLastMessage(channel.state.latestMessages[channel.state.latestMessages.length - 1]);
104
+ refreshUnreadCount();
105
+ };
106
+
107
+ const handleNewMessageEvent = (event: Event<StreamChatGenerics>) => {
108
+ const message = event.message;
109
+ if (message && (!message.parent_id || message.show_in_channel)) {
110
+ setLastMessage(message);
111
+ setUnread(channel.countUnread());
112
+ }
113
+ };
114
+
115
+ const handleUpdatedOrDeletedMessage = (event: Event<StreamChatGenerics>) => {
116
+ setLastMessage((prevLastMessage) => {
117
+ if (prevLastMessage?.id === event.message?.id) {
118
+ return event.message;
119
+ }
120
+ return prevLastMessage;
121
+ });
122
+ };
123
+
124
+ const listeners = [
125
+ channel.on('message.new', handleNewMessageEvent),
126
+ channel.on('message.updated', handleUpdatedOrDeletedMessage),
127
+ channel.on('message.deleted', handleUpdatedOrDeletedMessage),
128
+ channel.on('message.undeleted', handleEvent),
129
+ channel.on('channel.truncated', handleEvent),
130
+ ];
131
+
132
+ return () => listeners.forEach((l) => l.unsubscribe());
133
+ }, [channel, refreshUnreadCount, forceUpdate, channelListForceUpdate]);
134
+
135
+ const latestMessagePreview = useLatestMessagePreview(channel, forceUpdate, lastMessage);
136
+
137
+ return { latestMessagePreview, muted, unread };
138
+ };
@@ -0,0 +1,29 @@
1
+ import { useEffect, useState } from 'react';
2
+
3
+ import type { Channel } from 'stream-chat';
4
+
5
+ import { useChatContext } from '../../../contexts/chatContext/ChatContext';
6
+
7
+ import type { DefaultStreamChatGenerics } from '../../../types/types';
8
+
9
+ export const useIsChannelMuted = <
10
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
11
+ >(
12
+ channel: Channel<StreamChatGenerics>,
13
+ ) => {
14
+ const { client } = useChatContext<StreamChatGenerics>();
15
+ const initialized = channel?.initialized;
16
+
17
+ const [muted, setMuted] = useState(() => initialized && channel.muteStatus());
18
+
19
+ useEffect(() => {
20
+ const handleEvent = () => {
21
+ setMuted(initialized && channel.muteStatus());
22
+ };
23
+
24
+ client.on('notification.channel_mutes_updated', handleEvent);
25
+ return () => client.off('notification.channel_mutes_updated', handleEvent);
26
+ }, [channel, client, initialized, muted]);
27
+
28
+ return muted || { createdAt: null, expiresAt: null, muted: false };
29
+ };
@@ -35,7 +35,7 @@ init();
35
35
  export type ChatProps<
36
36
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
37
37
  > = Pick<ChatContextValue<StreamChatGenerics>, 'client'> &
38
- Partial<Pick<ChatContextValue<StreamChatGenerics>, 'ImageComponent'>> & {
38
+ Partial<Pick<ChatContextValue<StreamChatGenerics>, 'ImageComponent' | 'isMessageAIGenerated'>> & {
39
39
  /**
40
40
  * When false, ws connection won't be disconnection upon backgrounding the app.
41
41
  * To receive push notifications, its necessary that user doesn't have active
@@ -99,6 +99,12 @@ export type ChatProps<
99
99
  * ```
100
100
  */
101
101
  i18nInstance?: Streami18n;
102
+ /**
103
+ * Custom loading indicator component to be used to represent the loading state of the chat.
104
+ *
105
+ * This can be used during the phase when db is not initialised.
106
+ */
107
+ LoadingIndicator?: React.ComponentType | null;
102
108
  /**
103
109
  * You can pass the theme object to customize the styles of Chat components. You can check the default theme in [theme.ts](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/themeContext/utils/theme.ts)
104
110
  *
@@ -142,6 +148,8 @@ const ChatWithContext = <
142
148
  enableOfflineSupport = false,
143
149
  i18nInstance,
144
150
  ImageComponent = Image,
151
+ isMessageAIGenerated,
152
+ LoadingIndicator = null,
145
153
  style,
146
154
  } = props;
147
155
 
@@ -254,6 +262,7 @@ const ChatWithContext = <
254
262
  connectionRecovering,
255
263
  enableOfflineSupport,
256
264
  ImageComponent,
265
+ isMessageAIGenerated,
257
266
  isOnline,
258
267
  mutedUsers,
259
268
  setActiveChannel,
@@ -267,7 +276,7 @@ const ChatWithContext = <
267
276
 
268
277
  if (userID && enableOfflineSupport && !initialisedDatabase) {
269
278
  // if user id has been set and offline support is enabled, we need to wait for database to be initialised
270
- return null;
279
+ return LoadingIndicator ? <LoadingIndicator /> : null;
271
280
  }
272
281
 
273
282
  return (
@@ -18,6 +18,7 @@ describe('useAppSettings', () => {
18
18
  auto_translation_enabled: true,
19
19
  }),
20
20
  ),
21
+ userID: 'some-user-id',
21
22
  } as unknown as StreamChat,
22
23
  isOnline,
23
24
  false,
@@ -22,6 +22,8 @@ export const useAppSettings = <
22
22
  * Fetches app settings from the backend when offline support is disabled.
23
23
  */
24
24
  const enforceAppSettingsWithoutOfflineSupport = async () => {
25
+ if (!client.userID) return;
26
+
25
27
  try {
26
28
  const appSettings = await client.getAppSettings();
27
29
  if (isMounted.current) {
@@ -12,6 +12,7 @@ export const useCreateChatContext = <
12
12
  connectionRecovering,
13
13
  enableOfflineSupport,
14
14
  ImageComponent,
15
+ isMessageAIGenerated,
15
16
  isOnline,
16
17
  mutedUsers,
17
18
  setActiveChannel,
@@ -32,6 +33,7 @@ export const useCreateChatContext = <
32
33
  connectionRecovering,
33
34
  enableOfflineSupport,
34
35
  ImageComponent,
36
+ isMessageAIGenerated,
35
37
  isOnline,
36
38
  mutedUsers,
37
39
  setActiveChannel,
@@ -29,11 +29,6 @@ export const useIsOnline = <
29
29
  const onBackground = useCallback(() => {
30
30
  if (!closeConnectionOnBackground || !clientExists) return;
31
31
 
32
- for (const cid in client.activeChannels) {
33
- const channel = client.activeChannels[cid];
34
- channel?.state.setIsUpToDate(false);
35
- }
36
-
37
32
  client.closeConnection();
38
33
  setIsOnline(false);
39
34
  }, [closeConnectionOnBackground, client, clientExists]);
@@ -610,6 +610,7 @@ export const ImageGallery = <
610
610
  {...imageGalleryCustomComponents?.gridHandle}
611
611
  />
612
612
  )}
613
+ // @ts-ignore
613
614
  handleHeight={imageGalleryGridHandleHeight}
614
615
  index={0}
615
616
  onChange={(index: number) => setCurrentBottomSheetIndex(index)}
@@ -154,14 +154,14 @@ export const ImageGalleryFooterWithContext = <
154
154
  };
155
155
 
156
156
  return (
157
- <View
157
+ <SafeAreaView
158
158
  accessibilityLabel={accessibilityLabel}
159
159
  onLayout={(event) => setHeight(event.nativeEvent.layout.height)}
160
160
  pointerEvents={'box-none'}
161
161
  style={styles.wrapper}
162
162
  >
163
163
  <Animated.View style={footerStyle}>
164
- <SafeAreaView style={[{ backgroundColor: white }, container]}>
164
+ <View style={[{ backgroundColor: white }, container]}>
165
165
  {photo.type === FileTypes.Video ? (
166
166
  videoControlElement ? (
167
167
  videoControlElement({ duration, onPlayPause, paused, progress, videoRef })
@@ -175,37 +175,37 @@ export const ImageGalleryFooterWithContext = <
175
175
  />
176
176
  )
177
177
  ) : null}
178
- <View style={[styles.innerContainer, { backgroundColor: white }, innerContainer]}>
179
- {leftElement ? (
180
- leftElement({ openGridView, photo, share, shareMenuOpen })
181
- ) : (
182
- <ShareButton share={share} ShareIcon={ShareIcon} shareMenuOpen={shareMenuOpen} />
183
- )}
184
- {centerElement ? (
185
- centerElement({ openGridView, photo, share, shareMenuOpen })
186
- ) : (
187
- <View style={[styles.centerContainer, centerContainer]}>
188
- <Text style={[styles.imageCountText, { color: black }, imageCountText]}>
189
- {t<string>('{{ index }} of {{ photoLength }}', {
190
- index: photoLength - selectedIndex,
191
- photoLength,
192
- })}
193
- </Text>
178
+ </View>
179
+ <View style={[styles.innerContainer, { backgroundColor: white }, innerContainer]}>
180
+ {leftElement ? (
181
+ leftElement({ openGridView, photo, share, shareMenuOpen })
182
+ ) : (
183
+ <ShareButton share={share} ShareIcon={ShareIcon} shareMenuOpen={shareMenuOpen} />
184
+ )}
185
+ {centerElement ? (
186
+ centerElement({ openGridView, photo, share, shareMenuOpen })
187
+ ) : (
188
+ <View style={[styles.centerContainer, centerContainer]}>
189
+ <Text style={[styles.imageCountText, { color: black }, imageCountText]}>
190
+ {t<string>('{{ index }} of {{ photoLength }}', {
191
+ index: photoLength - selectedIndex,
192
+ photoLength,
193
+ })}
194
+ </Text>
195
+ </View>
196
+ )}
197
+ {rightElement ? (
198
+ rightElement({ openGridView, photo, share, shareMenuOpen })
199
+ ) : (
200
+ <TouchableOpacity onPress={openGridView}>
201
+ <View style={[styles.rightContainer, rightContainer]}>
202
+ {GridIcon ? GridIcon : <GridIconDefault />}
194
203
  </View>
195
- )}
196
- {rightElement ? (
197
- rightElement({ openGridView, photo, share, shareMenuOpen })
198
- ) : (
199
- <TouchableOpacity onPress={openGridView}>
200
- <View style={[styles.rightContainer, rightContainer]}>
201
- {GridIcon ? GridIcon : <GridIconDefault />}
202
- </View>
203
- </TouchableOpacity>
204
- )}
205
- </View>
206
- </SafeAreaView>
204
+ </TouchableOpacity>
205
+ )}
206
+ </View>
207
207
  </Animated.View>
208
- </View>
208
+ </SafeAreaView>
209
209
  );
210
210
  };
211
211
 
@@ -300,7 +300,7 @@ const styles = StyleSheet.create({
300
300
  },
301
301
  innerContainer: {
302
302
  flexDirection: 'row',
303
- height: 56,
303
+ paddingVertical: 4,
304
304
  },
305
305
  leftContainer: {
306
306
  flex: 1,
@@ -93,12 +93,12 @@ export const ImageGalleryHeader = <
93
93
  };
94
94
 
95
95
  return (
96
- <View
96
+ <SafeAreaView
97
97
  onLayout={(event) => setHeight(event.nativeEvent.layout.height)}
98
98
  pointerEvents={'box-none'}
99
99
  >
100
100
  <Animated.View style={headerStyle}>
101
- <SafeAreaView style={[styles.container, { backgroundColor: white }, container]}>
101
+ <View style={[styles.container, { backgroundColor: white }, container]}>
102
102
  {leftElement ? (
103
103
  leftElement({ hideOverlay, photo })
104
104
  ) : (
@@ -123,9 +123,9 @@ export const ImageGalleryHeader = <
123
123
  ) : (
124
124
  <View style={[styles.rightContainer, rightContainer]} />
125
125
  )}
126
- </SafeAreaView>
126
+ </View>
127
127
  </Animated.View>
128
- </View>
128
+ </SafeAreaView>
129
129
  );
130
130
  };
131
131
 
@@ -140,12 +140,11 @@ const styles = StyleSheet.create({
140
140
  container: {
141
141
  flexDirection: 'row',
142
142
  justifyContent: 'space-between',
143
- paddingVertical: 4,
143
+ paddingVertical: 8,
144
144
  },
145
145
  date: {
146
146
  fontSize: 12,
147
147
  fontWeight: '500',
148
- marginBottom: 8,
149
148
  opacity: 0.5,
150
149
  },
151
150
  leftContainer: {
@@ -72,12 +72,12 @@ export const useAnimatedGalleryStyle = ({
72
72
  { scaleX: -1 },
73
73
  { translateY: yScaleOffset },
74
74
  {
75
- translateX: -translateX.value - xScaleOffset,
75
+ translateX: -xScaleOffset,
76
76
  },
77
77
  { scale: oneEighth },
78
78
  ],
79
79
  };
80
- }, []);
80
+ }, [index]);
81
81
 
82
82
  return [animatedGalleryStyle, animatedStyles];
83
83
  };
@@ -125,9 +125,15 @@ export type MessagePropsWithContext<
125
125
  > = Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'enforceUniqueReaction' | 'members'> &
126
126
  Pick<KeyboardContextValue, 'dismissKeyboard'> &
127
127
  Partial<
128
- Omit<MessageContextValue<StreamChatGenerics>, 'groupStyles' | 'handleReaction' | 'message'>
128
+ Omit<
129
+ MessageContextValue<StreamChatGenerics>,
130
+ 'groupStyles' | 'handleReaction' | 'message' | 'isMessageAIGenerated'
131
+ >
132
+ > &
133
+ Pick<
134
+ MessageContextValue<StreamChatGenerics>,
135
+ 'groupStyles' | 'message' | 'isMessageAIGenerated'
129
136
  > &
130
- Pick<MessageContextValue<StreamChatGenerics>, 'groupStyles' | 'message'> &
131
137
  Pick<
132
138
  MessagesContextValue<StreamChatGenerics>,
133
139
  | 'sendReaction'
@@ -254,6 +260,11 @@ const MessageWithContext = <
254
260
  threadList = false,
255
261
  updateMessage,
256
262
  } = props;
263
+ const isMessageAIGenerated = messagesContext.isMessageAIGenerated;
264
+ const isAIGenerated = useMemo(
265
+ () => isMessageAIGenerated(message),
266
+ [message, isMessageAIGenerated],
267
+ );
257
268
  const isMessageTypeDeleted = message.type === 'deleted';
258
269
  const { client } = chatContext;
259
270
  const {
@@ -418,6 +429,8 @@ const MessageWithContext = <
418
429
  return !!attachments.images.length || !!attachments.videos.length;
419
430
  case 'poll':
420
431
  return !!message.poll_id;
432
+ case 'ai_text':
433
+ return isAIGenerated;
421
434
  case 'text':
422
435
  default:
423
436
  return !!message.text;
@@ -590,6 +603,7 @@ const MessageWithContext = <
590
603
  hasReactions,
591
604
  images: attachments.images,
592
605
  isEditedMessageOpen,
606
+ isMessageAIGenerated,
593
607
  isMyMessage,
594
608
  lastGroupMessage: groupStyles?.[0] === 'single' || groupStyles?.[0] === 'bottom',
595
609
  lastReceivedId,
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useMemo } from 'react';
2
2
  import {
3
3
  AnimatableNumericValue,
4
4
  ColorValue,
@@ -80,6 +80,7 @@ export type MessageContentPropsWithContext<
80
80
  | 'otherAttachments'
81
81
  | 'preventPress'
82
82
  | 'threadList'
83
+ | 'isMessageAIGenerated'
83
84
  > &
84
85
  Pick<
85
86
  MessagesContextValue<StreamChatGenerics>,
@@ -91,6 +92,7 @@ export type MessageContentPropsWithContext<
91
92
  | 'MessageError'
92
93
  | 'myMessageTheme'
93
94
  | 'Reply'
95
+ | 'StreamingMessageView'
94
96
  > &
95
97
  Pick<TranslationContextValue, 't'> & {
96
98
  setMessageContentWidth: React.Dispatch<React.SetStateAction<number>>;
@@ -120,6 +122,7 @@ const MessageContentWithContext = <
120
122
  FileAttachmentGroup,
121
123
  Gallery,
122
124
  groupStyles,
125
+ isMessageAIGenerated,
123
126
  isMyMessage,
124
127
  message,
125
128
  messageContentOrder,
@@ -132,6 +135,7 @@ const MessageContentWithContext = <
132
135
  preventPress,
133
136
  Reply,
134
137
  setMessageContentWidth,
138
+ StreamingMessageView,
135
139
  threadList,
136
140
  } = props;
137
141
  const { client } = useChatContext();
@@ -169,6 +173,11 @@ const MessageContentWithContext = <
169
173
  setMessageContentWidth(width);
170
174
  };
171
175
 
176
+ const isAIGenerated = useMemo(
177
+ () => isMessageAIGenerated(message),
178
+ [message, isMessageAIGenerated],
179
+ );
180
+
172
181
  const { hasThreadReplies, isMessageErrorType, isMessageReceivedOrErrorType } = useMessageData({});
173
182
 
174
183
  const repliesCurveColor = !isMessageReceivedOrErrorType ? backgroundColor : light_gray;
@@ -312,9 +321,16 @@ const MessageContentWithContext = <
312
321
  />
313
322
  ) : null;
314
323
  }
324
+ case 'ai_text':
325
+ return isAIGenerated ? (
326
+ <StreamingMessageView
327
+ key={`ai_message_text_container_${messageContentOrderIndex}`}
328
+ />
329
+ ) : null;
315
330
  case 'text':
316
331
  default:
317
- return otherAttachments.length && otherAttachments[0].actions ? null : (
332
+ return (otherAttachments.length && otherAttachments[0].actions) ||
333
+ isAIGenerated ? null : (
318
334
  <MessageTextContainer<StreamChatGenerics>
319
335
  key={`message_text_container_${messageContentOrderIndex}`}
320
336
  />
@@ -463,6 +479,7 @@ export const MessageContent = <
463
479
  goToMessage,
464
480
  groupStyles,
465
481
  isEditedMessageOpen,
482
+ isMessageAIGenerated,
466
483
  isMyMessage,
467
484
  lastReceivedId,
468
485
  message,
@@ -483,6 +500,7 @@ export const MessageContent = <
483
500
  MessageError,
484
501
  myMessageTheme,
485
502
  Reply,
503
+ StreamingMessageView,
486
504
  } = useMessagesContext<StreamChatGenerics>();
487
505
  const { t } = useTranslationContext();
488
506
 
@@ -498,6 +516,7 @@ export const MessageContent = <
498
516
  groupStyles,
499
517
  isAttachmentEqual,
500
518
  isEditedMessageOpen,
519
+ isMessageAIGenerated,
501
520
  isMyMessage,
502
521
  lastReceivedId,
503
522
  message,
@@ -510,6 +529,7 @@ export const MessageContent = <
510
529
  otherAttachments,
511
530
  preventPress,
512
531
  Reply,
532
+ StreamingMessageView,
513
533
  t,
514
534
  threadList,
515
535
  }}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useMemo } from 'react';
2
2
  import { StyleSheet, Text, View } from 'react-native';
3
3
 
4
4
  import type { Attachment } from 'stream-chat';
@@ -41,6 +41,7 @@ type MessageFooterPropsWithContext<
41
41
  | 'otherAttachments'
42
42
  | 'showMessageStatus'
43
43
  | 'lastGroupMessage'
44
+ | 'isMessageAIGenerated'
44
45
  > &
45
46
  Pick<
46
47
  MessagesContextValue<StreamChatGenerics>,
@@ -94,6 +95,7 @@ const MessageFooterWithContext = <
94
95
  formattedDate,
95
96
  isDeleted,
96
97
  isEditedMessageOpen,
98
+ isMessageAIGenerated,
97
99
  lastGroupMessage,
98
100
  members,
99
101
  message,
@@ -114,6 +116,11 @@ const MessageFooterWithContext = <
114
116
  } = useTheme();
115
117
  const { t } = useTranslationContext();
116
118
 
119
+ const isAIGenerated = useMemo(
120
+ () => isMessageAIGenerated(message),
121
+ [message, isMessageAIGenerated],
122
+ );
123
+
117
124
  if (isDeleted) {
118
125
  return (
119
126
  <View style={[styles.container, metaContainer]}>
@@ -129,6 +136,8 @@ const MessageFooterWithContext = <
129
136
  return null;
130
137
  }
131
138
 
139
+ const isEdited = isEditedMessage(message) && !isAIGenerated;
140
+
132
141
  return (
133
142
  <>
134
143
  <View style={[styles.container, metaContainer]} testID='message-status-time'>
@@ -141,7 +150,7 @@ const MessageFooterWithContext = <
141
150
  {showMessageStatus && <MessageStatus />}
142
151
  <MessageTimestamp formattedDate={formattedDate} timestamp={date} />
143
152
 
144
- {isEditedMessage(message) && !isEditedMessageOpen && (
153
+ {isEdited && !isEditedMessageOpen ? (
145
154
  <>
146
155
  <Text
147
156
  style={[
@@ -159,11 +168,11 @@ const MessageFooterWithContext = <
159
168
  {t<string>('Edited')}
160
169
  </Text>
161
170
  </>
162
- )}
171
+ ) : null}
163
172
  </View>
164
- {isEditedMessageOpen && (
173
+ {isEdited && isEditedMessageOpen ? (
165
174
  <MessageEditedTimestamp message={message} MessageTimestamp={MessageTimestamp} />
166
- )}
175
+ ) : null}
167
176
  </>
168
177
  );
169
178
  };
@@ -265,6 +274,7 @@ export const MessageFooter = <
265
274
  const {
266
275
  alignment,
267
276
  isEditedMessageOpen,
277
+ isMessageAIGenerated,
268
278
  lastGroupMessage,
269
279
  members,
270
280
  message,
@@ -281,6 +291,7 @@ export const MessageFooter = <
281
291
  alignment,
282
292
  deletedMessagesVisibilityType,
283
293
  isEditedMessageOpen,
294
+ isMessageAIGenerated,
284
295
  lastGroupMessage,
285
296
  members,
286
297
  message,
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+
3
+ import { MessageTextContainer, MessageTextContainerProps } from './MessageTextContainer';
4
+
5
+ import { useMessageContext } from '../../../contexts';
6
+ import type { DefaultStreamChatGenerics } from '../../../types/types';
7
+ import { useStreamingMessage } from '../hooks/useStreamingMessage';
8
+
9
+ export type StreamingMessageViewProps<
10
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
11
+ > = Pick<MessageTextContainerProps<StreamChatGenerics>, 'message'> & {
12
+ letterInterval?: number;
13
+ renderingLetterCount?: number;
14
+ };
15
+
16
+ export const StreamingMessageView = <
17
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
18
+ >(
19
+ props: StreamingMessageViewProps<StreamChatGenerics>,
20
+ ) => {
21
+ const { letterInterval, message: messageFromProps, renderingLetterCount } = props;
22
+ const { message: messageFromContext } = useMessageContext<StreamChatGenerics>();
23
+ const message = messageFromProps || messageFromContext;
24
+ const { text = '' } = message;
25
+ const { streamedMessageText } = useStreamingMessage({
26
+ letterInterval,
27
+ renderingLetterCount,
28
+ text,
29
+ });
30
+
31
+ return <MessageTextContainer message={{ ...message, text: streamedMessageText }} />;
32
+ };
33
+
34
+ StreamingMessageView.displayName = 'StreamingMessageView{messageSimple{content}}';