stream-chat-react-native-core 4.11.0-beta.2 → 5.0.0-offline-support.2

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 (1017) hide show
  1. package/lib/commonjs/components/Attachment/Attachment.js +1 -1
  2. package/lib/commonjs/components/Attachment/AttachmentActions.js +1 -1
  3. package/lib/commonjs/components/Attachment/Card.js +1 -1
  4. package/lib/commonjs/components/Attachment/FileAttachment.js +1 -1
  5. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +1 -1
  6. package/lib/commonjs/components/Attachment/FileIcon.js +1 -1
  7. package/lib/commonjs/components/Attachment/GallaryImage.js +1 -1
  8. package/lib/commonjs/components/Attachment/Gallery.js +1 -1
  9. package/lib/commonjs/components/Attachment/Giphy.js +1 -1
  10. package/lib/commonjs/components/Attachment/ImageLoadingFailedIndicator.js +1 -1
  11. package/lib/commonjs/components/Attachment/ImageLoadingIndicator.js +1 -1
  12. package/lib/commonjs/components/Attachment/VideoThumbnail.js +1 -1
  13. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +1 -1
  14. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
  15. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
  16. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
  17. package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js +1 -1
  18. package/lib/commonjs/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
  19. package/lib/commonjs/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
  20. package/lib/commonjs/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
  21. package/lib/commonjs/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
  22. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +1 -1
  23. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +1 -1
  24. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +1 -1
  25. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
  26. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +1 -1
  27. package/lib/commonjs/components/Avatar/Avatar.js +29 -16
  28. package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
  29. package/lib/commonjs/components/Avatar/GroupAvatar.js +26 -19
  30. package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
  31. package/lib/commonjs/components/Channel/Channel.js +227 -257
  32. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  33. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +2 -0
  34. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  35. package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js +2 -0
  36. package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
  37. package/lib/commonjs/components/ChannelList/ChannelList.js +34 -4
  38. package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
  39. package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +1 -1
  40. package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +1 -1
  41. package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +1 -1
  42. package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js +1 -1
  43. package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +20 -8
  44. package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
  45. package/lib/commonjs/components/ChannelList/Skeleton.js +1 -1
  46. package/lib/commonjs/components/ChannelList/hooks/listeners/handleEventToSyncDB.js +142 -0
  47. package/lib/commonjs/components/ChannelList/hooks/listeners/handleEventToSyncDB.js.map +1 -0
  48. package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
  49. package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
  50. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js +2 -2
  51. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
  52. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js +2 -2
  53. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
  54. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js +2 -2
  55. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
  56. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js +2 -2
  57. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
  58. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
  59. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
  60. package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js +128 -18
  61. package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +1 -1
  62. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
  63. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
  64. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js +2 -2
  65. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
  66. package/lib/commonjs/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js +2 -2
  67. package/lib/commonjs/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
  68. package/lib/commonjs/components/ChannelList/hooks/listeners/useSyncDatabase.js +34 -0
  69. package/lib/commonjs/components/ChannelList/hooks/listeners/useSyncDatabase.js.map +1 -0
  70. package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js +4 -4
  71. package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
  72. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +48 -22
  73. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  74. package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +1 -1
  75. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +7 -9
  76. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
  77. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +8 -6
  78. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
  79. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +1 -1
  80. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +1 -1
  81. package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +1 -1
  82. package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
  83. package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +1 -1
  84. package/lib/commonjs/components/Chat/Chat.js +18 -7
  85. package/lib/commonjs/components/Chat/Chat.js.map +1 -1
  86. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +3 -1
  87. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  88. package/lib/commonjs/components/Chat/hooks/useMutedUsers.js +3 -3
  89. package/lib/commonjs/components/Chat/hooks/useMutedUsers.js.map +1 -1
  90. package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
  91. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +1 -1
  92. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +1 -1
  93. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +4 -8
  94. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  95. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
  96. package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
  97. package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
  98. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +1 -1
  99. package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +2 -2
  100. package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
  101. package/lib/commonjs/components/ImageGallery/components/ProgressControl.js +1 -1
  102. package/lib/commonjs/components/Indicators/EmptyStateIndicator.js +1 -1
  103. package/lib/commonjs/components/Indicators/LoadingDot.js +1 -1
  104. package/lib/commonjs/components/Indicators/LoadingDots.js +1 -1
  105. package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js +1 -1
  106. package/lib/commonjs/components/Indicators/LoadingIndicator.js +1 -1
  107. package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js +1 -1
  108. package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
  109. package/lib/commonjs/components/Message/Message.js +1 -1
  110. package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +1 -1
  111. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +1 -1
  112. package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +1 -1
  113. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +1 -1
  114. package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +1 -1
  115. package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js +1 -1
  116. package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +1 -1
  117. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +1 -1
  118. package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +1 -1
  119. package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +1 -1
  120. package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +1 -1
  121. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +1 -1
  122. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js +1 -1
  123. package/lib/commonjs/components/Message/hooks/useMessageActions.js +1 -1
  124. package/lib/commonjs/components/MessageInput/AttachButton.js +1 -1
  125. package/lib/commonjs/components/MessageInput/CommandsButton.js +1 -1
  126. package/lib/commonjs/components/MessageInput/CooldownTimer.js +1 -1
  127. package/lib/commonjs/components/MessageInput/FileUploadPreview.js +1 -1
  128. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +1 -1
  129. package/lib/commonjs/components/MessageInput/InputButtons.js +1 -1
  130. package/lib/commonjs/components/MessageInput/MessageInput.js +1 -1
  131. package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +1 -1
  132. package/lib/commonjs/components/MessageInput/SendButton.js +1 -1
  133. package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +1 -1
  134. package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +1 -1
  135. package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js +1 -1
  136. package/lib/commonjs/components/MessageInput/components/InputEditingStateHeader.js +1 -1
  137. package/lib/commonjs/components/MessageInput/components/InputGiphySearch.js +1 -1
  138. package/lib/commonjs/components/MessageInput/components/InputReplyStateHeader.js +1 -1
  139. package/lib/commonjs/components/MessageList/DateHeader.js +1 -1
  140. package/lib/commonjs/components/MessageList/InlineDateSeparator.js +1 -1
  141. package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js +1 -1
  142. package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js +1 -1
  143. package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js +1 -1
  144. package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js +1 -1
  145. package/lib/commonjs/components/MessageList/MessageList.js +192 -224
  146. package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
  147. package/lib/commonjs/components/MessageList/MessageSystem.js +1 -1
  148. package/lib/commonjs/components/MessageList/NetworkDownIndicator.js +1 -1
  149. package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +1 -1
  150. package/lib/commonjs/components/MessageList/TypingIndicator.js +1 -1
  151. package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js +1 -1
  152. package/lib/commonjs/components/MessageOverlay/MessageActionList.js +1 -1
  153. package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +1 -1
  154. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +1 -1
  155. package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +1 -1
  156. package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +1 -1
  157. package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +1 -1
  158. package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js +1 -1
  159. package/lib/commonjs/components/RTLComponents/WritingDirectionAwareText.js +1 -1
  160. package/lib/commonjs/components/Reply/Reply.js +2 -2
  161. package/lib/commonjs/components/Reply/Reply.js.map +1 -1
  162. package/lib/commonjs/components/Spinner/Spinner.js +1 -1
  163. package/lib/commonjs/components/Thread/Thread.js +1 -1
  164. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +1 -1
  165. package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +1 -1
  166. package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +1 -1
  167. package/lib/commonjs/contexts/channelContext/ChannelContext.js +3 -3
  168. package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
  169. package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +1 -1
  170. package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
  171. package/lib/commonjs/contexts/chatContext/ChatContext.js +3 -3
  172. package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
  173. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +1 -1
  174. package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +1 -1
  175. package/lib/commonjs/contexts/messageContext/MessageContext.js +1 -1
  176. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +1 -1
  177. package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +1 -1
  178. package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js +1 -1
  179. package/lib/commonjs/contexts/messagesContext/MessagesContext.js +1 -1
  180. package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
  181. package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +13 -17
  182. package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
  183. package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
  184. package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +3 -3
  185. package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
  186. package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +1 -1
  187. package/lib/commonjs/contexts/themeContext/ThemeContext.js +1 -1
  188. package/lib/commonjs/contexts/threadContext/ThreadContext.js +1 -1
  189. package/lib/commonjs/contexts/translationContext/TranslationContext.js +1 -1
  190. package/lib/commonjs/contexts/typingContext/TypingContext.js +1 -1
  191. package/lib/commonjs/hooks/useImageErrorHandler.js +35 -0
  192. package/lib/commonjs/hooks/useImageErrorHandler.js.map +1 -0
  193. package/lib/commonjs/i18n/en.json +1 -2
  194. package/lib/commonjs/i18n/fr.json +1 -2
  195. package/lib/commonjs/i18n/he.json +0 -2
  196. package/lib/commonjs/i18n/hi.json +1 -2
  197. package/lib/commonjs/i18n/it.json +1 -2
  198. package/lib/commonjs/i18n/ja.json +0 -2
  199. package/lib/commonjs/i18n/ko.json +0 -2
  200. package/lib/commonjs/i18n/nl.json +1 -2
  201. package/lib/commonjs/i18n/ru.json +1 -2
  202. package/lib/commonjs/i18n/tr.json +1 -2
  203. package/lib/commonjs/icons/ArrowRight.js +1 -1
  204. package/lib/commonjs/icons/AtMentions.js +1 -1
  205. package/lib/commonjs/icons/Attach.js +1 -1
  206. package/lib/commonjs/icons/Audio.js +1 -1
  207. package/lib/commonjs/icons/CSV.js +1 -1
  208. package/lib/commonjs/icons/Camera.js +1 -1
  209. package/lib/commonjs/icons/Check.js +1 -1
  210. package/lib/commonjs/icons/CheckAll.js +1 -1
  211. package/lib/commonjs/icons/CheckSend.js +1 -1
  212. package/lib/commonjs/icons/CircleClose.js +1 -1
  213. package/lib/commonjs/icons/CirclePlus.js +1 -1
  214. package/lib/commonjs/icons/CircleRight.js +1 -1
  215. package/lib/commonjs/icons/Close.js +1 -1
  216. package/lib/commonjs/icons/Copy.js +1 -1
  217. package/lib/commonjs/icons/CurveLineLeftUp.js +1 -1
  218. package/lib/commonjs/icons/DOC.js +1 -1
  219. package/lib/commonjs/icons/DOCX.js +1 -1
  220. package/lib/commonjs/icons/Delete.js +1 -1
  221. package/lib/commonjs/icons/Down.js +1 -1
  222. package/lib/commonjs/icons/DownloadArrow.js +1 -1
  223. package/lib/commonjs/icons/DownloadCloud.js +1 -1
  224. package/lib/commonjs/icons/Edit.js +1 -1
  225. package/lib/commonjs/icons/Error.js +1 -1
  226. package/lib/commonjs/icons/Eye.js +1 -1
  227. package/lib/commonjs/icons/Flag.js +1 -1
  228. package/lib/commonjs/icons/Folder.js +1 -1
  229. package/lib/commonjs/icons/GenericFile.js +1 -1
  230. package/lib/commonjs/icons/GiphyIcon.js +1 -1
  231. package/lib/commonjs/icons/Grid.js +1 -1
  232. package/lib/commonjs/icons/Group.js +1 -1
  233. package/lib/commonjs/icons/HTML.js +1 -1
  234. package/lib/commonjs/icons/Imgur.js +1 -1
  235. package/lib/commonjs/icons/LOLReaction.js +1 -1
  236. package/lib/commonjs/icons/Lightning.js +1 -1
  237. package/lib/commonjs/icons/Link.js +1 -1
  238. package/lib/commonjs/icons/Loading.js +1 -1
  239. package/lib/commonjs/icons/Logo.js +1 -1
  240. package/lib/commonjs/icons/LoveReaction.js +1 -1
  241. package/lib/commonjs/icons/MD.js +1 -1
  242. package/lib/commonjs/icons/MailOpen.js +1 -1
  243. package/lib/commonjs/icons/MenuPointHorizontal.js +1 -1
  244. package/lib/commonjs/icons/MenuPointVertical.js +1 -1
  245. package/lib/commonjs/icons/MessageFlag.js +1 -1
  246. package/lib/commonjs/icons/MessageIcon.js +1 -1
  247. package/lib/commonjs/icons/Mute.js +1 -1
  248. package/lib/commonjs/icons/Notification.js +1 -1
  249. package/lib/commonjs/icons/ODT.js +1 -1
  250. package/lib/commonjs/icons/PDF.js +1 -1
  251. package/lib/commonjs/icons/PPT.js +1 -1
  252. package/lib/commonjs/icons/PPTX.js +1 -1
  253. package/lib/commonjs/icons/Pause.js +1 -1
  254. package/lib/commonjs/icons/Picture.js +1 -1
  255. package/lib/commonjs/icons/Pin.js +1 -1
  256. package/lib/commonjs/icons/PinHeader.js +1 -1
  257. package/lib/commonjs/icons/Play.js +1 -1
  258. package/lib/commonjs/icons/RAR.js +1 -1
  259. package/lib/commonjs/icons/RTF.js +1 -1
  260. package/lib/commonjs/icons/Recorder.js +1 -1
  261. package/lib/commonjs/icons/Refresh.js +1 -1
  262. package/lib/commonjs/icons/SEVEN_Z.js +1 -1
  263. package/lib/commonjs/icons/Search.js +1 -1
  264. package/lib/commonjs/icons/SendRight.js +1 -1
  265. package/lib/commonjs/icons/SendUp.js +1 -1
  266. package/lib/commonjs/icons/Share.js +1 -1
  267. package/lib/commonjs/icons/ShareRightArrow.js +1 -1
  268. package/lib/commonjs/icons/Smile.js +1 -1
  269. package/lib/commonjs/icons/Sound.js +1 -1
  270. package/lib/commonjs/icons/TAR.js +1 -1
  271. package/lib/commonjs/icons/TXT.js +1 -1
  272. package/lib/commonjs/icons/ThreadReply.js +1 -1
  273. package/lib/commonjs/icons/ThumbsDownReaction.js +1 -1
  274. package/lib/commonjs/icons/ThumbsUpReaction.js +1 -1
  275. package/lib/commonjs/icons/Time.js +1 -1
  276. package/lib/commonjs/icons/Unknown.js +1 -1
  277. package/lib/commonjs/icons/Unpin.js +1 -1
  278. package/lib/commonjs/icons/User.js +1 -1
  279. package/lib/commonjs/icons/UserAdd.js +1 -1
  280. package/lib/commonjs/icons/UserAdmin.js +1 -1
  281. package/lib/commonjs/icons/UserDelete.js +1 -1
  282. package/lib/commonjs/icons/UserMinus.js +1 -1
  283. package/lib/commonjs/icons/Video.js +1 -1
  284. package/lib/commonjs/icons/Warning.js +1 -1
  285. package/lib/commonjs/icons/WutReaction.js +1 -1
  286. package/lib/commonjs/icons/XLS.js +1 -1
  287. package/lib/commonjs/icons/XLSX.js +1 -1
  288. package/lib/commonjs/icons/ZIP.js +1 -1
  289. package/lib/commonjs/icons/utils/base.js +1 -1
  290. package/lib/commonjs/index.js +11 -0
  291. package/lib/commonjs/index.js.map +1 -1
  292. package/lib/commonjs/mock-builders/DB/consts.js +15 -0
  293. package/lib/commonjs/mock-builders/DB/consts.js.map +1 -0
  294. package/lib/commonjs/mock-builders/DB/mock.js +125 -0
  295. package/lib/commonjs/mock-builders/DB/mock.js.map +1 -0
  296. package/lib/commonjs/mock-builders/api/channelMocks.js +1 -0
  297. package/lib/commonjs/mock-builders/api/channelMocks.js.map +1 -1
  298. package/lib/commonjs/mock-builders/event/memberAdded.js +17 -0
  299. package/lib/commonjs/mock-builders/event/memberAdded.js.map +1 -0
  300. package/lib/commonjs/mock-builders/event/memberRemoved.js +17 -0
  301. package/lib/commonjs/mock-builders/event/memberRemoved.js.map +1 -0
  302. package/lib/commonjs/mock-builders/event/memberUpdated.js +17 -0
  303. package/lib/commonjs/mock-builders/event/memberUpdated.js.map +1 -0
  304. package/lib/commonjs/mock-builders/event/reactionDeleted.js +18 -0
  305. package/lib/commonjs/mock-builders/event/reactionDeleted.js.map +1 -0
  306. package/lib/commonjs/mock-builders/event/reactionNew.js +18 -0
  307. package/lib/commonjs/mock-builders/event/reactionNew.js.map +1 -0
  308. package/lib/commonjs/mock-builders/event/reactionUpdated.js +18 -0
  309. package/lib/commonjs/mock-builders/event/reactionUpdated.js.map +1 -0
  310. package/lib/commonjs/mock-builders/generator/reaction.js +1 -1
  311. package/lib/commonjs/mock-builders/generator/reaction.js.map +1 -1
  312. package/lib/commonjs/store/QuickSqliteClient.js +148 -0
  313. package/lib/commonjs/store/QuickSqliteClient.js.map +1 -0
  314. package/lib/commonjs/store/apis/deleteChannel.js +26 -0
  315. package/lib/commonjs/store/apis/deleteChannel.js.map +1 -0
  316. package/lib/commonjs/store/apis/deleteMember.js +28 -0
  317. package/lib/commonjs/store/apis/deleteMember.js.map +1 -0
  318. package/lib/commonjs/store/apis/deleteMessagesForChannel.js +26 -0
  319. package/lib/commonjs/store/apis/deleteMessagesForChannel.js.map +1 -0
  320. package/lib/commonjs/store/apis/deleteReactions.js +28 -0
  321. package/lib/commonjs/store/apis/deleteReactions.js.map +1 -0
  322. package/lib/commonjs/store/apis/getAllChannelIds.js +16 -0
  323. package/lib/commonjs/store/apis/getAllChannelIds.js.map +1 -0
  324. package/lib/commonjs/store/apis/getChannelMessages.js +45 -0
  325. package/lib/commonjs/store/apis/getChannelMessages.js.map +1 -0
  326. package/lib/commonjs/store/apis/getChannels.js +60 -0
  327. package/lib/commonjs/store/apis/getChannels.js.map +1 -0
  328. package/lib/commonjs/store/apis/getLastSyncedAt.js +23 -0
  329. package/lib/commonjs/store/apis/getLastSyncedAt.js.map +1 -0
  330. package/lib/commonjs/store/apis/getMembers.js +25 -0
  331. package/lib/commonjs/store/apis/getMembers.js.map +1 -0
  332. package/lib/commonjs/store/apis/getReads.js +25 -0
  333. package/lib/commonjs/store/apis/getReads.js.map +1 -0
  334. package/lib/commonjs/store/apis/queries/selectChannelIdsForFilterSort.js +31 -0
  335. package/lib/commonjs/store/apis/queries/selectChannelIdsForFilterSort.js.map +1 -0
  336. package/lib/commonjs/store/apis/queries/selectChannels.js +30 -0
  337. package/lib/commonjs/store/apis/queries/selectChannels.js.map +1 -0
  338. package/lib/commonjs/store/apis/queries/selectMembersForChannels.js +27 -0
  339. package/lib/commonjs/store/apis/queries/selectMembersForChannels.js.map +1 -0
  340. package/lib/commonjs/store/apis/queries/selectMessagesForChannels.js +27 -0
  341. package/lib/commonjs/store/apis/queries/selectMessagesForChannels.js.map +1 -0
  342. package/lib/commonjs/store/apis/queries/selectReactionsForMessages.js +27 -0
  343. package/lib/commonjs/store/apis/queries/selectReactionsForMessages.js.map +1 -0
  344. package/lib/commonjs/store/apis/queries/selectReadsForChannels.js +27 -0
  345. package/lib/commonjs/store/apis/queries/selectReadsForChannels.js.map +1 -0
  346. package/lib/commonjs/store/apis/updateMessage.js +69 -0
  347. package/lib/commonjs/store/apis/updateMessage.js.map +1 -0
  348. package/lib/commonjs/store/apis/updateReaction.js +53 -0
  349. package/lib/commonjs/store/apis/updateReaction.js.map +1 -0
  350. package/lib/commonjs/store/apis/upsertChannelData.js +26 -0
  351. package/lib/commonjs/store/apis/upsertChannelData.js.map +1 -0
  352. package/lib/commonjs/store/apis/upsertChannels.js +83 -0
  353. package/lib/commonjs/store/apis/upsertChannels.js.map +1 -0
  354. package/lib/commonjs/store/apis/upsertCidsForQuery.js +34 -0
  355. package/lib/commonjs/store/apis/upsertCidsForQuery.js.map +1 -0
  356. package/lib/commonjs/store/apis/upsertLastSyncedAt.js +22 -0
  357. package/lib/commonjs/store/apis/upsertLastSyncedAt.js.map +1 -0
  358. package/lib/commonjs/store/apis/upsertMembers.js +39 -0
  359. package/lib/commonjs/store/apis/upsertMembers.js.map +1 -0
  360. package/lib/commonjs/store/apis/upsertMessages.js +52 -0
  361. package/lib/commonjs/store/apis/upsertMessages.js.map +1 -0
  362. package/lib/commonjs/store/apis/upsertReads.js +39 -0
  363. package/lib/commonjs/store/apis/upsertReads.js.map +1 -0
  364. package/lib/commonjs/store/apis/utils/convertFilterSortToQuery.js +13 -0
  365. package/lib/commonjs/store/apis/utils/convertFilterSortToQuery.js.map +1 -0
  366. package/lib/commonjs/store/constants.js +11 -0
  367. package/lib/commonjs/store/constants.js.map +1 -0
  368. package/lib/commonjs/store/mappers/mapChannelDataToStorable.js +67 -0
  369. package/lib/commonjs/store/mappers/mapChannelDataToStorable.js.map +1 -0
  370. package/lib/commonjs/store/mappers/mapDateTimeToStorable.js +12 -0
  371. package/lib/commonjs/store/mappers/mapDateTimeToStorable.js.map +1 -0
  372. package/lib/commonjs/store/mappers/mapMemberToStorable.js +39 -0
  373. package/lib/commonjs/store/mappers/mapMemberToStorable.js.map +1 -0
  374. package/lib/commonjs/store/mappers/mapMessageToStorable.js +42 -0
  375. package/lib/commonjs/store/mappers/mapMessageToStorable.js.map +1 -0
  376. package/lib/commonjs/store/mappers/mapReactionToStorable.js +34 -0
  377. package/lib/commonjs/store/mappers/mapReactionToStorable.js.map +1 -0
  378. package/lib/commonjs/store/mappers/mapReadToStorable.js +23 -0
  379. package/lib/commonjs/store/mappers/mapReadToStorable.js.map +1 -0
  380. package/lib/commonjs/store/mappers/mapStorableToChannel.js +65 -0
  381. package/lib/commonjs/store/mappers/mapStorableToChannel.js.map +1 -0
  382. package/lib/commonjs/store/mappers/mapStorableToMember.js +38 -0
  383. package/lib/commonjs/store/mappers/mapStorableToMember.js.map +1 -0
  384. package/lib/commonjs/store/mappers/mapStorableToMessage.js +50 -0
  385. package/lib/commonjs/store/mappers/mapStorableToMessage.js.map +1 -0
  386. package/lib/commonjs/store/mappers/mapStorableToReaction.js +31 -0
  387. package/lib/commonjs/store/mappers/mapStorableToReaction.js.map +1 -0
  388. package/lib/commonjs/store/mappers/mapStorableToRead.js +20 -0
  389. package/lib/commonjs/store/mappers/mapStorableToRead.js.map +1 -0
  390. package/lib/commonjs/store/mappers/mapStorableToUser.js +31 -0
  391. package/lib/commonjs/store/mappers/mapStorableToUser.js.map +1 -0
  392. package/lib/commonjs/store/mappers/mapUserToStorable.js +34 -0
  393. package/lib/commonjs/store/mappers/mapUserToStorable.js.map +1 -0
  394. package/lib/commonjs/store/schema.js +161 -0
  395. package/lib/commonjs/store/schema.js.map +1 -0
  396. package/lib/commonjs/store/sqlite-utils/appendWhereCluase.js +37 -0
  397. package/lib/commonjs/store/sqlite-utils/appendWhereCluase.js.map +1 -0
  398. package/lib/commonjs/store/sqlite-utils/createCreateTableQuery.js +35 -0
  399. package/lib/commonjs/store/sqlite-utils/createCreateTableQuery.js.map +1 -0
  400. package/lib/commonjs/store/sqlite-utils/createDeleteQuery.js +14 -0
  401. package/lib/commonjs/store/sqlite-utils/createDeleteQuery.js.map +1 -0
  402. package/lib/commonjs/store/sqlite-utils/createSelectQuery.js +26 -0
  403. package/lib/commonjs/store/sqlite-utils/createSelectQuery.js.map +1 -0
  404. package/lib/commonjs/store/sqlite-utils/createUpdateQuery.js +29 -0
  405. package/lib/commonjs/store/sqlite-utils/createUpdateQuery.js.map +1 -0
  406. package/lib/commonjs/store/sqlite-utils/createUpsertQuery.js +30 -0
  407. package/lib/commonjs/store/sqlite-utils/createUpsertQuery.js.map +1 -0
  408. package/lib/commonjs/store/sqlite-utils/printRow.js +33 -0
  409. package/lib/commonjs/store/sqlite-utils/printRow.js.map +1 -0
  410. package/lib/commonjs/store/types.js +4 -0
  411. package/lib/commonjs/store/types.js.map +1 -0
  412. package/lib/commonjs/version.json +1 -1
  413. package/lib/module/components/Attachment/Attachment.js +1 -1
  414. package/lib/module/components/Attachment/AttachmentActions.js +1 -1
  415. package/lib/module/components/Attachment/Card.js +1 -1
  416. package/lib/module/components/Attachment/FileAttachment.js +1 -1
  417. package/lib/module/components/Attachment/FileAttachmentGroup.js +1 -1
  418. package/lib/module/components/Attachment/FileIcon.js +1 -1
  419. package/lib/module/components/Attachment/GallaryImage.js +1 -1
  420. package/lib/module/components/Attachment/Gallery.js +1 -1
  421. package/lib/module/components/Attachment/Giphy.js +1 -1
  422. package/lib/module/components/Attachment/ImageLoadingFailedIndicator.js +1 -1
  423. package/lib/module/components/Attachment/ImageLoadingIndicator.js +1 -1
  424. package/lib/module/components/Attachment/VideoThumbnail.js +1 -1
  425. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +1 -1
  426. package/lib/module/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
  427. package/lib/module/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
  428. package/lib/module/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
  429. package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js +1 -1
  430. package/lib/module/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
  431. package/lib/module/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
  432. package/lib/module/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
  433. package/lib/module/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
  434. package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +1 -1
  435. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +1 -1
  436. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +1 -1
  437. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
  438. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +1 -1
  439. package/lib/module/components/Avatar/Avatar.js +29 -16
  440. package/lib/module/components/Avatar/Avatar.js.map +1 -1
  441. package/lib/module/components/Avatar/GroupAvatar.js +26 -19
  442. package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
  443. package/lib/module/components/Channel/Channel.js +227 -257
  444. package/lib/module/components/Channel/Channel.js.map +1 -1
  445. package/lib/module/components/Channel/hooks/useCreateChannelContext.js +2 -0
  446. package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  447. package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js +2 -0
  448. package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
  449. package/lib/module/components/ChannelList/ChannelList.js +34 -4
  450. package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
  451. package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +1 -1
  452. package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +1 -1
  453. package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +1 -1
  454. package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js +1 -1
  455. package/lib/module/components/ChannelList/ChannelListMessenger.js +20 -8
  456. package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
  457. package/lib/module/components/ChannelList/Skeleton.js +1 -1
  458. package/lib/module/components/ChannelList/hooks/listeners/handleEventToSyncDB.js +142 -0
  459. package/lib/module/components/ChannelList/hooks/listeners/handleEventToSyncDB.js.map +1 -0
  460. package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
  461. package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
  462. package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js +2 -2
  463. package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
  464. package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js +2 -2
  465. package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
  466. package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js +2 -2
  467. package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
  468. package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js +2 -2
  469. package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
  470. package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
  471. package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
  472. package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js +128 -18
  473. package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +1 -1
  474. package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
  475. package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
  476. package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js +2 -2
  477. package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
  478. package/lib/module/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js +2 -2
  479. package/lib/module/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
  480. package/lib/module/components/ChannelList/hooks/listeners/useSyncDatabase.js +34 -0
  481. package/lib/module/components/ChannelList/hooks/listeners/useSyncDatabase.js.map +1 -0
  482. package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js +4 -4
  483. package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
  484. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +48 -22
  485. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  486. package/lib/module/components/ChannelPreview/ChannelAvatar.js +1 -1
  487. package/lib/module/components/ChannelPreview/ChannelPreview.js +7 -9
  488. package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
  489. package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +8 -6
  490. package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
  491. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +1 -1
  492. package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +1 -1
  493. package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +1 -1
  494. package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
  495. package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +1 -1
  496. package/lib/module/components/Chat/Chat.js +18 -7
  497. package/lib/module/components/Chat/Chat.js.map +1 -1
  498. package/lib/module/components/Chat/hooks/useCreateChatContext.js +3 -1
  499. package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  500. package/lib/module/components/Chat/hooks/useMutedUsers.js +3 -3
  501. package/lib/module/components/Chat/hooks/useMutedUsers.js.map +1 -1
  502. package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
  503. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +1 -1
  504. package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +1 -1
  505. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +4 -8
  506. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  507. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
  508. package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
  509. package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
  510. package/lib/module/components/ImageGallery/components/ImageGrid.js +1 -1
  511. package/lib/module/components/ImageGallery/components/ImageGridHandle.js +2 -2
  512. package/lib/module/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
  513. package/lib/module/components/ImageGallery/components/ProgressControl.js +1 -1
  514. package/lib/module/components/Indicators/EmptyStateIndicator.js +1 -1
  515. package/lib/module/components/Indicators/LoadingDot.js +1 -1
  516. package/lib/module/components/Indicators/LoadingDots.js +1 -1
  517. package/lib/module/components/Indicators/LoadingErrorIndicator.js +1 -1
  518. package/lib/module/components/Indicators/LoadingIndicator.js +1 -1
  519. package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js +1 -1
  520. package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
  521. package/lib/module/components/Message/Message.js +1 -1
  522. package/lib/module/components/Message/MessageSimple/MessageAvatar.js +1 -1
  523. package/lib/module/components/Message/MessageSimple/MessageContent.js +1 -1
  524. package/lib/module/components/Message/MessageSimple/MessageDeleted.js +1 -1
  525. package/lib/module/components/Message/MessageSimple/MessageFooter.js +1 -1
  526. package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +1 -1
  527. package/lib/module/components/Message/MessageSimple/MessageReplies.js +1 -1
  528. package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +1 -1
  529. package/lib/module/components/Message/MessageSimple/MessageSimple.js +1 -1
  530. package/lib/module/components/Message/MessageSimple/MessageStatus.js +1 -1
  531. package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +1 -1
  532. package/lib/module/components/Message/MessageSimple/ReactionList.js +1 -1
  533. package/lib/module/components/Message/MessageSimple/utils/renderText.js +1 -1
  534. package/lib/module/components/Message/MessageSimple/utils/renderText.test.js +1 -1
  535. package/lib/module/components/Message/hooks/useMessageActions.js +1 -1
  536. package/lib/module/components/MessageInput/AttachButton.js +1 -1
  537. package/lib/module/components/MessageInput/CommandsButton.js +1 -1
  538. package/lib/module/components/MessageInput/CooldownTimer.js +1 -1
  539. package/lib/module/components/MessageInput/FileUploadPreview.js +1 -1
  540. package/lib/module/components/MessageInput/ImageUploadPreview.js +1 -1
  541. package/lib/module/components/MessageInput/InputButtons.js +1 -1
  542. package/lib/module/components/MessageInput/MessageInput.js +1 -1
  543. package/lib/module/components/MessageInput/MoreOptionsButton.js +1 -1
  544. package/lib/module/components/MessageInput/SendButton.js +1 -1
  545. package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +1 -1
  546. package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +1 -1
  547. package/lib/module/components/MessageInput/UploadProgressIndicator.js +1 -1
  548. package/lib/module/components/MessageInput/components/InputEditingStateHeader.js +1 -1
  549. package/lib/module/components/MessageInput/components/InputGiphySearch.js +1 -1
  550. package/lib/module/components/MessageInput/components/InputReplyStateHeader.js +1 -1
  551. package/lib/module/components/MessageList/DateHeader.js +1 -1
  552. package/lib/module/components/MessageList/InlineDateSeparator.js +1 -1
  553. package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js +1 -1
  554. package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js +1 -1
  555. package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js +1 -1
  556. package/lib/module/components/MessageList/InlineUnreadIndicator.js +1 -1
  557. package/lib/module/components/MessageList/MessageList.js +192 -224
  558. package/lib/module/components/MessageList/MessageList.js.map +1 -1
  559. package/lib/module/components/MessageList/MessageSystem.js +1 -1
  560. package/lib/module/components/MessageList/NetworkDownIndicator.js +1 -1
  561. package/lib/module/components/MessageList/ScrollToBottomButton.js +1 -1
  562. package/lib/module/components/MessageList/TypingIndicator.js +1 -1
  563. package/lib/module/components/MessageList/TypingIndicatorContainer.js +1 -1
  564. package/lib/module/components/MessageOverlay/MessageActionList.js +1 -1
  565. package/lib/module/components/MessageOverlay/MessageActionListItem.js +1 -1
  566. package/lib/module/components/MessageOverlay/MessageOverlay.js +1 -1
  567. package/lib/module/components/MessageOverlay/OverlayBackdrop.js +1 -1
  568. package/lib/module/components/MessageOverlay/OverlayReactionList.js +1 -1
  569. package/lib/module/components/MessageOverlay/OverlayReactions.js +1 -1
  570. package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js +1 -1
  571. package/lib/module/components/RTLComponents/WritingDirectionAwareText.js +1 -1
  572. package/lib/module/components/Reply/Reply.js +2 -2
  573. package/lib/module/components/Reply/Reply.js.map +1 -1
  574. package/lib/module/components/Spinner/Spinner.js +1 -1
  575. package/lib/module/components/Thread/Thread.js +1 -1
  576. package/lib/module/components/Thread/components/ThreadFooterComponent.js +1 -1
  577. package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +1 -1
  578. package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +1 -1
  579. package/lib/module/contexts/channelContext/ChannelContext.js +3 -3
  580. package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
  581. package/lib/module/contexts/channelsContext/ChannelsContext.js +1 -1
  582. package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
  583. package/lib/module/contexts/chatContext/ChatContext.js +3 -3
  584. package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
  585. package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +1 -1
  586. package/lib/module/contexts/keyboardContext/KeyboardContext.js +1 -1
  587. package/lib/module/contexts/messageContext/MessageContext.js +1 -1
  588. package/lib/module/contexts/messageInputContext/MessageInputContext.js +1 -1
  589. package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +1 -1
  590. package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js +1 -1
  591. package/lib/module/contexts/messagesContext/MessagesContext.js +1 -1
  592. package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
  593. package/lib/module/contexts/overlayContext/OverlayProvider.js +13 -17
  594. package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
  595. package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
  596. package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +3 -3
  597. package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
  598. package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +1 -1
  599. package/lib/module/contexts/themeContext/ThemeContext.js +1 -1
  600. package/lib/module/contexts/threadContext/ThreadContext.js +1 -1
  601. package/lib/module/contexts/translationContext/TranslationContext.js +1 -1
  602. package/lib/module/contexts/typingContext/TypingContext.js +1 -1
  603. package/lib/module/hooks/useImageErrorHandler.js +35 -0
  604. package/lib/module/hooks/useImageErrorHandler.js.map +1 -0
  605. package/lib/module/i18n/en.json +1 -2
  606. package/lib/module/i18n/fr.json +1 -2
  607. package/lib/module/i18n/he.json +0 -2
  608. package/lib/module/i18n/hi.json +1 -2
  609. package/lib/module/i18n/it.json +1 -2
  610. package/lib/module/i18n/ja.json +0 -2
  611. package/lib/module/i18n/ko.json +0 -2
  612. package/lib/module/i18n/nl.json +1 -2
  613. package/lib/module/i18n/ru.json +1 -2
  614. package/lib/module/i18n/tr.json +1 -2
  615. package/lib/module/icons/ArrowRight.js +1 -1
  616. package/lib/module/icons/AtMentions.js +1 -1
  617. package/lib/module/icons/Attach.js +1 -1
  618. package/lib/module/icons/Audio.js +1 -1
  619. package/lib/module/icons/CSV.js +1 -1
  620. package/lib/module/icons/Camera.js +1 -1
  621. package/lib/module/icons/Check.js +1 -1
  622. package/lib/module/icons/CheckAll.js +1 -1
  623. package/lib/module/icons/CheckSend.js +1 -1
  624. package/lib/module/icons/CircleClose.js +1 -1
  625. package/lib/module/icons/CirclePlus.js +1 -1
  626. package/lib/module/icons/CircleRight.js +1 -1
  627. package/lib/module/icons/Close.js +1 -1
  628. package/lib/module/icons/Copy.js +1 -1
  629. package/lib/module/icons/CurveLineLeftUp.js +1 -1
  630. package/lib/module/icons/DOC.js +1 -1
  631. package/lib/module/icons/DOCX.js +1 -1
  632. package/lib/module/icons/Delete.js +1 -1
  633. package/lib/module/icons/Down.js +1 -1
  634. package/lib/module/icons/DownloadArrow.js +1 -1
  635. package/lib/module/icons/DownloadCloud.js +1 -1
  636. package/lib/module/icons/Edit.js +1 -1
  637. package/lib/module/icons/Error.js +1 -1
  638. package/lib/module/icons/Eye.js +1 -1
  639. package/lib/module/icons/Flag.js +1 -1
  640. package/lib/module/icons/Folder.js +1 -1
  641. package/lib/module/icons/GenericFile.js +1 -1
  642. package/lib/module/icons/GiphyIcon.js +1 -1
  643. package/lib/module/icons/Grid.js +1 -1
  644. package/lib/module/icons/Group.js +1 -1
  645. package/lib/module/icons/HTML.js +1 -1
  646. package/lib/module/icons/Imgur.js +1 -1
  647. package/lib/module/icons/LOLReaction.js +1 -1
  648. package/lib/module/icons/Lightning.js +1 -1
  649. package/lib/module/icons/Link.js +1 -1
  650. package/lib/module/icons/Loading.js +1 -1
  651. package/lib/module/icons/Logo.js +1 -1
  652. package/lib/module/icons/LoveReaction.js +1 -1
  653. package/lib/module/icons/MD.js +1 -1
  654. package/lib/module/icons/MailOpen.js +1 -1
  655. package/lib/module/icons/MenuPointHorizontal.js +1 -1
  656. package/lib/module/icons/MenuPointVertical.js +1 -1
  657. package/lib/module/icons/MessageFlag.js +1 -1
  658. package/lib/module/icons/MessageIcon.js +1 -1
  659. package/lib/module/icons/Mute.js +1 -1
  660. package/lib/module/icons/Notification.js +1 -1
  661. package/lib/module/icons/ODT.js +1 -1
  662. package/lib/module/icons/PDF.js +1 -1
  663. package/lib/module/icons/PPT.js +1 -1
  664. package/lib/module/icons/PPTX.js +1 -1
  665. package/lib/module/icons/Pause.js +1 -1
  666. package/lib/module/icons/Picture.js +1 -1
  667. package/lib/module/icons/Pin.js +1 -1
  668. package/lib/module/icons/PinHeader.js +1 -1
  669. package/lib/module/icons/Play.js +1 -1
  670. package/lib/module/icons/RAR.js +1 -1
  671. package/lib/module/icons/RTF.js +1 -1
  672. package/lib/module/icons/Recorder.js +1 -1
  673. package/lib/module/icons/Refresh.js +1 -1
  674. package/lib/module/icons/SEVEN_Z.js +1 -1
  675. package/lib/module/icons/Search.js +1 -1
  676. package/lib/module/icons/SendRight.js +1 -1
  677. package/lib/module/icons/SendUp.js +1 -1
  678. package/lib/module/icons/Share.js +1 -1
  679. package/lib/module/icons/ShareRightArrow.js +1 -1
  680. package/lib/module/icons/Smile.js +1 -1
  681. package/lib/module/icons/Sound.js +1 -1
  682. package/lib/module/icons/TAR.js +1 -1
  683. package/lib/module/icons/TXT.js +1 -1
  684. package/lib/module/icons/ThreadReply.js +1 -1
  685. package/lib/module/icons/ThumbsDownReaction.js +1 -1
  686. package/lib/module/icons/ThumbsUpReaction.js +1 -1
  687. package/lib/module/icons/Time.js +1 -1
  688. package/lib/module/icons/Unknown.js +1 -1
  689. package/lib/module/icons/Unpin.js +1 -1
  690. package/lib/module/icons/User.js +1 -1
  691. package/lib/module/icons/UserAdd.js +1 -1
  692. package/lib/module/icons/UserAdmin.js +1 -1
  693. package/lib/module/icons/UserDelete.js +1 -1
  694. package/lib/module/icons/UserMinus.js +1 -1
  695. package/lib/module/icons/Video.js +1 -1
  696. package/lib/module/icons/Warning.js +1 -1
  697. package/lib/module/icons/WutReaction.js +1 -1
  698. package/lib/module/icons/XLS.js +1 -1
  699. package/lib/module/icons/XLSX.js +1 -1
  700. package/lib/module/icons/ZIP.js +1 -1
  701. package/lib/module/icons/utils/base.js +1 -1
  702. package/lib/module/index.js +11 -0
  703. package/lib/module/index.js.map +1 -1
  704. package/lib/module/mock-builders/DB/consts.js +15 -0
  705. package/lib/module/mock-builders/DB/consts.js.map +1 -0
  706. package/lib/module/mock-builders/DB/mock.js +125 -0
  707. package/lib/module/mock-builders/DB/mock.js.map +1 -0
  708. package/lib/module/mock-builders/api/channelMocks.js +1 -0
  709. package/lib/module/mock-builders/api/channelMocks.js.map +1 -1
  710. package/lib/module/mock-builders/event/memberAdded.js +17 -0
  711. package/lib/module/mock-builders/event/memberAdded.js.map +1 -0
  712. package/lib/module/mock-builders/event/memberRemoved.js +17 -0
  713. package/lib/module/mock-builders/event/memberRemoved.js.map +1 -0
  714. package/lib/module/mock-builders/event/memberUpdated.js +17 -0
  715. package/lib/module/mock-builders/event/memberUpdated.js.map +1 -0
  716. package/lib/module/mock-builders/event/reactionDeleted.js +18 -0
  717. package/lib/module/mock-builders/event/reactionDeleted.js.map +1 -0
  718. package/lib/module/mock-builders/event/reactionNew.js +18 -0
  719. package/lib/module/mock-builders/event/reactionNew.js.map +1 -0
  720. package/lib/module/mock-builders/event/reactionUpdated.js +18 -0
  721. package/lib/module/mock-builders/event/reactionUpdated.js.map +1 -0
  722. package/lib/module/mock-builders/generator/reaction.js +1 -1
  723. package/lib/module/mock-builders/generator/reaction.js.map +1 -1
  724. package/lib/module/store/QuickSqliteClient.js +148 -0
  725. package/lib/module/store/QuickSqliteClient.js.map +1 -0
  726. package/lib/module/store/apis/deleteChannel.js +26 -0
  727. package/lib/module/store/apis/deleteChannel.js.map +1 -0
  728. package/lib/module/store/apis/deleteMember.js +28 -0
  729. package/lib/module/store/apis/deleteMember.js.map +1 -0
  730. package/lib/module/store/apis/deleteMessagesForChannel.js +26 -0
  731. package/lib/module/store/apis/deleteMessagesForChannel.js.map +1 -0
  732. package/lib/module/store/apis/deleteReactions.js +28 -0
  733. package/lib/module/store/apis/deleteReactions.js.map +1 -0
  734. package/lib/module/store/apis/getAllChannelIds.js +16 -0
  735. package/lib/module/store/apis/getAllChannelIds.js.map +1 -0
  736. package/lib/module/store/apis/getChannelMessages.js +45 -0
  737. package/lib/module/store/apis/getChannelMessages.js.map +1 -0
  738. package/lib/module/store/apis/getChannels.js +60 -0
  739. package/lib/module/store/apis/getChannels.js.map +1 -0
  740. package/lib/module/store/apis/getLastSyncedAt.js +23 -0
  741. package/lib/module/store/apis/getLastSyncedAt.js.map +1 -0
  742. package/lib/module/store/apis/getMembers.js +25 -0
  743. package/lib/module/store/apis/getMembers.js.map +1 -0
  744. package/lib/module/store/apis/getReads.js +25 -0
  745. package/lib/module/store/apis/getReads.js.map +1 -0
  746. package/lib/module/store/apis/queries/selectChannelIdsForFilterSort.js +31 -0
  747. package/lib/module/store/apis/queries/selectChannelIdsForFilterSort.js.map +1 -0
  748. package/lib/module/store/apis/queries/selectChannels.js +30 -0
  749. package/lib/module/store/apis/queries/selectChannels.js.map +1 -0
  750. package/lib/module/store/apis/queries/selectMembersForChannels.js +27 -0
  751. package/lib/module/store/apis/queries/selectMembersForChannels.js.map +1 -0
  752. package/lib/module/store/apis/queries/selectMessagesForChannels.js +27 -0
  753. package/lib/module/store/apis/queries/selectMessagesForChannels.js.map +1 -0
  754. package/lib/module/store/apis/queries/selectReactionsForMessages.js +27 -0
  755. package/lib/module/store/apis/queries/selectReactionsForMessages.js.map +1 -0
  756. package/lib/module/store/apis/queries/selectReadsForChannels.js +27 -0
  757. package/lib/module/store/apis/queries/selectReadsForChannels.js.map +1 -0
  758. package/lib/module/store/apis/updateMessage.js +69 -0
  759. package/lib/module/store/apis/updateMessage.js.map +1 -0
  760. package/lib/module/store/apis/updateReaction.js +53 -0
  761. package/lib/module/store/apis/updateReaction.js.map +1 -0
  762. package/lib/module/store/apis/upsertChannelData.js +26 -0
  763. package/lib/module/store/apis/upsertChannelData.js.map +1 -0
  764. package/lib/module/store/apis/upsertChannels.js +83 -0
  765. package/lib/module/store/apis/upsertChannels.js.map +1 -0
  766. package/lib/module/store/apis/upsertCidsForQuery.js +34 -0
  767. package/lib/module/store/apis/upsertCidsForQuery.js.map +1 -0
  768. package/lib/module/store/apis/upsertLastSyncedAt.js +22 -0
  769. package/lib/module/store/apis/upsertLastSyncedAt.js.map +1 -0
  770. package/lib/module/store/apis/upsertMembers.js +39 -0
  771. package/lib/module/store/apis/upsertMembers.js.map +1 -0
  772. package/lib/module/store/apis/upsertMessages.js +52 -0
  773. package/lib/module/store/apis/upsertMessages.js.map +1 -0
  774. package/lib/module/store/apis/upsertReads.js +39 -0
  775. package/lib/module/store/apis/upsertReads.js.map +1 -0
  776. package/lib/module/store/apis/utils/convertFilterSortToQuery.js +13 -0
  777. package/lib/module/store/apis/utils/convertFilterSortToQuery.js.map +1 -0
  778. package/lib/module/store/constants.js +11 -0
  779. package/lib/module/store/constants.js.map +1 -0
  780. package/lib/module/store/mappers/mapChannelDataToStorable.js +67 -0
  781. package/lib/module/store/mappers/mapChannelDataToStorable.js.map +1 -0
  782. package/lib/module/store/mappers/mapDateTimeToStorable.js +12 -0
  783. package/lib/module/store/mappers/mapDateTimeToStorable.js.map +1 -0
  784. package/lib/module/store/mappers/mapMemberToStorable.js +39 -0
  785. package/lib/module/store/mappers/mapMemberToStorable.js.map +1 -0
  786. package/lib/module/store/mappers/mapMessageToStorable.js +42 -0
  787. package/lib/module/store/mappers/mapMessageToStorable.js.map +1 -0
  788. package/lib/module/store/mappers/mapReactionToStorable.js +34 -0
  789. package/lib/module/store/mappers/mapReactionToStorable.js.map +1 -0
  790. package/lib/module/store/mappers/mapReadToStorable.js +23 -0
  791. package/lib/module/store/mappers/mapReadToStorable.js.map +1 -0
  792. package/lib/module/store/mappers/mapStorableToChannel.js +65 -0
  793. package/lib/module/store/mappers/mapStorableToChannel.js.map +1 -0
  794. package/lib/module/store/mappers/mapStorableToMember.js +38 -0
  795. package/lib/module/store/mappers/mapStorableToMember.js.map +1 -0
  796. package/lib/module/store/mappers/mapStorableToMessage.js +50 -0
  797. package/lib/module/store/mappers/mapStorableToMessage.js.map +1 -0
  798. package/lib/module/store/mappers/mapStorableToReaction.js +31 -0
  799. package/lib/module/store/mappers/mapStorableToReaction.js.map +1 -0
  800. package/lib/module/store/mappers/mapStorableToRead.js +20 -0
  801. package/lib/module/store/mappers/mapStorableToRead.js.map +1 -0
  802. package/lib/module/store/mappers/mapStorableToUser.js +31 -0
  803. package/lib/module/store/mappers/mapStorableToUser.js.map +1 -0
  804. package/lib/module/store/mappers/mapUserToStorable.js +34 -0
  805. package/lib/module/store/mappers/mapUserToStorable.js.map +1 -0
  806. package/lib/module/store/schema.js +161 -0
  807. package/lib/module/store/schema.js.map +1 -0
  808. package/lib/module/store/sqlite-utils/appendWhereCluase.js +37 -0
  809. package/lib/module/store/sqlite-utils/appendWhereCluase.js.map +1 -0
  810. package/lib/module/store/sqlite-utils/createCreateTableQuery.js +35 -0
  811. package/lib/module/store/sqlite-utils/createCreateTableQuery.js.map +1 -0
  812. package/lib/module/store/sqlite-utils/createDeleteQuery.js +14 -0
  813. package/lib/module/store/sqlite-utils/createDeleteQuery.js.map +1 -0
  814. package/lib/module/store/sqlite-utils/createSelectQuery.js +26 -0
  815. package/lib/module/store/sqlite-utils/createSelectQuery.js.map +1 -0
  816. package/lib/module/store/sqlite-utils/createUpdateQuery.js +29 -0
  817. package/lib/module/store/sqlite-utils/createUpdateQuery.js.map +1 -0
  818. package/lib/module/store/sqlite-utils/createUpsertQuery.js +30 -0
  819. package/lib/module/store/sqlite-utils/createUpsertQuery.js.map +1 -0
  820. package/lib/module/store/sqlite-utils/printRow.js +33 -0
  821. package/lib/module/store/sqlite-utils/printRow.js.map +1 -0
  822. package/lib/module/store/types.js +4 -0
  823. package/lib/module/store/types.js.map +1 -0
  824. package/lib/module/version.json +1 -1
  825. package/lib/typescript/__tests__/utils/BetterSqlite.d.ts +8 -0
  826. package/lib/typescript/components/Channel/Channel.d.ts +3 -5
  827. package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
  828. package/lib/typescript/components/Channel/hooks/useCreatePaginatedMessageListContext.d.ts +1 -1
  829. package/lib/typescript/components/ChannelList/hooks/listeners/handleEventToSyncDB.d.ts +2 -0
  830. package/lib/typescript/components/ChannelList/hooks/listeners/useConnectionRecovered.d.ts +3 -2
  831. package/lib/typescript/components/ChannelList/hooks/listeners/useSyncDatabase.d.ts +6 -0
  832. package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +4 -2
  833. package/lib/typescript/components/Chat/Chat.d.ts +4 -0
  834. package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
  835. package/lib/typescript/components/MessageList/MessageList.d.ts +1 -1
  836. package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +17 -0
  837. package/lib/typescript/contexts/chatContext/ChatContext.d.ts +1 -0
  838. package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts +4 -0
  839. package/lib/typescript/hooks/useImageErrorHandler.d.ts +5 -0
  840. package/lib/typescript/i18n/en.json +1 -2
  841. package/lib/typescript/i18n/fr.json +1 -2
  842. package/lib/typescript/i18n/he.json +0 -2
  843. package/lib/typescript/i18n/hi.json +1 -2
  844. package/lib/typescript/i18n/it.json +1 -2
  845. package/lib/typescript/i18n/ja.json +0 -2
  846. package/lib/typescript/i18n/ko.json +0 -2
  847. package/lib/typescript/i18n/nl.json +1 -2
  848. package/lib/typescript/i18n/ru.json +1 -2
  849. package/lib/typescript/i18n/tr.json +1 -2
  850. package/lib/typescript/index.d.ts +2 -0
  851. package/lib/typescript/store/QuickSqliteClient.d.ts +18 -0
  852. package/lib/typescript/store/apis/deleteChannel.d.ts +4 -0
  853. package/lib/typescript/store/apis/deleteMember.d.ts +6 -0
  854. package/lib/typescript/store/apis/deleteMessagesForChannel.d.ts +4 -0
  855. package/lib/typescript/store/apis/deleteReactions.d.ts +4 -0
  856. package/lib/typescript/store/apis/getAllChannelIds.d.ts +1 -0
  857. package/lib/typescript/store/apis/getChannelMessages.d.ts +6 -0
  858. package/lib/typescript/store/apis/getChannels.d.ts +7 -0
  859. package/lib/typescript/store/apis/getLastSyncedAt.d.ts +3 -0
  860. package/lib/typescript/store/apis/getMembers.d.ts +5 -0
  861. package/lib/typescript/store/apis/getReads.d.ts +5 -0
  862. package/lib/typescript/store/apis/queries/selectChannelIdsForFilterSort.d.ts +6 -0
  863. package/lib/typescript/store/apis/queries/selectChannels.d.ts +4 -0
  864. package/lib/typescript/store/apis/queries/selectMembersForChannels.d.ts +2 -0
  865. package/lib/typescript/store/apis/queries/selectMessagesForChannels.d.ts +2 -0
  866. package/lib/typescript/store/apis/queries/selectReactionsForMessages.d.ts +2 -0
  867. package/lib/typescript/store/apis/queries/selectReadsForChannels.d.ts +2 -0
  868. package/lib/typescript/store/apis/updateMessage.d.ts +6 -0
  869. package/lib/typescript/store/apis/updateReaction.d.ts +7 -0
  870. package/lib/typescript/store/apis/upsertChannelData.d.ts +5 -0
  871. package/lib/typescript/store/apis/upsertChannels.d.ts +9 -0
  872. package/lib/typescript/store/apis/upsertCidsForQuery.d.ts +7 -0
  873. package/lib/typescript/store/apis/upsertLastSyncedAt.d.ts +4 -0
  874. package/lib/typescript/store/apis/upsertMembers.d.ts +7 -0
  875. package/lib/typescript/store/apis/upsertMessages.d.ts +6 -0
  876. package/lib/typescript/store/apis/upsertReads.d.ts +7 -0
  877. package/lib/typescript/store/apis/utils/convertFilterSortToQuery.d.ts +6 -0
  878. package/lib/typescript/store/constants.d.ts +3 -0
  879. package/lib/typescript/store/mappers/mapChannelDataToStorable.d.ts +4 -0
  880. package/lib/typescript/store/mappers/mapDateTimeToStorable.d.ts +1 -0
  881. package/lib/typescript/store/mappers/mapMemberToStorable.d.ts +7 -0
  882. package/lib/typescript/store/mappers/mapMessageToStorable.d.ts +3 -0
  883. package/lib/typescript/store/mappers/mapReactionToStorable.d.ts +3 -0
  884. package/lib/typescript/store/mappers/mapReadToStorable.d.ts +7 -0
  885. package/lib/typescript/store/mappers/mapStorableToChannel.d.ts +4 -0
  886. package/lib/typescript/store/mappers/mapStorableToMember.d.ts +4 -0
  887. package/lib/typescript/store/mappers/mapStorableToMessage.d.ts +8 -0
  888. package/lib/typescript/store/mappers/mapStorableToReaction.d.ts +4 -0
  889. package/lib/typescript/store/mappers/mapStorableToRead.d.ts +4 -0
  890. package/lib/typescript/store/mappers/mapStorableToUser.d.ts +4 -0
  891. package/lib/typescript/store/mappers/mapUserToStorable.d.ts +3 -0
  892. package/lib/typescript/store/schema.d.ts +110 -0
  893. package/lib/typescript/store/sqlite-utils/__tests__/createSelectQuery.test.d.ts +1 -0
  894. package/lib/typescript/store/sqlite-utils/appendWhereCluase.d.ts +2 -0
  895. package/lib/typescript/store/sqlite-utils/createCreateTableQuery.d.ts +2 -0
  896. package/lib/typescript/store/sqlite-utils/createDeleteQuery.d.ts +12 -0
  897. package/lib/typescript/store/sqlite-utils/createSelectQuery.d.ts +13 -0
  898. package/lib/typescript/store/sqlite-utils/createUpdateQuery.d.ts +13 -0
  899. package/lib/typescript/store/sqlite-utils/createUpsertQuery.d.ts +11 -0
  900. package/lib/typescript/store/sqlite-utils/printRow.d.ts +2 -0
  901. package/lib/typescript/store/types.d.ts +8 -0
  902. package/lib/typescript/utils/Streami18n.d.ts +1 -2
  903. package/package.json +5 -3
  904. package/src/__tests__/offline-feature.test.js +659 -0
  905. package/src/__tests__/utils/BetterSqlite.js +44 -0
  906. package/src/components/Avatar/Avatar.tsx +46 -31
  907. package/src/components/Avatar/GroupAvatar.tsx +55 -43
  908. package/src/components/Channel/Channel.tsx +101 -136
  909. package/src/components/Channel/hooks/useCreateChannelContext.ts +2 -0
  910. package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts +2 -0
  911. package/src/components/ChannelList/ChannelList.tsx +25 -2
  912. package/src/components/ChannelList/ChannelListMessenger.tsx +4 -0
  913. package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +1 -0
  914. package/src/components/ChannelList/hooks/listeners/handleEventToSyncDB.ts +142 -0
  915. package/src/components/ChannelList/hooks/listeners/useAddedToChannelNotification.ts +2 -2
  916. package/src/components/ChannelList/hooks/listeners/useChannelDeleted.ts +2 -2
  917. package/src/components/ChannelList/hooks/listeners/useChannelHidden.ts +2 -2
  918. package/src/components/ChannelList/hooks/listeners/useChannelTruncated.ts +2 -2
  919. package/src/components/ChannelList/hooks/listeners/useChannelUpdated.ts +2 -2
  920. package/src/components/ChannelList/hooks/listeners/useChannelVisible.ts +2 -2
  921. package/src/components/ChannelList/hooks/listeners/useConnectionRecovered.ts +59 -14
  922. package/src/components/ChannelList/hooks/listeners/useNewMessage.ts +3 -2
  923. package/src/components/ChannelList/hooks/listeners/useNewMessageNotification.ts +2 -2
  924. package/src/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.ts +2 -2
  925. package/src/components/ChannelList/hooks/listeners/useSyncDatabase.ts +30 -0
  926. package/src/components/ChannelList/hooks/listeners/useUserPresence.ts +5 -4
  927. package/src/components/ChannelList/hooks/usePaginatedChannels.ts +34 -10
  928. package/src/components/ChannelPreview/ChannelPreview.tsx +8 -8
  929. package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +10 -9
  930. package/src/components/Chat/Chat.tsx +24 -3
  931. package/src/components/Chat/hooks/useCreateChatContext.ts +7 -3
  932. package/src/components/Chat/hooks/useMutedUsers.ts +5 -3
  933. package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +3 -3
  934. package/src/components/ImageGallery/components/ImageGridHandle.tsx +1 -1
  935. package/src/components/MessageInput/__tests__/__snapshots__/MessageInput.test.js.snap +16 -12
  936. package/src/components/MessageList/MessageList.tsx +167 -109
  937. package/src/components/MessageList/__tests__/__snapshots__/TypingIndicator.test.js.snap +45 -42
  938. package/src/components/Reply/Reply.tsx +1 -1
  939. package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +2 -0
  940. package/src/contexts/channelContext/ChannelContext.tsx +15 -0
  941. package/src/contexts/chatContext/ChatContext.tsx +1 -0
  942. package/src/contexts/overlayContext/OverlayProvider.tsx +0 -3
  943. package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +4 -0
  944. package/src/hooks/useImageErrorHandler.ts +16 -0
  945. package/src/i18n/en.json +1 -2
  946. package/src/i18n/fr.json +1 -2
  947. package/src/i18n/he.json +0 -2
  948. package/src/i18n/hi.json +1 -2
  949. package/src/i18n/it.json +1 -2
  950. package/src/i18n/ja.json +0 -2
  951. package/src/i18n/ko.json +0 -2
  952. package/src/i18n/nl.json +1 -2
  953. package/src/i18n/ru.json +1 -2
  954. package/src/i18n/tr.json +1 -2
  955. package/src/index.ts +3 -0
  956. package/src/mock-builders/DB/consts.ts +2 -0
  957. package/src/mock-builders/DB/mock.ts +114 -0
  958. package/src/mock-builders/api/channelMocks.tsx +1 -0
  959. package/src/mock-builders/event/memberAdded.js +8 -0
  960. package/src/mock-builders/event/memberRemoved.js +8 -0
  961. package/src/mock-builders/event/memberUpdated.js +8 -0
  962. package/src/mock-builders/event/reactionDeleted.js +9 -0
  963. package/src/mock-builders/event/reactionNew.js +9 -0
  964. package/src/mock-builders/event/reactionUpdated.js +9 -0
  965. package/src/mock-builders/generator/reaction.js +1 -1
  966. package/src/store/QuickSqliteClient.ts +120 -0
  967. package/src/store/apis/deleteChannel.ts +14 -0
  968. package/src/store/apis/deleteMember.ts +25 -0
  969. package/src/store/apis/deleteMessagesForChannel.ts +19 -0
  970. package/src/store/apis/deleteReactions.ts +24 -0
  971. package/src/store/apis/getAllChannelIds.ts +7 -0
  972. package/src/store/apis/getChannelMessages.ts +50 -0
  973. package/src/store/apis/getChannels.ts +43 -0
  974. package/src/store/apis/getLastSyncedAt.ts +13 -0
  975. package/src/store/apis/getMembers.ts +26 -0
  976. package/src/store/apis/getReads.ts +26 -0
  977. package/src/store/apis/queries/selectChannelIdsForFilterSort.ts +28 -0
  978. package/src/store/apis/queries/selectChannels.ts +19 -0
  979. package/src/store/apis/queries/selectMembersForChannels.ts +32 -0
  980. package/src/store/apis/queries/selectMessagesForChannels.ts +40 -0
  981. package/src/store/apis/queries/selectReactionsForMessages.ts +33 -0
  982. package/src/store/apis/queries/selectReadsForChannels.ts +30 -0
  983. package/src/store/apis/updateMessage.ts +65 -0
  984. package/src/store/apis/updateReaction.ts +54 -0
  985. package/src/store/apis/upsertChannelData.ts +20 -0
  986. package/src/store/apis/upsertChannels.ts +79 -0
  987. package/src/store/apis/upsertCidsForQuery.ts +30 -0
  988. package/src/store/apis/upsertLastSyncedAt.ts +17 -0
  989. package/src/store/apis/upsertMembers.ts +41 -0
  990. package/src/store/apis/upsertMessages.ts +43 -0
  991. package/src/store/apis/upsertReads.ts +41 -0
  992. package/src/store/apis/utils/convertFilterSortToQuery.ts +14 -0
  993. package/src/store/constants.ts +3 -0
  994. package/src/store/mappers/mapChannelDataToStorable.ts +67 -0
  995. package/src/store/mappers/mapDateTimeToStorable.ts +5 -0
  996. package/src/store/mappers/mapMemberToStorable.ts +45 -0
  997. package/src/store/mappers/mapMessageToStorable.ts +35 -0
  998. package/src/store/mappers/mapReactionToStorable.ts +19 -0
  999. package/src/store/mappers/mapReadToStorable.ts +25 -0
  1000. package/src/store/mappers/mapStorableToChannel.ts +69 -0
  1001. package/src/store/mappers/mapStorableToMember.ts +42 -0
  1002. package/src/store/mappers/mapStorableToMessage.ts +40 -0
  1003. package/src/store/mappers/mapStorableToReaction.ts +25 -0
  1004. package/src/store/mappers/mapStorableToRead.ts +21 -0
  1005. package/src/store/mappers/mapStorableToUser.ts +23 -0
  1006. package/src/store/mappers/mapUserToStorable.ts +18 -0
  1007. package/src/store/schema.ts +284 -0
  1008. package/src/store/sqlite-utils/__tests__/createSelectQuery.test.ts +21 -0
  1009. package/src/store/sqlite-utils/appendWhereCluase.ts +31 -0
  1010. package/src/store/sqlite-utils/createCreateTableQuery.ts +39 -0
  1011. package/src/store/sqlite-utils/createDeleteQuery.ts +23 -0
  1012. package/src/store/sqlite-utils/createSelectQuery.ts +25 -0
  1013. package/src/store/sqlite-utils/createUpdateQuery.ts +27 -0
  1014. package/src/store/sqlite-utils/createUpsertQuery.ts +48 -0
  1015. package/src/store/sqlite-utils/printRow.ts +28 -0
  1016. package/src/store/types.ts +11 -0
  1017. package/src/version.json +1 -1
@@ -0,0 +1,43 @@
1
+ import type { MessageResponse } from 'stream-chat';
2
+
3
+ import { mapMessageToStorable } from '../mappers/mapMessageToStorable';
4
+ import { mapReactionToStorable } from '../mappers/mapReactionToStorable';
5
+ import { mapUserToStorable } from '../mappers/mapUserToStorable';
6
+ import { QuickSqliteClient } from '../QuickSqliteClient';
7
+ import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
8
+ import type { PreparedQueries } from '../types';
9
+
10
+ export const upsertMessages = ({
11
+ flush = true,
12
+ messages,
13
+ }: {
14
+ messages: MessageResponse[];
15
+ flush?: boolean;
16
+ }) => {
17
+ const usersToUpsert: PreparedQueries[] = [];
18
+ const messagesToUpsert: PreparedQueries[] = [];
19
+ const reactionsToUpsert: PreparedQueries[] = [];
20
+
21
+ messages?.forEach((message: MessageResponse) => {
22
+ messagesToUpsert.push(createUpsertQuery('messages', mapMessageToStorable(message)));
23
+ if (message.user) {
24
+ usersToUpsert.push(createUpsertQuery('users', mapUserToStorable(message.user)));
25
+ }
26
+
27
+ [...(message.latest_reactions || []), ...(message.own_reactions || [])].forEach((r) => {
28
+ if (r.user) {
29
+ usersToUpsert.push(createUpsertQuery('users', mapUserToStorable(r.user)));
30
+ }
31
+
32
+ reactionsToUpsert.push(createUpsertQuery('reactions', mapReactionToStorable(r)));
33
+ });
34
+ });
35
+
36
+ const finalQueries = [...messagesToUpsert, ...reactionsToUpsert, ...usersToUpsert];
37
+
38
+ if (flush) {
39
+ QuickSqliteClient.executeSqlBatch(finalQueries);
40
+ }
41
+
42
+ return finalQueries;
43
+ };
@@ -0,0 +1,41 @@
1
+ import type { ReadResponse } from 'stream-chat';
2
+
3
+ import { mapReadToStorable } from '../mappers/mapReadToStorable';
4
+ import { mapUserToStorable } from '../mappers/mapUserToStorable';
5
+ import { QuickSqliteClient } from '../QuickSqliteClient';
6
+ import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
7
+ import type { PreparedQueries } from '../types';
8
+
9
+ export const upsertReads = ({
10
+ cid,
11
+ flush = true,
12
+ reads,
13
+ }: {
14
+ cid: string;
15
+ reads: ReadResponse[];
16
+ flush?: boolean;
17
+ }) => {
18
+ const queries: PreparedQueries[] = [];
19
+
20
+ reads?.forEach((read) => {
21
+ if (read.user) {
22
+ queries.push(createUpsertQuery('users', mapUserToStorable(read.user)));
23
+ }
24
+
25
+ queries.push(
26
+ createUpsertQuery(
27
+ 'reads',
28
+ mapReadToStorable({
29
+ cid,
30
+ read,
31
+ }),
32
+ ),
33
+ );
34
+ });
35
+
36
+ if (flush) {
37
+ QuickSqliteClient.executeSqlBatch(queries);
38
+ }
39
+
40
+ return queries;
41
+ };
@@ -0,0 +1,14 @@
1
+ import type { ChannelFilters, ChannelSort } from 'stream-chat';
2
+
3
+ import type { DefaultStreamChatGenerics } from '../../../types/types';
4
+
5
+ export const convertFilterSortToQuery = <
6
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
7
+ >({
8
+ filters,
9
+ sort,
10
+ }: {
11
+ filters?: ChannelFilters<StreamChatGenerics>;
12
+ sort?: ChannelSort<StreamChatGenerics>;
13
+ }) =>
14
+ JSON.stringify(`${filters ? JSON.stringify(filters) : ''}-${sort ? JSON.stringify(sort) : ''}`);
@@ -0,0 +1,3 @@
1
+ export const DB_NAME = 'stream-chat-react-native';
2
+ export const DB_LOCATION = 'databases';
3
+ export const DB_STATUS_ERROR = 1;
@@ -0,0 +1,67 @@
1
+ import type { ChannelResponse } from 'stream-chat';
2
+
3
+ import { mapDateTimeToStorable } from './mapDateTimeToStorable';
4
+
5
+ import type { DefaultStreamChatGenerics } from '../../types/types';
6
+
7
+ import type { TableRow } from '../types';
8
+
9
+ export const mapChannelDataToStorable = <
10
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
11
+ >(
12
+ channel: ChannelResponse<StreamChatGenerics>,
13
+ ): TableRow<'channels'> => {
14
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
+ const {
16
+ auto_translation_enabled,
17
+ auto_translation_language,
18
+ cid,
19
+ config,
20
+ cooldown,
21
+ created_at,
22
+ deleted_at,
23
+ disabled,
24
+ frozen,
25
+ hidden,
26
+ id,
27
+ invites,
28
+ last_message_at,
29
+ member_count,
30
+ members,
31
+ muted,
32
+ own_capabilities,
33
+ team,
34
+ truncated_at,
35
+ truncated_by,
36
+ truncated_by_id,
37
+ type,
38
+ updated_at,
39
+ ...extraData
40
+ } = channel;
41
+
42
+ return {
43
+ autoTranslationEnabled: auto_translation_enabled,
44
+ autoTranslationLanguage: auto_translation_language,
45
+ cid,
46
+ config: config && JSON.stringify(config),
47
+ cooldown,
48
+ createdAt: mapDateTimeToStorable(created_at),
49
+ deletedAt: mapDateTimeToStorable(deleted_at),
50
+ disabled,
51
+ extraData: JSON.stringify(extraData),
52
+ frozen,
53
+ hidden,
54
+ id,
55
+ invites: invites && JSON.stringify(invites),
56
+ lastMessageAt: mapDateTimeToStorable(last_message_at),
57
+ memberCount: member_count,
58
+ muted,
59
+ ownCapabilities: own_capabilities && JSON.stringify(own_capabilities),
60
+ team,
61
+ truncatedAt: truncated_at,
62
+ truncatedBy: truncated_by && JSON.stringify(truncated_by),
63
+ truncatedById: truncated_by_id,
64
+ type,
65
+ updatedAt: updated_at,
66
+ };
67
+ };
@@ -0,0 +1,5 @@
1
+ export const mapDateTimeToStorable = (datetime?: string) => {
2
+ if (!datetime) return '';
3
+
4
+ return new Date(datetime).toISOString();
5
+ };
@@ -0,0 +1,45 @@
1
+ import type { ChannelMemberResponse } from 'stream-chat';
2
+
3
+ import { mapDateTimeToStorable } from './mapDateTimeToStorable';
4
+
5
+ import type { DefaultStreamChatGenerics } from '../../types/types';
6
+ import type { TableRow } from '../types';
7
+
8
+ export const mapMemberToStorable = <
9
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
10
+ >({
11
+ cid,
12
+ member,
13
+ }: {
14
+ cid: string;
15
+ member: ChannelMemberResponse<StreamChatGenerics>;
16
+ }): TableRow<'members'> => {
17
+ const {
18
+ banned,
19
+ channel_role,
20
+ created_at,
21
+ invite_accepted_at,
22
+ invite_rejected_at,
23
+ invited,
24
+ is_moderator,
25
+ role,
26
+ shadow_banned,
27
+ updated_at,
28
+ user_id,
29
+ } = member;
30
+
31
+ return {
32
+ banned,
33
+ channelRole: channel_role,
34
+ cid,
35
+ createdAt: mapDateTimeToStorable(created_at),
36
+ inviteAcceptedAt: invite_accepted_at,
37
+ invited,
38
+ inviteRejectedAt: invite_rejected_at,
39
+ isModerator: is_moderator,
40
+ role,
41
+ shadowBanned: shadow_banned,
42
+ updatedAt: mapDateTimeToStorable(updated_at),
43
+ userId: user_id,
44
+ };
45
+ };
@@ -0,0 +1,35 @@
1
+ import type { MessageResponse } from 'stream-chat';
2
+
3
+ import { mapDateTimeToStorable } from './mapDateTimeToStorable';
4
+
5
+ import type { TableRow } from '../types';
6
+
7
+ export const mapMessageToStorable = (message: MessageResponse): TableRow<'messages'> => {
8
+ const {
9
+ attachments,
10
+ cid,
11
+ created_at,
12
+ deleted_at,
13
+ id,
14
+ reaction_counts,
15
+ text,
16
+ type,
17
+ updated_at,
18
+ user,
19
+ ...extraData
20
+ } = message;
21
+
22
+ return {
23
+ attachments: JSON.stringify(attachments),
24
+ cid: cid || '',
25
+ createdAt: mapDateTimeToStorable(created_at),
26
+ deletedAt: mapDateTimeToStorable(deleted_at),
27
+ extraData: JSON.stringify(extraData),
28
+ id,
29
+ reactionCounts: JSON.stringify(reaction_counts),
30
+ text,
31
+ type,
32
+ updatedAt: mapDateTimeToStorable(updated_at),
33
+ userId: user?.id,
34
+ };
35
+ };
@@ -0,0 +1,19 @@
1
+ import type { ReactionResponse } from 'stream-chat';
2
+
3
+ import { mapDateTimeToStorable } from './mapDateTimeToStorable';
4
+
5
+ import type { TableRow } from '../types';
6
+
7
+ export const mapReactionToStorable = (reaction: ReactionResponse): TableRow<'reactions'> => {
8
+ const { created_at, message_id, score, type, updated_at, user, ...extraData } = reaction;
9
+
10
+ return {
11
+ createdAt: mapDateTimeToStorable(created_at),
12
+ extraData: JSON.stringify(extraData),
13
+ messageId: message_id,
14
+ score,
15
+ type: type || '',
16
+ updatedAt: mapDateTimeToStorable(updated_at),
17
+ userId: user?.id,
18
+ };
19
+ };
@@ -0,0 +1,25 @@
1
+ import type { ReadResponse } from 'stream-chat';
2
+
3
+ import { mapDateTimeToStorable } from './mapDateTimeToStorable';
4
+
5
+ import type { DefaultStreamChatGenerics } from '../../types/types';
6
+ import type { TableRow } from '../types';
7
+
8
+ export const mapReadToStorable = <
9
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
10
+ >({
11
+ cid,
12
+ read,
13
+ }: {
14
+ cid: string;
15
+ read: ReadResponse<StreamChatGenerics>;
16
+ }): TableRow<'reads'> => {
17
+ const { last_read, unread_messages, user } = read;
18
+
19
+ return {
20
+ cid,
21
+ lastRead: mapDateTimeToStorable(last_read),
22
+ unreadMessages: unread_messages,
23
+ userId: user?.id,
24
+ };
25
+ };
@@ -0,0 +1,69 @@
1
+ import type { ChannelAPIResponse } from 'stream-chat';
2
+
3
+ import type { DefaultStreamChatGenerics } from '../../types/types';
4
+ import type { TableRow } from '../types';
5
+
6
+ export const mapStorableToChannel = <
7
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
8
+ >(
9
+ channelRow: TableRow<'channels'>,
10
+ ): Omit<
11
+ ChannelAPIResponse<StreamChatGenerics>,
12
+ 'duration' | 'messages' | 'members' | 'pinned_messages'
13
+ > => {
14
+ const {
15
+ autoTranslationEnabled,
16
+ autoTranslationLanguage,
17
+ cid,
18
+ config,
19
+ cooldown,
20
+ createdAt,
21
+ createdById,
22
+ deletedAt,
23
+ disabled,
24
+ extraData,
25
+ frozen,
26
+ hidden,
27
+ id,
28
+ invites,
29
+ lastMessageAt,
30
+ memberCount,
31
+ muted,
32
+ ownCapabilities,
33
+ team,
34
+ truncatedAt,
35
+ truncatedBy,
36
+ truncatedById,
37
+ type,
38
+ updatedAt,
39
+ } = channelRow;
40
+
41
+ return {
42
+ channel: {
43
+ auto_translation_enabled: autoTranslationEnabled,
44
+ auto_translation_language: autoTranslationLanguage,
45
+ cid,
46
+ config: config && JSON.parse(config),
47
+ cooldown,
48
+ created_at: createdAt,
49
+ created_by_id: createdById,
50
+ deleted_at: deletedAt,
51
+ disabled,
52
+ frozen,
53
+ hidden,
54
+ id,
55
+ invites: invites && JSON.parse(invites),
56
+ last_message_at: lastMessageAt,
57
+ memberCount,
58
+ muted,
59
+ own_capabilities: ownCapabilities && JSON.parse(ownCapabilities),
60
+ team,
61
+ truncated_at: truncatedAt,
62
+ truncated_by: truncatedBy,
63
+ truncated_by_id: truncatedById,
64
+ type,
65
+ updated_at: updatedAt,
66
+ ...(extraData ? JSON.parse(extraData) : {}),
67
+ },
68
+ };
69
+ };
@@ -0,0 +1,42 @@
1
+ import type { ChannelMemberResponse } from 'stream-chat';
2
+
3
+ import { mapStorableToUser } from './mapStorableToUser';
4
+
5
+ import type { DefaultStreamChatGenerics } from '../../types/types';
6
+ import type { TableRowJoinedUser } from '../types';
7
+
8
+ export const mapStorableToMember = <
9
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
10
+ >(
11
+ memberRow: TableRowJoinedUser<'members'>,
12
+ ): ChannelMemberResponse<StreamChatGenerics> => {
13
+ const {
14
+ banned,
15
+ channelRole,
16
+ createdAt,
17
+ inviteAcceptedAt,
18
+ invited,
19
+ inviteRejectedAt,
20
+ isModerator,
21
+ role,
22
+ shadowBanned,
23
+ updatedAt,
24
+ user,
25
+ userId,
26
+ } = memberRow;
27
+
28
+ return {
29
+ banned,
30
+ channel_role: channelRole,
31
+ created_at: createdAt,
32
+ invite_accepted_at: inviteAcceptedAt,
33
+ invite_rejected_at: inviteRejectedAt,
34
+ invited,
35
+ is_moderator: isModerator,
36
+ role,
37
+ shadow_banned: shadowBanned,
38
+ updated_at: updatedAt,
39
+ user: mapStorableToUser(user),
40
+ user_id: userId,
41
+ };
42
+ };
@@ -0,0 +1,40 @@
1
+ import type { MessageResponse } from 'stream-chat';
2
+
3
+ import { mapStorableToReaction } from './mapStorableToReaction';
4
+
5
+ import { mapStorableToUser } from './mapStorableToUser';
6
+
7
+ import type { DefaultStreamChatGenerics } from '../../types/types';
8
+
9
+ import type { TableRowJoinedUser } from '../types';
10
+
11
+ export const mapStorableToMessage = <
12
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
13
+ >({
14
+ currentUserId,
15
+ messageRow,
16
+ reactionRows,
17
+ }: {
18
+ currentUserId: string;
19
+ messageRow: TableRowJoinedUser<'messages'>;
20
+ reactionRows: TableRowJoinedUser<'reactions'>[];
21
+ }): MessageResponse<StreamChatGenerics> => {
22
+ const { createdAt, deletedAt, extraData, reactionCounts, updatedAt, user, ...rest } = messageRow;
23
+ const latestReactions =
24
+ reactionRows?.map((reaction) => mapStorableToReaction<StreamChatGenerics>(reaction)) || [];
25
+
26
+ const ownReactions = latestReactions.filter((reaction) => reaction.user?.id === currentUserId);
27
+
28
+ return {
29
+ ...rest,
30
+ attachments: messageRow.attachments ? JSON.parse(messageRow.attachments) : [],
31
+ created_at: createdAt,
32
+ deleted_at: deletedAt,
33
+ latest_reactions: latestReactions,
34
+ own_reactions: ownReactions,
35
+ reaction_counts: reactionCounts ? JSON.parse(reactionCounts) : {},
36
+ updated_at: updatedAt,
37
+ user: mapStorableToUser(user),
38
+ ...(extraData ? JSON.parse(extraData) : {}),
39
+ };
40
+ };
@@ -0,0 +1,25 @@
1
+ import type { ReactionResponse } from 'stream-chat';
2
+
3
+ import { mapStorableToUser } from './mapStorableToUser';
4
+
5
+ import type { DefaultStreamChatGenerics } from '../../types/types';
6
+
7
+ import type { TableRowJoinedUser } from '../types';
8
+
9
+ export const mapStorableToReaction = <
10
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
11
+ >(
12
+ reactionRow: TableRowJoinedUser<'reactions'>,
13
+ ): ReactionResponse<StreamChatGenerics> => {
14
+ const { createdAt, extraData, messageId, score, type, updatedAt, user } = reactionRow;
15
+
16
+ return {
17
+ created_at: createdAt,
18
+ message_id: messageId,
19
+ score,
20
+ type,
21
+ updated_at: updatedAt,
22
+ user: mapStorableToUser(user),
23
+ ...(extraData ? JSON.parse(extraData) : {}),
24
+ };
25
+ };
@@ -0,0 +1,21 @@
1
+ import type { ReadResponse } from 'stream-chat';
2
+
3
+ import { mapStorableToUser } from './mapStorableToUser';
4
+
5
+ import type { DefaultStreamChatGenerics } from '../../types/types';
6
+
7
+ import type { TableRowJoinedUser } from '../types';
8
+
9
+ export const mapStorableToRead = <
10
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
11
+ >(
12
+ row: TableRowJoinedUser<'reads'>,
13
+ ): ReadResponse<StreamChatGenerics> => {
14
+ const { lastRead, unreadMessages, user } = row;
15
+
16
+ return {
17
+ last_read: lastRead,
18
+ unread_messages: unreadMessages,
19
+ user: mapStorableToUser(user),
20
+ };
21
+ };
@@ -0,0 +1,23 @@
1
+ import type { UserResponse } from 'stream-chat';
2
+
3
+ import type { DefaultStreamChatGenerics } from '../../types/types';
4
+ import type { TableRow } from '../types';
5
+
6
+ export const mapStorableToUser = <
7
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
8
+ >(
9
+ userRow: TableRow<'users'>,
10
+ ): UserResponse<StreamChatGenerics> => {
11
+ const { banned, createdAt, extraData, id, lastActive, online, role, updatedAt } = userRow;
12
+
13
+ return {
14
+ banned: Boolean(banned),
15
+ created_at: createdAt,
16
+ id,
17
+ last_active: lastActive,
18
+ online: Boolean(online),
19
+ role,
20
+ updated_at: updatedAt,
21
+ ...(extraData ? JSON.parse(extraData) : {}),
22
+ };
23
+ };
@@ -0,0 +1,18 @@
1
+ import type { UserResponse } from 'stream-chat';
2
+
3
+ import type { TableRow } from '../types';
4
+
5
+ export const mapUserToStorable = (user: UserResponse): TableRow<'users'> => {
6
+ const { banned, created_at, id, last_active, online, role, updated_at, ...extraData } = user;
7
+
8
+ return {
9
+ banned,
10
+ createdAt: created_at,
11
+ extraData: JSON.stringify(extraData || {}),
12
+ id,
13
+ lastActive: last_active,
14
+ online,
15
+ role,
16
+ updatedAt: updated_at,
17
+ };
18
+ };