stream-chat-react-native-core 4.0.0-beta.2 → 4.0.0-beta.6

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 (1049) hide show
  1. package/lib/commonjs/components/Attachment/Attachment.js +12 -12
  2. package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
  3. package/lib/commonjs/components/Attachment/AttachmentActions.js +4 -4
  4. package/lib/commonjs/components/Attachment/AttachmentActions.js.map +1 -1
  5. package/lib/commonjs/components/Attachment/Card.js +15 -15
  6. package/lib/commonjs/components/Attachment/Card.js.map +1 -1
  7. package/lib/commonjs/components/Attachment/FileAttachment.js +8 -8
  8. package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
  9. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +4 -4
  10. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
  11. package/lib/commonjs/components/Attachment/FileIcon.js.map +1 -1
  12. package/lib/commonjs/components/Attachment/Gallery.js +97 -106
  13. package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
  14. package/lib/commonjs/components/Attachment/Giphy.js +112 -148
  15. package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
  16. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGallery.js +46 -0
  17. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGallery.js.map +1 -0
  18. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js +88 -0
  19. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js.map +1 -0
  20. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js +75 -0
  21. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js.map +1 -0
  22. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js +43 -0
  23. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js.map +1 -0
  24. package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnail.js +30 -0
  25. package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnail.js.map +1 -0
  26. package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnailGrid.js +49 -0
  27. package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnailGrid.js.map +1 -0
  28. package/lib/commonjs/components/Attachment/utils/buildGallery/types.js +4 -0
  29. package/lib/commonjs/components/Attachment/utils/buildGallery/types.js.map +1 -0
  30. package/lib/commonjs/components/Attachment/utils/getAspectRatio.js +14 -0
  31. package/lib/commonjs/components/Attachment/utils/getAspectRatio.js.map +1 -0
  32. package/lib/commonjs/components/Attachment/utils/getGalleryImageBorderRadius.js +36 -0
  33. package/lib/commonjs/components/Attachment/utils/getGalleryImageBorderRadius.js.map +1 -0
  34. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +9 -8
  35. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  36. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +2 -2
  37. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
  38. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +16 -16
  39. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -1
  40. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +7 -7
  41. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -1
  42. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +4 -4
  43. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -1
  44. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +11 -11
  45. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
  46. package/lib/commonjs/components/Avatar/Avatar.js +13 -7
  47. package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
  48. package/lib/commonjs/components/Avatar/GroupAvatar.js +10 -4
  49. package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
  50. package/lib/commonjs/components/Channel/Channel.js +64 -64
  51. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  52. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  53. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  54. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  55. package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
  56. package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
  57. package/lib/commonjs/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
  58. package/lib/commonjs/components/Channel/hooks/useCreateTypingContext.js.map +1 -1
  59. package/lib/commonjs/components/ChannelList/ChannelList.js +6 -6
  60. package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
  61. package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +4 -4
  62. package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
  63. package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +6 -7
  64. package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
  65. package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +2 -2
  66. package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
  67. package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +17 -17
  68. package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
  69. package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
  70. package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
  71. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
  72. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
  73. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
  74. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
  75. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
  76. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
  77. package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +1 -1
  78. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
  79. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
  80. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js +3 -3
  81. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
  82. package/lib/commonjs/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
  83. package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
  84. package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +2 -2
  85. package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
  86. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +83 -70
  87. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  88. package/lib/commonjs/components/ChannelList/utils.js +1 -1
  89. package/lib/commonjs/components/ChannelList/utils.js.map +1 -1
  90. package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +2 -2
  91. package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
  92. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +4 -4
  93. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
  94. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +4 -4
  95. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
  96. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +48 -20
  97. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
  98. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +51 -0
  99. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -0
  100. package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +4 -4
  101. package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
  102. package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
  103. package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
  104. package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +2 -2
  105. package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
  106. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js.map +1 -1
  107. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
  108. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
  109. package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
  110. package/lib/commonjs/components/Chat/Chat.js +4 -4
  111. package/lib/commonjs/components/Chat/Chat.js.map +1 -1
  112. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  113. package/lib/commonjs/components/Chat/hooks/useIsOnline.js.map +1 -1
  114. package/lib/commonjs/components/Chat/hooks/useMutedUsers.js.map +1 -1
  115. package/lib/commonjs/components/ImageGallery/ImageGallery.js +89 -56
  116. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  117. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +2 -2
  118. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  119. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +12 -12
  120. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  121. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +28 -11
  122. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  123. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +7 -7
  124. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
  125. package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +5 -5
  126. package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
  127. package/lib/commonjs/components/Indicators/LoadingIndicator.js +9 -9
  128. package/lib/commonjs/components/Indicators/LoadingIndicator.js.map +1 -1
  129. package/lib/commonjs/components/Message/Message.js +19 -15
  130. package/lib/commonjs/components/Message/Message.js.map +1 -1
  131. package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +6 -6
  132. package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
  133. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +19 -19
  134. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
  135. package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +5 -5
  136. package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
  137. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +20 -16
  138. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
  139. package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +6 -6
  140. package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -1
  141. package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js +10 -10
  142. package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js.map +1 -1
  143. package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +5 -5
  144. package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
  145. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +6 -6
  146. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  147. package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +15 -13
  148. package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js.map +1 -1
  149. package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +3 -3
  150. package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
  151. package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +51 -51
  152. package/lib/commonjs/components/Message/MessageSimple/ReactionList.js.map +1 -1
  153. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js +89 -0
  154. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js.map +1 -0
  155. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js +46 -0
  156. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -0
  157. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +151 -81
  158. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  159. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js +240 -0
  160. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js.map +1 -0
  161. package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js.map +1 -1
  162. package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js +16 -3
  163. package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
  164. package/lib/commonjs/components/Message/hooks/useMessageActions.js +18 -14
  165. package/lib/commonjs/components/Message/hooks/useMessageActions.js.map +1 -1
  166. package/lib/commonjs/components/Message/utils/messageActions.js.map +1 -1
  167. package/lib/commonjs/components/Message/utils/removeReservedFields.js.map +1 -1
  168. package/lib/commonjs/components/MessageInput/AttachButton.js +3 -3
  169. package/lib/commonjs/components/MessageInput/AttachButton.js.map +1 -1
  170. package/lib/commonjs/components/MessageInput/CommandsButton.js +3 -3
  171. package/lib/commonjs/components/MessageInput/CommandsButton.js.map +1 -1
  172. package/lib/commonjs/components/MessageInput/CooldownTimer.js +2 -2
  173. package/lib/commonjs/components/MessageInput/CooldownTimer.js.map +1 -1
  174. package/lib/commonjs/components/MessageInput/FileUploadPreview.js +13 -13
  175. package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
  176. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +7 -7
  177. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
  178. package/lib/commonjs/components/MessageInput/InputButtons.js +9 -9
  179. package/lib/commonjs/components/MessageInput/InputButtons.js.map +1 -1
  180. package/lib/commonjs/components/MessageInput/MessageInput.js +40 -40
  181. package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
  182. package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +3 -3
  183. package/lib/commonjs/components/MessageInput/MoreOptionsButton.js.map +1 -1
  184. package/lib/commonjs/components/MessageInput/SendButton.js +5 -5
  185. package/lib/commonjs/components/MessageInput/SendButton.js.map +1 -1
  186. package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +2 -2
  187. package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -1
  188. package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +10 -10
  189. package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
  190. package/lib/commonjs/components/MessageInput/hooks/useCooldown.js.map +1 -1
  191. package/lib/commonjs/components/MessageInput/hooks/useCountdown.js.map +1 -1
  192. package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js +4 -4
  193. package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js.map +1 -1
  194. package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js +4 -4
  195. package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js.map +1 -1
  196. package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js +4 -4
  197. package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js.map +1 -1
  198. package/lib/commonjs/components/MessageList/MessageList.js +28 -28
  199. package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
  200. package/lib/commonjs/components/MessageList/MessageSystem.js +6 -6
  201. package/lib/commonjs/components/MessageList/MessageSystem.js.map +1 -1
  202. package/lib/commonjs/components/MessageList/TypingIndicator.js +5 -5
  203. package/lib/commonjs/components/MessageList/TypingIndicator.js.map +1 -1
  204. package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js +2 -2
  205. package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js.map +1 -1
  206. package/lib/commonjs/components/MessageList/hooks/useMessageList.js +7 -7
  207. package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
  208. package/lib/commonjs/components/MessageList/hooks/useTypingString.js +2 -2
  209. package/lib/commonjs/components/MessageList/hooks/useTypingString.js.map +1 -1
  210. package/lib/commonjs/components/MessageList/utils/filterTypingUsers.js.map +1 -1
  211. package/lib/commonjs/components/MessageList/utils/getDateSeparators.js.map +1 -1
  212. package/lib/commonjs/components/MessageList/utils/getGroupStyles.js.map +1 -1
  213. package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js +3 -1
  214. package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
  215. package/lib/commonjs/components/MessageList/utils/getReadStates.js.map +1 -1
  216. package/lib/commonjs/components/MessageOverlay/MessageActionList.js +5 -5
  217. package/lib/commonjs/components/MessageOverlay/MessageActionList.js.map +1 -1
  218. package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +8 -8
  219. package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js.map +1 -1
  220. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +41 -34
  221. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
  222. package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +1 -1
  223. package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js.map +1 -1
  224. package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +16 -16
  225. package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js.map +1 -1
  226. package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +31 -34
  227. package/lib/commonjs/components/MessageOverlay/OverlayReactions.js.map +1 -1
  228. package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js +41 -0
  229. package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js.map +1 -0
  230. package/lib/commonjs/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -1
  231. package/lib/commonjs/components/Reply/Reply.js +25 -19
  232. package/lib/commonjs/components/Reply/Reply.js.map +1 -1
  233. package/lib/commonjs/components/Thread/Thread.js +6 -6
  234. package/lib/commonjs/components/Thread/Thread.js.map +1 -1
  235. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +12 -12
  236. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
  237. package/lib/commonjs/components/docs/data.js +45 -45
  238. package/lib/commonjs/components/docs/data.js.map +1 -1
  239. package/lib/commonjs/components/index.js +26 -0
  240. package/lib/commonjs/components/index.js.map +1 -1
  241. package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +2 -2
  242. package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
  243. package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +2 -2
  244. package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
  245. package/lib/commonjs/contexts/channelContext/ChannelContext.js +2 -2
  246. package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
  247. package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +2 -2
  248. package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
  249. package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +3 -3
  250. package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
  251. package/lib/commonjs/contexts/channelsStateContext/useChannelState.js.map +1 -1
  252. package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
  253. package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
  254. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +2 -2
  255. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
  256. package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +2 -2
  257. package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js.map +1 -1
  258. package/lib/commonjs/contexts/messageContext/MessageContext.js +2 -2
  259. package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
  260. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +18 -14
  261. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  262. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  263. package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js +10 -3
  264. package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
  265. package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +5 -19
  266. package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
  267. package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.js +36 -0
  268. package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.js.map +1 -0
  269. package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js +105 -0
  270. package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js.map +1 -0
  271. package/lib/commonjs/contexts/messagesContext/MessagesContext.js +2 -2
  272. package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
  273. package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
  274. package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
  275. package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +33 -31
  276. package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
  277. package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
  278. package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +2 -2
  279. package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
  280. package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +2 -2
  281. package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
  282. package/lib/commonjs/contexts/themeContext/ThemeContext.js +2 -2
  283. package/lib/commonjs/contexts/themeContext/ThemeContext.js.map +1 -1
  284. package/lib/commonjs/contexts/themeContext/utils/theme.js +20 -11
  285. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  286. package/lib/commonjs/contexts/threadContext/ThreadContext.js +2 -2
  287. package/lib/commonjs/contexts/threadContext/ThreadContext.js.map +1 -1
  288. package/lib/commonjs/contexts/translationContext/TranslationContext.js +3 -3
  289. package/lib/commonjs/contexts/translationContext/TranslationContext.js.map +1 -1
  290. package/lib/commonjs/contexts/typingContext/TypingContext.js +2 -2
  291. package/lib/commonjs/contexts/typingContext/TypingContext.js.map +1 -1
  292. package/lib/commonjs/contexts/utils/getDisplayName.js.map +1 -1
  293. package/lib/commonjs/emoji-data/index.js +2 -2
  294. package/lib/commonjs/emoji-data/index.js.map +1 -1
  295. package/lib/commonjs/hooks/useStreami18n.js.map +1 -1
  296. package/lib/commonjs/icons/UserAdmin.js +62 -0
  297. package/lib/commonjs/icons/UserAdmin.js.map +1 -0
  298. package/lib/commonjs/icons/index.js +0 -26
  299. package/lib/commonjs/icons/index.js.map +1 -1
  300. package/lib/commonjs/icons/utils/base.js +1 -1
  301. package/lib/commonjs/index.js +6 -6
  302. package/lib/commonjs/mock-builders/api/error.js +1 -1
  303. package/lib/commonjs/mock-builders/api/sendMessage.js.map +1 -1
  304. package/lib/commonjs/mock-builders/generator/attachment.js +1 -3
  305. package/lib/commonjs/mock-builders/generator/attachment.js.map +1 -1
  306. package/lib/commonjs/mock-builders/generator/channel.js +101 -51
  307. package/lib/commonjs/mock-builders/generator/channel.js.map +1 -1
  308. package/lib/commonjs/mock-builders/generator/user.js +32 -33
  309. package/lib/commonjs/mock-builders/generator/user.js.map +1 -1
  310. package/lib/commonjs/mock-builders/mock.js +1 -1
  311. package/lib/commonjs/native.js +1 -1
  312. package/lib/commonjs/native.js.map +1 -1
  313. package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js +7 -7
  314. package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js.map +1 -1
  315. package/lib/commonjs/styleguideComponents/JsDoc.js +4 -4
  316. package/lib/commonjs/styleguideComponents/JsDoc.js.map +1 -1
  317. package/lib/commonjs/styleguideComponents/PathlineRenderer.js +7 -7
  318. package/lib/commonjs/styleguideComponents/PathlineRenderer.js.map +1 -1
  319. package/lib/commonjs/styleguideComponents/PropsRenderer.js +25 -25
  320. package/lib/commonjs/styleguideComponents/PropsRenderer.js.map +1 -1
  321. package/lib/commonjs/styleguideComponents/Wrapper.js +1 -1
  322. package/lib/commonjs/styleguideComponents/Wrapper.js.map +1 -1
  323. package/lib/commonjs/utils/Streami18n.js.map +1 -1
  324. package/lib/commonjs/utils/getResizedImageUrl.js +26 -0
  325. package/lib/commonjs/utils/getResizedImageUrl.js.map +1 -0
  326. package/lib/commonjs/utils/getUrlOfImageAttachment.js +9 -0
  327. package/lib/commonjs/utils/getUrlOfImageAttachment.js.map +1 -0
  328. package/lib/commonjs/utils/utils.js +9 -3
  329. package/lib/commonjs/utils/utils.js.map +1 -1
  330. package/lib/commonjs/version.json +1 -1
  331. package/lib/module/components/Attachment/Attachment.js +12 -12
  332. package/lib/module/components/Attachment/Attachment.js.map +1 -1
  333. package/lib/module/components/Attachment/AttachmentActions.js +4 -4
  334. package/lib/module/components/Attachment/AttachmentActions.js.map +1 -1
  335. package/lib/module/components/Attachment/Card.js +15 -15
  336. package/lib/module/components/Attachment/Card.js.map +1 -1
  337. package/lib/module/components/Attachment/FileAttachment.js +8 -8
  338. package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
  339. package/lib/module/components/Attachment/FileAttachmentGroup.js +4 -4
  340. package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
  341. package/lib/module/components/Attachment/FileIcon.js.map +1 -1
  342. package/lib/module/components/Attachment/Gallery.js +97 -106
  343. package/lib/module/components/Attachment/Gallery.js.map +1 -1
  344. package/lib/module/components/Attachment/Giphy.js +112 -148
  345. package/lib/module/components/Attachment/Giphy.js.map +1 -1
  346. package/lib/module/components/Attachment/utils/buildGallery/buildGallery.js +46 -0
  347. package/lib/module/components/Attachment/utils/buildGallery/buildGallery.js.map +1 -0
  348. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js +88 -0
  349. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js.map +1 -0
  350. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js +75 -0
  351. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js.map +1 -0
  352. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js +43 -0
  353. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js.map +1 -0
  354. package/lib/module/components/Attachment/utils/buildGallery/buildThumbnail.js +30 -0
  355. package/lib/module/components/Attachment/utils/buildGallery/buildThumbnail.js.map +1 -0
  356. package/lib/module/components/Attachment/utils/buildGallery/buildThumbnailGrid.js +49 -0
  357. package/lib/module/components/Attachment/utils/buildGallery/buildThumbnailGrid.js.map +1 -0
  358. package/lib/module/components/Attachment/utils/buildGallery/types.js +4 -0
  359. package/lib/module/components/Attachment/utils/buildGallery/types.js.map +1 -0
  360. package/lib/module/components/Attachment/utils/getAspectRatio.js +14 -0
  361. package/lib/module/components/Attachment/utils/getAspectRatio.js.map +1 -0
  362. package/lib/module/components/Attachment/utils/getGalleryImageBorderRadius.js +36 -0
  363. package/lib/module/components/Attachment/utils/getGalleryImageBorderRadius.js.map +1 -0
  364. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +9 -8
  365. package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  366. package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +2 -2
  367. package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
  368. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +16 -16
  369. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -1
  370. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +7 -7
  371. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -1
  372. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +4 -4
  373. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -1
  374. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +11 -11
  375. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
  376. package/lib/module/components/Avatar/Avatar.js +13 -7
  377. package/lib/module/components/Avatar/Avatar.js.map +1 -1
  378. package/lib/module/components/Avatar/GroupAvatar.js +10 -4
  379. package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
  380. package/lib/module/components/Channel/Channel.js +64 -64
  381. package/lib/module/components/Channel/Channel.js.map +1 -1
  382. package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  383. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  384. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  385. package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
  386. package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
  387. package/lib/module/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
  388. package/lib/module/components/Channel/hooks/useCreateTypingContext.js.map +1 -1
  389. package/lib/module/components/ChannelList/ChannelList.js +6 -6
  390. package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
  391. package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +4 -4
  392. package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
  393. package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +6 -7
  394. package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
  395. package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +2 -2
  396. package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
  397. package/lib/module/components/ChannelList/ChannelListMessenger.js +17 -17
  398. package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
  399. package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
  400. package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
  401. package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
  402. package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
  403. package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
  404. package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
  405. package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
  406. package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
  407. package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +1 -1
  408. package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
  409. package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
  410. package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js +3 -3
  411. package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
  412. package/lib/module/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
  413. package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
  414. package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +2 -2
  415. package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
  416. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +83 -70
  417. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  418. package/lib/module/components/ChannelList/utils.js +1 -1
  419. package/lib/module/components/ChannelList/utils.js.map +1 -1
  420. package/lib/module/components/ChannelPreview/ChannelAvatar.js +2 -2
  421. package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
  422. package/lib/module/components/ChannelPreview/ChannelPreview.js +4 -4
  423. package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
  424. package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +4 -4
  425. package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
  426. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +48 -20
  427. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
  428. package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +51 -0
  429. package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -0
  430. package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +4 -4
  431. package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
  432. package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
  433. package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
  434. package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +2 -2
  435. package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
  436. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js.map +1 -1
  437. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
  438. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
  439. package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
  440. package/lib/module/components/Chat/Chat.js +4 -4
  441. package/lib/module/components/Chat/Chat.js.map +1 -1
  442. package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  443. package/lib/module/components/Chat/hooks/useIsOnline.js.map +1 -1
  444. package/lib/module/components/Chat/hooks/useMutedUsers.js.map +1 -1
  445. package/lib/module/components/ImageGallery/ImageGallery.js +89 -56
  446. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  447. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +2 -2
  448. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  449. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +12 -12
  450. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  451. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +28 -11
  452. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  453. package/lib/module/components/ImageGallery/components/ImageGrid.js +7 -7
  454. package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
  455. package/lib/module/components/ImageGallery/components/ImageGridHandle.js +5 -5
  456. package/lib/module/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
  457. package/lib/module/components/Indicators/LoadingIndicator.js +9 -9
  458. package/lib/module/components/Indicators/LoadingIndicator.js.map +1 -1
  459. package/lib/module/components/Message/Message.js +19 -15
  460. package/lib/module/components/Message/Message.js.map +1 -1
  461. package/lib/module/components/Message/MessageSimple/MessageAvatar.js +6 -6
  462. package/lib/module/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
  463. package/lib/module/components/Message/MessageSimple/MessageContent.js +19 -19
  464. package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
  465. package/lib/module/components/Message/MessageSimple/MessageDeleted.js +5 -5
  466. package/lib/module/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
  467. package/lib/module/components/Message/MessageSimple/MessageFooter.js +20 -16
  468. package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
  469. package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +6 -6
  470. package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -1
  471. package/lib/module/components/Message/MessageSimple/MessageReplies.js +10 -10
  472. package/lib/module/components/Message/MessageSimple/MessageReplies.js.map +1 -1
  473. package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +5 -5
  474. package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
  475. package/lib/module/components/Message/MessageSimple/MessageSimple.js +6 -6
  476. package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  477. package/lib/module/components/Message/MessageSimple/MessageStatus.js +15 -13
  478. package/lib/module/components/Message/MessageSimple/MessageStatus.js.map +1 -1
  479. package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +3 -3
  480. package/lib/module/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
  481. package/lib/module/components/Message/MessageSimple/ReactionList.js +51 -51
  482. package/lib/module/components/Message/MessageSimple/ReactionList.js.map +1 -1
  483. package/lib/module/components/Message/MessageSimple/utils/parseLinks.js +89 -0
  484. package/lib/module/components/Message/MessageSimple/utils/parseLinks.js.map +1 -0
  485. package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js +46 -0
  486. package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -0
  487. package/lib/module/components/Message/MessageSimple/utils/renderText.js +151 -81
  488. package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  489. package/lib/module/components/Message/MessageSimple/utils/renderText.test.js +240 -0
  490. package/lib/module/components/Message/MessageSimple/utils/renderText.test.js.map +1 -0
  491. package/lib/module/components/Message/hooks/useCreateMessageContext.js.map +1 -1
  492. package/lib/module/components/Message/hooks/useMessageActionHandlers.js +16 -3
  493. package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
  494. package/lib/module/components/Message/hooks/useMessageActions.js +18 -14
  495. package/lib/module/components/Message/hooks/useMessageActions.js.map +1 -1
  496. package/lib/module/components/Message/utils/messageActions.js.map +1 -1
  497. package/lib/module/components/Message/utils/removeReservedFields.js.map +1 -1
  498. package/lib/module/components/MessageInput/AttachButton.js +3 -3
  499. package/lib/module/components/MessageInput/AttachButton.js.map +1 -1
  500. package/lib/module/components/MessageInput/CommandsButton.js +3 -3
  501. package/lib/module/components/MessageInput/CommandsButton.js.map +1 -1
  502. package/lib/module/components/MessageInput/CooldownTimer.js +2 -2
  503. package/lib/module/components/MessageInput/CooldownTimer.js.map +1 -1
  504. package/lib/module/components/MessageInput/FileUploadPreview.js +13 -13
  505. package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
  506. package/lib/module/components/MessageInput/ImageUploadPreview.js +7 -7
  507. package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
  508. package/lib/module/components/MessageInput/InputButtons.js +9 -9
  509. package/lib/module/components/MessageInput/InputButtons.js.map +1 -1
  510. package/lib/module/components/MessageInput/MessageInput.js +40 -40
  511. package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
  512. package/lib/module/components/MessageInput/MoreOptionsButton.js +3 -3
  513. package/lib/module/components/MessageInput/MoreOptionsButton.js.map +1 -1
  514. package/lib/module/components/MessageInput/SendButton.js +5 -5
  515. package/lib/module/components/MessageInput/SendButton.js.map +1 -1
  516. package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +2 -2
  517. package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -1
  518. package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +10 -10
  519. package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
  520. package/lib/module/components/MessageInput/hooks/useCooldown.js.map +1 -1
  521. package/lib/module/components/MessageInput/hooks/useCountdown.js.map +1 -1
  522. package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js +4 -4
  523. package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js.map +1 -1
  524. package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js +4 -4
  525. package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js.map +1 -1
  526. package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js +4 -4
  527. package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js.map +1 -1
  528. package/lib/module/components/MessageList/MessageList.js +28 -28
  529. package/lib/module/components/MessageList/MessageList.js.map +1 -1
  530. package/lib/module/components/MessageList/MessageSystem.js +6 -6
  531. package/lib/module/components/MessageList/MessageSystem.js.map +1 -1
  532. package/lib/module/components/MessageList/TypingIndicator.js +5 -5
  533. package/lib/module/components/MessageList/TypingIndicator.js.map +1 -1
  534. package/lib/module/components/MessageList/TypingIndicatorContainer.js +2 -2
  535. package/lib/module/components/MessageList/TypingIndicatorContainer.js.map +1 -1
  536. package/lib/module/components/MessageList/hooks/useMessageList.js +7 -7
  537. package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
  538. package/lib/module/components/MessageList/hooks/useTypingString.js +2 -2
  539. package/lib/module/components/MessageList/hooks/useTypingString.js.map +1 -1
  540. package/lib/module/components/MessageList/utils/filterTypingUsers.js.map +1 -1
  541. package/lib/module/components/MessageList/utils/getDateSeparators.js.map +1 -1
  542. package/lib/module/components/MessageList/utils/getGroupStyles.js.map +1 -1
  543. package/lib/module/components/MessageList/utils/getLastReceivedMessage.js +3 -1
  544. package/lib/module/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
  545. package/lib/module/components/MessageList/utils/getReadStates.js.map +1 -1
  546. package/lib/module/components/MessageOverlay/MessageActionList.js +5 -5
  547. package/lib/module/components/MessageOverlay/MessageActionList.js.map +1 -1
  548. package/lib/module/components/MessageOverlay/MessageActionListItem.js +8 -8
  549. package/lib/module/components/MessageOverlay/MessageActionListItem.js.map +1 -1
  550. package/lib/module/components/MessageOverlay/MessageOverlay.js +41 -34
  551. package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
  552. package/lib/module/components/MessageOverlay/OverlayBackdrop.js +1 -1
  553. package/lib/module/components/MessageOverlay/OverlayBackdrop.js.map +1 -1
  554. package/lib/module/components/MessageOverlay/OverlayReactionList.js +16 -16
  555. package/lib/module/components/MessageOverlay/OverlayReactionList.js.map +1 -1
  556. package/lib/module/components/MessageOverlay/OverlayReactions.js +31 -34
  557. package/lib/module/components/MessageOverlay/OverlayReactions.js.map +1 -1
  558. package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js +41 -0
  559. package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js.map +1 -0
  560. package/lib/module/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -1
  561. package/lib/module/components/Reply/Reply.js +25 -19
  562. package/lib/module/components/Reply/Reply.js.map +1 -1
  563. package/lib/module/components/Thread/Thread.js +6 -6
  564. package/lib/module/components/Thread/Thread.js.map +1 -1
  565. package/lib/module/components/Thread/components/ThreadFooterComponent.js +12 -12
  566. package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
  567. package/lib/module/components/docs/data.js +45 -45
  568. package/lib/module/components/docs/data.js.map +1 -1
  569. package/lib/module/components/index.js +26 -0
  570. package/lib/module/components/index.js.map +1 -1
  571. package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +2 -2
  572. package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
  573. package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +2 -2
  574. package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
  575. package/lib/module/contexts/channelContext/ChannelContext.js +2 -2
  576. package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
  577. package/lib/module/contexts/channelsContext/ChannelsContext.js +2 -2
  578. package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
  579. package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +3 -3
  580. package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
  581. package/lib/module/contexts/channelsStateContext/useChannelState.js.map +1 -1
  582. package/lib/module/contexts/chatContext/ChatContext.js +2 -2
  583. package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
  584. package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +2 -2
  585. package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
  586. package/lib/module/contexts/keyboardContext/KeyboardContext.js +2 -2
  587. package/lib/module/contexts/keyboardContext/KeyboardContext.js.map +1 -1
  588. package/lib/module/contexts/messageContext/MessageContext.js +2 -2
  589. package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
  590. package/lib/module/contexts/messageInputContext/MessageInputContext.js +18 -14
  591. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  592. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  593. package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js +10 -3
  594. package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
  595. package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +5 -19
  596. package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
  597. package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.js +36 -0
  598. package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.js.map +1 -0
  599. package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js +105 -0
  600. package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js.map +1 -0
  601. package/lib/module/contexts/messagesContext/MessagesContext.js +2 -2
  602. package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
  603. package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
  604. package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
  605. package/lib/module/contexts/overlayContext/OverlayProvider.js +33 -31
  606. package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
  607. package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
  608. package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +2 -2
  609. package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
  610. package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +2 -2
  611. package/lib/module/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
  612. package/lib/module/contexts/themeContext/ThemeContext.js +2 -2
  613. package/lib/module/contexts/themeContext/ThemeContext.js.map +1 -1
  614. package/lib/module/contexts/themeContext/utils/theme.js +20 -11
  615. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  616. package/lib/module/contexts/threadContext/ThreadContext.js +2 -2
  617. package/lib/module/contexts/threadContext/ThreadContext.js.map +1 -1
  618. package/lib/module/contexts/translationContext/TranslationContext.js +3 -3
  619. package/lib/module/contexts/translationContext/TranslationContext.js.map +1 -1
  620. package/lib/module/contexts/typingContext/TypingContext.js +2 -2
  621. package/lib/module/contexts/typingContext/TypingContext.js.map +1 -1
  622. package/lib/module/contexts/utils/getDisplayName.js.map +1 -1
  623. package/lib/module/emoji-data/index.js +2 -2
  624. package/lib/module/emoji-data/index.js.map +1 -1
  625. package/lib/module/hooks/useStreami18n.js.map +1 -1
  626. package/lib/module/icons/UserAdmin.js +62 -0
  627. package/lib/module/icons/UserAdmin.js.map +1 -0
  628. package/lib/module/icons/index.js +0 -26
  629. package/lib/module/icons/index.js.map +1 -1
  630. package/lib/module/icons/utils/base.js +1 -1
  631. package/lib/module/index.js +6 -6
  632. package/lib/module/mock-builders/api/error.js +1 -1
  633. package/lib/module/mock-builders/api/sendMessage.js.map +1 -1
  634. package/lib/module/mock-builders/generator/attachment.js +1 -3
  635. package/lib/module/mock-builders/generator/attachment.js.map +1 -1
  636. package/lib/module/mock-builders/generator/channel.js +101 -51
  637. package/lib/module/mock-builders/generator/channel.js.map +1 -1
  638. package/lib/module/mock-builders/generator/user.js +32 -33
  639. package/lib/module/mock-builders/generator/user.js.map +1 -1
  640. package/lib/module/mock-builders/mock.js +1 -1
  641. package/lib/module/native.js +1 -1
  642. package/lib/module/native.js.map +1 -1
  643. package/lib/module/styleguideComponents/ArgumentsRenderer.js +7 -7
  644. package/lib/module/styleguideComponents/ArgumentsRenderer.js.map +1 -1
  645. package/lib/module/styleguideComponents/JsDoc.js +4 -4
  646. package/lib/module/styleguideComponents/JsDoc.js.map +1 -1
  647. package/lib/module/styleguideComponents/PathlineRenderer.js +7 -7
  648. package/lib/module/styleguideComponents/PathlineRenderer.js.map +1 -1
  649. package/lib/module/styleguideComponents/PropsRenderer.js +25 -25
  650. package/lib/module/styleguideComponents/PropsRenderer.js.map +1 -1
  651. package/lib/module/styleguideComponents/Wrapper.js +1 -1
  652. package/lib/module/styleguideComponents/Wrapper.js.map +1 -1
  653. package/lib/module/utils/Streami18n.js.map +1 -1
  654. package/lib/module/utils/getResizedImageUrl.js +26 -0
  655. package/lib/module/utils/getResizedImageUrl.js.map +1 -0
  656. package/lib/module/utils/getUrlOfImageAttachment.js +9 -0
  657. package/lib/module/utils/getUrlOfImageAttachment.js.map +1 -0
  658. package/lib/module/utils/utils.js +9 -3
  659. package/lib/module/utils/utils.js.map +1 -1
  660. package/lib/module/version.json +1 -1
  661. package/lib/typescript/components/Attachment/Attachment.d.ts +6 -6
  662. package/lib/typescript/components/Attachment/AttachmentActions.d.ts +5 -5
  663. package/lib/typescript/components/Attachment/Card.d.ts +5 -5
  664. package/lib/typescript/components/Attachment/FileAttachment.d.ts +6 -6
  665. package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts +4 -4
  666. package/lib/typescript/components/Attachment/Gallery.d.ts +6 -9
  667. package/lib/typescript/components/Attachment/Giphy.d.ts +7 -7
  668. package/lib/typescript/components/Attachment/utils/buildGallery/buildGallery.d.ts +23 -0
  669. package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.d.ts +7 -0
  670. package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.d.ts +7 -0
  671. package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.d.ts +7 -0
  672. package/lib/typescript/components/Attachment/utils/buildGallery/buildThumbnail.d.ts +10 -0
  673. package/lib/typescript/components/Attachment/utils/buildGallery/buildThumbnailGrid.d.ts +137 -0
  674. package/lib/typescript/components/Attachment/utils/buildGallery/types.d.ts +23 -0
  675. package/lib/typescript/components/Attachment/utils/getAspectRatio.d.ts +9 -0
  676. package/lib/typescript/components/Attachment/utils/getGalleryImageBorderRadius.d.ts +22 -0
  677. package/lib/typescript/components/AutoCompleteInput/AutoCompleteInput.d.ts +4 -4
  678. package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.d.ts +3 -2
  679. package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionHeader.d.ts +4 -4
  680. package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionItem.d.ts +5 -5
  681. package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts +10 -11
  682. package/lib/typescript/components/Avatar/Avatar.d.ts +1 -1
  683. package/lib/typescript/components/Channel/Channel.d.ts +10 -10
  684. package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +2 -2
  685. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +3 -3
  686. package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +3 -3
  687. package/lib/typescript/components/Channel/hooks/useCreateOwnCapabilitiesContext.d.ts +4 -4
  688. package/lib/typescript/components/Channel/hooks/useCreatePaginatedMessageListContext.d.ts +3 -3
  689. package/lib/typescript/components/Channel/hooks/useCreateThreadContext.d.ts +2 -2
  690. package/lib/typescript/components/Channel/hooks/useCreateTypingContext.d.ts +2 -2
  691. package/lib/typescript/components/ChannelList/ChannelList.d.ts +15 -15
  692. package/lib/typescript/components/ChannelList/ChannelListMessenger.d.ts +4 -4
  693. package/lib/typescript/components/ChannelList/hooks/listeners/useAddedToChannelNotification.d.ts +5 -5
  694. package/lib/typescript/components/ChannelList/hooks/listeners/useChannelDeleted.d.ts +5 -5
  695. package/lib/typescript/components/ChannelList/hooks/listeners/useChannelHidden.d.ts +5 -5
  696. package/lib/typescript/components/ChannelList/hooks/listeners/useChannelTruncated.d.ts +5 -5
  697. package/lib/typescript/components/ChannelList/hooks/listeners/useChannelUpdated.d.ts +5 -5
  698. package/lib/typescript/components/ChannelList/hooks/listeners/useChannelVisible.d.ts +5 -5
  699. package/lib/typescript/components/ChannelList/hooks/listeners/useConnectionRecovered.d.ts +2 -2
  700. package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessage.d.ts +4 -4
  701. package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessageNotification.d.ts +5 -5
  702. package/lib/typescript/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.d.ts +5 -5
  703. package/lib/typescript/components/ChannelList/hooks/listeners/useUserPresence.d.ts +4 -4
  704. package/lib/typescript/components/ChannelList/hooks/useCreateChannelsContext.d.ts +2 -2
  705. package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +11 -9
  706. package/lib/typescript/components/ChannelList/utils.d.ts +7 -7
  707. package/lib/typescript/components/ChannelPreview/ChannelAvatar.d.ts +3 -3
  708. package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts +7 -7
  709. package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts +4 -5
  710. package/lib/typescript/components/ChannelPreview/ChannelPreviewMessenger.d.ts +6 -6
  711. package/lib/typescript/components/ChannelPreview/ChannelPreviewMutedStatus.d.ts +9 -0
  712. package/lib/typescript/components/ChannelPreview/ChannelPreviewStatus.d.ts +3 -3
  713. package/lib/typescript/components/ChannelPreview/ChannelPreviewTitle.d.ts +3 -3
  714. package/lib/typescript/components/ChannelPreview/ChannelPreviewUnreadCount.d.ts +3 -3
  715. package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.d.ts +3 -3
  716. package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayName.d.ts +4 -4
  717. package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.d.ts +2 -2
  718. package/lib/typescript/components/ChannelPreview/hooks/useLatestMessagePreview.d.ts +5 -5
  719. package/lib/typescript/components/Chat/Chat.d.ts +3 -3
  720. package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +2 -2
  721. package/lib/typescript/components/Chat/hooks/useIsOnline.d.ts +2 -2
  722. package/lib/typescript/components/Chat/hooks/useMutedUsers.d.ts +2 -2
  723. package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +12 -10
  724. package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts +1 -1
  725. package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +10 -10
  726. package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts +10 -10
  727. package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +10 -10
  728. package/lib/typescript/components/ImageGallery/components/__tests__/ImageGalleryHeader.test.d.ts +1 -0
  729. package/lib/typescript/components/Message/Message.d.ts +12 -12
  730. package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +5 -5
  731. package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts +4 -4
  732. package/lib/typescript/components/Message/MessageSimple/MessageDeleted.d.ts +6 -6
  733. package/lib/typescript/components/Message/MessageSimple/MessageFooter.d.ts +8 -8
  734. package/lib/typescript/components/Message/MessageSimple/MessagePinnedHeader.d.ts +4 -4
  735. package/lib/typescript/components/Message/MessageSimple/MessageReplies.d.ts +4 -4
  736. package/lib/typescript/components/Message/MessageSimple/MessageRepliesAvatars.d.ts +3 -3
  737. package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +4 -4
  738. package/lib/typescript/components/Message/MessageSimple/MessageStatus.d.ts +4 -4
  739. package/lib/typescript/components/Message/MessageSimple/MessageTextContainer.d.ts +6 -6
  740. package/lib/typescript/components/Message/MessageSimple/ReactionList.d.ts +4 -4
  741. package/lib/typescript/components/Message/MessageSimple/utils/parseLinks.d.ts +7 -0
  742. package/lib/typescript/components/Message/MessageSimple/utils/parseLinks.test.d.ts +1 -0
  743. package/lib/typescript/components/Message/MessageSimple/utils/renderText.d.ts +20 -6
  744. package/lib/typescript/components/Message/MessageSimple/utils/renderText.test.d.ts +1 -0
  745. package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts +2 -2
  746. package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +2 -2
  747. package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +5 -5
  748. package/lib/typescript/components/Message/utils/messageActions.d.ts +7 -7
  749. package/lib/typescript/components/Message/utils/removeReservedFields.d.ts +2 -2
  750. package/lib/typescript/components/MessageInput/AttachButton.d.ts +5 -5
  751. package/lib/typescript/components/MessageInput/CommandsButton.d.ts +5 -5
  752. package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +4 -4
  753. package/lib/typescript/components/MessageInput/ImageUploadPreview.d.ts +4 -4
  754. package/lib/typescript/components/MessageInput/InputButtons.d.ts +5 -5
  755. package/lib/typescript/components/MessageInput/MessageInput.d.ts +4 -4
  756. package/lib/typescript/components/MessageInput/MoreOptionsButton.d.ts +5 -5
  757. package/lib/typescript/components/MessageInput/SendButton.d.ts +4 -4
  758. package/lib/typescript/components/MessageInput/ShowThreadMessageInChannelButton.d.ts +2 -2
  759. package/lib/typescript/components/MessageInput/hooks/useCooldown.d.ts +2 -2
  760. package/lib/typescript/components/MessageList/InlineLoadingMoreIndicator.d.ts +2 -2
  761. package/lib/typescript/components/MessageList/InlineLoadingMoreRecentIndicator.d.ts +2 -2
  762. package/lib/typescript/components/MessageList/InlineLoadingMoreThreadIndicator.d.ts +2 -2
  763. package/lib/typescript/components/MessageList/MessageList.d.ts +7 -7
  764. package/lib/typescript/components/MessageList/MessageSystem.d.ts +5 -5
  765. package/lib/typescript/components/MessageList/TypingIndicator.d.ts +2 -2
  766. package/lib/typescript/components/MessageList/TypingIndicatorContainer.d.ts +4 -4
  767. package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts +5 -5
  768. package/lib/typescript/components/MessageList/hooks/useTypingString.d.ts +2 -2
  769. package/lib/typescript/components/MessageList/utils/filterTypingUsers.d.ts +3 -3
  770. package/lib/typescript/components/MessageList/utils/getDateSeparators.d.ts +4 -4
  771. package/lib/typescript/components/MessageList/utils/getGroupStyles.d.ts +5 -5
  772. package/lib/typescript/components/MessageList/utils/getLastReceivedMessage.d.ts +2 -2
  773. package/lib/typescript/components/MessageList/utils/getReadStates.d.ts +8 -5
  774. package/lib/typescript/components/MessageOverlay/MessageActionList.d.ts +4 -4
  775. package/lib/typescript/components/MessageOverlay/MessageActionListItem.d.ts +4 -3
  776. package/lib/typescript/components/MessageOverlay/MessageOverlay.d.ts +4 -4
  777. package/lib/typescript/components/MessageOverlay/OverlayReactionList.d.ts +6 -6
  778. package/lib/typescript/components/MessageOverlay/OverlayReactions.d.ts +3 -1
  779. package/lib/typescript/components/MessageOverlay/OverlayReactionsAvatar.d.ts +7 -0
  780. package/lib/typescript/components/MessageOverlay/hooks/useMessageActionAnimation.d.ts +1 -1
  781. package/lib/typescript/components/Reply/Reply.d.ts +5 -5
  782. package/lib/typescript/components/Thread/Thread.d.ts +8 -8
  783. package/lib/typescript/components/Thread/components/ThreadFooterComponent.d.ts +2 -2
  784. package/lib/typescript/components/index.d.ts +2 -0
  785. package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +2 -2
  786. package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +12 -12
  787. package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +30 -22
  788. package/lib/typescript/contexts/channelsStateContext/ChannelsStateContext.d.ts +19 -19
  789. package/lib/typescript/contexts/channelsStateContext/useChannelState.d.ts +17 -17
  790. package/lib/typescript/contexts/chatContext/ChatContext.d.ts +11 -11
  791. package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts +8 -8
  792. package/lib/typescript/contexts/keyboardContext/KeyboardContext.d.ts +2 -2
  793. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +12 -12
  794. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +39 -37
  795. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +3 -3
  796. package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts +3 -3
  797. package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +27 -25
  798. package/lib/typescript/contexts/messageOverlayContext/hooks/useResettableState.d.ts +12 -0
  799. package/lib/typescript/contexts/messageOverlayContext/hooks/useResettableState.test.d.ts +1 -0
  800. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +67 -67
  801. package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +8 -8
  802. package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts +2 -2
  803. package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts +8 -8
  804. package/lib/typescript/contexts/suggestionsContext/SuggestionsContext.d.ts +21 -21
  805. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +17 -8
  806. package/lib/typescript/contexts/threadContext/ThreadContext.d.ts +10 -10
  807. package/lib/typescript/contexts/translationContext/TranslationContext.d.ts +2 -2
  808. package/lib/typescript/contexts/typingContext/TypingContext.d.ts +8 -8
  809. package/lib/typescript/hooks/useStreami18n.d.ts +1 -1
  810. package/lib/typescript/icons/{Left.d.ts → UserAdmin.d.ts} +1 -1
  811. package/lib/typescript/icons/index.d.ts +0 -2
  812. package/lib/typescript/types/types.d.ts +16 -13
  813. package/lib/typescript/utils/Streami18n.d.ts +6 -6
  814. package/lib/typescript/utils/getResizedImageUrl.d.ts +19 -0
  815. package/lib/typescript/utils/getUrlOfImageAttachment.d.ts +7 -0
  816. package/lib/typescript/utils/utils.d.ts +27 -22
  817. package/package.json +9 -13
  818. package/src/components/Attachment/Attachment.tsx +18 -59
  819. package/src/components/Attachment/AttachmentActions.tsx +17 -57
  820. package/src/components/Attachment/Card.tsx +17 -51
  821. package/src/components/Attachment/FileAttachment.tsx +16 -51
  822. package/src/components/Attachment/FileAttachmentGroup.tsx +16 -57
  823. package/src/components/Attachment/FileIcon.tsx +2 -2
  824. package/src/components/Attachment/Gallery.tsx +177 -242
  825. package/src/components/Attachment/Giphy.tsx +84 -128
  826. package/src/components/Attachment/__tests__/Attachment.test.js +11 -10
  827. package/src/components/Attachment/__tests__/Gallery.test.js +233 -0
  828. package/src/components/Attachment/__tests__/buildGallery.test.js +131 -0
  829. package/src/components/Attachment/utils/buildGallery/buildGallery.ts +77 -0
  830. package/src/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.ts +91 -0
  831. package/src/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.ts +99 -0
  832. package/src/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.ts +66 -0
  833. package/src/components/Attachment/utils/buildGallery/buildThumbnail.ts +48 -0
  834. package/src/components/Attachment/utils/buildGallery/buildThumbnailGrid.ts +188 -0
  835. package/src/components/Attachment/utils/buildGallery/types.ts +27 -0
  836. package/src/components/Attachment/utils/getAspectRatio.ts +21 -0
  837. package/src/components/Attachment/utils/getGalleryImageBorderRadius.ts +71 -0
  838. package/src/components/AttachmentPicker/AttachmentPicker.tsx +4 -2
  839. package/src/components/AutoCompleteInput/AutoCompleteInput.tsx +23 -62
  840. package/src/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.tsx +6 -4
  841. package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx +13 -20
  842. package/src/components/AutoCompleteInput/AutoCompleteSuggestionItem.tsx +20 -25
  843. package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +25 -29
  844. package/src/components/AutoCompleteInput/__tests__/AutoCompleteInput.test.js +6 -8
  845. package/src/components/Avatar/Avatar.tsx +8 -11
  846. package/src/components/Avatar/GroupAvatar.tsx +7 -2
  847. package/src/components/Avatar/__tests__/Avatar.test.js +2 -2
  848. package/src/components/Channel/Channel.tsx +237 -313
  849. package/src/components/Channel/__tests__/Channel.test.js +10 -10
  850. package/src/components/Channel/__tests__/ownCapabilities.test.js +8 -8
  851. package/src/components/Channel/hooks/useCreateChannelContext.ts +4 -19
  852. package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +52 -68
  853. package/src/components/Channel/hooks/useCreateMessagesContext.ts +4 -19
  854. package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +5 -19
  855. package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts +16 -32
  856. package/src/components/Channel/hooks/useCreateThreadContext.ts +4 -19
  857. package/src/components/Channel/hooks/useCreateTypingContext.ts +4 -19
  858. package/src/components/ChannelList/ChannelList.tsx +36 -58
  859. package/src/components/ChannelList/ChannelListFooterLoadingIndicator.tsx +1 -2
  860. package/src/components/ChannelList/ChannelListHeaderErrorIndicator.tsx +3 -7
  861. package/src/components/ChannelList/ChannelListHeaderNetworkDownIndicator.tsx +2 -2
  862. package/src/components/ChannelList/ChannelListMessenger.tsx +22 -74
  863. package/src/components/ChannelList/__tests__/ChannelList.test.js +73 -13
  864. package/src/components/ChannelList/__tests__/ChannelListMessenger.test.js +11 -12
  865. package/src/components/ChannelList/hooks/listeners/useAddedToChannelNotification.ts +17 -39
  866. package/src/components/ChannelList/hooks/listeners/useChannelDeleted.ts +15 -37
  867. package/src/components/ChannelList/hooks/listeners/useChannelHidden.ts +15 -37
  868. package/src/components/ChannelList/hooks/listeners/useChannelTruncated.ts +17 -39
  869. package/src/components/ChannelList/hooks/listeners/useChannelUpdated.ts +15 -37
  870. package/src/components/ChannelList/hooks/listeners/useChannelVisible.ts +17 -39
  871. package/src/components/ChannelList/hooks/listeners/useConnectionRecovered.ts +3 -18
  872. package/src/components/ChannelList/hooks/listeners/useNewMessage.ts +13 -36
  873. package/src/components/ChannelList/hooks/listeners/useNewMessageNotification.ts +17 -39
  874. package/src/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.ts +15 -37
  875. package/src/components/ChannelList/hooks/listeners/useUserPresence.ts +11 -33
  876. package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +5 -21
  877. package/src/components/ChannelList/hooks/usePaginatedChannels.ts +89 -77
  878. package/src/components/ChannelList/utils.ts +9 -42
  879. package/src/components/ChannelPreview/ChannelAvatar.tsx +6 -29
  880. package/src/components/ChannelPreview/ChannelPreview.tsx +21 -54
  881. package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +13 -23
  882. package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +35 -55
  883. package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx +50 -0
  884. package/src/components/ChannelPreview/ChannelPreviewStatus.tsx +10 -30
  885. package/src/components/ChannelPreview/ChannelPreviewTitle.tsx +7 -28
  886. package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx +7 -27
  887. package/src/components/ChannelPreview/__tests__/ChannelPreview.test.js +8 -9
  888. package/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +8 -9
  889. package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.ts +9 -30
  890. package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts +8 -30
  891. package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts +9 -30
  892. package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts +29 -80
  893. package/src/components/Chat/Chat.tsx +17 -45
  894. package/src/components/Chat/__tests__/Chat.test.js +5 -5
  895. package/src/components/Chat/hooks/useCreateChatContext.ts +4 -19
  896. package/src/components/Chat/hooks/useIsOnline.ts +8 -22
  897. package/src/components/Chat/hooks/useMutedUsers.ts +5 -20
  898. package/src/components/ImageGallery/ImageGallery.tsx +109 -86
  899. package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +1 -2
  900. package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +20 -15
  901. package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +42 -21
  902. package/src/components/ImageGallery/components/ImageGrid.tsx +47 -33
  903. package/src/components/ImageGallery/components/ImageGridHandle.tsx +1 -0
  904. package/src/components/ImageGallery/components/__tests__/ImageGalleryHeader.test.tsx +31 -0
  905. package/src/components/Indicators/LoadingIndicator.tsx +1 -2
  906. package/src/components/Message/Message.tsx +59 -112
  907. package/src/components/Message/MessageSimple/MessageAvatar.tsx +14 -56
  908. package/src/components/Message/MessageSimple/MessageContent.tsx +20 -64
  909. package/src/components/Message/MessageSimple/MessageDeleted.tsx +19 -61
  910. package/src/components/Message/MessageSimple/MessageFooter.tsx +28 -71
  911. package/src/components/Message/MessageSimple/MessagePinnedHeader.tsx +15 -56
  912. package/src/components/Message/MessageSimple/MessageReplies.tsx +15 -56
  913. package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +7 -29
  914. package/src/components/Message/MessageSimple/MessageSimple.tsx +16 -57
  915. package/src/components/Message/MessageSimple/MessageStatus.tsx +21 -58
  916. package/src/components/Message/MessageSimple/MessageTextContainer.tsx +19 -66
  917. package/src/components/Message/MessageSimple/ReactionList.tsx +47 -88
  918. package/src/components/Message/MessageSimple/__tests__/Message.test.js +9 -9
  919. package/src/components/Message/MessageSimple/__tests__/MessageAvatar.test.js +2 -2
  920. package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +9 -26
  921. package/src/components/Message/MessageSimple/__tests__/MessagePinnedHeader.test.js +2 -2
  922. package/src/components/Message/MessageSimple/__tests__/MessageReplies.test.js +2 -2
  923. package/src/components/Message/MessageSimple/__tests__/MessageStatus.test.js +4 -5
  924. package/src/components/Message/MessageSimple/__tests__/MessageTextContainer.test.js +2 -2
  925. package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageAvatar.test.js.snap +1 -1
  926. package/src/components/Message/MessageSimple/utils/parseLinks.test.ts +100 -0
  927. package/src/components/Message/MessageSimple/utils/parseLinks.ts +95 -0
  928. package/src/components/Message/MessageSimple/utils/renderText.test.tsx +70 -0
  929. package/src/components/Message/MessageSimple/utils/renderText.tsx +97 -94
  930. package/src/components/Message/hooks/useCreateMessageContext.ts +5 -21
  931. package/src/components/Message/hooks/useMessageActionHandlers.ts +21 -27
  932. package/src/components/Message/hooks/useMessageActions.tsx +21 -31
  933. package/src/components/Message/utils/messageActions.ts +9 -36
  934. package/src/components/Message/utils/removeReservedFields.ts +3 -18
  935. package/src/components/MessageInput/AttachButton.tsx +14 -56
  936. package/src/components/MessageInput/CommandsButton.tsx +16 -58
  937. package/src/components/MessageInput/CooldownTimer.tsx +1 -0
  938. package/src/components/MessageInput/FileUploadPreview.tsx +16 -58
  939. package/src/components/MessageInput/ImageUploadPreview.tsx +13 -56
  940. package/src/components/MessageInput/InputButtons.tsx +14 -55
  941. package/src/components/MessageInput/MessageInput.tsx +30 -72
  942. package/src/components/MessageInput/MoreOptionsButton.tsx +14 -56
  943. package/src/components/MessageInput/SendButton.tsx +13 -54
  944. package/src/components/MessageInput/SendMessageDisallowedIndicator.tsx +1 -1
  945. package/src/components/MessageInput/ShowThreadMessageInChannelButton.tsx +5 -20
  946. package/src/components/MessageInput/__tests__/AttachButton.test.js +2 -2
  947. package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +15 -17
  948. package/src/components/MessageInput/__tests__/ImageUploadPreview.test.js +3 -3
  949. package/src/components/MessageInput/__tests__/MessageInput.test.js +8 -8
  950. package/src/components/MessageInput/__tests__/SendButton.test.js +2 -2
  951. package/src/components/MessageInput/__tests__/UploadProgressIndicator.test.js +2 -2
  952. package/src/components/MessageInput/__tests__/__snapshots__/FileUploadPreview.test.js.snap +1604 -4172
  953. package/src/components/MessageInput/__tests__/__snapshots__/MessageInput.test.js.snap +1 -643
  954. package/src/components/MessageInput/hooks/useCooldown.ts +7 -19
  955. package/src/components/MessageInput/hooks/useCountdown.ts +1 -0
  956. package/src/components/MessageList/InlineLoadingMoreIndicator.tsx +3 -18
  957. package/src/components/MessageList/InlineLoadingMoreRecentIndicator.tsx +3 -18
  958. package/src/components/MessageList/InlineLoadingMoreThreadIndicator.tsx +3 -18
  959. package/src/components/MessageList/MessageList.tsx +37 -79
  960. package/src/components/MessageList/MessageSystem.tsx +7 -28
  961. package/src/components/MessageList/TypingIndicator.tsx +4 -20
  962. package/src/components/MessageList/TypingIndicatorContainer.tsx +14 -47
  963. package/src/components/MessageList/__tests__/MessageList.test.js +17 -17
  964. package/src/components/MessageList/__tests__/MessageSystem.test.js +3 -3
  965. package/src/components/MessageList/__tests__/ScrollToBottomButton.test.js +3 -3
  966. package/src/components/MessageList/__tests__/TypingIndicator.test.js +5 -6
  967. package/src/components/MessageList/__tests__/__snapshots__/TypingIndicator.test.js.snap +1 -1
  968. package/src/components/MessageList/hooks/useMessageList.ts +24 -59
  969. package/src/components/MessageList/hooks/useTypingString.ts +6 -22
  970. package/src/components/MessageList/utils/filterTypingUsers.ts +7 -28
  971. package/src/components/MessageList/utils/getDateSeparators.ts +6 -27
  972. package/src/components/MessageList/utils/getGroupStyles.ts +7 -29
  973. package/src/components/MessageList/utils/getLastReceivedMessage.ts +9 -19
  974. package/src/components/MessageList/utils/getReadStates.ts +5 -20
  975. package/src/components/MessageOverlay/MessageActionList.tsx +17 -58
  976. package/src/components/MessageOverlay/MessageActionListItem.tsx +23 -10
  977. package/src/components/MessageOverlay/MessageOverlay.tsx +56 -95
  978. package/src/components/MessageOverlay/OverlayBackdrop.tsx +1 -0
  979. package/src/components/MessageOverlay/OverlayReactionList.tsx +23 -78
  980. package/src/components/MessageOverlay/OverlayReactions.tsx +12 -8
  981. package/src/components/MessageOverlay/OverlayReactionsAvatar.tsx +27 -0
  982. package/src/components/MessageOverlay/hooks/useMessageActionAnimation.tsx +1 -0
  983. package/src/components/Reply/Reply.tsx +44 -81
  984. package/src/components/Thread/Thread.tsx +24 -58
  985. package/src/components/Thread/__tests__/Thread.test.js +12 -14
  986. package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +13 -13
  987. package/src/components/Thread/components/ThreadFooterComponent.tsx +12 -48
  988. package/src/components/docs/data.js +38 -37
  989. package/src/components/index.ts +2 -0
  990. package/src/contexts/activeChannelsRefContext/ActiveChannelsRefContext.tsx +1 -2
  991. package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +10 -9
  992. package/src/contexts/channelContext/ChannelContext.tsx +16 -50
  993. package/src/contexts/channelsContext/ChannelsContext.tsx +37 -63
  994. package/src/contexts/channelsStateContext/ChannelsStateContext.tsx +38 -116
  995. package/src/contexts/channelsStateContext/useChannelState.ts +28 -60
  996. package/src/contexts/chatContext/ChatContext.tsx +15 -51
  997. package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +13 -56
  998. package/src/contexts/keyboardContext/KeyboardContext.tsx +13 -8
  999. package/src/contexts/messageContext/MessageContext.tsx +16 -50
  1000. package/src/contexts/messageInputContext/MessageInputContext.tsx +88 -134
  1001. package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +6 -23
  1002. package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +15 -34
  1003. package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +34 -90
  1004. package/src/contexts/messageOverlayContext/hooks/useResettableState.test.tsx +46 -0
  1005. package/src/contexts/messageOverlayContext/hooks/useResettableState.ts +22 -0
  1006. package/src/contexts/messagesContext/MessagesContext.tsx +73 -112
  1007. package/src/contexts/overlayContext/OverlayContext.tsx +28 -34
  1008. package/src/contexts/overlayContext/OverlayProvider.tsx +36 -46
  1009. package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +14 -55
  1010. package/src/contexts/suggestionsContext/SuggestionsContext.tsx +42 -42
  1011. package/src/contexts/suggestionsContext/__tests__/Suggestions.test.js +1 -0
  1012. package/src/contexts/themeContext/ThemeContext.tsx +1 -0
  1013. package/src/contexts/themeContext/utils/theme.ts +36 -19
  1014. package/src/contexts/threadContext/ThreadContext.tsx +14 -48
  1015. package/src/contexts/translationContext/TranslationContext.tsx +14 -9
  1016. package/src/contexts/typingContext/TypingContext.tsx +12 -46
  1017. package/src/contexts/utils/getDisplayName.ts +1 -0
  1018. package/src/emoji-data/index.js +1 -1
  1019. package/src/hooks/useStreami18n.ts +1 -1
  1020. package/src/icons/UserAdmin.tsx +23 -0
  1021. package/src/icons/index.ts +0 -2
  1022. package/src/mock-builders/api/sendMessage.js +1 -0
  1023. package/src/mock-builders/generator/attachment.js +0 -2
  1024. package/src/mock-builders/generator/channel.js +101 -64
  1025. package/src/mock-builders/generator/user.js +33 -26
  1026. package/src/native.ts +1 -0
  1027. package/src/styleguideComponents/ArgumentsRenderer.tsx +2 -1
  1028. package/src/styleguideComponents/JsDoc.tsx +3 -1
  1029. package/src/styleguideComponents/PathlineRenderer.tsx +2 -1
  1030. package/src/styleguideComponents/PropsRenderer.tsx +7 -4
  1031. package/src/styleguideComponents/Wrapper.tsx +1 -0
  1032. package/src/types/types.ts +16 -18
  1033. package/src/utils/Streami18n.ts +6 -6
  1034. package/src/utils/__tests__/Streami18n.test.js +1 -2
  1035. package/src/utils/getResizedImageUrl.ts +43 -0
  1036. package/src/utils/getUrlOfImageAttachment.ts +10 -0
  1037. package/src/utils/utils.ts +72 -132
  1038. package/src/version.json +1 -1
  1039. package/lib/commonjs/icons/Left.js +0 -38
  1040. package/lib/commonjs/icons/Left.js.map +0 -1
  1041. package/lib/commonjs/icons/Right.js +0 -38
  1042. package/lib/commonjs/icons/Right.js.map +0 -1
  1043. package/lib/module/icons/Left.js +0 -38
  1044. package/lib/module/icons/Left.js.map +0 -1
  1045. package/lib/module/icons/Right.js +0 -38
  1046. package/lib/module/icons/Right.js.map +0 -1
  1047. package/lib/typescript/icons/Right.d.ts +0 -3
  1048. package/src/icons/Left.tsx +0 -12
  1049. package/src/icons/Right.tsx +0 -12
@@ -1,22 +1,14 @@
1
1
  import { useCallback, useEffect, useState } from 'react';
2
2
 
3
+ import type { NetInfoSubscription } from '@react-native-community/netinfo';
4
+
5
+ import type { StreamChat, Event as StreamEvent } from 'stream-chat';
6
+
3
7
  import { useAppStateListener } from '../../../hooks/useAppStateListener';
4
8
  import { useIsMountedRef } from '../../../hooks/useIsMountedRef';
5
9
  import { NetInfo } from '../../../native';
6
10
 
7
- import type { NetInfoSubscription } from '@react-native-community/netinfo';
8
- import type { StreamChat, Event as StreamEvent } from 'stream-chat';
9
-
10
- import type {
11
- DefaultAttachmentType,
12
- DefaultChannelType,
13
- DefaultCommandType,
14
- DefaultEventType,
15
- DefaultMessageType,
16
- DefaultReactionType,
17
- DefaultUserType,
18
- UnknownType,
19
- } from '../../../types/types';
11
+ import type { DefaultStreamChatGenerics } from '../../../types/types';
20
12
 
21
13
  /**
22
14
  * Disconnect the websocket connection when app goes to background,
@@ -25,15 +17,9 @@ import type {
25
17
  * You can't receive push notification until you have active websocket connection.
26
18
  */
27
19
  export const useIsOnline = <
28
- At extends UnknownType = DefaultAttachmentType,
29
- Ch extends UnknownType = DefaultChannelType,
30
- Co extends string = DefaultCommandType,
31
- Ev extends UnknownType = DefaultEventType,
32
- Me extends UnknownType = DefaultMessageType,
33
- Re extends UnknownType = DefaultReactionType,
34
- Us extends UnknownType = DefaultUserType,
20
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
35
21
  >(
36
- client: StreamChat<At, Ch, Co, Ev, Me, Re, Us>,
22
+ client: StreamChat<StreamChatGenerics>,
37
23
  closeConnectionOnBackground = true,
38
24
  ) => {
39
25
  const [isOnline, setIsOnline] = useState(true);
@@ -62,7 +48,7 @@ export const useIsOnline = <
62
48
  useAppStateListener(onForeground, onBackground);
63
49
 
64
50
  useEffect(() => {
65
- const handleChangedEvent = (event: StreamEvent<At, Ch, Co, Ev, Me, Re, Us>) => {
51
+ const handleChangedEvent = (event: StreamEvent<StreamChatGenerics>) => {
66
52
  setConnectionRecovering(!event.online);
67
53
  setIsOnline(event.online || false);
68
54
  };
@@ -2,32 +2,17 @@ import { useEffect, useState } from 'react';
2
2
 
3
3
  import type { Event, Mute, StreamChat } from 'stream-chat';
4
4
 
5
- import type {
6
- DefaultAttachmentType,
7
- DefaultChannelType,
8
- DefaultCommandType,
9
- DefaultEventType,
10
- DefaultMessageType,
11
- DefaultReactionType,
12
- DefaultUserType,
13
- UnknownType,
14
- } from '../../../types/types';
5
+ import type { DefaultStreamChatGenerics } from '../../../types/types';
15
6
 
16
7
  export const useMutedUsers = <
17
- At extends UnknownType = DefaultAttachmentType,
18
- Ch extends UnknownType = DefaultChannelType,
19
- Co extends string = DefaultCommandType,
20
- Ev extends UnknownType = DefaultEventType,
21
- Me extends UnknownType = DefaultMessageType,
22
- Re extends UnknownType = DefaultReactionType,
23
- Us extends UnknownType = DefaultUserType,
8
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
24
9
  >(
25
- client: StreamChat<At, Ch, Co, Ev, Me, Re, Us>,
10
+ client: StreamChat<StreamChatGenerics>,
26
11
  ) => {
27
- const [mutedUsers, setMutedUsers] = useState<Mute<Us>[]>(client.mutedUsers || []);
12
+ const [mutedUsers, setMutedUsers] = useState<Mute<StreamChatGenerics>[]>(client.mutedUsers || []);
28
13
 
29
14
  useEffect(() => {
30
- const handleEvent = (event: Event<At, Ch, Co, Ev, Me, Re, Us>) => {
15
+ const handleEvent = (event: Event<StreamChatGenerics>) => {
31
16
  setMutedUsers((mutes) => event.me?.mutes || mutes || []);
32
17
  };
33
18
 
@@ -9,7 +9,7 @@ import {
9
9
  StyleSheet,
10
10
  ViewStyle,
11
11
  } from 'react-native';
12
- import BottomSheet from '@gorhom/bottom-sheet';
12
+
13
13
  import {
14
14
  PanGestureHandler,
15
15
  PanGestureHandlerGestureEvent,
@@ -18,6 +18,7 @@ import {
18
18
  TapGestureHandler,
19
19
  TapGestureHandlerGestureEvent,
20
20
  } from 'react-native-gesture-handler';
21
+
21
22
  import Animated, {
22
23
  cancelAnimation,
23
24
  Easing,
@@ -32,6 +33,10 @@ import Animated, {
32
33
  withTiming,
33
34
  } from 'react-native-reanimated';
34
35
 
36
+ import { BottomSheetModal, BottomSheetModalProvider } from '@gorhom/bottom-sheet';
37
+
38
+ import type { UserResponse } from 'stream-chat';
39
+
35
40
  import { AnimatedGalleryImage } from './components/AnimatedGalleryImage';
36
41
  import {
37
42
  ImageGalleryFooter,
@@ -52,20 +57,11 @@ import { useImageGalleryContext } from '../../contexts/imageGalleryContext/Image
52
57
  import { useOverlayContext } from '../../contexts/overlayContext/OverlayContext';
53
58
  import { useTheme } from '../../contexts/themeContext/ThemeContext';
54
59
  import { triggerHaptic } from '../../native';
60
+ import type { DefaultStreamChatGenerics } from '../../types/types';
61
+ import { getResizedImageUrl } from '../../utils/getResizedImageUrl';
62
+ import { getUrlOfImageAttachment } from '../../utils/getUrlOfImageAttachment';
55
63
  import { vh, vw } from '../../utils/utils';
56
64
 
57
- import type { UserResponse } from 'stream-chat';
58
- import type {
59
- DefaultAttachmentType,
60
- DefaultChannelType,
61
- DefaultCommandType,
62
- DefaultEventType,
63
- DefaultMessageType,
64
- DefaultReactionType,
65
- DefaultUserType,
66
- UnknownType,
67
- } from '../../types/types';
68
-
69
65
  const isAndroid = Platform.OS === 'android';
70
66
  const fullScreenHeight = Dimensions.get('screen').height;
71
67
  const measuredScreenHeight = vh(100);
@@ -84,7 +80,9 @@ export enum IsSwiping {
84
80
  FALSE,
85
81
  }
86
82
 
87
- export type ImageGalleryCustomComponents<Us extends UnknownType = DefaultUserType> = {
83
+ export type ImageGalleryCustomComponents<
84
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
85
+ > = {
88
86
  /**
89
87
  * Override props for following UI components, which are part of [image gallery](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#gallery-components).
90
88
  *
@@ -117,34 +115,29 @@ export type ImageGalleryCustomComponents<Us extends UnknownType = DefaultUserTyp
117
115
  * @overrideType object
118
116
  */
119
117
  imageGalleryCustomComponents?: {
120
- footer?: ImageGalleryFooterCustomComponentProps<Us>;
121
- grid?: ImageGalleryGridImageComponents<Us>;
118
+ footer?: ImageGalleryFooterCustomComponentProps<StreamChatGenerics>;
119
+ grid?: ImageGalleryGridImageComponents<StreamChatGenerics>;
122
120
  gridHandle?: ImageGalleryGridHandleCustomComponentProps;
123
- header?: ImageGalleryHeaderCustomComponentProps<Us>;
121
+ header?: ImageGalleryHeaderCustomComponentProps<StreamChatGenerics>;
124
122
  };
125
123
  };
126
124
 
127
- type Props<Us extends UnknownType = DefaultUserType> = ImageGalleryCustomComponents<Us> & {
128
- overlayOpacity: Animated.SharedValue<number>;
129
- visible: boolean;
130
- imageGalleryGridHandleHeight?: number;
131
- /**
132
- * This should be
133
- */
134
- imageGalleryGridSnapPoints?: [string | number, string | number];
135
- numberOfImageGalleryGridColumns?: number;
136
- };
125
+ type Props<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> =
126
+ ImageGalleryCustomComponents<StreamChatGenerics> & {
127
+ overlayOpacity: Animated.SharedValue<number>;
128
+ visible: boolean;
129
+ imageGalleryGridHandleHeight?: number;
130
+ /**
131
+ * This should be
132
+ */
133
+ imageGalleryGridSnapPoints?: [string | number, string | number];
134
+ numberOfImageGalleryGridColumns?: number;
135
+ };
137
136
 
138
137
  export const ImageGallery = <
139
- At extends UnknownType = DefaultAttachmentType,
140
- Ch extends UnknownType = DefaultChannelType,
141
- Co extends string = DefaultCommandType,
142
- Ev extends UnknownType = DefaultEventType,
143
- Me extends UnknownType = DefaultMessageType,
144
- Re extends UnknownType = DefaultReactionType,
145
- Us extends UnknownType = DefaultUserType,
138
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
146
139
  >(
147
- props: Props<Us>,
140
+ props: Props<StreamChatGenerics>,
148
141
  ) => {
149
142
  const {
150
143
  imageGalleryCustomComponents,
@@ -160,8 +153,9 @@ export const ImageGallery = <
160
153
  imageGallery: { backgroundColor },
161
154
  },
162
155
  } = useTheme();
156
+ const [gridPhotos, setGridPhotos] = useState<Photo<StreamChatGenerics>[]>([]);
163
157
  const { overlay, setOverlay, translucentStatusBar } = useOverlayContext();
164
- const { image, images, setImage } = useImageGalleryContext<At, Ch, Co, Ev, Me, Re, Us>();
158
+ const { image, images, setImage } = useImageGalleryContext<StreamChatGenerics>();
165
159
 
166
160
  /**
167
161
  * Height constants
@@ -180,15 +174,15 @@ export const ImageGallery = <
180
174
  : vh(100);
181
175
  const halfScreenHeight = screenHeight / 2;
182
176
  const quarterScreenHeight = screenHeight / 4;
183
- const snapPoints = React.useMemo(() => [0, (screenHeight * 9) / 10], []);
177
+ const snapPoints = React.useMemo(() => [(screenHeight * 9) / 10], []);
184
178
 
185
179
  /**
186
- * BottomSheet ref
180
+ * BottomSheetModal ref
187
181
  */
188
- const bottomSheetRef = useRef<BottomSheet>(null);
182
+ const bottomSheetModalRef = useRef<BottomSheetModal>(null);
189
183
 
190
184
  /**
191
- * BottomSheet state
185
+ * BottomSheetModal state
192
186
  */
193
187
  const [currentBottomSheetIndex, setCurrentBottomSheetIndex] = useState(0);
194
188
  const animatedBottomSheetIndex = useSharedValue(0);
@@ -337,27 +331,37 @@ export const ImageGallery = <
337
331
  * Photos array created from all currently available
338
332
  * photo attachments
339
333
  */
340
- const photos = images.reduce((acc: Photo<Us>[], cur) => {
334
+ const photos = images.reduce((acc: Photo<StreamChatGenerics>[], cur) => {
341
335
  const attachmentImages =
342
336
  cur.attachments?.filter(
343
337
  (attachment) =>
344
338
  attachment.type === 'image' &&
345
339
  !attachment.title_link &&
346
340
  !attachment.og_scrape_url &&
347
- (attachment.image_url || attachment.thumb_url),
341
+ getUrlOfImageAttachment(attachment),
348
342
  ) || [];
349
343
 
350
- const attachmentPhotos = attachmentImages.map((attachmentImage) => ({
351
- channelId: cur.cid,
352
- created_at: cur.created_at,
353
- id: `photoId-${cur.id}-${attachmentImage.image_url || attachmentImage.thumb_url}`,
354
- messageId: cur.id,
355
- uri: attachmentImage.image_url || attachmentImage.thumb_url || '',
356
- user: cur.user,
357
- user_id: cur.user_id,
358
- }));
359
-
360
- return [...acc, ...attachmentPhotos];
344
+ const attachmentPhotos = attachmentImages.map((a) => {
345
+ const imageUrl = getUrlOfImageAttachment(a) as string;
346
+
347
+ return {
348
+ channelId: cur.cid,
349
+ created_at: cur.created_at,
350
+ id: `photoId-${cur.id}-${imageUrl}`,
351
+ messageId: cur.id,
352
+ original_height: a.original_height,
353
+ original_width: a.original_width,
354
+ uri: getResizedImageUrl({
355
+ height: screenHeight,
356
+ url: imageUrl,
357
+ width: screenWidth,
358
+ }),
359
+ user: cur.user,
360
+ user_id: cur.user_id,
361
+ };
362
+ });
363
+
364
+ return [...acc, ...attachmentPhotos] as Photo<StreamChatGenerics>[];
361
365
  }, []);
362
366
 
363
367
  /**
@@ -398,8 +402,15 @@ export const ImageGallery = <
398
402
  const uriForCurrentImage = photos[selectedIndex]?.uri;
399
403
  useEffect(() => {
400
404
  setCurrentImageHeight(screenHeight);
401
- if (photos[index.value]?.uri) {
402
- Image.getSize(photos[index.value].uri, (width, height) => {
405
+ const photo = photos[index.value];
406
+ const height = photo?.original_height;
407
+ const width = photo?.original_width;
408
+
409
+ if (height && width) {
410
+ const imageHeight = Math.floor(height * (screenWidth / width));
411
+ setCurrentImageHeight(imageHeight > screenHeight ? screenHeight : imageHeight);
412
+ } else if (photo?.uri) {
413
+ Image.getSize(photo.uri, (width, height) => {
403
414
  const imageHeight = Math.floor(height * (screenWidth / width));
404
415
  setCurrentImageHeight(imageHeight > screenHeight ? screenHeight : imageHeight);
405
416
  });
@@ -1038,16 +1049,22 @@ export const ImageGallery = <
1038
1049
  );
1039
1050
 
1040
1051
  /**
1041
- * Functions to open and close BottomSheet with image grid
1052
+ * Functions toclose BottomSheetModal with image grid
1042
1053
  */
1043
1054
  const closeGridView = () => {
1044
- if (bottomSheetRef.current) {
1045
- bottomSheetRef.current.close();
1055
+ if (bottomSheetModalRef.current?.close) {
1056
+ bottomSheetModalRef.current.close();
1057
+ setGridPhotos([]);
1046
1058
  }
1047
1059
  };
1060
+
1061
+ /**
1062
+ * Function to open BottomSheetModal with image grid
1063
+ */
1048
1064
  const openGridView = () => {
1049
- if (bottomSheetRef.current) {
1050
- bottomSheetRef.current.snapTo(1);
1065
+ if (bottomSheetModalRef.current?.present) {
1066
+ bottomSheetModalRef.current.present();
1067
+ setGridPhotos(photos);
1051
1068
  }
1052
1069
  };
1053
1070
 
@@ -1133,13 +1150,13 @@ export const ImageGallery = <
1133
1150
  </TapGestureHandler>
1134
1151
  </Animated.View>
1135
1152
  </TapGestureHandler>
1136
- <ImageGalleryHeader<Us>
1153
+ <ImageGalleryHeader<StreamChatGenerics>
1137
1154
  opacity={headerFooterOpacity}
1138
1155
  photo={photos[selectedIndex]}
1139
1156
  visible={headerFooterVisible}
1140
1157
  {...imageGalleryCustomComponents?.header}
1141
1158
  />
1142
- <ImageGalleryFooter<Us>
1159
+ <ImageGalleryFooter<StreamChatGenerics>
1143
1160
  opacity={headerFooterOpacity}
1144
1161
  openGridView={openGridView}
1145
1162
  photo={photos[selectedIndex]}
@@ -1153,30 +1170,32 @@ export const ImageGallery = <
1153
1170
  closeGridView={closeGridView}
1154
1171
  currentBottomSheetIndex={currentBottomSheetIndex}
1155
1172
  />
1156
- <BottomSheet
1157
- animatedIndex={animatedBottomSheetIndex}
1158
- containerHeight={fullScreenHeight}
1159
- handleComponent={() => (
1160
- <ImageGridHandle
1173
+ <BottomSheetModalProvider>
1174
+ <BottomSheetModal
1175
+ animatedIndex={animatedBottomSheetIndex}
1176
+ enablePanDownToClose={true}
1177
+ handleComponent={() => (
1178
+ <ImageGridHandle
1179
+ closeGridView={closeGridView}
1180
+ {...imageGalleryCustomComponents?.gridHandle}
1181
+ />
1182
+ )}
1183
+ handleHeight={imageGalleryGridHandleHeight ?? 40}
1184
+ index={0}
1185
+ onChange={(index: number) => setCurrentBottomSheetIndex(index)}
1186
+ ref={bottomSheetModalRef}
1187
+ snapPoints={imageGalleryGridSnapPoints || snapPoints}
1188
+ >
1189
+ <ImageGrid
1161
1190
  closeGridView={closeGridView}
1162
- {...imageGalleryCustomComponents?.gridHandle}
1191
+ numberOfImageGalleryGridColumns={numberOfImageGalleryGridColumns}
1192
+ photos={gridPhotos}
1193
+ resetVisibleValues={resetVisibleValues}
1194
+ setImage={setImage}
1195
+ {...imageGalleryCustomComponents?.grid}
1163
1196
  />
1164
- )}
1165
- handleHeight={imageGalleryGridHandleHeight ?? 40}
1166
- index={0}
1167
- onChange={(index: number) => setCurrentBottomSheetIndex(index)}
1168
- ref={bottomSheetRef}
1169
- snapPoints={imageGalleryGridSnapPoints || snapPoints}
1170
- >
1171
- <ImageGrid
1172
- closeGridView={closeGridView}
1173
- numberOfImageGalleryGridColumns={numberOfImageGalleryGridColumns}
1174
- photos={photos}
1175
- resetVisibleValues={resetVisibleValues}
1176
- setImage={setImage}
1177
- {...imageGalleryCustomComponents?.grid}
1178
- />
1179
- </BottomSheet>
1197
+ </BottomSheetModal>
1198
+ </BottomSheetModalProvider>
1180
1199
  </Animated.View>
1181
1200
  );
1182
1201
  };
@@ -1196,13 +1215,17 @@ const styles = StyleSheet.create({
1196
1215
  },
1197
1216
  });
1198
1217
 
1199
- export type Photo<Us extends UnknownType = DefaultUserType> = {
1218
+ export type Photo<
1219
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
1220
+ > = {
1200
1221
  id: string;
1201
1222
  uri: string;
1202
1223
  channelId?: string;
1203
1224
  created_at?: string | Date;
1204
1225
  messageId?: string;
1205
- user?: UserResponse<Us> | null;
1226
+ original_height?: number;
1227
+ original_width?: number;
1228
+ user?: UserResponse<StreamChatGenerics> | null;
1206
1229
  user_id?: string;
1207
1230
  };
1208
1231
 
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
2
  import { View } from 'react-native';
3
+ import type { ImageStyle, StyleProp } from 'react-native';
3
4
  import Animated, { useAnimatedStyle } from 'react-native-reanimated';
4
5
 
5
6
  import { vw } from '../../../utils/utils';
6
7
 
7
- import type { ImageStyle, StyleProp } from 'react-native';
8
-
9
8
  const screenWidth = vw(100);
10
9
  const halfScreenWidth = vw(50);
11
10
  const oneEight = 1 / 8;
@@ -7,10 +7,9 @@ import { useTranslationContext } from '../../../contexts/translationContext/Tran
7
7
  import { Grid as GridIconDefault, Share as ShareIconDefault } from '../../../icons';
8
8
  import { deleteFile, saveFile, shareImage } from '../../../native';
9
9
 
10
+ import type { DefaultStreamChatGenerics } from '../../../types/types';
10
11
  import type { Photo } from '../ImageGallery';
11
12
 
12
- import type { DefaultUserType, UnknownType } from '../../../types/types';
13
-
14
13
  const ReanimatedSafeAreaView = Animated.createAnimatedComponent
15
14
  ? Animated.createAnimatedComponent(SafeAreaView)
16
15
  : SafeAreaView;
@@ -47,7 +46,9 @@ const styles = StyleSheet.create({
47
46
  },
48
47
  });
49
48
 
50
- export type ImageGalleryFooterCustomComponent<Us extends UnknownType = DefaultUserType> = ({
49
+ export type ImageGalleryFooterCustomComponent<
50
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
51
+ > = ({
51
52
  openGridView,
52
53
  photo,
53
54
  share,
@@ -56,28 +57,34 @@ export type ImageGalleryFooterCustomComponent<Us extends UnknownType = DefaultUs
56
57
  openGridView: () => void;
57
58
  share: () => Promise<void>;
58
59
  shareMenuOpen: boolean;
59
- photo?: Photo<Us>;
60
+ photo?: Photo<StreamChatGenerics>;
60
61
  }) => React.ReactElement | null;
61
62
 
62
- export type ImageGalleryFooterCustomComponentProps<Us extends UnknownType = DefaultUserType> = {
63
- centerElement?: ImageGalleryFooterCustomComponent<Us>;
63
+ export type ImageGalleryFooterCustomComponentProps<
64
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
65
+ > = {
66
+ centerElement?: ImageGalleryFooterCustomComponent<StreamChatGenerics>;
64
67
  GridIcon?: React.ReactElement;
65
- leftElement?: ImageGalleryFooterCustomComponent<Us>;
66
- rightElement?: ImageGalleryFooterCustomComponent<Us>;
68
+ leftElement?: ImageGalleryFooterCustomComponent<StreamChatGenerics>;
69
+ rightElement?: ImageGalleryFooterCustomComponent<StreamChatGenerics>;
67
70
  ShareIcon?: React.ReactElement;
68
71
  };
69
72
 
70
- type Props<Us extends UnknownType = DefaultUserType> =
71
- ImageGalleryFooterCustomComponentProps<Us> & {
73
+ type Props<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> =
74
+ ImageGalleryFooterCustomComponentProps<StreamChatGenerics> & {
72
75
  opacity: Animated.SharedValue<number>;
73
76
  openGridView: () => void;
74
- photo: Photo<Us>;
77
+ photo: Photo<StreamChatGenerics>;
75
78
  photoLength: number;
76
79
  selectedIndex: number;
77
80
  visible: Animated.SharedValue<number>;
78
81
  };
79
82
 
80
- export const ImageGalleryFooter = <Us extends UnknownType = DefaultUserType>(props: Props<Us>) => {
83
+ export const ImageGalleryFooter = <
84
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
85
+ >(
86
+ props: Props<StreamChatGenerics>,
87
+ ) => {
81
88
  const {
82
89
  centerElement,
83
90
  GridIcon,
@@ -126,9 +133,7 @@ export const ImageGalleryFooter = <Us extends UnknownType = DefaultUserType>(pro
126
133
  setShareMenuOpen(true);
127
134
  try {
128
135
  const localImage = await saveFile({
129
- fileName: `${photo.user?.name || photo.user_id || 'ChatPhoto'}-${
130
- photo.messageId
131
- }-${selectedIndex}.jpg`,
136
+ fileName: `${photo.user?.id || 'ChatPhoto'}-${photo.messageId}-${selectedIndex}.jpg`,
132
137
  fromUrl: photo.uri,
133
138
  });
134
139
  await shareImage({ type: 'image/jpeg', url: localImage });
@@ -15,14 +15,14 @@ import { useOverlayContext } from '../../../contexts/overlayContext/OverlayConte
15
15
  import { useTheme } from '../../../contexts/themeContext/ThemeContext';
16
16
  import {
17
17
  isDayOrMoment,
18
+ TDateTimeParserOutput,
18
19
  useTranslationContext,
19
20
  } from '../../../contexts/translationContext/TranslationContext';
20
21
  import { Close } from '../../../icons';
21
22
 
23
+ import type { DefaultStreamChatGenerics } from '../../../types/types';
22
24
  import type { Photo } from '../ImageGallery';
23
25
 
24
- import type { DefaultUserType, UnknownType } from '../../../types/types';
25
-
26
26
  const ReanimatedSafeAreaView = Animated.createAnimatedComponent
27
27
  ? Animated.createAnimatedComponent(SafeAreaView)
28
28
  : SafeAreaView;
@@ -58,29 +58,37 @@ const styles = StyleSheet.create({
58
58
  },
59
59
  });
60
60
 
61
- export type ImageGalleryHeaderCustomComponent<Us extends UnknownType = DefaultUserType> = ({
61
+ export type ImageGalleryHeaderCustomComponent<
62
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
63
+ > = ({
62
64
  hideOverlay,
63
65
  photo,
64
66
  }: {
65
67
  hideOverlay: () => void;
66
- photo?: Photo<Us>;
68
+ photo?: Photo<StreamChatGenerics>;
67
69
  }) => React.ReactElement | null;
68
70
 
69
- export type ImageGalleryHeaderCustomComponentProps<Us extends UnknownType = DefaultUserType> = {
70
- centerElement?: ImageGalleryHeaderCustomComponent<Us>;
71
+ export type ImageGalleryHeaderCustomComponentProps<
72
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
73
+ > = {
74
+ centerElement?: ImageGalleryHeaderCustomComponent<StreamChatGenerics>;
71
75
  CloseIcon?: React.ReactElement;
72
- leftElement?: ImageGalleryHeaderCustomComponent<Us>;
73
- rightElement?: ImageGalleryHeaderCustomComponent<Us>;
76
+ leftElement?: ImageGalleryHeaderCustomComponent<StreamChatGenerics>;
77
+ rightElement?: ImageGalleryHeaderCustomComponent<StreamChatGenerics>;
74
78
  };
75
79
 
76
- type Props<Us extends UnknownType = DefaultUserType> =
77
- ImageGalleryHeaderCustomComponentProps<Us> & {
80
+ type Props<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> =
81
+ ImageGalleryHeaderCustomComponentProps<StreamChatGenerics> & {
78
82
  opacity: Animated.SharedValue<number>;
79
83
  visible: Animated.SharedValue<number>;
80
- photo?: Photo<Us>;
84
+ photo?: Photo<StreamChatGenerics>;
81
85
  };
82
86
 
83
- export const ImageGalleryHeader = <Us extends UnknownType = DefaultUserType>(props: Props<Us>) => {
87
+ export const ImageGalleryHeader = <
88
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
89
+ >(
90
+ props: Props<StreamChatGenerics>,
91
+ ) => {
84
92
  const { centerElement, CloseIcon, leftElement, opacity, photo, rightElement, visible } = props;
85
93
  const [height, setHeight] = useState(200);
86
94
  const {
@@ -105,16 +113,29 @@ export const ImageGalleryHeader = <Us extends UnknownType = DefaultUserType>(pro
105
113
  const parsedDate = photo ? tDateTimeParser(photo?.created_at) : null;
106
114
 
107
115
  /**
108
- * .calendar is required on moment types, but in reality it
109
- * is unavailable on first render. We therefore check if it
110
- * is available and call it, otherwise we call .fromNow.
116
+ * .calendar and .fromNow can be initialized after the first render,
117
+ * and attempting to access them at that time will cause an error
118
+ * to be thrown.
119
+ *
120
+ * This falls back to null if neither exist.
111
121
  */
112
- const date =
113
- parsedDate && isDayOrMoment(parsedDate)
114
- ? parsedDate.calendar
115
- ? parsedDate.calendar()
116
- : parsedDate.fromNow()
117
- : null;
122
+ const getDateObject = (date: TDateTimeParserOutput | null) => {
123
+ if (date === null || !isDayOrMoment(date)) {
124
+ return null;
125
+ }
126
+
127
+ if (date.calendar) {
128
+ return date.calendar();
129
+ }
130
+
131
+ if (date.fromNow) {
132
+ return date.fromNow();
133
+ }
134
+
135
+ return null;
136
+ };
137
+
138
+ const date = getDateObject(parsedDate);
118
139
 
119
140
  const headerStyle = useAnimatedStyle<ViewStyle>(() => ({
120
141
  opacity: opacity.value,