stream-chat-react-native-core 9.0.0-beta.31 → 9.0.0-beta.32

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 (590) hide show
  1. package/lib/commonjs/components/Attachment/Attachment.js +15 -52
  2. package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
  3. package/lib/commonjs/components/Attachment/FileAttachment.js +4 -6
  4. package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
  5. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +4 -10
  6. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
  7. package/lib/commonjs/components/Attachment/FilePreview.js +3 -6
  8. package/lib/commonjs/components/Attachment/FilePreview.js.map +1 -1
  9. package/lib/commonjs/components/Attachment/Gallery.js +9 -28
  10. package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
  11. package/lib/commonjs/components/Attachment/GalleryImage.js +3 -3
  12. package/lib/commonjs/components/Attachment/GalleryImage.js.map +1 -1
  13. package/lib/commonjs/components/Attachment/Giphy/GiphyImage.js +7 -13
  14. package/lib/commonjs/components/Attachment/Giphy/GiphyImage.js.map +1 -1
  15. package/lib/commonjs/components/Attachment/UnsupportedAttachment.js +4 -6
  16. package/lib/commonjs/components/Attachment/UnsupportedAttachment.js.map +1 -1
  17. package/lib/commonjs/components/Attachment/UrlPreview/URLPreview.js +3 -3
  18. package/lib/commonjs/components/Attachment/UrlPreview/URLPreview.js.map +1 -1
  19. package/lib/commonjs/components/Attachment/UrlPreview/URLPreviewCompact.js +3 -3
  20. package/lib/commonjs/components/Attachment/UrlPreview/URLPreviewCompact.js.map +1 -1
  21. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +4 -2
  22. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  23. package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +7 -4
  24. package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
  25. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +9 -13
  26. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
  27. package/lib/commonjs/components/Channel/Channel.js +9 -418
  28. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  29. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +0 -8
  30. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  31. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -77
  32. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  33. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +2 -132
  34. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  35. package/lib/commonjs/components/ChannelList/ChannelList.js +1 -57
  36. package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
  37. package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js +4 -2
  38. package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js.map +1 -1
  39. package/lib/commonjs/components/ChannelList/ChannelListView.js +11 -20
  40. package/lib/commonjs/components/ChannelList/ChannelListView.js.map +1 -1
  41. package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +1 -39
  42. package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
  43. package/lib/commonjs/components/ChannelPreview/ChannelDetailsBottomSheet.js +3 -2
  44. package/lib/commonjs/components/ChannelPreview/ChannelDetailsBottomSheet.js.map +1 -1
  45. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +4 -6
  46. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
  47. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +6 -18
  48. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
  49. package/lib/commonjs/components/ChannelPreview/ChannelPreviewView.js +8 -28
  50. package/lib/commonjs/components/ChannelPreview/ChannelPreviewView.js.map +1 -1
  51. package/lib/commonjs/components/ChannelPreview/ChannelSwipableWrapper.js +3 -3
  52. package/lib/commonjs/components/ChannelPreview/ChannelSwipableWrapper.js.map +1 -1
  53. package/lib/commonjs/components/Chat/Chat.js +4 -6
  54. package/lib/commonjs/components/Chat/Chat.js.map +1 -1
  55. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +0 -2
  56. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  57. package/lib/commonjs/components/ImageGallery/ImageGallery.js +7 -9
  58. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  59. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +4 -2
  60. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  61. package/lib/commonjs/components/Message/Message.js +9 -13
  62. package/lib/commonjs/components/Message/Message.js.map +1 -1
  63. package/lib/commonjs/components/Message/MessageItemView/MessageBubble.js +4 -2
  64. package/lib/commonjs/components/Message/MessageItemView/MessageBubble.js.map +1 -1
  65. package/lib/commonjs/components/Message/MessageItemView/MessageContent.js +18 -39
  66. package/lib/commonjs/components/Message/MessageItemView/MessageContent.js.map +1 -1
  67. package/lib/commonjs/components/Message/MessageItemView/MessageDeleted.js +5 -7
  68. package/lib/commonjs/components/Message/MessageItemView/MessageDeleted.js.map +1 -1
  69. package/lib/commonjs/components/Message/MessageItemView/MessageFooter.js +4 -8
  70. package/lib/commonjs/components/Message/MessageItemView/MessageFooter.js.map +1 -1
  71. package/lib/commonjs/components/Message/MessageItemView/MessageHeader.js +8 -16
  72. package/lib/commonjs/components/Message/MessageItemView/MessageHeader.js.map +1 -1
  73. package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js +13 -35
  74. package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js.map +1 -1
  75. package/lib/commonjs/components/Message/MessageItemView/MessageReplies.js +3 -5
  76. package/lib/commonjs/components/Message/MessageItemView/MessageReplies.js.map +1 -1
  77. package/lib/commonjs/components/Message/MessageItemView/MessageTextContainer.js +3 -3
  78. package/lib/commonjs/components/Message/MessageItemView/MessageTextContainer.js.map +1 -1
  79. package/lib/commonjs/components/Message/MessageItemView/MessageWrapper.js +6 -4
  80. package/lib/commonjs/components/Message/MessageItemView/MessageWrapper.js.map +1 -1
  81. package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListBottom.js +6 -8
  82. package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListBottom.js.map +1 -1
  83. package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListTop.js +7 -11
  84. package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListTop.js.map +1 -1
  85. package/lib/commonjs/components/MessageInput/MessageComposer.js +15 -55
  86. package/lib/commonjs/components/MessageInput/MessageComposer.js.map +1 -1
  87. package/lib/commonjs/components/MessageInput/MessageInputHeaderView.js +5 -5
  88. package/lib/commonjs/components/MessageInput/MessageInputHeaderView.js.map +1 -1
  89. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +9 -17
  90. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
  91. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/FileAttachmentUploadPreview.js +5 -5
  92. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/FileAttachmentUploadPreview.js.map +1 -1
  93. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js +5 -5
  94. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js.map +1 -1
  95. package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js +5 -5
  96. package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js.map +1 -1
  97. package/lib/commonjs/components/MessageInput/components/InputButtons/index.js +4 -4
  98. package/lib/commonjs/components/MessageInput/components/InputButtons/index.js.map +1 -1
  99. package/lib/commonjs/components/MessageInput/components/LinkPreviewList.js +3 -2
  100. package/lib/commonjs/components/MessageInput/components/LinkPreviewList.js.map +1 -1
  101. package/lib/commonjs/components/MessageInput/components/OutputButtons/index.js +7 -13
  102. package/lib/commonjs/components/MessageInput/components/OutputButtons/index.js.map +1 -1
  103. package/lib/commonjs/components/MessageList/MessageFlashList.js +14 -40
  104. package/lib/commonjs/components/MessageList/MessageFlashList.js.map +1 -1
  105. package/lib/commonjs/components/MessageList/MessageList.js +12 -38
  106. package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
  107. package/lib/commonjs/components/MessageList/StickyHeader.js +3 -1
  108. package/lib/commonjs/components/MessageList/StickyHeader.js.map +1 -1
  109. package/lib/commonjs/components/MessageMenu/MessageActionList.js +4 -2
  110. package/lib/commonjs/components/MessageMenu/MessageActionList.js.map +1 -1
  111. package/lib/commonjs/components/MessageMenu/MessageMenu.js.map +1 -1
  112. package/lib/commonjs/components/MessageMenu/MessageUserReactions.js +4 -8
  113. package/lib/commonjs/components/MessageMenu/MessageUserReactions.js.map +1 -1
  114. package/lib/commonjs/components/MessageMenu/MessageUserReactionsItem.js +4 -2
  115. package/lib/commonjs/components/MessageMenu/MessageUserReactionsItem.js.map +1 -1
  116. package/lib/commonjs/components/Poll/CreatePollContent.js +3 -1
  117. package/lib/commonjs/components/Poll/CreatePollContent.js.map +1 -1
  118. package/lib/commonjs/components/Poll/Poll.js +12 -9
  119. package/lib/commonjs/components/Poll/Poll.js.map +1 -1
  120. package/lib/commonjs/components/Poll/components/PollAnswersList.js +5 -3
  121. package/lib/commonjs/components/Poll/components/PollAnswersList.js.map +1 -1
  122. package/lib/commonjs/components/Poll/components/PollOption.js +5 -3
  123. package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
  124. package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js +5 -5
  125. package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
  126. package/lib/commonjs/components/Poll/components/PollResults/PollResults.js +5 -3
  127. package/lib/commonjs/components/Poll/components/PollResults/PollResults.js.map +1 -1
  128. package/lib/commonjs/components/Reply/Reply.js +4 -2
  129. package/lib/commonjs/components/Reply/Reply.js.map +1 -1
  130. package/lib/commonjs/components/Thread/Thread.js +4 -8
  131. package/lib/commonjs/components/Thread/Thread.js.map +1 -1
  132. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +4 -6
  133. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
  134. package/lib/commonjs/components/ThreadList/ThreadList.js +12 -15
  135. package/lib/commonjs/components/ThreadList/ThreadList.js.map +1 -1
  136. package/lib/commonjs/components/ThreadList/ThreadListItem.js +8 -11
  137. package/lib/commonjs/components/ThreadList/ThreadListItem.js.map +1 -1
  138. package/lib/commonjs/components/ui/Avatar/Avatar.js +3 -3
  139. package/lib/commonjs/components/ui/Avatar/Avatar.js.map +1 -1
  140. package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
  141. package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
  142. package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
  143. package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
  144. package/lib/commonjs/contexts/componentsContext/ComponentsContext.js +37 -0
  145. package/lib/commonjs/contexts/componentsContext/ComponentsContext.js.map +1 -0
  146. package/lib/commonjs/contexts/componentsContext/PLAN.md +148 -0
  147. package/lib/commonjs/contexts/componentsContext/defaultComponents.js +286 -0
  148. package/lib/commonjs/contexts/componentsContext/defaultComponents.js.map +1 -0
  149. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +1 -9
  150. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
  151. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContextBase.js.map +1 -1
  152. package/lib/commonjs/contexts/index.js +11 -0
  153. package/lib/commonjs/contexts/index.js.map +1 -1
  154. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  155. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -76
  156. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  157. package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
  158. package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js +7 -5
  159. package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js.map +1 -1
  160. package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
  161. package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +1 -4
  162. package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
  163. package/lib/commonjs/contexts/threadsContext/ThreadsContext.js.map +1 -1
  164. package/lib/commonjs/version.json +1 -1
  165. package/lib/module/components/Attachment/Attachment.js +15 -52
  166. package/lib/module/components/Attachment/Attachment.js.map +1 -1
  167. package/lib/module/components/Attachment/FileAttachment.js +4 -6
  168. package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
  169. package/lib/module/components/Attachment/FileAttachmentGroup.js +4 -10
  170. package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
  171. package/lib/module/components/Attachment/FilePreview.js +3 -6
  172. package/lib/module/components/Attachment/FilePreview.js.map +1 -1
  173. package/lib/module/components/Attachment/Gallery.js +9 -28
  174. package/lib/module/components/Attachment/Gallery.js.map +1 -1
  175. package/lib/module/components/Attachment/GalleryImage.js +3 -3
  176. package/lib/module/components/Attachment/GalleryImage.js.map +1 -1
  177. package/lib/module/components/Attachment/Giphy/GiphyImage.js +7 -13
  178. package/lib/module/components/Attachment/Giphy/GiphyImage.js.map +1 -1
  179. package/lib/module/components/Attachment/UnsupportedAttachment.js +4 -6
  180. package/lib/module/components/Attachment/UnsupportedAttachment.js.map +1 -1
  181. package/lib/module/components/Attachment/UrlPreview/URLPreview.js +3 -3
  182. package/lib/module/components/Attachment/UrlPreview/URLPreview.js.map +1 -1
  183. package/lib/module/components/Attachment/UrlPreview/URLPreviewCompact.js +3 -3
  184. package/lib/module/components/Attachment/UrlPreview/URLPreviewCompact.js.map +1 -1
  185. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +4 -2
  186. package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  187. package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +7 -4
  188. package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
  189. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +9 -13
  190. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
  191. package/lib/module/components/Channel/Channel.js +9 -418
  192. package/lib/module/components/Channel/Channel.js.map +1 -1
  193. package/lib/module/components/Channel/hooks/useCreateChannelContext.js +0 -8
  194. package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  195. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -77
  196. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  197. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +2 -132
  198. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  199. package/lib/module/components/ChannelList/ChannelList.js +1 -57
  200. package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
  201. package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js +4 -2
  202. package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js.map +1 -1
  203. package/lib/module/components/ChannelList/ChannelListView.js +11 -20
  204. package/lib/module/components/ChannelList/ChannelListView.js.map +1 -1
  205. package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +1 -39
  206. package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
  207. package/lib/module/components/ChannelPreview/ChannelDetailsBottomSheet.js +3 -2
  208. package/lib/module/components/ChannelPreview/ChannelDetailsBottomSheet.js.map +1 -1
  209. package/lib/module/components/ChannelPreview/ChannelPreview.js +4 -6
  210. package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
  211. package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +6 -18
  212. package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
  213. package/lib/module/components/ChannelPreview/ChannelPreviewView.js +8 -28
  214. package/lib/module/components/ChannelPreview/ChannelPreviewView.js.map +1 -1
  215. package/lib/module/components/ChannelPreview/ChannelSwipableWrapper.js +3 -3
  216. package/lib/module/components/ChannelPreview/ChannelSwipableWrapper.js.map +1 -1
  217. package/lib/module/components/Chat/Chat.js +4 -6
  218. package/lib/module/components/Chat/Chat.js.map +1 -1
  219. package/lib/module/components/Chat/hooks/useCreateChatContext.js +0 -2
  220. package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  221. package/lib/module/components/ImageGallery/ImageGallery.js +7 -9
  222. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  223. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +4 -2
  224. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  225. package/lib/module/components/Message/Message.js +9 -13
  226. package/lib/module/components/Message/Message.js.map +1 -1
  227. package/lib/module/components/Message/MessageItemView/MessageBubble.js +4 -2
  228. package/lib/module/components/Message/MessageItemView/MessageBubble.js.map +1 -1
  229. package/lib/module/components/Message/MessageItemView/MessageContent.js +18 -39
  230. package/lib/module/components/Message/MessageItemView/MessageContent.js.map +1 -1
  231. package/lib/module/components/Message/MessageItemView/MessageDeleted.js +5 -7
  232. package/lib/module/components/Message/MessageItemView/MessageDeleted.js.map +1 -1
  233. package/lib/module/components/Message/MessageItemView/MessageFooter.js +4 -8
  234. package/lib/module/components/Message/MessageItemView/MessageFooter.js.map +1 -1
  235. package/lib/module/components/Message/MessageItemView/MessageHeader.js +8 -16
  236. package/lib/module/components/Message/MessageItemView/MessageHeader.js.map +1 -1
  237. package/lib/module/components/Message/MessageItemView/MessageItemView.js +13 -35
  238. package/lib/module/components/Message/MessageItemView/MessageItemView.js.map +1 -1
  239. package/lib/module/components/Message/MessageItemView/MessageReplies.js +3 -5
  240. package/lib/module/components/Message/MessageItemView/MessageReplies.js.map +1 -1
  241. package/lib/module/components/Message/MessageItemView/MessageTextContainer.js +3 -3
  242. package/lib/module/components/Message/MessageItemView/MessageTextContainer.js.map +1 -1
  243. package/lib/module/components/Message/MessageItemView/MessageWrapper.js +6 -4
  244. package/lib/module/components/Message/MessageItemView/MessageWrapper.js.map +1 -1
  245. package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListBottom.js +6 -8
  246. package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListBottom.js.map +1 -1
  247. package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListTop.js +7 -11
  248. package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListTop.js.map +1 -1
  249. package/lib/module/components/MessageInput/MessageComposer.js +15 -55
  250. package/lib/module/components/MessageInput/MessageComposer.js.map +1 -1
  251. package/lib/module/components/MessageInput/MessageInputHeaderView.js +5 -5
  252. package/lib/module/components/MessageInput/MessageInputHeaderView.js.map +1 -1
  253. package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +9 -17
  254. package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
  255. package/lib/module/components/MessageInput/components/AttachmentPreview/FileAttachmentUploadPreview.js +5 -5
  256. package/lib/module/components/MessageInput/components/AttachmentPreview/FileAttachmentUploadPreview.js.map +1 -1
  257. package/lib/module/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js +5 -5
  258. package/lib/module/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js.map +1 -1
  259. package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js +5 -5
  260. package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js.map +1 -1
  261. package/lib/module/components/MessageInput/components/InputButtons/index.js +4 -4
  262. package/lib/module/components/MessageInput/components/InputButtons/index.js.map +1 -1
  263. package/lib/module/components/MessageInput/components/LinkPreviewList.js +3 -2
  264. package/lib/module/components/MessageInput/components/LinkPreviewList.js.map +1 -1
  265. package/lib/module/components/MessageInput/components/OutputButtons/index.js +7 -13
  266. package/lib/module/components/MessageInput/components/OutputButtons/index.js.map +1 -1
  267. package/lib/module/components/MessageList/MessageFlashList.js +14 -40
  268. package/lib/module/components/MessageList/MessageFlashList.js.map +1 -1
  269. package/lib/module/components/MessageList/MessageList.js +12 -38
  270. package/lib/module/components/MessageList/MessageList.js.map +1 -1
  271. package/lib/module/components/MessageList/StickyHeader.js +3 -1
  272. package/lib/module/components/MessageList/StickyHeader.js.map +1 -1
  273. package/lib/module/components/MessageMenu/MessageActionList.js +4 -2
  274. package/lib/module/components/MessageMenu/MessageActionList.js.map +1 -1
  275. package/lib/module/components/MessageMenu/MessageMenu.js.map +1 -1
  276. package/lib/module/components/MessageMenu/MessageUserReactions.js +4 -8
  277. package/lib/module/components/MessageMenu/MessageUserReactions.js.map +1 -1
  278. package/lib/module/components/MessageMenu/MessageUserReactionsItem.js +4 -2
  279. package/lib/module/components/MessageMenu/MessageUserReactionsItem.js.map +1 -1
  280. package/lib/module/components/Poll/CreatePollContent.js +3 -1
  281. package/lib/module/components/Poll/CreatePollContent.js.map +1 -1
  282. package/lib/module/components/Poll/Poll.js +12 -9
  283. package/lib/module/components/Poll/Poll.js.map +1 -1
  284. package/lib/module/components/Poll/components/PollAnswersList.js +5 -3
  285. package/lib/module/components/Poll/components/PollAnswersList.js.map +1 -1
  286. package/lib/module/components/Poll/components/PollOption.js +5 -3
  287. package/lib/module/components/Poll/components/PollOption.js.map +1 -1
  288. package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js +5 -5
  289. package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
  290. package/lib/module/components/Poll/components/PollResults/PollResults.js +5 -3
  291. package/lib/module/components/Poll/components/PollResults/PollResults.js.map +1 -1
  292. package/lib/module/components/Reply/Reply.js +4 -2
  293. package/lib/module/components/Reply/Reply.js.map +1 -1
  294. package/lib/module/components/Thread/Thread.js +4 -8
  295. package/lib/module/components/Thread/Thread.js.map +1 -1
  296. package/lib/module/components/Thread/components/ThreadFooterComponent.js +4 -6
  297. package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
  298. package/lib/module/components/ThreadList/ThreadList.js +12 -15
  299. package/lib/module/components/ThreadList/ThreadList.js.map +1 -1
  300. package/lib/module/components/ThreadList/ThreadListItem.js +8 -11
  301. package/lib/module/components/ThreadList/ThreadListItem.js.map +1 -1
  302. package/lib/module/components/ui/Avatar/Avatar.js +3 -3
  303. package/lib/module/components/ui/Avatar/Avatar.js.map +1 -1
  304. package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
  305. package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
  306. package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
  307. package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
  308. package/lib/module/contexts/componentsContext/ComponentsContext.js +37 -0
  309. package/lib/module/contexts/componentsContext/ComponentsContext.js.map +1 -0
  310. package/lib/module/contexts/componentsContext/PLAN.md +148 -0
  311. package/lib/module/contexts/componentsContext/defaultComponents.js +286 -0
  312. package/lib/module/contexts/componentsContext/defaultComponents.js.map +1 -0
  313. package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +1 -9
  314. package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
  315. package/lib/module/contexts/imageGalleryContext/ImageGalleryContextBase.js.map +1 -1
  316. package/lib/module/contexts/index.js +11 -0
  317. package/lib/module/contexts/index.js.map +1 -1
  318. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  319. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -76
  320. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  321. package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
  322. package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js +7 -5
  323. package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js.map +1 -1
  324. package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
  325. package/lib/module/contexts/overlayContext/OverlayProvider.js +1 -4
  326. package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
  327. package/lib/module/contexts/threadsContext/ThreadsContext.js.map +1 -1
  328. package/lib/module/version.json +1 -1
  329. package/lib/typescript/components/Attachment/Attachment.d.ts +1 -1
  330. package/lib/typescript/components/Attachment/Attachment.d.ts.map +1 -1
  331. package/lib/typescript/components/Attachment/FileAttachment.d.ts +1 -1
  332. package/lib/typescript/components/Attachment/FileAttachment.d.ts.map +1 -1
  333. package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts +1 -2
  334. package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts.map +1 -1
  335. package/lib/typescript/components/Attachment/FilePreview.d.ts +2 -3
  336. package/lib/typescript/components/Attachment/FilePreview.d.ts.map +1 -1
  337. package/lib/typescript/components/Attachment/Gallery.d.ts +1 -1
  338. package/lib/typescript/components/Attachment/Gallery.d.ts.map +1 -1
  339. package/lib/typescript/components/Attachment/GalleryImage.d.ts +3 -2
  340. package/lib/typescript/components/Attachment/GalleryImage.d.ts.map +1 -1
  341. package/lib/typescript/components/Attachment/Giphy/GiphyImage.d.ts +4 -2
  342. package/lib/typescript/components/Attachment/Giphy/GiphyImage.d.ts.map +1 -1
  343. package/lib/typescript/components/Attachment/UnsupportedAttachment.d.ts +2 -3
  344. package/lib/typescript/components/Attachment/UnsupportedAttachment.d.ts.map +1 -1
  345. package/lib/typescript/components/Attachment/UrlPreview/URLPreview.d.ts +4 -3
  346. package/lib/typescript/components/Attachment/UrlPreview/URLPreview.d.ts.map +1 -1
  347. package/lib/typescript/components/Attachment/UrlPreview/URLPreviewCompact.d.ts +4 -3
  348. package/lib/typescript/components/Attachment/UrlPreview/URLPreviewCompact.d.ts.map +1 -1
  349. package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts.map +1 -1
  350. package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.d.ts.map +1 -1
  351. package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts +2 -3
  352. package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts.map +1 -1
  353. package/lib/typescript/components/Channel/Channel.d.ts +3 -28
  354. package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
  355. package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
  356. package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts.map +1 -1
  357. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +1 -1
  358. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts.map +1 -1
  359. package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
  360. package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts.map +1 -1
  361. package/lib/typescript/components/Channel/hooks/useMessageListPagination.d.ts.map +1 -1
  362. package/lib/typescript/components/ChannelList/ChannelList.d.ts +2 -10
  363. package/lib/typescript/components/ChannelList/ChannelList.d.ts.map +1 -1
  364. package/lib/typescript/components/ChannelList/ChannelListLoadingIndicator.d.ts.map +1 -1
  365. package/lib/typescript/components/ChannelList/ChannelListView.d.ts +1 -1
  366. package/lib/typescript/components/ChannelList/ChannelListView.d.ts.map +1 -1
  367. package/lib/typescript/components/ChannelList/hooks/useCreateChannelsContext.d.ts +1 -1
  368. package/lib/typescript/components/ChannelList/hooks/useCreateChannelsContext.d.ts.map +1 -1
  369. package/lib/typescript/components/ChannelPreview/ChannelDetailsBottomSheet.d.ts +1 -2
  370. package/lib/typescript/components/ChannelPreview/ChannelDetailsBottomSheet.d.ts.map +1 -1
  371. package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts +1 -1
  372. package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts.map +1 -1
  373. package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts +1 -2
  374. package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts.map +1 -1
  375. package/lib/typescript/components/ChannelPreview/ChannelPreviewView.d.ts +1 -1
  376. package/lib/typescript/components/ChannelPreview/ChannelPreviewView.d.ts.map +1 -1
  377. package/lib/typescript/components/ChannelPreview/ChannelSwipableWrapper.d.ts +1 -3
  378. package/lib/typescript/components/ChannelPreview/ChannelSwipableWrapper.d.ts.map +1 -1
  379. package/lib/typescript/components/Chat/Chat.d.ts +1 -7
  380. package/lib/typescript/components/Chat/Chat.d.ts.map +1 -1
  381. package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
  382. package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts.map +1 -1
  383. package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +6 -1
  384. package/lib/typescript/components/ImageGallery/ImageGallery.d.ts.map +1 -1
  385. package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts.map +1 -1
  386. package/lib/typescript/components/ImageGallery/components/types.d.ts +0 -2
  387. package/lib/typescript/components/ImageGallery/components/types.d.ts.map +1 -1
  388. package/lib/typescript/components/Message/Message.d.ts +1 -1
  389. package/lib/typescript/components/Message/Message.d.ts.map +1 -1
  390. package/lib/typescript/components/Message/MessageItemView/MessageBubble.d.ts +1 -2
  391. package/lib/typescript/components/Message/MessageItemView/MessageBubble.d.ts.map +1 -1
  392. package/lib/typescript/components/Message/MessageItemView/MessageContent.d.ts +1 -1
  393. package/lib/typescript/components/Message/MessageItemView/MessageContent.d.ts.map +1 -1
  394. package/lib/typescript/components/Message/MessageItemView/MessageDeleted.d.ts +1 -2
  395. package/lib/typescript/components/Message/MessageItemView/MessageDeleted.d.ts.map +1 -1
  396. package/lib/typescript/components/Message/MessageItemView/MessageFooter.d.ts +0 -2
  397. package/lib/typescript/components/Message/MessageItemView/MessageFooter.d.ts.map +1 -1
  398. package/lib/typescript/components/Message/MessageItemView/MessageHeader.d.ts.map +1 -1
  399. package/lib/typescript/components/Message/MessageItemView/MessageItemView.d.ts +1 -1
  400. package/lib/typescript/components/Message/MessageItemView/MessageItemView.d.ts.map +1 -1
  401. package/lib/typescript/components/Message/MessageItemView/MessageReplies.d.ts +1 -2
  402. package/lib/typescript/components/Message/MessageItemView/MessageReplies.d.ts.map +1 -1
  403. package/lib/typescript/components/Message/MessageItemView/MessageTextContainer.d.ts +1 -1
  404. package/lib/typescript/components/Message/MessageItemView/MessageTextContainer.d.ts.map +1 -1
  405. package/lib/typescript/components/Message/MessageItemView/MessageWrapper.d.ts.map +1 -1
  406. package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListBottom.d.ts +1 -1
  407. package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListBottom.d.ts.map +1 -1
  408. package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListTop.d.ts +1 -1
  409. package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListTop.d.ts.map +1 -1
  410. package/lib/typescript/components/MessageInput/MessageComposer.d.ts +1 -2
  411. package/lib/typescript/components/MessageInput/MessageComposer.d.ts.map +1 -1
  412. package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.d.ts +3 -4
  413. package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.d.ts.map +1 -1
  414. package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.d.ts +1 -1
  415. package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.d.ts.map +1 -1
  416. package/lib/typescript/components/MessageInput/components/InputButtons/index.d.ts +1 -1
  417. package/lib/typescript/components/MessageInput/components/InputButtons/index.d.ts.map +1 -1
  418. package/lib/typescript/components/MessageInput/components/LinkPreviewList.d.ts.map +1 -1
  419. package/lib/typescript/components/MessageInput/components/OutputButtons/index.d.ts +1 -1
  420. package/lib/typescript/components/MessageInput/components/OutputButtons/index.d.ts.map +1 -1
  421. package/lib/typescript/components/MessageList/MessageFlashList.d.ts +1 -1
  422. package/lib/typescript/components/MessageList/MessageFlashList.d.ts.map +1 -1
  423. package/lib/typescript/components/MessageList/MessageList.d.ts +1 -1
  424. package/lib/typescript/components/MessageList/MessageList.d.ts.map +1 -1
  425. package/lib/typescript/components/MessageList/StickyHeader.d.ts +2 -3
  426. package/lib/typescript/components/MessageList/StickyHeader.d.ts.map +1 -1
  427. package/lib/typescript/components/MessageMenu/MessageActionList.d.ts +1 -2
  428. package/lib/typescript/components/MessageMenu/MessageActionList.d.ts.map +1 -1
  429. package/lib/typescript/components/MessageMenu/MessageMenu.d.ts +1 -2
  430. package/lib/typescript/components/MessageMenu/MessageMenu.d.ts.map +1 -1
  431. package/lib/typescript/components/MessageMenu/MessageUserReactions.d.ts +1 -1
  432. package/lib/typescript/components/MessageMenu/MessageUserReactions.d.ts.map +1 -1
  433. package/lib/typescript/components/MessageMenu/MessageUserReactionsItem.d.ts +2 -3
  434. package/lib/typescript/components/MessageMenu/MessageUserReactionsItem.d.ts.map +1 -1
  435. package/lib/typescript/components/Poll/CreatePollContent.d.ts +2 -2
  436. package/lib/typescript/components/Poll/CreatePollContent.d.ts.map +1 -1
  437. package/lib/typescript/components/Poll/Poll.d.ts +5 -8
  438. package/lib/typescript/components/Poll/Poll.d.ts.map +1 -1
  439. package/lib/typescript/components/Poll/components/PollAnswersList.d.ts +1 -2
  440. package/lib/typescript/components/Poll/components/PollAnswersList.d.ts.map +1 -1
  441. package/lib/typescript/components/Poll/components/PollOption.d.ts +1 -2
  442. package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
  443. package/lib/typescript/components/Poll/components/PollResults/PollOptionFullResults.d.ts +1 -4
  444. package/lib/typescript/components/Poll/components/PollResults/PollOptionFullResults.d.ts.map +1 -1
  445. package/lib/typescript/components/Poll/components/PollResults/PollResults.d.ts +1 -2
  446. package/lib/typescript/components/Poll/components/PollResults/PollResults.d.ts.map +1 -1
  447. package/lib/typescript/components/Reply/Reply.d.ts +4 -3
  448. package/lib/typescript/components/Reply/Reply.d.ts.map +1 -1
  449. package/lib/typescript/components/Thread/Thread.d.ts +2 -8
  450. package/lib/typescript/components/Thread/Thread.d.ts.map +1 -1
  451. package/lib/typescript/components/Thread/components/ThreadFooterComponent.d.ts +1 -2
  452. package/lib/typescript/components/Thread/components/ThreadFooterComponent.d.ts.map +1 -1
  453. package/lib/typescript/components/ThreadList/ThreadList.d.ts +2 -3
  454. package/lib/typescript/components/ThreadList/ThreadList.d.ts.map +1 -1
  455. package/lib/typescript/components/ThreadList/ThreadListItem.d.ts.map +1 -1
  456. package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +0 -17
  457. package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts.map +1 -1
  458. package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +0 -23
  459. package/lib/typescript/contexts/channelContext/ChannelContext.d.ts.map +1 -1
  460. package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +0 -112
  461. package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts.map +1 -1
  462. package/lib/typescript/contexts/chatContext/ChatContext.d.ts +0 -5
  463. package/lib/typescript/contexts/chatContext/ChatContext.d.ts.map +1 -1
  464. package/lib/typescript/contexts/componentsContext/ComponentsContext.d.ts +321 -0
  465. package/lib/typescript/contexts/componentsContext/ComponentsContext.d.ts.map +1 -0
  466. package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts +296 -0
  467. package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts.map +1 -0
  468. package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts.map +1 -1
  469. package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContextBase.d.ts +0 -5
  470. package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContextBase.d.ts.map +1 -1
  471. package/lib/typescript/contexts/index.d.ts +1 -0
  472. package/lib/typescript/contexts/index.d.ts.map +1 -1
  473. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +1 -169
  474. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
  475. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
  476. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts.map +1 -1
  477. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +3 -332
  478. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts.map +1 -1
  479. package/lib/typescript/contexts/overlayContext/MessageOverlayHostLayer.d.ts +2 -5
  480. package/lib/typescript/contexts/overlayContext/MessageOverlayHostLayer.d.ts.map +1 -1
  481. package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +0 -4
  482. package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts.map +1 -1
  483. package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts.map +1 -1
  484. package/lib/typescript/contexts/threadsContext/ThreadsContext.d.ts +0 -9
  485. package/lib/typescript/contexts/threadsContext/ThreadsContext.d.ts.map +1 -1
  486. package/package.json +1 -1
  487. package/src/__tests__/offline-support/offline-feature.js +64 -67
  488. package/src/components/Attachment/Attachment.tsx +7 -69
  489. package/src/components/Attachment/FileAttachment.tsx +4 -7
  490. package/src/components/Attachment/FileAttachmentGroup.tsx +9 -19
  491. package/src/components/Attachment/FilePreview.tsx +4 -9
  492. package/src/components/Attachment/Gallery.tsx +6 -83
  493. package/src/components/Attachment/GalleryImage.tsx +5 -4
  494. package/src/components/Attachment/Giphy/GiphyImage.tsx +15 -37
  495. package/src/components/Attachment/UnsupportedAttachment.tsx +5 -10
  496. package/src/components/Attachment/UrlPreview/URLPreview.tsx +6 -4
  497. package/src/components/Attachment/UrlPreview/URLPreviewCompact.tsx +6 -4
  498. package/src/components/AttachmentPicker/AttachmentPicker.tsx +2 -2
  499. package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx +5 -4
  500. package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +4 -20
  501. package/src/components/Channel/Channel.tsx +31 -438
  502. package/src/components/Channel/__tests__/isAttachmentEqualHandler.test.js +12 -9
  503. package/src/components/Channel/hooks/useCreateChannelContext.ts +0 -8
  504. package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +1 -81
  505. package/src/components/Channel/hooks/useCreateMessagesContext.ts +0 -130
  506. package/src/components/ChannelList/ChannelList.tsx +3 -76
  507. package/src/components/ChannelList/ChannelListLoadingIndicator.tsx +3 -1
  508. package/src/components/ChannelList/ChannelListView.tsx +12 -33
  509. package/src/components/ChannelList/__tests__/ChannelList.test.js +173 -116
  510. package/src/components/ChannelList/__tests__/ChannelListView.test.js +64 -41
  511. package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +0 -39
  512. package/src/components/ChannelPreview/ChannelDetailsBottomSheet.tsx +2 -2
  513. package/src/components/ChannelPreview/ChannelPreview.tsx +6 -14
  514. package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +7 -33
  515. package/src/components/ChannelPreview/ChannelPreviewView.tsx +11 -40
  516. package/src/components/ChannelPreview/ChannelSwipableWrapper.tsx +2 -4
  517. package/src/components/ChannelPreview/__tests__/ChannelDetailsBottomSheet.test.tsx +16 -12
  518. package/src/components/ChannelPreview/__tests__/ChannelPreview.test.tsx +25 -24
  519. package/src/components/ChannelPreview/__tests__/ChannelSwipableWrapper.test.tsx +11 -6
  520. package/src/components/Chat/Chat.tsx +5 -12
  521. package/src/components/Chat/hooks/useCreateChatContext.ts +0 -2
  522. package/src/components/ImageGallery/ImageGallery.tsx +14 -16
  523. package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +0 -8
  524. package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +25 -21
  525. package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +3 -1
  526. package/src/components/ImageGallery/components/types.ts +0 -3
  527. package/src/components/Message/Message.tsx +11 -32
  528. package/src/components/Message/MessageItemView/MessageBubble.tsx +11 -7
  529. package/src/components/Message/MessageItemView/MessageContent.tsx +14 -47
  530. package/src/components/Message/MessageItemView/MessageDeleted.tsx +3 -9
  531. package/src/components/Message/MessageItemView/MessageFooter.tsx +2 -14
  532. package/src/components/Message/MessageItemView/MessageHeader.tsx +11 -29
  533. package/src/components/Message/MessageItemView/MessageItemView.tsx +10 -42
  534. package/src/components/Message/MessageItemView/MessageReplies.tsx +2 -8
  535. package/src/components/Message/MessageItemView/MessageTextContainer.tsx +4 -8
  536. package/src/components/Message/MessageItemView/MessageWrapper.tsx +4 -9
  537. package/src/components/Message/MessageItemView/ReactionList/ReactionListBottom.tsx +4 -12
  538. package/src/components/Message/MessageItemView/ReactionList/ReactionListTop.tsx +4 -20
  539. package/src/components/Message/MessageItemView/__tests__/MessageContent.test.js +47 -30
  540. package/src/components/Message/MessageItemView/__tests__/MessageItemView.test.js +16 -7
  541. package/src/components/Message/MessageItemView/__tests__/MessageTextContainer.test.tsx +8 -4
  542. package/src/components/MessageInput/MessageComposer.tsx +16 -76
  543. package/src/components/MessageInput/MessageInputHeaderView.tsx +3 -3
  544. package/src/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.tsx +7 -35
  545. package/src/components/MessageInput/components/AttachmentPreview/FileAttachmentUploadPreview.tsx +2 -2
  546. package/src/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.tsx +2 -2
  547. package/src/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.tsx +6 -4
  548. package/src/components/MessageInput/components/InputButtons/index.tsx +4 -5
  549. package/src/components/MessageInput/components/LinkPreviewList.tsx +3 -2
  550. package/src/components/MessageInput/components/OutputButtons/index.tsx +4 -23
  551. package/src/components/MessageList/MessageFlashList.tsx +13 -57
  552. package/src/components/MessageList/MessageList.tsx +15 -57
  553. package/src/components/MessageList/StickyHeader.tsx +4 -3
  554. package/src/components/MessageMenu/MessageActionList.tsx +4 -3
  555. package/src/components/MessageMenu/MessageMenu.tsx +35 -47
  556. package/src/components/MessageMenu/MessageUserReactions.tsx +7 -27
  557. package/src/components/MessageMenu/MessageUserReactionsItem.tsx +3 -6
  558. package/src/components/MessageMenu/__tests__/MessageUserReactions.test.tsx +12 -11
  559. package/src/components/Poll/CreatePollContent.tsx +3 -4
  560. package/src/components/Poll/Poll.tsx +22 -24
  561. package/src/components/Poll/components/PollAnswersList.tsx +9 -11
  562. package/src/components/Poll/components/PollOption.tsx +9 -11
  563. package/src/components/Poll/components/PollResults/PollOptionFullResults.tsx +10 -11
  564. package/src/components/Poll/components/PollResults/PollResults.tsx +9 -15
  565. package/src/components/Reply/Reply.tsx +18 -5
  566. package/src/components/Thread/Thread.tsx +3 -18
  567. package/src/components/Thread/components/ThreadFooterComponent.tsx +10 -11
  568. package/src/components/ThreadList/ThreadList.tsx +14 -22
  569. package/src/components/ThreadList/ThreadListItem.tsx +6 -11
  570. package/src/components/ui/Avatar/Avatar.tsx +2 -2
  571. package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +0 -15
  572. package/src/contexts/channelContext/ChannelContext.tsx +0 -24
  573. package/src/contexts/channelsContext/ChannelsContext.tsx +0 -113
  574. package/src/contexts/chatContext/ChatContext.tsx +0 -5
  575. package/src/contexts/componentsContext/ComponentsContext.tsx +62 -0
  576. package/src/contexts/componentsContext/PLAN.md +148 -0
  577. package/src/contexts/componentsContext/__tests__/defaultComponents.test.ts +44 -0
  578. package/src/contexts/componentsContext/defaultComponents.ts +332 -0
  579. package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +0 -8
  580. package/src/contexts/imageGalleryContext/ImageGalleryContextBase.tsx +0 -10
  581. package/src/contexts/index.ts +1 -0
  582. package/src/contexts/messageInputContext/MessageInputContext.tsx +0 -185
  583. package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +1 -75
  584. package/src/contexts/messagesContext/MessagesContext.tsx +3 -358
  585. package/src/contexts/overlayContext/MessageOverlayHostLayer.tsx +5 -7
  586. package/src/contexts/overlayContext/OverlayContext.tsx +0 -4
  587. package/src/contexts/overlayContext/OverlayProvider.tsx +1 -2
  588. package/src/contexts/overlayContext/__tests__/MessageOverlayHostLayer.test.tsx +21 -6
  589. package/src/contexts/threadsContext/ThreadsContext.tsx +0 -9
  590. package/src/version.json +1 -1
@@ -9,7 +9,7 @@ import { v4 as uuidv4 } from 'uuid';
9
9
 
10
10
  import { ChannelList } from '../../components/ChannelList/ChannelList';
11
11
  import { Chat } from '../../components/Chat/Chat';
12
- import { useChannelsContext } from '../../contexts/channelsContext/ChannelsContext';
12
+ import { WithComponents } from '../../contexts/componentsContext/ComponentsContext';
13
13
  import { getOrCreateChannelApi } from '../../mock-builders/api/getOrCreateChannel';
14
14
  import { queryChannelsApi } from '../../mock-builders/api/queryChannels';
15
15
  import { useMockedApis } from '../../mock-builders/api/useMockedApis';
@@ -48,33 +48,17 @@ import { BetterSqlite } from '../../test-utils/BetterSqlite';
48
48
  * to those components might end up breaking tests for ChannelList, which will be quite painful
49
49
  * to debug.
50
50
  */
51
- const ChannelPreviewComponent = ({ channel, setActiveChannel }) => (
52
- <View accessibilityLabel='list-item' onPress={setActiveChannel} testID={channel.cid}>
53
- <Text>{channel.data.name}</Text>
54
- <Text>{channel.state.messages[0]?.text}</Text>
51
+ /**
52
+ * Custom Preview component used via WithComponents.
53
+ * Receives { channel, muted, unread, lastMessage } from ChannelPreview.
54
+ */
55
+ const ChannelPreviewComponent = ({ channel }) => (
56
+ <View accessibilityLabel='list-item' testID={channel.cid}>
57
+ <Text>{channel.data?.name}</Text>
58
+ <Text>{channel.state?.messages?.[0]?.text}</Text>
55
59
  </View>
56
60
  );
57
61
 
58
- const ChannelListComponent = (props) => {
59
- const { channels, onSelect } = useChannelsContext();
60
- if (!channels) {
61
- return null;
62
- }
63
-
64
- return (
65
- <View testID='channel-list'>
66
- {channels?.map((channel) => (
67
- <ChannelPreviewComponent
68
- {...props}
69
- channel={channel}
70
- key={channel.id}
71
- setActiveChannel={onSelect}
72
- />
73
- ))}
74
- </View>
75
- );
76
- };
77
-
78
62
  test('Workaround to allow exporting tests', () => expect(true).toBe(true));
79
63
 
80
64
  export const Generic = () => {
@@ -223,12 +207,9 @@ export const Generic = () => {
223
207
  const renderComponent = () =>
224
208
  render(
225
209
  <Chat client={chatClient} enableOfflineSupport>
226
- <ChannelList
227
- filters={filters}
228
- List={ChannelListComponent}
229
- Preview={ChannelPreviewComponent}
230
- sort={sort}
231
- />
210
+ <WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
211
+ <ChannelList filters={filters} sort={sort} swipeActionsEnabled={false} />
212
+ </WithComponents>
232
213
  </Chat>,
233
214
  );
234
215
 
@@ -325,7 +306,7 @@ export const Generic = () => {
325
306
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
326
307
 
327
308
  await waitFor(async () => {
328
- expect(screen.getByTestId('channel-list')).toBeTruthy();
309
+ expect(screen.getByTestId('channel-list-view')).toBeTruthy();
329
310
  await expectCIDsOnUIToBeInDB(screen.queryAllByLabelText);
330
311
  });
331
312
  });
@@ -340,7 +321,7 @@ export const Generic = () => {
340
321
 
341
322
  await waitFor(
342
323
  async () => {
343
- expect(screen.getByTestId('channel-list')).toBeTruthy();
324
+ expect(screen.getByTestId('channel-list-view')).toBeTruthy();
344
325
  await expectAllChannelsWithStateToBeInDB(screen.queryAllByLabelText);
345
326
  },
346
327
  { timeout: 5000 },
@@ -359,7 +340,7 @@ export const Generic = () => {
359
340
  await act(
360
341
  async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true),
361
342
  );
362
- expect(screen.getByTestId('channel-list')).toBeTruthy();
343
+ expect(screen.getByTestId('channel-list-view')).toBeTruthy();
363
344
  expect(screen.getByTestId(emptyChannel.cid)).toBeTruthy();
364
345
  expect(chatClient.hydrateActiveChannels).toHaveBeenCalled();
365
346
  expect(chatClient.hydrateActiveChannels.mock.calls[0][0]).toStrictEqual([emptyChannel]);
@@ -372,7 +353,7 @@ export const Generic = () => {
372
353
  renderComponent();
373
354
  act(() => dispatchConnectionChangedEvent(chatClient));
374
355
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
375
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
356
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
376
357
  const targetChannel = channels[0].channel;
377
358
  const newMessage = generateMessage({
378
359
  cid: targetChannel.cid,
@@ -401,7 +382,7 @@ export const Generic = () => {
401
382
  renderComponent();
402
383
  act(() => dispatchConnectionChangedEvent(chatClient));
403
384
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
404
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
385
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
405
386
  const targetChannel = channels[0].channel;
406
387
 
407
388
  // check if the reads state is correct first
@@ -463,7 +444,7 @@ export const Generic = () => {
463
444
  renderComponent();
464
445
  act(() => dispatchConnectionChangedEvent(chatClient));
465
446
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
466
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
447
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
467
448
  const targetChannel = channels[0].channel;
468
449
 
469
450
  // check if the reads state is correct first
@@ -526,7 +507,7 @@ export const Generic = () => {
526
507
  act(() => dispatchConnectionChangedEvent(chatClient));
527
508
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
528
509
  await waitFor(() => {
529
- expect(screen.getByTestId('channel-list')).toBeTruthy();
510
+ expect(screen.getByTestId('channel-list-view')).toBeTruthy();
530
511
  });
531
512
 
532
513
  const newChannel = createChannel();
@@ -534,13 +515,26 @@ export const Generic = () => {
534
515
  useMockedApis(chatClient, [getOrCreateChannelApi(newChannel)]);
535
516
 
536
517
  await act(() => dispatchNotificationMessageNewEvent(chatClient, newChannel.channel));
518
+
519
+ // Verify the new channel appears on the UI
537
520
  await waitFor(() => {
538
521
  const channelIdsOnUI = screen
539
522
  .queryAllByLabelText('list-item')
540
523
  .map((node) => node._fiber.pendingProps.testID);
541
524
  expect(channelIdsOnUI.includes(newChannel.channel.cid)).toBeTruthy();
542
525
  });
543
- await expectAllChannelsWithStateToBeInDB(screen.queryAllByLabelText);
526
+
527
+ // Verify the new channel and its state are persisted in the DB
528
+ await waitFor(async () => {
529
+ const channelsRows = await BetterSqlite.selectFromTable('channels');
530
+ const messagesRows = await BetterSqlite.selectFromTable('messages');
531
+
532
+ expect(channelsRows.length).toBe(channels.length);
533
+ expect(messagesRows.length).toBe(allMessages.length);
534
+
535
+ const matchingChannelRow = channelsRows.filter((c) => c.id === newChannel.channel.id);
536
+ expect(matchingChannelRow.length).toBe(1);
537
+ });
544
538
  });
545
539
 
546
540
  it('should update a message in database', async () => {
@@ -549,7 +543,7 @@ export const Generic = () => {
549
543
  renderComponent();
550
544
  act(() => dispatchConnectionChangedEvent(chatClient));
551
545
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
552
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
546
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
553
547
 
554
548
  const updatedMessage = { ...channels[0].messages[0] };
555
549
  updatedMessage.text = uuidv4();
@@ -571,7 +565,7 @@ export const Generic = () => {
571
565
  renderComponent();
572
566
  act(() => dispatchConnectionChangedEvent(chatClient));
573
567
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
574
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
568
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
575
569
  const removedChannel = channels[getRandomInt(0, channels.length - 1)].channel;
576
570
  act(() => dispatchNotificationRemovedFromChannel(chatClient, removedChannel));
577
571
  await waitFor(async () => {
@@ -598,7 +592,7 @@ export const Generic = () => {
598
592
  renderComponent();
599
593
  act(() => dispatchConnectionChangedEvent(chatClient));
600
594
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
601
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
595
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
602
596
  const removedChannel = channels[getRandomInt(0, channels.length - 1)].channel;
603
597
  act(() => dispatchChannelDeletedEvent(chatClient, removedChannel));
604
598
  await waitFor(async () => {
@@ -625,7 +619,7 @@ export const Generic = () => {
625
619
  renderComponent();
626
620
  act(() => dispatchConnectionChangedEvent(chatClient));
627
621
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
628
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
622
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
629
623
  const hiddenChannel = channels[getRandomInt(0, channels.length - 1)].channel;
630
624
  act(() => dispatchChannelHiddenEvent(chatClient, hiddenChannel));
631
625
  await waitFor(async () => {
@@ -655,7 +649,7 @@ export const Generic = () => {
655
649
  renderComponent();
656
650
  act(() => dispatchConnectionChangedEvent(chatClient));
657
651
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
658
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
652
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
659
653
  const hiddenChannel = channels[getRandomInt(0, channels.length - 1)].channel;
660
654
  // first, we mark it as hidden
661
655
  act(() => dispatchChannelHiddenEvent(chatClient, hiddenChannel));
@@ -708,20 +702,23 @@ export const Generic = () => {
708
702
  renderComponent();
709
703
  act(() => dispatchConnectionChangedEvent(chatClient));
710
704
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
711
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
705
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
712
706
 
713
707
  const newChannel = createChannel();
714
708
  useMockedApis(chatClient, [getOrCreateChannelApi(newChannel)]);
715
709
 
716
- act(() => dispatchNotificationAddedToChannel(chatClient, newChannel.channel));
710
+ await act(() => dispatchNotificationAddedToChannel(chatClient, newChannel.channel));
717
711
 
718
- await waitFor(async () => {
712
+ // Verify the new channel appears on the UI
713
+ await waitFor(() => {
719
714
  const channelIdsOnUI = screen
720
715
  .queryAllByLabelText('list-item')
721
716
  .map((node) => node._fiber.pendingProps.testID);
722
717
  expect(channelIdsOnUI.includes(newChannel.channel.cid)).toBeTruthy();
718
+ });
723
719
 
724
- await expectCIDsOnUIToBeInDB(screen.queryAllByLabelText);
720
+ // Verify the new channel is persisted in the DB
721
+ await waitFor(async () => {
725
722
  const channelsRows = await BetterSqlite.selectFromTable('channels');
726
723
  const matchingChannelsRows = channelsRows.filter((c) => c.id === newChannel.channel.id);
727
724
 
@@ -739,7 +736,7 @@ export const Generic = () => {
739
736
  renderComponent();
740
737
  act(() => dispatchConnectionChangedEvent(chatClient));
741
738
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
742
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
739
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
743
740
 
744
741
  const channelToTruncate = channels[getRandomInt(0, channels.length - 1)].channel;
745
742
  act(() => dispatchChannelTruncatedEvent(chatClient, channelToTruncate));
@@ -771,7 +768,7 @@ export const Generic = () => {
771
768
  renderComponent();
772
769
  act(() => dispatchConnectionChangedEvent(chatClient));
773
770
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
774
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
771
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
775
772
 
776
773
  const channelResponse = channels[getRandomInt(0, channels.length - 1)];
777
774
  const channelToTruncate = channelResponse.channel;
@@ -815,7 +812,7 @@ export const Generic = () => {
815
812
  renderComponent();
816
813
  act(() => dispatchConnectionChangedEvent(chatClient));
817
814
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
818
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
815
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
819
816
 
820
817
  const channelResponse = channels[getRandomInt(0, channels.length - 1)];
821
818
  const channelToTruncate = channelResponse.channel;
@@ -847,7 +844,7 @@ export const Generic = () => {
847
844
  renderComponent();
848
845
  act(() => dispatchConnectionChangedEvent(chatClient));
849
846
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
850
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
847
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
851
848
 
852
849
  const channelResponse = channels[getRandomInt(0, channels.length - 1)];
853
850
  const channelToTruncate = channelResponse.channel;
@@ -881,7 +878,7 @@ export const Generic = () => {
881
878
  renderComponent();
882
879
  act(() => dispatchConnectionChangedEvent(chatClient));
883
880
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
884
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
881
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
885
882
 
886
883
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
887
884
  const targetMessage =
@@ -926,7 +923,7 @@ export const Generic = () => {
926
923
  renderComponent();
927
924
  act(() => dispatchConnectionChangedEvent(chatClient));
928
925
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
929
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
926
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
930
927
 
931
928
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
932
929
  const targetMessage =
@@ -1010,7 +1007,7 @@ export const Generic = () => {
1010
1007
  renderComponent();
1011
1008
  act(() => dispatchConnectionChangedEvent(chatClient));
1012
1009
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1013
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1010
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1014
1011
 
1015
1012
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1016
1013
  const targetMessage =
@@ -1076,7 +1073,7 @@ export const Generic = () => {
1076
1073
  renderComponent();
1077
1074
  act(() => dispatchConnectionChangedEvent(chatClient));
1078
1075
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1079
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1076
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1080
1077
 
1081
1078
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1082
1079
  const targetMessage =
@@ -1130,7 +1127,7 @@ export const Generic = () => {
1130
1127
  renderComponent();
1131
1128
  act(() => dispatchConnectionChangedEvent(chatClient));
1132
1129
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1133
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1130
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1134
1131
 
1135
1132
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1136
1133
  const targetMessage =
@@ -1167,7 +1164,7 @@ export const Generic = () => {
1167
1164
  renderComponent();
1168
1165
  act(() => dispatchConnectionChangedEvent(chatClient));
1169
1166
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1170
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1167
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1171
1168
 
1172
1169
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1173
1170
  const targetMessage =
@@ -1264,7 +1261,7 @@ export const Generic = () => {
1264
1261
  renderComponent();
1265
1262
  act(() => dispatchConnectionChangedEvent(chatClient));
1266
1263
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1267
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1264
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1268
1265
 
1269
1266
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1270
1267
  const targetMessage =
@@ -1323,7 +1320,7 @@ export const Generic = () => {
1323
1320
  renderComponent();
1324
1321
  act(() => dispatchConnectionChangedEvent(chatClient));
1325
1322
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1326
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1323
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1327
1324
 
1328
1325
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1329
1326
  const targetMessage =
@@ -1380,7 +1377,7 @@ export const Generic = () => {
1380
1377
  renderComponent();
1381
1378
  act(() => dispatchConnectionChangedEvent(chatClient));
1382
1379
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1383
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1380
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1384
1381
 
1385
1382
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1386
1383
  const targetMessage =
@@ -1438,7 +1435,7 @@ export const Generic = () => {
1438
1435
 
1439
1436
  act(() => dispatchConnectionChangedEvent(chatClient));
1440
1437
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1441
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1438
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1442
1439
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1443
1440
 
1444
1441
  const oldMemberCount = targetChannel.channel.member_count;
@@ -1466,7 +1463,7 @@ export const Generic = () => {
1466
1463
  renderComponent();
1467
1464
  act(() => dispatchConnectionChangedEvent(chatClient));
1468
1465
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1469
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1466
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1470
1467
 
1471
1468
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1472
1469
  const targetMember = targetChannel.members[getRandomInt(0, targetChannel.members.length - 1)];
@@ -1494,7 +1491,7 @@ export const Generic = () => {
1494
1491
  renderComponent();
1495
1492
  act(() => dispatchConnectionChangedEvent(chatClient));
1496
1493
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1497
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1494
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1498
1495
 
1499
1496
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1500
1497
  const targetMember = targetChannel.members[getRandomInt(0, targetChannel.members.length - 1)];
@@ -1521,7 +1518,7 @@ export const Generic = () => {
1521
1518
  renderComponent();
1522
1519
  act(() => dispatchConnectionChangedEvent(chatClient));
1523
1520
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1524
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1521
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1525
1522
 
1526
1523
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1527
1524
  targetChannel.channel.name = uuidv4();
@@ -1547,7 +1544,7 @@ export const Generic = () => {
1547
1544
  renderComponent();
1548
1545
  act(() => dispatchConnectionChangedEvent(chatClient));
1549
1546
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1550
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1547
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1551
1548
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1552
1549
  const targetMember = targetChannel.members[getRandomInt(0, targetChannel.members.length - 1)];
1553
1550
 
@@ -1582,7 +1579,7 @@ export const Generic = () => {
1582
1579
  renderComponent();
1583
1580
  act(() => dispatchConnectionChangedEvent(chatClient));
1584
1581
  await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
1585
- await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
1582
+ await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
1586
1583
  const targetChannel = channels[getRandomInt(0, channels.length - 1)];
1587
1584
  const targetMember = targetChannel.members[getRandomInt(0, targetChannel.members.length - 1)];
1588
1585
 
@@ -11,17 +11,8 @@ import {
11
11
  type Attachment as AttachmentType,
12
12
  } from 'stream-chat';
13
13
 
14
- import { AudioAttachment as AudioAttachmentDefault } from './Audio';
15
-
16
- import { UnsupportedAttachment as UnsupportedAttachmentDefault } from './UnsupportedAttachment';
17
- import { URLPreview as URLPreviewDefault } from './UrlPreview';
18
- import { URLPreviewCompact as URLPreviewCompactDefault } from './UrlPreview/URLPreviewCompact';
19
-
20
- import { FileAttachment as FileAttachmentDefault } from '../../components/Attachment/FileAttachment';
21
- import { Gallery as GalleryDefault } from '../../components/Attachment/Gallery';
22
- import { Giphy as GiphyDefault } from '../../components/Attachment/Giphy';
23
-
24
14
  import { useTheme } from '../../contexts';
15
+ import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
25
16
  import {
26
17
  MessageContextValue,
27
18
  useMessageContext,
@@ -39,16 +30,7 @@ export type ActionHandler = (name: string, value: string) => void;
39
30
 
40
31
  export type AttachmentPropsWithContext = Pick<
41
32
  MessagesContextValue,
42
- | 'AudioAttachment'
43
- | 'FileAttachment'
44
- | 'Gallery'
45
- | 'Giphy'
46
- | 'isAttachmentEqual'
47
- | 'UrlPreview'
48
- | 'URLPreviewCompact'
49
- | 'myMessageTheme'
50
- | 'urlPreviewType'
51
- | 'UnsupportedAttachment'
33
+ 'isAttachmentEqual' | 'myMessageTheme' | 'urlPreviewType'
52
34
  > &
53
35
  Pick<MessageContextValue, 'message'> & {
54
36
  /**
@@ -62,19 +44,16 @@ export type AttachmentPropsWithContext = Pick<
62
44
  };
63
45
 
64
46
  const AttachmentWithContext = (props: AttachmentPropsWithContext) => {
47
+ const { attachment, index, message, urlPreviewType } = props;
65
48
  const {
66
- attachment,
67
49
  AudioAttachment,
68
50
  FileAttachment,
69
51
  Gallery,
70
52
  Giphy,
71
53
  UrlPreview,
72
54
  URLPreviewCompact,
73
- index,
74
- message,
75
- urlPreviewType,
76
55
  UnsupportedAttachment,
77
- } = props;
56
+ } = useComponentsContext();
78
57
  const audioAttachmentStyles = useAudioAttachmentStyles();
79
58
 
80
59
  if (attachment.type === FileTypes.Giphy || attachment.type === FileTypes.Imgur) {
@@ -164,31 +143,9 @@ export type AttachmentProps = Partial<AttachmentPropsWithContext>;
164
143
  * Attachment - The message attachment
165
144
  */
166
145
  export const Attachment = (props: AttachmentProps) => {
167
- const {
168
- attachment,
169
- AudioAttachment: PropAudioAttachment,
170
- FileAttachment: PropFileAttachment,
171
- Gallery: PropGallery,
172
- Giphy: PropGiphy,
173
- myMessageTheme: PropMyMessageTheme,
174
- UrlPreview: PropUrlPreview,
175
- URLPreviewCompact: PropURLPreviewCompact,
176
- urlPreviewType: PropUrlPreviewType,
177
- UnsupportedAttachment: PropUnsupportedAttachment,
178
- } = props;
146
+ const { attachment } = props;
179
147
 
180
- const {
181
- AudioAttachment: ContextAudioAttachment,
182
- FileAttachment: ContextFileAttachment,
183
- Gallery: ContextGallery,
184
- Giphy: ContextGiphy,
185
- isAttachmentEqual,
186
- myMessageTheme: ContextMyMessageTheme,
187
- UrlPreview: ContextUrlPreview,
188
- URLPreviewCompact: ContextURLPreviewCompact,
189
- urlPreviewType: ContextUrlPreviewType,
190
- UnsupportedAttachment: ContextUnsupportedAttachment,
191
- } = useMessagesContext();
148
+ const { isAttachmentEqual, myMessageTheme, urlPreviewType } = useMessagesContext();
192
149
 
193
150
  const { message } = useMessageContext();
194
151
 
@@ -196,33 +153,14 @@ export const Attachment = (props: AttachmentProps) => {
196
153
  return null;
197
154
  }
198
155
 
199
- const AudioAttachment = PropAudioAttachment || ContextAudioAttachment || AudioAttachmentDefault;
200
- const FileAttachment = PropFileAttachment || ContextFileAttachment || FileAttachmentDefault;
201
- const Gallery = PropGallery || ContextGallery || GalleryDefault;
202
- const Giphy = PropGiphy || ContextGiphy || GiphyDefault;
203
- const UrlPreview = PropUrlPreview || ContextUrlPreview || URLPreviewDefault;
204
- const myMessageTheme = PropMyMessageTheme || ContextMyMessageTheme;
205
- const URLPreviewCompact =
206
- PropURLPreviewCompact || ContextURLPreviewCompact || URLPreviewCompactDefault;
207
- const urlPreviewType = PropUrlPreviewType || ContextUrlPreviewType;
208
- const UnsupportedAttachment =
209
- PropUnsupportedAttachment || ContextUnsupportedAttachment || UnsupportedAttachmentDefault;
210
-
211
156
  return (
212
157
  <MemoizedAttachment
213
158
  {...{
214
159
  attachment,
215
- message,
216
- AudioAttachment,
217
- FileAttachment,
218
- Gallery,
219
- Giphy,
220
160
  isAttachmentEqual,
161
+ message,
221
162
  myMessageTheme,
222
- UrlPreview,
223
- URLPreviewCompact,
224
163
  urlPreviewType,
225
- UnsupportedAttachment,
226
164
  }}
227
165
  />
228
166
  );
@@ -7,6 +7,7 @@ import { openUrlSafely } from './utils/openUrlSafely';
7
7
 
8
8
  import { FileIconProps } from '../../components/Attachment/FileIcon';
9
9
 
10
+ import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
10
11
  import {
11
12
  MessageContextValue,
12
13
  useMessageContext,
@@ -21,7 +22,7 @@ export type FileAttachmentPropsWithContext = Pick<
21
22
  MessageContextValue,
22
23
  'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'
23
24
  > &
24
- Pick<MessagesContextValue, 'additionalPressableProps' | 'FilePreview'> & {
25
+ Pick<MessagesContextValue, 'additionalPressableProps'> & {
25
26
  /** The attachment to render */
26
27
  attachment: Attachment;
27
28
  attachmentIconSize?: FileIconProps['size'];
@@ -41,13 +42,13 @@ const FileAttachmentWithContext = (props: FileAttachmentPropsWithContext) => {
41
42
  additionalPressableProps,
42
43
  attachment,
43
44
  attachmentIconSize,
44
- FilePreview,
45
45
  onLongPress,
46
46
  onPress,
47
47
  onPressIn,
48
48
  preventPress,
49
49
  styles: stylesProp = styles,
50
50
  } = props;
51
+ const { FilePreview } = useComponentsContext();
51
52
 
52
53
  const defaultOnPress = () => openUrlSafely(attachment.asset_url);
53
54
 
@@ -99,17 +100,13 @@ export type FileAttachmentProps = Partial<Omit<FileAttachmentPropsWithContext, '
99
100
  Pick<FileAttachmentPropsWithContext, 'attachment'>;
100
101
 
101
102
  export const FileAttachment = (props: FileAttachmentProps) => {
102
- const { FilePreview: PropFilePreview } = props;
103
103
  const { onLongPress, onPress, onPressIn, preventPress } = useMessageContext();
104
- const { additionalPressableProps, FilePreview: ContextFilePreview } = useMessagesContext();
105
-
106
- const FilePreview = PropFilePreview || ContextFilePreview;
104
+ const { additionalPressableProps } = useMessagesContext();
107
105
 
108
106
  return (
109
107
  <FileAttachmentWithContext
110
108
  {...{
111
109
  additionalPressableProps,
112
- FilePreview,
113
110
  onLongPress,
114
111
  onPress,
115
112
  onPressIn,
@@ -1,30 +1,24 @@
1
1
  import React from 'react';
2
2
  import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
3
3
 
4
- import { Attachment as AttachmentDefault } from './Attachment';
5
-
4
+ import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
6
5
  import {
7
6
  MessageContextValue,
8
7
  useMessageContext,
9
8
  } from '../../contexts/messageContext/MessageContext';
10
-
11
- import {
12
- MessagesContextValue,
13
- useMessagesContext,
14
- } from '../../contexts/messagesContext/MessagesContext';
15
9
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
16
10
  import { primitives } from '../../theme';
17
11
 
18
- export type FileAttachmentGroupPropsWithContext = Pick<MessageContextValue, 'files' | 'message'> &
19
- Pick<MessagesContextValue, 'Attachment'> & {
20
- styles?: Partial<{
21
- attachmentContainer: StyleProp<ViewStyle>;
22
- container: StyleProp<ViewStyle>;
23
- }>;
24
- };
12
+ export type FileAttachmentGroupPropsWithContext = Pick<MessageContextValue, 'files' | 'message'> & {
13
+ styles?: Partial<{
14
+ attachmentContainer: StyleProp<ViewStyle>;
15
+ container: StyleProp<ViewStyle>;
16
+ }>;
17
+ };
25
18
 
26
19
  const FileAttachmentGroupWithContext = (props: FileAttachmentGroupPropsWithContext) => {
27
- const { Attachment, files, message, styles: stylesProp = {} } = props;
20
+ const { files, message, styles: stylesProp = {} } = props;
21
+ const { Attachment } = useComponentsContext();
28
22
 
29
23
  const {
30
24
  theme: {
@@ -75,8 +69,6 @@ export const FileAttachmentGroup = (props: FileAttachmentGroupProps) => {
75
69
 
76
70
  const { files: contextFiles, message } = useMessageContext();
77
71
 
78
- const { Attachment = AttachmentDefault, AudioAttachment } = useMessagesContext();
79
-
80
72
  const files = propFiles || contextFiles;
81
73
 
82
74
  if (!files.length) {
@@ -86,8 +78,6 @@ export const FileAttachmentGroup = (props: FileAttachmentGroupProps) => {
86
78
  return (
87
79
  <MemoizedFileAttachmentGroup
88
80
  {...{
89
- Attachment,
90
- AudioAttachment,
91
81
  files,
92
82
  message,
93
83
  }}
@@ -3,16 +3,13 @@ import { StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle } from 'react-n
3
3
 
4
4
  import type { Attachment } from 'stream-chat';
5
5
 
6
- import { FileIcon as FileIconDefault, FileIconProps } from '../../components/Attachment/FileIcon';
7
- import {
8
- MessagesContextValue,
9
- useMessagesContext,
10
- } from '../../contexts/messagesContext/MessagesContext';
6
+ import type { FileIconProps } from '../../components/Attachment/FileIcon';
7
+ import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
11
8
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
12
9
  import { primitives } from '../../theme';
13
10
  import { getDurationLabelFromDuration, getFileSizeDisplayText } from '../../utils/utils';
14
11
 
15
- export type FilePreviewProps = Partial<Pick<MessagesContextValue, 'FileAttachmentIcon'>> & {
12
+ export type FilePreviewProps = {
16
13
  /** The attachment to render */
17
14
  attachment: Attachment;
18
15
  attachmentIconSize?: FileIconProps['size'];
@@ -30,14 +27,12 @@ export type FilePreviewProps = Partial<Pick<MessagesContextValue, 'FileAttachmen
30
27
  export const FilePreview = (props: FilePreviewProps) => {
31
28
  const {
32
29
  attachment,
33
- FileAttachmentIcon: PropFileAttachmentIcon,
34
30
  attachmentIconSize,
35
31
  styles: stylesProp = {},
36
32
  titleNumberOfLines = 2,
37
33
  indicator,
38
34
  } = props;
39
- const { FileAttachmentIcon: ContextFileAttachmentIcon } = useMessagesContext();
40
- const FileAttachmentIcon = PropFileAttachmentIcon || ContextFileAttachmentIcon || FileIconDefault;
35
+ const { FileAttachmentIcon } = useComponentsContext();
41
36
 
42
37
  const styles = useStyles();
43
38