stream-chat-react-native-core 4.1.0-next.1 → 4.1.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1331) hide show
  1. package/README.md +1 -13
  2. package/lib/commonjs/components/Attachment/Attachment.js +16 -15
  3. package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
  4. package/lib/commonjs/components/Attachment/AttachmentActions.js +4 -4
  5. package/lib/commonjs/components/Attachment/AttachmentActions.js.map +1 -1
  6. package/lib/commonjs/components/Attachment/Card.js +18 -15
  7. package/lib/commonjs/components/Attachment/Card.js.map +1 -1
  8. package/lib/commonjs/components/Attachment/FileAttachment.js +8 -8
  9. package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
  10. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +4 -4
  11. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
  12. package/lib/commonjs/components/Attachment/FileIcon.js.map +1 -1
  13. package/lib/commonjs/components/Attachment/Gallery.js +123 -121
  14. package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
  15. package/lib/commonjs/components/Attachment/Giphy.js +112 -148
  16. package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
  17. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGallery.js +46 -0
  18. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGallery.js.map +1 -0
  19. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js +88 -0
  20. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js.map +1 -0
  21. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js +75 -0
  22. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js.map +1 -0
  23. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js +43 -0
  24. package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js.map +1 -0
  25. package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnail.js +30 -0
  26. package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnail.js.map +1 -0
  27. package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnailGrid.js +49 -0
  28. package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnailGrid.js.map +1 -0
  29. package/lib/commonjs/components/Attachment/utils/buildGallery/types.js +4 -0
  30. package/lib/commonjs/{styleguideComponents/Reanimated.js.map → components/Attachment/utils/buildGallery/types.js.map} +0 -0
  31. package/lib/commonjs/components/Attachment/utils/getAspectRatio.js +14 -0
  32. package/lib/commonjs/components/Attachment/utils/getAspectRatio.js.map +1 -0
  33. package/lib/commonjs/components/Attachment/utils/getGalleryImageBorderRadius.js +36 -0
  34. package/lib/commonjs/components/Attachment/utils/getGalleryImageBorderRadius.js.map +1 -0
  35. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +9 -8
  36. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  37. package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js +11 -8
  38. package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js.map +1 -1
  39. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +24 -48
  40. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
  41. package/lib/commonjs/components/AutoCompleteInput/{CommandsItem.js → AutoCompleteSuggestionCommandIcon.js} +21 -94
  42. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -0
  43. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +145 -0
  44. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -0
  45. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +248 -0
  46. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -0
  47. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +223 -0
  48. package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -0
  49. package/lib/commonjs/components/Avatar/Avatar.js +13 -7
  50. package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
  51. package/lib/commonjs/components/Avatar/GroupAvatar.js +10 -8
  52. package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
  53. package/lib/commonjs/components/Channel/Channel.js +303 -202
  54. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  55. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +7 -5
  56. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  57. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +7 -5
  58. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  59. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +13 -31
  60. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  61. package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +35 -0
  62. package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -0
  63. package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
  64. package/lib/commonjs/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
  65. package/lib/commonjs/components/Channel/hooks/useCreateTypingContext.js.map +1 -1
  66. package/lib/commonjs/components/ChannelList/ChannelList.js +6 -6
  67. package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
  68. package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +5 -4
  69. package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
  70. package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +6 -7
  71. package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
  72. package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +4 -3
  73. package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
  74. package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js +7 -4
  75. package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js.map +1 -1
  76. package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +17 -17
  77. package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
  78. package/lib/commonjs/components/ChannelList/Skeleton.js +14 -13
  79. package/lib/commonjs/components/ChannelList/Skeleton.js.map +1 -1
  80. package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
  81. package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
  82. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
  83. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
  84. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
  85. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
  86. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
  87. package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
  88. package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js +3 -1
  89. package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +1 -1
  90. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
  91. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
  92. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js +3 -3
  93. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
  94. package/lib/commonjs/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
  95. package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
  96. package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +2 -2
  97. package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
  98. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +96 -63
  99. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  100. package/lib/commonjs/components/ChannelList/utils.js +1 -1
  101. package/lib/commonjs/components/ChannelList/utils.js.map +1 -1
  102. package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +2 -2
  103. package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
  104. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +4 -4
  105. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
  106. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +5 -5
  107. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
  108. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +49 -20
  109. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
  110. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +51 -0
  111. package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -0
  112. package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +4 -4
  113. package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
  114. package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
  115. package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
  116. package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +2 -2
  117. package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
  118. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js +16 -7
  119. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js.map +1 -1
  120. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
  121. package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
  122. package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js +2 -1
  123. package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
  124. package/lib/commonjs/components/Chat/Chat.js +8 -4
  125. package/lib/commonjs/components/Chat/Chat.js.map +1 -1
  126. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  127. package/lib/commonjs/components/Chat/hooks/useIsOnline.js +40 -31
  128. package/lib/commonjs/components/Chat/hooks/useIsOnline.js.map +1 -1
  129. package/lib/commonjs/components/Chat/hooks/useMutedUsers.js.map +1 -1
  130. package/lib/commonjs/components/ImageGallery/ImageGallery.js +107 -97
  131. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  132. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +2 -2
  133. package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  134. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +12 -12
  135. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  136. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +31 -16
  137. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  138. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +7 -9
  139. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
  140. package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +5 -5
  141. package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
  142. package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js.map +1 -1
  143. package/lib/commonjs/components/Indicators/LoadingIndicator.js +9 -9
  144. package/lib/commonjs/components/Indicators/LoadingIndicator.js.map +1 -1
  145. package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js +20 -12
  146. package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js.map +1 -1
  147. package/lib/commonjs/components/Message/Message.js +152 -854
  148. package/lib/commonjs/components/Message/Message.js.map +1 -1
  149. package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +6 -6
  150. package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
  151. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +41 -39
  152. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
  153. package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +8 -6
  154. package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
  155. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +34 -22
  156. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
  157. package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +122 -0
  158. package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -0
  159. package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js +26 -10
  160. package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js.map +1 -1
  161. package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +5 -5
  162. package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
  163. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +31 -14
  164. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  165. package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +28 -24
  166. package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js.map +1 -1
  167. package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +7 -3
  168. package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
  169. package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +86 -113
  170. package/lib/commonjs/components/Message/MessageSimple/ReactionList.js.map +1 -1
  171. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js +89 -0
  172. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js.map +1 -0
  173. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js +46 -0
  174. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -0
  175. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +207 -26
  176. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  177. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js +240 -0
  178. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js.map +1 -0
  179. package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js +1 -5
  180. package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js.map +1 -1
  181. package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js +307 -0
  182. package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -0
  183. package/lib/commonjs/components/Message/hooks/useMessageActions.js +563 -0
  184. package/lib/commonjs/components/Message/hooks/useMessageActions.js.map +1 -0
  185. package/lib/commonjs/components/Message/utils/messageActions.js +17 -15
  186. package/lib/commonjs/components/Message/utils/messageActions.js.map +1 -1
  187. package/lib/commonjs/components/Message/utils/removeReservedFields.js.map +1 -1
  188. package/lib/commonjs/components/MessageInput/AttachButton.js +6 -4
  189. package/lib/commonjs/components/MessageInput/AttachButton.js.map +1 -1
  190. package/lib/commonjs/components/MessageInput/CommandsButton.js +3 -3
  191. package/lib/commonjs/components/MessageInput/CommandsButton.js.map +1 -1
  192. package/lib/commonjs/components/MessageInput/CooldownTimer.js +78 -0
  193. package/lib/commonjs/components/MessageInput/CooldownTimer.js.map +1 -0
  194. package/lib/commonjs/components/MessageInput/FileUploadPreview.js +32 -27
  195. package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
  196. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +9 -9
  197. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
  198. package/lib/commonjs/components/MessageInput/InputButtons.js +17 -22
  199. package/lib/commonjs/components/MessageInput/InputButtons.js.map +1 -1
  200. package/lib/commonjs/components/MessageInput/MessageInput.js +93 -65
  201. package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
  202. package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +3 -3
  203. package/lib/commonjs/components/MessageInput/MoreOptionsButton.js.map +1 -1
  204. package/lib/commonjs/components/MessageInput/SendButton.js +8 -6
  205. package/lib/commonjs/components/MessageInput/SendButton.js.map +1 -1
  206. package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +71 -0
  207. package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -0
  208. package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +11 -10
  209. package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
  210. package/lib/commonjs/components/MessageInput/hooks/useCooldown.js +63 -0
  211. package/lib/commonjs/components/MessageInput/hooks/useCooldown.js.map +1 -0
  212. package/lib/commonjs/components/MessageInput/hooks/useCountdown.js +57 -0
  213. package/lib/commonjs/components/MessageInput/hooks/useCountdown.js.map +1 -0
  214. package/lib/commonjs/components/MessageList/DateHeader.js +2 -2
  215. package/lib/commonjs/components/MessageList/DateHeader.js.map +1 -1
  216. package/lib/commonjs/components/MessageList/InlineDateSeparator.js +4 -3
  217. package/lib/commonjs/components/MessageList/InlineDateSeparator.js.map +1 -1
  218. package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js +4 -4
  219. package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js.map +1 -1
  220. package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js +4 -4
  221. package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js.map +1 -1
  222. package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js +4 -4
  223. package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js.map +1 -1
  224. package/lib/commonjs/components/MessageList/MessageList.js +106 -58
  225. package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
  226. package/lib/commonjs/components/MessageList/MessageSystem.js +6 -6
  227. package/lib/commonjs/components/MessageList/MessageSystem.js.map +1 -1
  228. package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +7 -5
  229. package/lib/commonjs/components/MessageList/ScrollToBottomButton.js.map +1 -1
  230. package/lib/commonjs/components/MessageList/TypingIndicator.js +5 -5
  231. package/lib/commonjs/components/MessageList/TypingIndicator.js.map +1 -1
  232. package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js +2 -2
  233. package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js.map +1 -1
  234. package/lib/commonjs/components/MessageList/hooks/useMessageList.js +24 -11
  235. package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
  236. package/lib/commonjs/components/MessageList/hooks/useTypingString.js +2 -2
  237. package/lib/commonjs/components/MessageList/hooks/useTypingString.js.map +1 -1
  238. package/lib/commonjs/components/MessageList/utils/filterTypingUsers.js.map +1 -1
  239. package/lib/commonjs/components/MessageList/utils/getDateSeparators.js +2 -1
  240. package/lib/commonjs/components/MessageList/utils/getDateSeparators.js.map +1 -1
  241. package/lib/commonjs/components/MessageList/utils/getGroupStyles.js +11 -10
  242. package/lib/commonjs/components/MessageList/utils/getGroupStyles.js.map +1 -1
  243. package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js +3 -1
  244. package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
  245. package/lib/commonjs/components/MessageList/utils/getReadStates.js.map +1 -1
  246. package/lib/{module/components/MessageOverlay/MessageActions.js → commonjs/components/MessageOverlay/MessageActionList.js} +33 -85
  247. package/lib/commonjs/components/MessageOverlay/MessageActionList.js.map +1 -0
  248. package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +131 -0
  249. package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js.map +1 -0
  250. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +110 -115
  251. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
  252. package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +38 -0
  253. package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js.map +1 -0
  254. package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +17 -18
  255. package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js.map +1 -1
  256. package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +31 -34
  257. package/lib/commonjs/components/MessageOverlay/OverlayReactions.js.map +1 -1
  258. package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js +41 -0
  259. package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js.map +1 -0
  260. package/lib/commonjs/components/MessageOverlay/hooks/useMessageActionAnimation.js +37 -0
  261. package/lib/commonjs/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -0
  262. package/lib/commonjs/components/Reply/Reply.js +25 -19
  263. package/lib/commonjs/components/Reply/Reply.js.map +1 -1
  264. package/lib/commonjs/components/Thread/Thread.js +6 -6
  265. package/lib/commonjs/components/Thread/Thread.js.map +1 -1
  266. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +13 -12
  267. package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
  268. package/lib/commonjs/components/docs/ListProps.md +1 -1
  269. package/lib/commonjs/components/docs/data.js +45 -45
  270. package/lib/commonjs/components/docs/data.js.map +1 -1
  271. package/lib/commonjs/components/index.js +133 -55
  272. package/lib/commonjs/components/index.js.map +1 -1
  273. package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +2 -2
  274. package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
  275. package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +2 -2
  276. package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
  277. package/lib/commonjs/contexts/channelContext/ChannelContext.js +2 -2
  278. package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
  279. package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +2 -2
  280. package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
  281. package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +4 -4
  282. package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
  283. package/lib/commonjs/contexts/channelsStateContext/useChannelState.js +3 -3
  284. package/lib/commonjs/contexts/channelsStateContext/useChannelState.js.map +1 -1
  285. package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
  286. package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
  287. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +2 -2
  288. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
  289. package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +2 -2
  290. package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js.map +1 -1
  291. package/lib/commonjs/contexts/messageContext/MessageContext.js +2 -2
  292. package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
  293. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +105 -70
  294. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  295. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +9 -5
  296. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  297. package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js +10 -3
  298. package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
  299. package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +5 -19
  300. package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
  301. package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.js +36 -0
  302. package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.js.map +1 -0
  303. package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js +105 -0
  304. package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js.map +1 -0
  305. package/lib/commonjs/contexts/messagesContext/MessagesContext.js +2 -2
  306. package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
  307. package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
  308. package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
  309. package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +49 -51
  310. package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
  311. package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +61 -0
  312. package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js.map +1 -0
  313. package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +2 -2
  314. package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
  315. package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +20 -33
  316. package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
  317. package/lib/commonjs/contexts/themeContext/ThemeContext.js +2 -2
  318. package/lib/commonjs/contexts/themeContext/ThemeContext.js.map +1 -1
  319. package/lib/commonjs/contexts/themeContext/utils/theme.js +48 -20
  320. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  321. package/lib/commonjs/contexts/threadContext/ThreadContext.js +2 -2
  322. package/lib/commonjs/contexts/threadContext/ThreadContext.js.map +1 -1
  323. package/lib/commonjs/contexts/translationContext/TranslationContext.js +3 -3
  324. package/lib/commonjs/contexts/translationContext/TranslationContext.js.map +1 -1
  325. package/lib/commonjs/contexts/typingContext/TypingContext.js +2 -2
  326. package/lib/commonjs/contexts/typingContext/TypingContext.js.map +1 -1
  327. package/lib/commonjs/contexts/utils/getDisplayName.js.map +1 -1
  328. package/lib/commonjs/emoji-data/compiled.js +0 -315
  329. package/lib/commonjs/emoji-data/compiled.js.map +1 -1
  330. package/lib/commonjs/emoji-data/emojiNames.js +0 -105
  331. package/lib/commonjs/emoji-data/emojiNames.js.map +1 -1
  332. package/lib/commonjs/emoji-data/emojis.js +0 -175
  333. package/lib/commonjs/emoji-data/emojis.js.map +1 -1
  334. package/lib/commonjs/emoji-data/index.js +2 -2
  335. package/lib/commonjs/emoji-data/index.js.map +1 -1
  336. package/lib/commonjs/hooks/useAppStateListener.js +8 -5
  337. package/lib/commonjs/hooks/useAppStateListener.js.map +1 -1
  338. package/lib/commonjs/hooks/useIsMountedRef.js +19 -0
  339. package/lib/commonjs/hooks/useIsMountedRef.js.map +1 -0
  340. package/lib/commonjs/hooks/useStreami18n.js +5 -2
  341. package/lib/commonjs/hooks/useStreami18n.js.map +1 -1
  342. package/lib/commonjs/i18n/en.json +9 -3
  343. package/lib/commonjs/i18n/fr.json +9 -3
  344. package/lib/commonjs/i18n/hi.json +9 -3
  345. package/lib/commonjs/i18n/it.json +9 -3
  346. package/lib/commonjs/i18n/ja.json +9 -0
  347. package/lib/commonjs/i18n/ko.json +9 -0
  348. package/lib/commonjs/i18n/nl.json +9 -3
  349. package/lib/commonjs/i18n/ru.json +9 -3
  350. package/lib/commonjs/i18n/tr.json +10 -4
  351. package/lib/commonjs/icons/Pin.js +42 -0
  352. package/lib/commonjs/icons/Pin.js.map +1 -0
  353. package/lib/commonjs/icons/PinHeader.js +38 -0
  354. package/lib/commonjs/icons/PinHeader.js.map +1 -0
  355. package/lib/commonjs/icons/Unpin.js +38 -0
  356. package/lib/commonjs/icons/Unpin.js.map +1 -0
  357. package/lib/commonjs/icons/UserAdmin.js +62 -0
  358. package/lib/commonjs/icons/UserAdmin.js.map +1 -0
  359. package/lib/commonjs/icons/index.js +39 -26
  360. package/lib/commonjs/icons/index.js.map +1 -1
  361. package/lib/commonjs/icons/utils/base.js +1 -1
  362. package/lib/commonjs/index.js +6 -6
  363. package/lib/commonjs/init.js +13 -0
  364. package/lib/commonjs/init.js.map +1 -0
  365. package/lib/commonjs/mock-builders/api/error.js +1 -1
  366. package/lib/commonjs/mock-builders/api/queryChannels.js +1 -1
  367. package/lib/commonjs/mock-builders/api/queryChannels.js.map +1 -1
  368. package/lib/commonjs/mock-builders/api/sendMessage.js +4 -1
  369. package/lib/commonjs/mock-builders/api/sendMessage.js.map +1 -1
  370. package/lib/commonjs/mock-builders/generator/attachment.js +1 -3
  371. package/lib/commonjs/mock-builders/generator/attachment.js.map +1 -1
  372. package/lib/commonjs/mock-builders/generator/channel.js +101 -50
  373. package/lib/commonjs/mock-builders/generator/channel.js.map +1 -1
  374. package/lib/commonjs/mock-builders/generator/user.js +32 -33
  375. package/lib/commonjs/mock-builders/generator/user.js.map +1 -1
  376. package/lib/commonjs/mock-builders/mock.js +3 -3
  377. package/lib/commonjs/mock-builders/mock.js.map +1 -1
  378. package/lib/commonjs/mock-builders/native/react-native-mock.js +1 -1
  379. package/lib/commonjs/mock-builders/native/react-native-mock.js.map +1 -1
  380. package/lib/commonjs/native.js +1 -7
  381. package/lib/commonjs/native.js.map +1 -1
  382. package/lib/commonjs/utils/Streami18n.js.map +1 -1
  383. package/lib/commonjs/utils/date.js +13 -0
  384. package/lib/commonjs/utils/date.js.map +1 -0
  385. package/lib/commonjs/utils/getResizedImageUrl.js +37 -0
  386. package/lib/commonjs/utils/getResizedImageUrl.js.map +1 -0
  387. package/lib/commonjs/utils/getUrlOfImageAttachment.js +9 -0
  388. package/lib/commonjs/utils/getUrlOfImageAttachment.js.map +1 -0
  389. package/lib/commonjs/utils/utils.js +39 -19
  390. package/lib/commonjs/utils/utils.js.map +1 -1
  391. package/lib/commonjs/version.json +1 -1
  392. package/lib/module/components/Attachment/Attachment.js +16 -15
  393. package/lib/module/components/Attachment/Attachment.js.map +1 -1
  394. package/lib/module/components/Attachment/AttachmentActions.js +4 -4
  395. package/lib/module/components/Attachment/AttachmentActions.js.map +1 -1
  396. package/lib/module/components/Attachment/Card.js +18 -15
  397. package/lib/module/components/Attachment/Card.js.map +1 -1
  398. package/lib/module/components/Attachment/FileAttachment.js +8 -8
  399. package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
  400. package/lib/module/components/Attachment/FileAttachmentGroup.js +4 -4
  401. package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
  402. package/lib/module/components/Attachment/FileIcon.js.map +1 -1
  403. package/lib/module/components/Attachment/Gallery.js +123 -121
  404. package/lib/module/components/Attachment/Gallery.js.map +1 -1
  405. package/lib/module/components/Attachment/Giphy.js +112 -148
  406. package/lib/module/components/Attachment/Giphy.js.map +1 -1
  407. package/lib/module/components/Attachment/utils/buildGallery/buildGallery.js +46 -0
  408. package/lib/module/components/Attachment/utils/buildGallery/buildGallery.js.map +1 -0
  409. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js +88 -0
  410. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js.map +1 -0
  411. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js +75 -0
  412. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js.map +1 -0
  413. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js +43 -0
  414. package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js.map +1 -0
  415. package/lib/module/components/Attachment/utils/buildGallery/buildThumbnail.js +30 -0
  416. package/lib/module/components/Attachment/utils/buildGallery/buildThumbnail.js.map +1 -0
  417. package/lib/module/components/Attachment/utils/buildGallery/buildThumbnailGrid.js +49 -0
  418. package/lib/module/components/Attachment/utils/buildGallery/buildThumbnailGrid.js.map +1 -0
  419. package/lib/module/components/Attachment/utils/buildGallery/types.js +4 -0
  420. package/lib/module/{styleguideComponents/Reanimated.js.map → components/Attachment/utils/buildGallery/types.js.map} +0 -0
  421. package/lib/module/components/Attachment/utils/getAspectRatio.js +14 -0
  422. package/lib/module/components/Attachment/utils/getAspectRatio.js.map +1 -0
  423. package/lib/module/components/Attachment/utils/getGalleryImageBorderRadius.js +36 -0
  424. package/lib/module/components/Attachment/utils/getGalleryImageBorderRadius.js.map +1 -0
  425. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +9 -8
  426. package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  427. package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js +11 -8
  428. package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js.map +1 -1
  429. package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +24 -48
  430. package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
  431. package/lib/module/components/AutoCompleteInput/{CommandsItem.js → AutoCompleteSuggestionCommandIcon.js} +21 -94
  432. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -0
  433. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +145 -0
  434. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -0
  435. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +248 -0
  436. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -0
  437. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +223 -0
  438. package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -0
  439. package/lib/module/components/Avatar/Avatar.js +13 -7
  440. package/lib/module/components/Avatar/Avatar.js.map +1 -1
  441. package/lib/module/components/Avatar/GroupAvatar.js +10 -8
  442. package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
  443. package/lib/module/components/Channel/Channel.js +303 -202
  444. package/lib/module/components/Channel/Channel.js.map +1 -1
  445. package/lib/module/components/Channel/hooks/useCreateChannelContext.js +7 -5
  446. package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  447. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +7 -5
  448. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  449. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +13 -31
  450. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  451. package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +35 -0
  452. package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -0
  453. package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
  454. package/lib/module/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
  455. package/lib/module/components/Channel/hooks/useCreateTypingContext.js.map +1 -1
  456. package/lib/module/components/ChannelList/ChannelList.js +6 -6
  457. package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
  458. package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +5 -4
  459. package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
  460. package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +6 -7
  461. package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
  462. package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +4 -3
  463. package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
  464. package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js +7 -4
  465. package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js.map +1 -1
  466. package/lib/module/components/ChannelList/ChannelListMessenger.js +17 -17
  467. package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
  468. package/lib/module/components/ChannelList/Skeleton.js +14 -13
  469. package/lib/module/components/ChannelList/Skeleton.js.map +1 -1
  470. package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
  471. package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
  472. package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
  473. package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
  474. package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
  475. package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
  476. package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
  477. package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
  478. package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js +3 -1
  479. package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +1 -1
  480. package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
  481. package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
  482. package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js +3 -3
  483. package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
  484. package/lib/module/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
  485. package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
  486. package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +2 -2
  487. package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
  488. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +96 -63
  489. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  490. package/lib/module/components/ChannelList/utils.js +1 -1
  491. package/lib/module/components/ChannelList/utils.js.map +1 -1
  492. package/lib/module/components/ChannelPreview/ChannelAvatar.js +2 -2
  493. package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
  494. package/lib/module/components/ChannelPreview/ChannelPreview.js +4 -4
  495. package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
  496. package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +5 -5
  497. package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
  498. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +49 -20
  499. package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
  500. package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +51 -0
  501. package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -0
  502. package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +4 -4
  503. package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
  504. package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
  505. package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
  506. package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +2 -2
  507. package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
  508. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js +16 -7
  509. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js.map +1 -1
  510. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
  511. package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
  512. package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js +2 -1
  513. package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
  514. package/lib/module/components/Chat/Chat.js +8 -4
  515. package/lib/module/components/Chat/Chat.js.map +1 -1
  516. package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  517. package/lib/module/components/Chat/hooks/useIsOnline.js +40 -31
  518. package/lib/module/components/Chat/hooks/useIsOnline.js.map +1 -1
  519. package/lib/module/components/Chat/hooks/useMutedUsers.js.map +1 -1
  520. package/lib/module/components/ImageGallery/ImageGallery.js +107 -97
  521. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  522. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +2 -2
  523. package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
  524. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +12 -12
  525. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  526. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +31 -16
  527. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  528. package/lib/module/components/ImageGallery/components/ImageGrid.js +7 -9
  529. package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
  530. package/lib/module/components/ImageGallery/components/ImageGridHandle.js +5 -5
  531. package/lib/module/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
  532. package/lib/module/components/Indicators/LoadingErrorIndicator.js.map +1 -1
  533. package/lib/module/components/Indicators/LoadingIndicator.js +9 -9
  534. package/lib/module/components/Indicators/LoadingIndicator.js.map +1 -1
  535. package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js +20 -12
  536. package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js.map +1 -1
  537. package/lib/module/components/Message/Message.js +152 -854
  538. package/lib/module/components/Message/Message.js.map +1 -1
  539. package/lib/module/components/Message/MessageSimple/MessageAvatar.js +6 -6
  540. package/lib/module/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
  541. package/lib/module/components/Message/MessageSimple/MessageContent.js +41 -39
  542. package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
  543. package/lib/module/components/Message/MessageSimple/MessageDeleted.js +8 -6
  544. package/lib/module/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
  545. package/lib/module/components/Message/MessageSimple/MessageFooter.js +34 -22
  546. package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
  547. package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +122 -0
  548. package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -0
  549. package/lib/module/components/Message/MessageSimple/MessageReplies.js +26 -10
  550. package/lib/module/components/Message/MessageSimple/MessageReplies.js.map +1 -1
  551. package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +5 -5
  552. package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
  553. package/lib/module/components/Message/MessageSimple/MessageSimple.js +31 -14
  554. package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  555. package/lib/module/components/Message/MessageSimple/MessageStatus.js +28 -24
  556. package/lib/module/components/Message/MessageSimple/MessageStatus.js.map +1 -1
  557. package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +7 -3
  558. package/lib/module/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
  559. package/lib/module/components/Message/MessageSimple/ReactionList.js +86 -113
  560. package/lib/module/components/Message/MessageSimple/ReactionList.js.map +1 -1
  561. package/lib/module/components/Message/MessageSimple/utils/parseLinks.js +89 -0
  562. package/lib/module/components/Message/MessageSimple/utils/parseLinks.js.map +1 -0
  563. package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js +46 -0
  564. package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -0
  565. package/lib/module/components/Message/MessageSimple/utils/renderText.js +207 -26
  566. package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  567. package/lib/module/components/Message/MessageSimple/utils/renderText.test.js +240 -0
  568. package/lib/module/components/Message/MessageSimple/utils/renderText.test.js.map +1 -0
  569. package/lib/module/components/Message/hooks/useCreateMessageContext.js +1 -5
  570. package/lib/module/components/Message/hooks/useCreateMessageContext.js.map +1 -1
  571. package/lib/module/components/Message/hooks/useMessageActionHandlers.js +307 -0
  572. package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -0
  573. package/lib/module/components/Message/hooks/useMessageActions.js +563 -0
  574. package/lib/module/components/Message/hooks/useMessageActions.js.map +1 -0
  575. package/lib/module/components/Message/utils/messageActions.js +17 -15
  576. package/lib/module/components/Message/utils/messageActions.js.map +1 -1
  577. package/lib/module/components/Message/utils/removeReservedFields.js.map +1 -1
  578. package/lib/module/components/MessageInput/AttachButton.js +6 -4
  579. package/lib/module/components/MessageInput/AttachButton.js.map +1 -1
  580. package/lib/module/components/MessageInput/CommandsButton.js +3 -3
  581. package/lib/module/components/MessageInput/CommandsButton.js.map +1 -1
  582. package/lib/module/components/MessageInput/CooldownTimer.js +78 -0
  583. package/lib/module/components/MessageInput/CooldownTimer.js.map +1 -0
  584. package/lib/module/components/MessageInput/FileUploadPreview.js +32 -27
  585. package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
  586. package/lib/module/components/MessageInput/ImageUploadPreview.js +9 -9
  587. package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
  588. package/lib/module/components/MessageInput/InputButtons.js +17 -22
  589. package/lib/module/components/MessageInput/InputButtons.js.map +1 -1
  590. package/lib/module/components/MessageInput/MessageInput.js +93 -65
  591. package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
  592. package/lib/module/components/MessageInput/MoreOptionsButton.js +3 -3
  593. package/lib/module/components/MessageInput/MoreOptionsButton.js.map +1 -1
  594. package/lib/module/components/MessageInput/SendButton.js +8 -6
  595. package/lib/module/components/MessageInput/SendButton.js.map +1 -1
  596. package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +71 -0
  597. package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -0
  598. package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +11 -10
  599. package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
  600. package/lib/module/components/MessageInput/hooks/useCooldown.js +63 -0
  601. package/lib/module/components/MessageInput/hooks/useCooldown.js.map +1 -0
  602. package/lib/module/components/MessageInput/hooks/useCountdown.js +57 -0
  603. package/lib/module/components/MessageInput/hooks/useCountdown.js.map +1 -0
  604. package/lib/module/components/MessageList/DateHeader.js +2 -2
  605. package/lib/module/components/MessageList/DateHeader.js.map +1 -1
  606. package/lib/module/components/MessageList/InlineDateSeparator.js +4 -3
  607. package/lib/module/components/MessageList/InlineDateSeparator.js.map +1 -1
  608. package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js +4 -4
  609. package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js.map +1 -1
  610. package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js +4 -4
  611. package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js.map +1 -1
  612. package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js +4 -4
  613. package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js.map +1 -1
  614. package/lib/module/components/MessageList/MessageList.js +106 -58
  615. package/lib/module/components/MessageList/MessageList.js.map +1 -1
  616. package/lib/module/components/MessageList/MessageSystem.js +6 -6
  617. package/lib/module/components/MessageList/MessageSystem.js.map +1 -1
  618. package/lib/module/components/MessageList/ScrollToBottomButton.js +7 -5
  619. package/lib/module/components/MessageList/ScrollToBottomButton.js.map +1 -1
  620. package/lib/module/components/MessageList/TypingIndicator.js +5 -5
  621. package/lib/module/components/MessageList/TypingIndicator.js.map +1 -1
  622. package/lib/module/components/MessageList/TypingIndicatorContainer.js +2 -2
  623. package/lib/module/components/MessageList/TypingIndicatorContainer.js.map +1 -1
  624. package/lib/module/components/MessageList/hooks/useMessageList.js +24 -11
  625. package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
  626. package/lib/module/components/MessageList/hooks/useTypingString.js +2 -2
  627. package/lib/module/components/MessageList/hooks/useTypingString.js.map +1 -1
  628. package/lib/module/components/MessageList/utils/filterTypingUsers.js.map +1 -1
  629. package/lib/module/components/MessageList/utils/getDateSeparators.js +2 -1
  630. package/lib/module/components/MessageList/utils/getDateSeparators.js.map +1 -1
  631. package/lib/module/components/MessageList/utils/getGroupStyles.js +11 -10
  632. package/lib/module/components/MessageList/utils/getGroupStyles.js.map +1 -1
  633. package/lib/module/components/MessageList/utils/getLastReceivedMessage.js +3 -1
  634. package/lib/module/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
  635. package/lib/module/components/MessageList/utils/getReadStates.js.map +1 -1
  636. package/lib/{commonjs/components/MessageOverlay/MessageActions.js → module/components/MessageOverlay/MessageActionList.js} +33 -85
  637. package/lib/module/components/MessageOverlay/MessageActionList.js.map +1 -0
  638. package/lib/module/components/MessageOverlay/MessageActionListItem.js +131 -0
  639. package/lib/module/components/MessageOverlay/MessageActionListItem.js.map +1 -0
  640. package/lib/module/components/MessageOverlay/MessageOverlay.js +110 -115
  641. package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
  642. package/lib/module/components/MessageOverlay/OverlayBackdrop.js +38 -0
  643. package/lib/module/components/MessageOverlay/OverlayBackdrop.js.map +1 -0
  644. package/lib/module/components/MessageOverlay/OverlayReactionList.js +17 -18
  645. package/lib/module/components/MessageOverlay/OverlayReactionList.js.map +1 -1
  646. package/lib/module/components/MessageOverlay/OverlayReactions.js +31 -34
  647. package/lib/module/components/MessageOverlay/OverlayReactions.js.map +1 -1
  648. package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js +41 -0
  649. package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js.map +1 -0
  650. package/lib/module/components/MessageOverlay/hooks/useMessageActionAnimation.js +37 -0
  651. package/lib/module/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -0
  652. package/lib/module/components/Reply/Reply.js +25 -19
  653. package/lib/module/components/Reply/Reply.js.map +1 -1
  654. package/lib/module/components/Thread/Thread.js +6 -6
  655. package/lib/module/components/Thread/Thread.js.map +1 -1
  656. package/lib/module/components/Thread/components/ThreadFooterComponent.js +13 -12
  657. package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
  658. package/lib/module/components/docs/ListProps.md +1 -1
  659. package/lib/module/components/docs/data.js +45 -45
  660. package/lib/module/components/docs/data.js.map +1 -1
  661. package/lib/module/components/index.js +133 -55
  662. package/lib/module/components/index.js.map +1 -1
  663. package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +2 -2
  664. package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
  665. package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +2 -2
  666. package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
  667. package/lib/module/contexts/channelContext/ChannelContext.js +2 -2
  668. package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
  669. package/lib/module/contexts/channelsContext/ChannelsContext.js +2 -2
  670. package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
  671. package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +4 -4
  672. package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
  673. package/lib/module/contexts/channelsStateContext/useChannelState.js +3 -3
  674. package/lib/module/contexts/channelsStateContext/useChannelState.js.map +1 -1
  675. package/lib/module/contexts/chatContext/ChatContext.js +2 -2
  676. package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
  677. package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +2 -2
  678. package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
  679. package/lib/module/contexts/keyboardContext/KeyboardContext.js +2 -2
  680. package/lib/module/contexts/keyboardContext/KeyboardContext.js.map +1 -1
  681. package/lib/module/contexts/messageContext/MessageContext.js +2 -2
  682. package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
  683. package/lib/module/contexts/messageInputContext/MessageInputContext.js +105 -70
  684. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  685. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +9 -5
  686. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  687. package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js +10 -3
  688. package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
  689. package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +5 -19
  690. package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
  691. package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.js +36 -0
  692. package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.js.map +1 -0
  693. package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js +105 -0
  694. package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js.map +1 -0
  695. package/lib/module/contexts/messagesContext/MessagesContext.js +2 -2
  696. package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
  697. package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
  698. package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
  699. package/lib/module/contexts/overlayContext/OverlayProvider.js +49 -51
  700. package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
  701. package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +61 -0
  702. package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js.map +1 -0
  703. package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +2 -2
  704. package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
  705. package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +20 -33
  706. package/lib/module/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
  707. package/lib/module/contexts/themeContext/ThemeContext.js +2 -2
  708. package/lib/module/contexts/themeContext/ThemeContext.js.map +1 -1
  709. package/lib/module/contexts/themeContext/utils/theme.js +48 -20
  710. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  711. package/lib/module/contexts/threadContext/ThreadContext.js +2 -2
  712. package/lib/module/contexts/threadContext/ThreadContext.js.map +1 -1
  713. package/lib/module/contexts/translationContext/TranslationContext.js +3 -3
  714. package/lib/module/contexts/translationContext/TranslationContext.js.map +1 -1
  715. package/lib/module/contexts/typingContext/TypingContext.js +2 -2
  716. package/lib/module/contexts/typingContext/TypingContext.js.map +1 -1
  717. package/lib/module/contexts/utils/getDisplayName.js.map +1 -1
  718. package/lib/module/emoji-data/compiled.js +0 -315
  719. package/lib/module/emoji-data/compiled.js.map +1 -1
  720. package/lib/module/emoji-data/emojiNames.js +0 -105
  721. package/lib/module/emoji-data/emojiNames.js.map +1 -1
  722. package/lib/module/emoji-data/emojis.js +0 -175
  723. package/lib/module/emoji-data/emojis.js.map +1 -1
  724. package/lib/module/emoji-data/index.js +2 -2
  725. package/lib/module/emoji-data/index.js.map +1 -1
  726. package/lib/module/hooks/useAppStateListener.js +8 -5
  727. package/lib/module/hooks/useAppStateListener.js.map +1 -1
  728. package/lib/module/hooks/useIsMountedRef.js +19 -0
  729. package/lib/module/hooks/useIsMountedRef.js.map +1 -0
  730. package/lib/module/hooks/useStreami18n.js +5 -2
  731. package/lib/module/hooks/useStreami18n.js.map +1 -1
  732. package/lib/module/i18n/en.json +9 -3
  733. package/lib/module/i18n/fr.json +9 -3
  734. package/lib/module/i18n/hi.json +9 -3
  735. package/lib/module/i18n/it.json +9 -3
  736. package/lib/module/i18n/ja.json +9 -0
  737. package/lib/module/i18n/ko.json +9 -0
  738. package/lib/module/i18n/nl.json +9 -3
  739. package/lib/module/i18n/ru.json +9 -3
  740. package/lib/module/i18n/tr.json +10 -4
  741. package/lib/module/icons/Pin.js +42 -0
  742. package/lib/module/icons/Pin.js.map +1 -0
  743. package/lib/module/icons/PinHeader.js +38 -0
  744. package/lib/module/icons/PinHeader.js.map +1 -0
  745. package/lib/module/icons/Unpin.js +38 -0
  746. package/lib/module/icons/Unpin.js.map +1 -0
  747. package/lib/module/icons/UserAdmin.js +62 -0
  748. package/lib/module/icons/UserAdmin.js.map +1 -0
  749. package/lib/module/icons/index.js +39 -26
  750. package/lib/module/icons/index.js.map +1 -1
  751. package/lib/module/icons/utils/base.js +1 -1
  752. package/lib/module/index.js +6 -6
  753. package/lib/module/init.js +13 -0
  754. package/lib/module/init.js.map +1 -0
  755. package/lib/module/mock-builders/api/error.js +1 -1
  756. package/lib/module/mock-builders/api/queryChannels.js +1 -1
  757. package/lib/module/mock-builders/api/queryChannels.js.map +1 -1
  758. package/lib/module/mock-builders/api/sendMessage.js +4 -1
  759. package/lib/module/mock-builders/api/sendMessage.js.map +1 -1
  760. package/lib/module/mock-builders/generator/attachment.js +1 -3
  761. package/lib/module/mock-builders/generator/attachment.js.map +1 -1
  762. package/lib/module/mock-builders/generator/channel.js +101 -50
  763. package/lib/module/mock-builders/generator/channel.js.map +1 -1
  764. package/lib/module/mock-builders/generator/user.js +32 -33
  765. package/lib/module/mock-builders/generator/user.js.map +1 -1
  766. package/lib/module/mock-builders/mock.js +3 -3
  767. package/lib/module/mock-builders/mock.js.map +1 -1
  768. package/lib/module/mock-builders/native/react-native-mock.js +1 -1
  769. package/lib/module/mock-builders/native/react-native-mock.js.map +1 -1
  770. package/lib/module/native.js +1 -7
  771. package/lib/module/native.js.map +1 -1
  772. package/lib/module/utils/Streami18n.js.map +1 -1
  773. package/lib/module/utils/date.js +13 -0
  774. package/lib/module/utils/date.js.map +1 -0
  775. package/lib/module/utils/getResizedImageUrl.js +37 -0
  776. package/lib/module/utils/getResizedImageUrl.js.map +1 -0
  777. package/lib/module/utils/getUrlOfImageAttachment.js +9 -0
  778. package/lib/module/utils/getUrlOfImageAttachment.js.map +1 -0
  779. package/lib/module/utils/utils.js +39 -19
  780. package/lib/module/utils/utils.js.map +1 -1
  781. package/lib/module/version.json +1 -1
  782. package/lib/typescript/components/Attachment/Attachment.d.ts +6 -6
  783. package/lib/typescript/components/Attachment/AttachmentActions.d.ts +5 -5
  784. package/lib/typescript/components/Attachment/Card.d.ts +7 -5
  785. package/lib/typescript/components/Attachment/FileAttachment.d.ts +6 -6
  786. package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts +4 -4
  787. package/lib/typescript/components/Attachment/Gallery.d.ts +19 -6
  788. package/lib/typescript/components/Attachment/Giphy.d.ts +7 -7
  789. package/lib/typescript/components/Attachment/utils/buildGallery/buildGallery.d.ts +23 -0
  790. package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.d.ts +7 -0
  791. package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.d.ts +7 -0
  792. package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.d.ts +7 -0
  793. package/lib/typescript/components/Attachment/utils/buildGallery/buildThumbnail.d.ts +10 -0
  794. package/lib/typescript/components/Attachment/utils/buildGallery/buildThumbnailGrid.d.ts +137 -0
  795. package/lib/typescript/components/Attachment/utils/buildGallery/types.d.ts +23 -0
  796. package/lib/typescript/components/Attachment/utils/getAspectRatio.d.ts +9 -0
  797. package/lib/typescript/components/Attachment/utils/getGalleryImageBorderRadius.d.ts +22 -0
  798. package/lib/typescript/components/AutoCompleteInput/AutoCompleteInput.d.ts +10 -4
  799. package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.d.ts +5 -0
  800. package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionHeader.d.ts +8 -0
  801. package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionItem.d.ts +10 -0
  802. package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts +21 -0
  803. package/lib/typescript/components/Avatar/Avatar.d.ts +1 -1
  804. package/lib/typescript/components/Channel/Channel.d.ts +13 -16
  805. package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +2 -2
  806. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +3 -70
  807. package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +3 -126
  808. package/lib/typescript/components/Channel/hooks/useCreateOwnCapabilitiesContext.d.ts +7 -0
  809. package/lib/typescript/components/Channel/hooks/useCreatePaginatedMessageListContext.d.ts +3 -3
  810. package/lib/typescript/components/Channel/hooks/useCreateThreadContext.d.ts +2 -2
  811. package/lib/typescript/components/Channel/hooks/useCreateTypingContext.d.ts +2 -2
  812. package/lib/typescript/components/ChannelList/ChannelList.d.ts +15 -15
  813. package/lib/typescript/components/ChannelList/ChannelListMessenger.d.ts +4 -4
  814. package/lib/typescript/components/ChannelList/hooks/listeners/useAddedToChannelNotification.d.ts +5 -5
  815. package/lib/typescript/components/ChannelList/hooks/listeners/useChannelDeleted.d.ts +5 -5
  816. package/lib/typescript/components/ChannelList/hooks/listeners/useChannelHidden.d.ts +5 -5
  817. package/lib/typescript/components/ChannelList/hooks/listeners/useChannelTruncated.d.ts +5 -5
  818. package/lib/typescript/components/ChannelList/hooks/listeners/useChannelUpdated.d.ts +5 -5
  819. package/lib/typescript/components/ChannelList/hooks/listeners/useChannelVisible.d.ts +5 -5
  820. package/lib/typescript/components/ChannelList/hooks/listeners/useConnectionRecovered.d.ts +2 -2
  821. package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessage.d.ts +4 -4
  822. package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessageNotification.d.ts +5 -5
  823. package/lib/typescript/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.d.ts +5 -5
  824. package/lib/typescript/components/ChannelList/hooks/listeners/useUserPresence.d.ts +4 -4
  825. package/lib/typescript/components/ChannelList/hooks/useCreateChannelsContext.d.ts +2 -2
  826. package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +11 -9
  827. package/lib/typescript/components/ChannelList/utils.d.ts +7 -7
  828. package/lib/typescript/components/ChannelPreview/ChannelAvatar.d.ts +3 -3
  829. package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts +7 -7
  830. package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts +4 -5
  831. package/lib/typescript/components/ChannelPreview/ChannelPreviewMessenger.d.ts +6 -6
  832. package/lib/typescript/components/ChannelPreview/ChannelPreviewMutedStatus.d.ts +9 -0
  833. package/lib/typescript/components/ChannelPreview/ChannelPreviewStatus.d.ts +3 -3
  834. package/lib/typescript/components/ChannelPreview/ChannelPreviewTitle.d.ts +3 -3
  835. package/lib/typescript/components/ChannelPreview/ChannelPreviewUnreadCount.d.ts +3 -3
  836. package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.d.ts +15 -3
  837. package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayName.d.ts +4 -4
  838. package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.d.ts +2 -2
  839. package/lib/typescript/components/ChannelPreview/hooks/useLatestMessagePreview.d.ts +5 -5
  840. package/lib/typescript/components/Chat/Chat.d.ts +3 -3
  841. package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +2 -2
  842. package/lib/typescript/components/Chat/hooks/useIsOnline.d.ts +2 -2
  843. package/lib/typescript/components/Chat/hooks/useMutedUsers.d.ts +2 -2
  844. package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +13 -11
  845. package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts +1 -1
  846. package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +10 -10
  847. package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts +10 -10
  848. package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +10 -11
  849. package/lib/typescript/components/ImageGallery/components/__tests__/ImageGalleryHeader.test.d.ts +1 -0
  850. package/lib/typescript/components/Indicators/LoadingErrorIndicator.d.ts +1 -1
  851. package/lib/typescript/components/KeyboardCompatibleView/KeyboardCompatibleView.d.ts +2 -1
  852. package/lib/typescript/components/Message/Message.d.ts +14 -13
  853. package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +5 -5
  854. package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts +4 -4
  855. package/lib/typescript/components/Message/MessageSimple/MessageDeleted.d.ts +6 -6
  856. package/lib/typescript/components/Message/MessageSimple/MessageFooter.d.ts +8 -8
  857. package/lib/typescript/components/Message/MessageSimple/MessagePinnedHeader.d.ts +8 -0
  858. package/lib/typescript/components/Message/MessageSimple/MessageReplies.d.ts +4 -4
  859. package/lib/typescript/components/Message/MessageSimple/MessageRepliesAvatars.d.ts +3 -3
  860. package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +4 -4
  861. package/lib/typescript/components/Message/MessageSimple/MessageStatus.d.ts +4 -4
  862. package/lib/typescript/components/Message/MessageSimple/MessageTextContainer.d.ts +7 -6
  863. package/lib/typescript/components/Message/MessageSimple/ReactionList.d.ts +5 -4
  864. package/lib/typescript/components/Message/MessageSimple/utils/parseLinks.d.ts +7 -0
  865. package/lib/typescript/components/Message/MessageSimple/utils/parseLinks.test.d.ts +1 -0
  866. package/lib/typescript/components/Message/MessageSimple/utils/renderText.d.ts +21 -6
  867. package/lib/typescript/components/Message/MessageSimple/utils/renderText.test.d.ts +1 -0
  868. package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts +2 -2
  869. package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +15 -0
  870. package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +26 -0
  871. package/lib/typescript/components/Message/utils/messageActions.d.ts +22 -21
  872. package/lib/typescript/components/Message/utils/removeReservedFields.d.ts +2 -2
  873. package/lib/typescript/components/MessageInput/AttachButton.d.ts +5 -5
  874. package/lib/typescript/components/MessageInput/CommandsButton.d.ts +5 -5
  875. package/lib/typescript/components/MessageInput/CooldownTimer.d.ts +10 -0
  876. package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +4 -4
  877. package/lib/typescript/components/MessageInput/ImageUploadPreview.d.ts +4 -4
  878. package/lib/typescript/components/MessageInput/InputButtons.d.ts +5 -5
  879. package/lib/typescript/components/MessageInput/MessageInput.d.ts +4 -4
  880. package/lib/typescript/components/MessageInput/MoreOptionsButton.d.ts +5 -5
  881. package/lib/typescript/components/MessageInput/SendButton.d.ts +4 -4
  882. package/lib/typescript/components/MessageInput/SendMessageDisallowedIndicator.d.ts +1 -0
  883. package/lib/typescript/components/MessageInput/ShowThreadMessageInChannelButton.d.ts +2 -2
  884. package/lib/typescript/components/MessageInput/hooks/useCooldown.d.ts +9 -0
  885. package/lib/typescript/components/MessageInput/hooks/useCountdown.d.ts +8 -0
  886. package/lib/typescript/components/MessageList/InlineLoadingMoreIndicator.d.ts +2 -2
  887. package/lib/typescript/components/MessageList/InlineLoadingMoreRecentIndicator.d.ts +2 -2
  888. package/lib/typescript/components/MessageList/InlineLoadingMoreThreadIndicator.d.ts +2 -2
  889. package/lib/typescript/components/MessageList/MessageList.d.ts +8 -7
  890. package/lib/typescript/components/MessageList/MessageSystem.d.ts +5 -5
  891. package/lib/typescript/components/MessageList/TypingIndicator.d.ts +2 -2
  892. package/lib/typescript/components/MessageList/TypingIndicatorContainer.d.ts +4 -4
  893. package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts +6 -5
  894. package/lib/typescript/components/MessageList/hooks/useTypingString.d.ts +2 -2
  895. package/lib/typescript/components/MessageList/utils/filterTypingUsers.d.ts +3 -3
  896. package/lib/typescript/components/MessageList/utils/getDateSeparators.d.ts +4 -4
  897. package/lib/typescript/components/MessageList/utils/getGroupStyles.d.ts +5 -5
  898. package/lib/typescript/components/MessageList/utils/getLastReceivedMessage.d.ts +2 -2
  899. package/lib/typescript/components/MessageList/utils/getReadStates.d.ts +8 -5
  900. package/lib/typescript/components/MessageOverlay/MessageActionList.d.ts +12 -0
  901. package/lib/typescript/components/MessageOverlay/MessageActionListItem.d.ts +21 -0
  902. package/lib/typescript/components/MessageOverlay/MessageOverlay.d.ts +6 -7
  903. package/lib/typescript/components/MessageOverlay/OverlayBackdrop.d.ts +6 -0
  904. package/lib/typescript/components/MessageOverlay/OverlayReactionList.d.ts +6 -7
  905. package/lib/typescript/components/MessageOverlay/OverlayReactions.d.ts +3 -1
  906. package/lib/typescript/components/MessageOverlay/OverlayReactionsAvatar.d.ts +7 -0
  907. package/lib/typescript/components/MessageOverlay/hooks/useMessageActionAnimation.d.ts +12 -0
  908. package/lib/typescript/components/Reply/Reply.d.ts +5 -5
  909. package/lib/typescript/components/Thread/Thread.d.ts +8 -8
  910. package/lib/typescript/components/Thread/components/ThreadFooterComponent.d.ts +2 -2
  911. package/lib/typescript/components/index.d.ts +13 -7
  912. package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +2 -2
  913. package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +39 -40
  914. package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +30 -22
  915. package/lib/typescript/contexts/channelsStateContext/ChannelsStateContext.d.ts +19 -19
  916. package/lib/typescript/contexts/channelsStateContext/useChannelState.d.ts +17 -17
  917. package/lib/typescript/contexts/chatContext/ChatContext.d.ts +11 -11
  918. package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts +8 -8
  919. package/lib/typescript/contexts/keyboardContext/KeyboardContext.d.ts +2 -2
  920. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +12 -16
  921. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +53 -42
  922. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +3 -3
  923. package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts +3 -3
  924. package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +31 -32
  925. package/lib/typescript/contexts/messageOverlayContext/hooks/useResettableState.d.ts +12 -0
  926. package/lib/typescript/contexts/messageOverlayContext/hooks/useResettableState.test.d.ts +1 -0
  927. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +77 -166
  928. package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +15 -8
  929. package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts +2 -2
  930. package/lib/typescript/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.d.ts +25 -0
  931. package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts +8 -8
  932. package/lib/typescript/contexts/suggestionsContext/SuggestionsContext.d.ts +29 -28
  933. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +48 -17
  934. package/lib/typescript/contexts/threadContext/ThreadContext.d.ts +10 -10
  935. package/lib/typescript/contexts/translationContext/TranslationContext.d.ts +2 -2
  936. package/lib/typescript/contexts/typingContext/TypingContext.d.ts +8 -8
  937. package/lib/typescript/contexts/utils/getDisplayName.d.ts +2 -2
  938. package/lib/typescript/hooks/useIsMountedRef.d.ts +20 -0
  939. package/lib/typescript/i18n/en.json +9 -3
  940. package/lib/typescript/i18n/fr.json +9 -3
  941. package/lib/typescript/i18n/hi.json +9 -3
  942. package/lib/typescript/i18n/it.json +9 -3
  943. package/lib/typescript/i18n/ja.json +9 -0
  944. package/lib/typescript/i18n/ko.json +9 -0
  945. package/lib/typescript/i18n/nl.json +9 -3
  946. package/lib/typescript/i18n/ru.json +9 -3
  947. package/lib/typescript/i18n/tr.json +10 -4
  948. package/lib/typescript/icons/{Left.d.ts → Pin.d.ts} +1 -1
  949. package/lib/typescript/icons/PinHeader.d.ts +3 -0
  950. package/lib/typescript/icons/{Right.d.ts → Unpin.d.ts} +1 -1
  951. package/lib/typescript/icons/UserAdmin.d.ts +3 -0
  952. package/lib/typescript/icons/index.d.ts +3 -2
  953. package/lib/typescript/init.d.ts +2 -0
  954. package/lib/typescript/native.d.ts +1 -9
  955. package/lib/typescript/types/types.d.ts +16 -13
  956. package/lib/typescript/utils/Streami18n.d.ts +15 -12
  957. package/lib/typescript/utils/date.d.ts +2 -0
  958. package/lib/typescript/utils/getResizedImageUrl.d.ts +20 -0
  959. package/lib/typescript/utils/getUrlOfImageAttachment.d.ts +7 -0
  960. package/lib/typescript/utils/utils.d.ts +36 -30
  961. package/package.json +15 -20
  962. package/src/components/Attachment/Attachment.tsx +20 -61
  963. package/src/components/Attachment/AttachmentActions.tsx +17 -57
  964. package/src/components/Attachment/Card.tsx +22 -52
  965. package/src/components/Attachment/FileAttachment.tsx +16 -51
  966. package/src/components/Attachment/FileAttachmentGroup.tsx +16 -57
  967. package/src/components/Attachment/FileIcon.tsx +2 -2
  968. package/src/components/Attachment/Gallery.tsx +209 -241
  969. package/src/components/Attachment/Giphy.tsx +84 -128
  970. package/src/components/Attachment/__tests__/Attachment.test.js +27 -19
  971. package/src/components/Attachment/__tests__/Gallery.test.js +233 -0
  972. package/src/components/Attachment/__tests__/buildGallery.test.js +131 -0
  973. package/src/components/Attachment/utils/buildGallery/buildGallery.ts +77 -0
  974. package/src/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.ts +91 -0
  975. package/src/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.ts +99 -0
  976. package/src/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.ts +66 -0
  977. package/src/components/Attachment/utils/buildGallery/buildThumbnail.ts +48 -0
  978. package/src/components/Attachment/utils/buildGallery/buildThumbnailGrid.ts +188 -0
  979. package/src/components/Attachment/utils/buildGallery/types.ts +27 -0
  980. package/src/components/Attachment/utils/getAspectRatio.ts +21 -0
  981. package/src/components/Attachment/utils/getGalleryImageBorderRadius.ts +71 -0
  982. package/src/components/AttachmentPicker/AttachmentPicker.tsx +4 -2
  983. package/src/components/AttachmentPicker/components/AttachmentSelectionBar.tsx +15 -3
  984. package/src/components/AutoCompleteInput/AutoCompleteInput.tsx +66 -96
  985. package/src/components/AutoCompleteInput/{CommandsItem.tsx → AutoCompleteSuggestionCommandIcon.tsx} +7 -59
  986. package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx +102 -0
  987. package/src/components/AutoCompleteInput/AutoCompleteSuggestionItem.tsx +149 -0
  988. package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +209 -0
  989. package/src/components/AutoCompleteInput/__tests__/AutoCompleteInput.test.js +10 -16
  990. package/src/components/Avatar/Avatar.tsx +8 -11
  991. package/src/components/Avatar/GroupAvatar.tsx +7 -21
  992. package/src/components/Avatar/__tests__/Avatar.test.js +2 -33
  993. package/src/components/Channel/Channel.tsx +495 -477
  994. package/src/components/Channel/__tests__/Channel.test.js +63 -100
  995. package/src/components/Channel/__tests__/ownCapabilities.test.js +376 -0
  996. package/src/components/Channel/hooks/useCreateChannelContext.ts +11 -25
  997. package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +54 -69
  998. package/src/components/Channel/hooks/useCreateMessagesContext.ts +17 -49
  999. package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +39 -0
  1000. package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts +16 -32
  1001. package/src/components/Channel/hooks/useCreateThreadContext.ts +4 -19
  1002. package/src/components/Channel/hooks/useCreateTypingContext.ts +4 -19
  1003. package/src/components/ChannelList/ChannelList.tsx +36 -58
  1004. package/src/components/ChannelList/ChannelListFooterLoadingIndicator.tsx +2 -3
  1005. package/src/components/ChannelList/ChannelListHeaderErrorIndicator.tsx +3 -7
  1006. package/src/components/ChannelList/ChannelListHeaderNetworkDownIndicator.tsx +5 -2
  1007. package/src/components/ChannelList/ChannelListLoadingIndicator.tsx +5 -1
  1008. package/src/components/ChannelList/ChannelListMessenger.tsx +22 -74
  1009. package/src/components/ChannelList/Skeleton.tsx +2 -1
  1010. package/src/components/ChannelList/__tests__/ChannelList.test.js +75 -16
  1011. package/src/components/ChannelList/__tests__/ChannelListMessenger.test.js +46 -14
  1012. package/src/components/ChannelList/hooks/listeners/useAddedToChannelNotification.ts +17 -39
  1013. package/src/components/ChannelList/hooks/listeners/useChannelDeleted.ts +15 -37
  1014. package/src/components/ChannelList/hooks/listeners/useChannelHidden.ts +15 -37
  1015. package/src/components/ChannelList/hooks/listeners/useChannelTruncated.ts +17 -39
  1016. package/src/components/ChannelList/hooks/listeners/useChannelUpdated.ts +15 -37
  1017. package/src/components/ChannelList/hooks/listeners/useChannelVisible.ts +17 -39
  1018. package/src/components/ChannelList/hooks/listeners/useConnectionRecovered.ts +8 -20
  1019. package/src/components/ChannelList/hooks/listeners/useNewMessage.ts +13 -36
  1020. package/src/components/ChannelList/hooks/listeners/useNewMessageNotification.ts +17 -39
  1021. package/src/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.ts +15 -37
  1022. package/src/components/ChannelList/hooks/listeners/useUserPresence.ts +11 -33
  1023. package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +5 -21
  1024. package/src/components/ChannelList/hooks/usePaginatedChannels.ts +95 -70
  1025. package/src/components/ChannelList/utils.ts +9 -42
  1026. package/src/components/ChannelPreview/ChannelAvatar.tsx +6 -29
  1027. package/src/components/ChannelPreview/ChannelPreview.tsx +21 -54
  1028. package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +14 -24
  1029. package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +39 -56
  1030. package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx +50 -0
  1031. package/src/components/ChannelPreview/ChannelPreviewStatus.tsx +10 -30
  1032. package/src/components/ChannelPreview/ChannelPreviewTitle.tsx +7 -28
  1033. package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx +7 -27
  1034. package/src/components/ChannelPreview/__tests__/ChannelPreview.test.js +16 -22
  1035. package/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +23 -14
  1036. package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.ts +15 -30
  1037. package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts +8 -30
  1038. package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts +9 -30
  1039. package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts +31 -81
  1040. package/src/components/Chat/Chat.tsx +19 -44
  1041. package/src/components/Chat/__tests__/Chat.test.js +12 -47
  1042. package/src/components/Chat/hooks/useCreateChatContext.ts +4 -19
  1043. package/src/components/Chat/hooks/useIsOnline.ts +45 -56
  1044. package/src/components/Chat/hooks/useMutedUsers.ts +5 -20
  1045. package/src/components/ImageGallery/ImageGallery.tsx +127 -133
  1046. package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +1 -2
  1047. package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +20 -15
  1048. package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +45 -25
  1049. package/src/components/ImageGallery/components/ImageGrid.tsx +46 -35
  1050. package/src/components/ImageGallery/components/ImageGridHandle.tsx +1 -0
  1051. package/src/components/ImageGallery/components/__tests__/ImageGalleryHeader.test.tsx +31 -0
  1052. package/src/components/Indicators/LoadingErrorIndicator.tsx +1 -1
  1053. package/src/components/Indicators/LoadingIndicator.tsx +1 -2
  1054. package/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx +9 -2
  1055. package/src/components/Message/Message.tsx +196 -688
  1056. package/src/components/Message/MessageSimple/MessageAvatar.tsx +14 -56
  1057. package/src/components/Message/MessageSimple/MessageContent.tsx +42 -87
  1058. package/src/components/Message/MessageSimple/MessageDeleted.tsx +24 -63
  1059. package/src/components/Message/MessageSimple/MessageFooter.tsx +60 -84
  1060. package/src/components/Message/MessageSimple/MessagePinnedHeader.tsx +109 -0
  1061. package/src/components/Message/MessageSimple/MessageReplies.tsx +19 -60
  1062. package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +7 -29
  1063. package/src/components/Message/MessageSimple/MessageSimple.tsx +64 -78
  1064. package/src/components/Message/MessageSimple/MessageStatus.tsx +35 -88
  1065. package/src/components/Message/MessageSimple/MessageTextContainer.tsx +24 -66
  1066. package/src/components/Message/MessageSimple/ReactionList.tsx +110 -163
  1067. package/src/components/Message/MessageSimple/__tests__/Message.test.js +24 -258
  1068. package/src/components/Message/MessageSimple/__tests__/MessageAvatar.test.js +9 -8
  1069. package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +63 -46
  1070. package/src/components/Message/MessageSimple/__tests__/MessagePinnedHeader.test.js +53 -0
  1071. package/src/components/Message/MessageSimple/__tests__/MessageReplies.test.js +13 -9
  1072. package/src/components/Message/MessageSimple/__tests__/MessageStatus.test.js +11 -47
  1073. package/src/components/Message/MessageSimple/__tests__/MessageTextContainer.test.js +2 -2
  1074. package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageAvatar.test.js.snap +35 -22
  1075. package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessagePinnedHeader.test.js.snap +80 -0
  1076. package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageReplies.test.js.snap +72 -46
  1077. package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageStatus.test.js.snap +77 -48
  1078. package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageTextContainer.test.js.snap +6 -18
  1079. package/src/components/Message/MessageSimple/utils/parseLinks.test.ts +100 -0
  1080. package/src/components/Message/MessageSimple/utils/parseLinks.ts +95 -0
  1081. package/src/components/Message/MessageSimple/utils/renderText.test.tsx +70 -0
  1082. package/src/components/Message/MessageSimple/utils/renderText.tsx +138 -63
  1083. package/src/components/Message/hooks/useCreateMessageContext.ts +5 -26
  1084. package/src/components/Message/hooks/useMessageActionHandlers.ts +157 -0
  1085. package/src/components/Message/hooks/useMessageActions.tsx +371 -0
  1086. package/src/components/Message/utils/messageActions.ts +53 -54
  1087. package/src/components/Message/utils/removeReservedFields.ts +3 -18
  1088. package/src/components/MessageInput/AttachButton.tsx +15 -57
  1089. package/src/components/MessageInput/CommandsButton.tsx +16 -58
  1090. package/src/components/MessageInput/CooldownTimer.tsx +67 -0
  1091. package/src/components/MessageInput/FileUploadPreview.tsx +86 -118
  1092. package/src/components/MessageInput/ImageUploadPreview.tsx +15 -58
  1093. package/src/components/MessageInput/InputButtons.tsx +17 -64
  1094. package/src/components/MessageInput/MessageInput.tsx +83 -97
  1095. package/src/components/MessageInput/MoreOptionsButton.tsx +14 -56
  1096. package/src/components/MessageInput/SendButton.tsx +14 -55
  1097. package/src/components/MessageInput/SendMessageDisallowedIndicator.tsx +47 -0
  1098. package/src/components/MessageInput/ShowThreadMessageInChannelButton.tsx +6 -21
  1099. package/src/components/MessageInput/__tests__/AttachButton.test.js +2 -2
  1100. package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +193 -97
  1101. package/src/components/MessageInput/__tests__/ImageUploadPreview.test.js +35 -35
  1102. package/src/components/MessageInput/__tests__/MessageInput.test.js +29 -17
  1103. package/src/components/MessageInput/__tests__/SendButton.test.js +2 -2
  1104. package/src/components/MessageInput/__tests__/UploadProgressIndicator.test.js +2 -2
  1105. package/src/components/MessageInput/__tests__/__snapshots__/AttachButton.test.js.snap +134 -52
  1106. package/src/components/MessageInput/__tests__/__snapshots__/FileUploadPreview.test.js.snap +3955 -1647
  1107. package/src/components/MessageInput/__tests__/__snapshots__/ImageUploadPreview.test.js.snap +1964 -1464
  1108. package/src/components/MessageInput/__tests__/__snapshots__/MessageInput.test.js.snap +633 -326
  1109. package/src/components/MessageInput/__tests__/__snapshots__/SendButton.test.js.snap +224 -124
  1110. package/src/components/MessageInput/__tests__/__snapshots__/UploadProgressIndicator.test.js.snap +85 -17
  1111. package/src/components/MessageInput/hooks/useCooldown.ts +48 -0
  1112. package/src/components/MessageInput/hooks/useCountdown.ts +48 -0
  1113. package/src/components/MessageList/DateHeader.tsx +2 -2
  1114. package/src/components/MessageList/InlineDateSeparator.tsx +5 -2
  1115. package/src/components/MessageList/InlineLoadingMoreIndicator.tsx +3 -18
  1116. package/src/components/MessageList/InlineLoadingMoreRecentIndicator.tsx +3 -18
  1117. package/src/components/MessageList/InlineLoadingMoreThreadIndicator.tsx +3 -18
  1118. package/src/components/MessageList/MessageList.tsx +198 -152
  1119. package/src/components/MessageList/MessageSystem.tsx +7 -28
  1120. package/src/components/MessageList/ScrollToBottomButton.tsx +6 -1
  1121. package/src/components/MessageList/TypingIndicator.tsx +4 -20
  1122. package/src/components/MessageList/TypingIndicatorContainer.tsx +14 -47
  1123. package/src/components/MessageList/__tests__/MessageList.test.js +231 -152
  1124. package/src/components/MessageList/__tests__/MessageSystem.test.js +3 -3
  1125. package/src/components/MessageList/__tests__/ScrollToBottomButton.test.js +13 -8
  1126. package/src/components/MessageList/__tests__/TypingIndicator.test.js +14 -97
  1127. package/src/components/MessageList/__tests__/__snapshots__/MessageSystem.test.js.snap +9 -4
  1128. package/src/components/MessageList/__tests__/__snapshots__/ScrollToBottomButton.test.js.snap +78 -32
  1129. package/src/components/MessageList/__tests__/__snapshots__/TypingIndicator.test.js.snap +60 -57
  1130. package/src/components/MessageList/hooks/useMessageList.ts +39 -62
  1131. package/src/components/MessageList/hooks/useTypingString.ts +6 -22
  1132. package/src/components/MessageList/utils/filterTypingUsers.ts +7 -28
  1133. package/src/components/MessageList/utils/getDateSeparators.ts +10 -30
  1134. package/src/components/MessageList/utils/getGroupStyles.ts +23 -44
  1135. package/src/components/MessageList/utils/getLastReceivedMessage.ts +9 -19
  1136. package/src/components/MessageList/utils/getReadStates.ts +5 -20
  1137. package/src/components/MessageOverlay/MessageActionList.tsx +170 -0
  1138. package/src/components/MessageOverlay/MessageActionListItem.tsx +124 -0
  1139. package/src/components/MessageOverlay/MessageOverlay.tsx +279 -310
  1140. package/src/components/MessageOverlay/OverlayBackdrop.tsx +18 -0
  1141. package/src/components/MessageOverlay/OverlayReactionList.tsx +24 -82
  1142. package/src/components/MessageOverlay/OverlayReactions.tsx +12 -8
  1143. package/src/components/MessageOverlay/OverlayReactionsAvatar.tsx +27 -0
  1144. package/src/components/MessageOverlay/hooks/useMessageActionAnimation.tsx +44 -0
  1145. package/src/components/Reply/Reply.tsx +44 -81
  1146. package/src/components/Thread/Thread.tsx +24 -58
  1147. package/src/components/Thread/__tests__/Thread.test.js +58 -77
  1148. package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +874 -1011
  1149. package/src/components/Thread/components/ThreadFooterComponent.tsx +13 -49
  1150. package/src/components/docs/ListProps.md +1 -1
  1151. package/src/components/docs/data.js +38 -37
  1152. package/src/components/index.ts +13 -7
  1153. package/src/contexts/activeChannelsRefContext/ActiveChannelsRefContext.tsx +1 -2
  1154. package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +10 -9
  1155. package/src/contexts/channelContext/ChannelContext.tsx +43 -79
  1156. package/src/contexts/channelsContext/ChannelsContext.tsx +37 -63
  1157. package/src/contexts/channelsStateContext/ChannelsStateContext.tsx +39 -117
  1158. package/src/contexts/channelsStateContext/useChannelState.ts +29 -61
  1159. package/src/contexts/chatContext/ChatContext.tsx +15 -51
  1160. package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +13 -56
  1161. package/src/contexts/keyboardContext/KeyboardContext.tsx +13 -8
  1162. package/src/contexts/messageContext/MessageContext.tsx +16 -57
  1163. package/src/contexts/messageInputContext/MessageInputContext.tsx +146 -157
  1164. package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +13 -26
  1165. package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +15 -34
  1166. package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +41 -97
  1167. package/src/contexts/messageOverlayContext/hooks/useResettableState.test.tsx +46 -0
  1168. package/src/contexts/messageOverlayContext/hooks/useResettableState.ts +22 -0
  1169. package/src/contexts/messagesContext/MessagesContext.tsx +96 -234
  1170. package/src/contexts/overlayContext/OverlayContext.tsx +35 -35
  1171. package/src/contexts/overlayContext/OverlayProvider.tsx +50 -62
  1172. package/src/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.tsx +38 -0
  1173. package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +14 -55
  1174. package/src/contexts/suggestionsContext/SuggestionsContext.tsx +59 -80
  1175. package/src/contexts/suggestionsContext/__tests__/Suggestions.test.js +4 -2
  1176. package/src/contexts/themeContext/ThemeContext.tsx +1 -0
  1177. package/src/contexts/themeContext/utils/theme.ts +94 -36
  1178. package/src/contexts/threadContext/ThreadContext.tsx +14 -48
  1179. package/src/contexts/translationContext/TranslationContext.tsx +15 -10
  1180. package/src/contexts/typingContext/TypingContext.tsx +12 -46
  1181. package/src/contexts/utils/getDisplayName.ts +3 -1
  1182. package/src/emoji-data/compiled.ts +1830 -9609
  1183. package/src/emoji-data/emojiNames.ts +0 -140
  1184. package/src/emoji-data/emojis.ts +0 -210
  1185. package/src/emoji-data/index.js +1 -1
  1186. package/src/hooks/useAppStateListener.ts +26 -12
  1187. package/src/hooks/useIsMountedRef.ts +36 -0
  1188. package/src/hooks/useStreami18n.ts +5 -3
  1189. package/src/i18n/en.json +9 -3
  1190. package/src/i18n/fr.json +9 -3
  1191. package/src/i18n/hi.json +9 -3
  1192. package/src/i18n/it.json +9 -3
  1193. package/src/i18n/ja.json +9 -0
  1194. package/src/i18n/ko.json +9 -0
  1195. package/src/i18n/nl.json +9 -3
  1196. package/src/i18n/ru.json +9 -3
  1197. package/src/i18n/tr.json +10 -4
  1198. package/src/icons/Pin.tsx +17 -0
  1199. package/src/icons/PinHeader.tsx +12 -0
  1200. package/src/icons/Unpin.tsx +12 -0
  1201. package/src/icons/UserAdmin.tsx +23 -0
  1202. package/src/icons/index.ts +3 -2
  1203. package/src/init.ts +5 -0
  1204. package/src/mock-builders/api/queryChannels.js +1 -1
  1205. package/src/mock-builders/api/sendMessage.js +3 -1
  1206. package/src/mock-builders/generator/attachment.js +0 -2
  1207. package/src/mock-builders/generator/channel.js +101 -46
  1208. package/src/mock-builders/generator/user.js +33 -26
  1209. package/src/mock-builders/mock.js +2 -2
  1210. package/src/mock-builders/native/react-native-mock.js +1 -1
  1211. package/src/native.ts +2 -13
  1212. package/src/types/types.ts +16 -18
  1213. package/src/utils/Streami18n.ts +6 -6
  1214. package/src/utils/__tests__/Streami18n.test.js +9 -45
  1215. package/src/utils/__tests__/getResizedImageUrl.test.js +57 -0
  1216. package/src/utils/__tests__/utils.test.js +19 -0
  1217. package/src/utils/date.ts +4 -0
  1218. package/src/utils/getResizedImageUrl.ts +59 -0
  1219. package/src/utils/getUrlOfImageAttachment.ts +10 -0
  1220. package/src/utils/utils.ts +97 -142
  1221. package/src/version.json +1 -1
  1222. package/lib/commonjs/components/AutoCompleteInput/CommandsHeader.js +0 -78
  1223. package/lib/commonjs/components/AutoCompleteInput/CommandsHeader.js.map +0 -1
  1224. package/lib/commonjs/components/AutoCompleteInput/CommandsItem.js.map +0 -1
  1225. package/lib/commonjs/components/AutoCompleteInput/EmojisHeader.js +0 -81
  1226. package/lib/commonjs/components/AutoCompleteInput/EmojisHeader.js.map +0 -1
  1227. package/lib/commonjs/components/AutoCompleteInput/EmojisItem.js +0 -75
  1228. package/lib/commonjs/components/AutoCompleteInput/EmojisItem.js.map +0 -1
  1229. package/lib/commonjs/components/AutoCompleteInput/MentionsItem.js +0 -125
  1230. package/lib/commonjs/components/AutoCompleteInput/MentionsItem.js.map +0 -1
  1231. package/lib/commonjs/components/AutoCompleteInput/SuggestionsList.js +0 -199
  1232. package/lib/commonjs/components/AutoCompleteInput/SuggestionsList.js.map +0 -1
  1233. package/lib/commonjs/components/Channel/utils/debounce.js +0 -20
  1234. package/lib/commonjs/components/Channel/utils/debounce.js.map +0 -1
  1235. package/lib/commonjs/components/Channel/utils/throttle.js +0 -20
  1236. package/lib/commonjs/components/Channel/utils/throttle.js.map +0 -1
  1237. package/lib/commonjs/components/MessageOverlay/MessageActions.js.map +0 -1
  1238. package/lib/commonjs/icons/Left.js +0 -38
  1239. package/lib/commonjs/icons/Left.js.map +0 -1
  1240. package/lib/commonjs/icons/Right.js +0 -38
  1241. package/lib/commonjs/icons/Right.js.map +0 -1
  1242. package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js +0 -100
  1243. package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js.map +0 -1
  1244. package/lib/commonjs/styleguideComponents/BottomSheet.js +0 -25
  1245. package/lib/commonjs/styleguideComponents/BottomSheet.js.map +0 -1
  1246. package/lib/commonjs/styleguideComponents/JsDoc.js +0 -87
  1247. package/lib/commonjs/styleguideComponents/JsDoc.js.map +0 -1
  1248. package/lib/commonjs/styleguideComponents/Markdown.js +0 -12
  1249. package/lib/commonjs/styleguideComponents/Markdown.js.map +0 -1
  1250. package/lib/commonjs/styleguideComponents/PathlineRenderer.js +0 -92
  1251. package/lib/commonjs/styleguideComponents/PathlineRenderer.js.map +0 -1
  1252. package/lib/commonjs/styleguideComponents/PropsRenderer.js +0 -267
  1253. package/lib/commonjs/styleguideComponents/PropsRenderer.js.map +0 -1
  1254. package/lib/commonjs/styleguideComponents/Reanimated.js +0 -2
  1255. package/lib/commonjs/styleguideComponents/Wrapper.js +0 -29
  1256. package/lib/commonjs/styleguideComponents/Wrapper.js.map +0 -1
  1257. package/lib/commonjs/styleguideComponents/register-react-native-web.js +0 -44
  1258. package/lib/commonjs/styleguideComponents/register-react-native-web.js.map +0 -1
  1259. package/lib/commonjs/styleguideComponents/resolveAssetSource.js +0 -11
  1260. package/lib/commonjs/styleguideComponents/resolveAssetSource.js.map +0 -1
  1261. package/lib/module/components/AutoCompleteInput/CommandsHeader.js +0 -78
  1262. package/lib/module/components/AutoCompleteInput/CommandsHeader.js.map +0 -1
  1263. package/lib/module/components/AutoCompleteInput/CommandsItem.js.map +0 -1
  1264. package/lib/module/components/AutoCompleteInput/EmojisHeader.js +0 -81
  1265. package/lib/module/components/AutoCompleteInput/EmojisHeader.js.map +0 -1
  1266. package/lib/module/components/AutoCompleteInput/EmojisItem.js +0 -75
  1267. package/lib/module/components/AutoCompleteInput/EmojisItem.js.map +0 -1
  1268. package/lib/module/components/AutoCompleteInput/MentionsItem.js +0 -125
  1269. package/lib/module/components/AutoCompleteInput/MentionsItem.js.map +0 -1
  1270. package/lib/module/components/AutoCompleteInput/SuggestionsList.js +0 -199
  1271. package/lib/module/components/AutoCompleteInput/SuggestionsList.js.map +0 -1
  1272. package/lib/module/components/Channel/utils/debounce.js +0 -20
  1273. package/lib/module/components/Channel/utils/debounce.js.map +0 -1
  1274. package/lib/module/components/Channel/utils/throttle.js +0 -20
  1275. package/lib/module/components/Channel/utils/throttle.js.map +0 -1
  1276. package/lib/module/components/MessageOverlay/MessageActions.js.map +0 -1
  1277. package/lib/module/icons/Left.js +0 -38
  1278. package/lib/module/icons/Left.js.map +0 -1
  1279. package/lib/module/icons/Right.js +0 -38
  1280. package/lib/module/icons/Right.js.map +0 -1
  1281. package/lib/module/styleguideComponents/ArgumentsRenderer.js +0 -100
  1282. package/lib/module/styleguideComponents/ArgumentsRenderer.js.map +0 -1
  1283. package/lib/module/styleguideComponents/BottomSheet.js +0 -25
  1284. package/lib/module/styleguideComponents/BottomSheet.js.map +0 -1
  1285. package/lib/module/styleguideComponents/JsDoc.js +0 -87
  1286. package/lib/module/styleguideComponents/JsDoc.js.map +0 -1
  1287. package/lib/module/styleguideComponents/Markdown.js +0 -12
  1288. package/lib/module/styleguideComponents/Markdown.js.map +0 -1
  1289. package/lib/module/styleguideComponents/PathlineRenderer.js +0 -92
  1290. package/lib/module/styleguideComponents/PathlineRenderer.js.map +0 -1
  1291. package/lib/module/styleguideComponents/PropsRenderer.js +0 -267
  1292. package/lib/module/styleguideComponents/PropsRenderer.js.map +0 -1
  1293. package/lib/module/styleguideComponents/Reanimated.js +0 -2
  1294. package/lib/module/styleguideComponents/Wrapper.js +0 -29
  1295. package/lib/module/styleguideComponents/Wrapper.js.map +0 -1
  1296. package/lib/module/styleguideComponents/register-react-native-web.js +0 -44
  1297. package/lib/module/styleguideComponents/register-react-native-web.js.map +0 -1
  1298. package/lib/module/styleguideComponents/resolveAssetSource.js +0 -11
  1299. package/lib/module/styleguideComponents/resolveAssetSource.js.map +0 -1
  1300. package/lib/typescript/components/AutoCompleteInput/CommandsHeader.d.ts +0 -2
  1301. package/lib/typescript/components/AutoCompleteInput/CommandsItem.d.ts +0 -15
  1302. package/lib/typescript/components/AutoCompleteInput/EmojisHeader.d.ts +0 -5
  1303. package/lib/typescript/components/AutoCompleteInput/EmojisItem.d.ts +0 -12
  1304. package/lib/typescript/components/AutoCompleteInput/MentionsItem.d.ts +0 -16
  1305. package/lib/typescript/components/AutoCompleteInput/SuggestionsList.d.ts +0 -13
  1306. package/lib/typescript/components/Channel/utils/debounce.d.ts +0 -2
  1307. package/lib/typescript/components/Channel/utils/throttle.d.ts +0 -2
  1308. package/lib/typescript/components/MessageOverlay/MessageActions.d.ts +0 -11
  1309. package/src/components/AutoCompleteInput/CommandsHeader.tsx +0 -43
  1310. package/src/components/AutoCompleteInput/EmojisHeader.tsx +0 -45
  1311. package/src/components/AutoCompleteInput/EmojisItem.tsx +0 -52
  1312. package/src/components/AutoCompleteInput/MentionsItem.tsx +0 -74
  1313. package/src/components/AutoCompleteInput/SuggestionsList.tsx +0 -138
  1314. package/src/components/AutoCompleteInput/__tests__/CommandsItem.test.js +0 -29
  1315. package/src/components/AutoCompleteInput/__tests__/MentionsItem.test.js +0 -62
  1316. package/src/components/Channel/utils/debounce.ts +0 -12
  1317. package/src/components/Channel/utils/throttle.ts +0 -12
  1318. package/src/components/MessageList/__tests__/__snapshots__/MessageList.test.js.snap +0 -983
  1319. package/src/components/MessageOverlay/MessageActions.tsx +0 -243
  1320. package/src/icons/Left.tsx +0 -12
  1321. package/src/icons/Right.tsx +0 -12
  1322. package/src/styleguideComponents/ArgumentsRenderer.tsx +0 -59
  1323. package/src/styleguideComponents/BottomSheet.tsx +0 -3
  1324. package/src/styleguideComponents/JsDoc.tsx +0 -43
  1325. package/src/styleguideComponents/Markdown.tsx +0 -1
  1326. package/src/styleguideComponents/PathlineRenderer.tsx +0 -44
  1327. package/src/styleguideComponents/PropsRenderer.tsx +0 -138
  1328. package/src/styleguideComponents/Reanimated.tsx +0 -0
  1329. package/src/styleguideComponents/Wrapper.tsx +0 -6
  1330. package/src/styleguideComponents/register-react-native-web.js +0 -13
  1331. package/src/styleguideComponents/resolveAssetSource.js +0 -2
package/README.md CHANGED
@@ -31,18 +31,6 @@
31
31
  - [Keep in mind](#-keep-in-mind)
32
32
  - [Contributing](#-contributing)
33
33
 
34
- ## 🔐 React Native Compatibility
35
-
36
- To use this library you need to ensure you match up with the correct version of React Native you are using.
37
-
38
- | `stream-chat-react-native` version | React Native Version | `stream-chat` Version |
39
- | ---------------------------------- | --------------------- | --------------------- |
40
- | `3.2.0` | `>= 0.60` | `>= 3.5.1` |
41
- | `3.0.0` | `>= 0.60` | `>= 3.0.0` |
42
- | `2.x.x` | `>= 0.60` | `< 3.0.0` |
43
- | `1.x.x` | `>= 0.59` | `< 3.0.0` |
44
- | `0.x.x` | `*` | `< 3.0.0` |
45
-
46
34
  ## 📖 React Native Chat Tutorial
47
35
 
48
36
  The best place to start is the [React Native Chat Tutorial](https://github.com/GetStream/stream-chat-react-native/wiki/Tutorial-v3.0). It teaches you how to use this SDK and also shows how to make frequently required changes.
@@ -58,7 +46,7 @@ This repo includes 4 example apps. One made with Expo, one Native JavaScript cod
58
46
 
59
47
  - [Expo example](./examples/ExpoMessaging)
60
48
  - [Native example](./examples/NativeMessaging)
61
- - [Typescript example](./examples/TypescriptMessaging)
49
+ - [Typescript example](./examples/TypeScriptMessaging)
62
50
  - [Fully featured messaging application](./examples/SampleApp)
63
51
 
64
52
  Besides, our team maintains a dedicated repository for fully-fledged sample applications and demos at [GetStream/react-native-samples](https://github.com/GetStream/react-native-samples). Please consider checking following sample applications:
@@ -13,12 +13,12 @@ var _AttachmentActions = require("../../components/Attachment/AttachmentActions"
13
13
 
14
14
  var _Card = require("../../components/Attachment/Card");
15
15
 
16
+ var _FileAttachment = require("../../components/Attachment/FileAttachment");
17
+
16
18
  var _Gallery = require("../../components/Attachment/Gallery");
17
19
 
18
20
  var _Giphy = require("../../components/Attachment/Giphy");
19
21
 
20
- var _FileAttachment = require("../../components/Attachment/FileAttachment");
21
-
22
22
  var _MessagesContext = require("../../contexts/messagesContext/MessagesContext");
23
23
 
24
24
  var _this = this,
@@ -42,7 +42,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
42
42
  __self: _this,
43
43
  __source: {
44
44
  fileName: _jsxFileName,
45
- lineNumber: 62,
45
+ lineNumber: 41,
46
46
  columnNumber: 12
47
47
  }
48
48
  });
@@ -53,7 +53,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
53
53
  __self: _this,
54
54
  __source: {
55
55
  fileName: _jsxFileName,
56
- lineNumber: 69,
56
+ lineNumber: 48,
57
57
  columnNumber: 12
58
58
  }
59
59
  }));
@@ -65,7 +65,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
65
65
  __self: _this,
66
66
  __source: {
67
67
  fileName: _jsxFileName,
68
- lineNumber: 75,
68
+ lineNumber: 54,
69
69
  columnNumber: 9
70
70
  }
71
71
  }), hasAttachmentActions && _react["default"].createElement(AttachmentActions, (0, _extends2["default"])({
@@ -74,7 +74,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
74
74
  __self: _this,
75
75
  __source: {
76
76
  fileName: _jsxFileName,
77
- lineNumber: 77,
77
+ lineNumber: 56,
78
78
  columnNumber: 11
79
79
  }
80
80
  })));
@@ -86,21 +86,22 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
86
86
  __self: _this,
87
87
  __source: {
88
88
  fileName: _jsxFileName,
89
- lineNumber: 84,
89
+ lineNumber: 63,
90
90
  columnNumber: 12
91
91
  }
92
92
  });
93
93
  }
94
94
 
95
- if (attachment.type === 'video' && attachment.asset_url && attachment.image_url) {
96
- return _react["default"].createElement(Card, (0, _extends2["default"])({}, attachment, {
95
+ if (attachment.type === 'video' && attachment.asset_url) {
96
+ return _react["default"].createElement(FileAttachment, {
97
+ attachment: attachment,
97
98
  __self: _this,
98
99
  __source: {
99
100
  fileName: _jsxFileName,
100
- lineNumber: 90,
101
+ lineNumber: 69,
101
102
  columnNumber: 7
102
103
  }
103
- }));
104
+ });
104
105
  }
105
106
 
106
107
  if (hasAttachmentActions) {
@@ -108,7 +109,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
108
109
  __self: _this,
109
110
  __source: {
110
111
  fileName: _jsxFileName,
111
- lineNumber: 97,
112
+ lineNumber: 76,
112
113
  columnNumber: 9
113
114
  }
114
115
  })), _react["default"].createElement(AttachmentActions, (0, _extends2["default"])({
@@ -117,7 +118,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
117
118
  __self: _this,
118
119
  __source: {
119
120
  fileName: _jsxFileName,
120
- lineNumber: 98,
121
+ lineNumber: 77,
121
122
  columnNumber: 9
122
123
  }
123
124
  })));
@@ -126,7 +127,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
126
127
  __self: _this,
127
128
  __source: {
128
129
  fileName: _jsxFileName,
129
- lineNumber: 102,
130
+ lineNumber: 81,
130
131
  columnNumber: 12
131
132
  }
132
133
  }));
@@ -182,7 +183,7 @@ var Attachment = function Attachment(props) {
182
183
  __self: _this,
183
184
  __source: {
184
185
  fileName: _jsxFileName,
185
- lineNumber: 196,
186
+ lineNumber: 155,
186
187
  columnNumber: 5
187
188
  }
188
189
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["Attachment.tsx"],"names":["AttachmentWithContext","props","attachment","AttachmentActions","Card","FileAttachment","Gallery","Giphy","UrlPreview","hasAttachmentActions","actions","length","type","title_link","og_scrape_url","image_url","thumb_url","id","asset_url","areEqual","prevProps","nextProps","prevAttachment","nextAttachment","attachmentEqual","MemoizedAttachment","React","memo","Attachment","PropAttachmentActions","PropCard","PropFileAttachment","PropGallery","PropGiphy","PropUrlPreview","ContextAttachmentActions","ContextCard","ContextFileAttachment","ContextGallery","ContextGiphy","ContextUrlPreview","AttachmentActionsDefault","CardDefault","FileAttachmentDefault","GalleryDefault","GiphyDefault"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;AAsCA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAwB,CAS5BC,KAT4B,EAUzB;AAAA;;AACH,MAAQC,UAAR,GAA4FD,KAA5F,CAAQC,UAAR;AAAA,MAAoBC,iBAApB,GAA4FF,KAA5F,CAAoBE,iBAApB;AAAA,MAAuCC,IAAvC,GAA4FH,KAA5F,CAAuCG,IAAvC;AAAA,MAA6CC,cAA7C,GAA4FJ,KAA5F,CAA6CI,cAA7C;AAAA,MAA6DC,OAA7D,GAA4FL,KAA5F,CAA6DK,OAA7D;AAAA,MAAsEC,KAAtE,GAA4FN,KAA5F,CAAsEM,KAAtE;AAAA,MAA6EC,UAA7E,G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,WALX,GAQI/B,KARJ,CAKEK,OALF;AAAA,MAMS2B,SANT,GAQIhC,KARJ,CAMEM,KANF;AAAA,MAOc2B,cAPd,GAQIjC,KARJ,CAOEO,UAPF;;AAUA,4BAOI,0CAPJ;AAAA,MACqB2B,wBADrB,uBACEhC,iBADF;AAAA,MAEQiC,WAFR,uBAEEhC,IAFF;AAAA,MAGkBiC,qBAHlB,uBAGEhC,cAHF;AAAA,MAIWiC,cAJX,uBAIEhC,OAJF;AAAA,MAKSiC,YALT,uBAKEhC,KALF;AAAA,MAMciC,iBANd,uBAMEhC,UANF;;AASA,MAAI,CAACN,UAAL,EAAiB;AACf,WAAO,IAAP;AACD;;AAED,MAAMC,iBAAiB,GACrB0B,qBAAqB,IAAIM,wBAAzB,IAAqDM,oCADvD;AAEA,MAAMrC,IAAI,GAAG0B,QAAQ,IAAIM,WAAZ,IAA2BM,UAAxC;AACA,MAAMrC,cAAc,GAAG0B,kBAAkB,IAAIM,qBAAtB,IAA+CM,8BAAtE;AACA,MAAMrC,OAAO,GAAG0B,WAAW,IAAIM,cAAf,IAAiCM,gBAAjD;AACA,MAAMrC,KAAK,GAAG0B,SAAS,IAAIM,YAAb,IAA6BM,YAA3C;AACA,MAAMrC,UAAU,GAAG0B,cAAc,IAAIM,iBAAlB,IAAuCE,UAA1D;AAEA,SACE,gCAAC,kBAAD;AAEIxC,IAAAA,UAAU,EAAVA,UAFJ;AAGIC,IAAAA,iBAAiB,EAAjBA,iBAHJ;AAIIC,IAAAA,IAAI,EAAJA,IAJJ;AAKIC,IAAAA,cAAc,EAAdA,cALJ;AAMIC,IAAAA,OAAO,EAAPA,OANJ;AAOIC,IAAAA,KAAK,EAALA,KAPJ;AAQIC,IAAAA,UAAU,EAAVA,UARJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IADF;AAaD,CAvDM","sourcesContent":["import React from 'react';\n\nimport { AttachmentActions as AttachmentActionsDefault } from '../../components/Attachment/AttachmentActions';\nimport { Card as CardDefault } from '../../components/Attachment/Card';\nimport { Gallery as GalleryDefault } from '../../components/Attachment/Gallery';\nimport { Giphy as GiphyDefault } from '../../components/Attachment/Giphy';\nimport { FileAttachment as FileAttachmentDefault } from '../../components/Attachment/FileAttachment';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\n\nimport type { Attachment as AttachmentType } from 'stream-chat';\n\nimport type {\n DefaultAttachmentType,\n DefaultChannelType,\n DefaultCommandType,\n DefaultEventType,\n DefaultMessageType,\n DefaultReactionType,\n DefaultUserType,\n UnknownType,\n} from '../../types/types';\n\nexport type ActionHandler = (name: string, value: string) => void;\n\nexport type AttachmentPropsWithContext<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = Pick<\n MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>,\n 'AttachmentActions' | 'Card' | 'FileAttachment' | 'Gallery' | 'Giphy' | 'UrlPreview'\n> & {\n /**\n * The attachment to render\n */\n attachment: AttachmentType<At>;\n};\n\nconst AttachmentWithContext = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n props: AttachmentPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>,\n) => {\n const { attachment, AttachmentActions, Card, FileAttachment, Gallery, Giphy, UrlPreview } = props;\n\n const hasAttachmentActions = !!attachment.actions?.length;\n\n if (attachment.type === 'giphy' || attachment.type === 'imgur') {\n return <Giphy attachment={attachment} />;\n }\n\n if (\n (attachment.title_link || attachment.og_scrape_url) &&\n (attachment.image_url || attachment.thumb_url)\n ) {\n return <UrlPreview {...attachment} />;\n }\n\n if (attachment.type === 'image') {\n return (\n <>\n <Gallery images={[attachment]} />\n {hasAttachmentActions && (\n <AttachmentActions key={`key-actions-${attachment.id}`} {...attachment} />\n )}\n </>\n );\n }\n\n if (attachment.type === 'file' || attachment.type === 'audio') {\n return <FileAttachment attachment={attachment} />;\n }\n\n if (attachment.type === 'video' && attachment.asset_url && attachment.image_url) {\n return (\n // TODO: Put in video component\n <Card {...attachment} />\n );\n }\n\n if (hasAttachmentActions) {\n return (\n <>\n <Card {...attachment} />\n <AttachmentActions key={`key-actions-${attachment.id}`} {...attachment} />\n </>\n );\n } else {\n return <Card {...attachment} />;\n }\n};\n\nconst areEqual = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n prevProps: AttachmentPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>,\n nextProps: AttachmentPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>,\n) => {\n const { attachment: prevAttachment } = prevProps;\n const { attachment: nextAttachment } = nextProps;\n\n const attachmentEqual =\n prevAttachment.actions?.length === nextAttachment.actions?.length &&\n prevAttachment.image_url === nextAttachment.image_url &&\n prevAttachment.thumb_url === nextAttachment.thumb_url;\n\n return attachmentEqual;\n};\n\nconst MemoizedAttachment = React.memo(\n AttachmentWithContext,\n areEqual,\n) as typeof AttachmentWithContext;\n\nexport type AttachmentProps<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = Partial<\n Pick<\n MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>,\n 'AttachmentActions' | 'Card' | 'FileAttachment' | 'Gallery' | 'Giphy' | 'UrlPreview'\n >\n> &\n Pick<AttachmentPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>, 'attachment'>;\n\n/**\n * Attachment - The message attachment\n */\nexport const Attachment = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n props: AttachmentProps<At, Ch, Co, Ev, Me, Re, Us>,\n) => {\n const {\n attachment,\n AttachmentActions: PropAttachmentActions,\n Card: PropCard,\n FileAttachment: PropFileAttachment,\n Gallery: PropGallery,\n Giphy: PropGiphy,\n UrlPreview: PropUrlPreview,\n } = props;\n\n const {\n AttachmentActions: ContextAttachmentActions,\n Card: ContextCard,\n FileAttachment: ContextFileAttachment,\n Gallery: ContextGallery,\n Giphy: ContextGiphy,\n UrlPreview: ContextUrlPreview,\n } = useMessagesContext<At, Ch, Co, Ev, Me, Re, Us>();\n\n if (!attachment) {\n return null;\n }\n\n const AttachmentActions =\n PropAttachmentActions || ContextAttachmentActions || AttachmentActionsDefault;\n const Card = PropCard || ContextCard || CardDefault;\n const FileAttachment = PropFileAttachment || ContextFileAttachment || FileAttachmentDefault;\n const Gallery = PropGallery || ContextGallery || GalleryDefault;\n const Giphy = PropGiphy || ContextGiphy || GiphyDefault;\n const UrlPreview = PropUrlPreview || ContextUrlPreview || CardDefault;\n\n return (\n <MemoizedAttachment\n {...{\n attachment,\n AttachmentActions,\n Card,\n FileAttachment,\n Gallery,\n Giphy,\n UrlPreview,\n }}\n />\n );\n};\n"]}
1
+ {"version":3,"sources":["Attachment.tsx"],"names":["AttachmentWithContext","props","attachment","AttachmentActions","Card","FileAttachment","Gallery","Giphy","UrlPreview","hasAttachmentActions","actions","length","type","title_link","og_scrape_url","image_url","thumb_url","id","asset_url","areEqual","prevProps","nextProps","prevAttachment","nextAttachment","attachmentEqual","MemoizedAttachment","React","memo","Attachment","PropAttachmentActions","PropCard","PropFileAttachment","PropGallery","PropGiphy","PropUrlPreview","ContextAttachmentActions","ContextCard","ContextFileAttachment","ContextGallery","ContextGiphy","ContextUrlPreview","AttachmentActionsDefault","CardDefault","FileAttachmentDefault","GalleryDefault","GiphyDefault"],"mappings":";;;;;;;;;AAAA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;AAqBA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAwB,CAG5BC,KAH4B,EAIzB;AAAA;;AACH,MAAQC,UAAR,GAA4FD,KAA5F,CAAQC,UAAR;AAAA,MAAoBC,iBAApB,GAA4FF,KAA5F,CAAoBE,iBAApB;AAAA,MAAuCC,IAAvC,GAA4FH,KAA5F,CAAuCG,IAAvC;AAAA,MAA6CC,cAA7C,GAA4FJ,KAA5F,CAA6CI,cAA7C;AAAA,MAA6DC,OAA7D,GAA4FL,KAA5F,CAA6DK,OAA7D;AAAA,MAAsEC,KAAtE,GAA4FN,KAA5F,CAAsEM,KAAtE;AAAA,MAA6EC,UAA7E,GAA4FP,KAA5F,CAA6EO,UAA7E;AAEA,MAAMC,oBAAoB,GAAG,CAAC,yBAACP,UAAU,CAACQ,OAAZ,aAAC,oBAAoBC,MAArB,CAA9B;;AAEA,MAAIT,UAAU,CAACU,IAAX,KAAoB,OAApB,IAA+BV,UAAU,CAACU,IAAX,KAAoB,OAAvD,EAAgE;AAC9D,WAAO,gCAAC,KAAD;AAAO,MAAA,UAAU,EAAEV,UAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAP;AACD;;AAED,MACE,CAACA,UAAU,CAACW,UAAX,IAAyBX,UAAU,CAACY,aAArC,MACCZ,UAAU,CAACa,SAAX,IAAwBb,UAAU,CAACc,SADpC,CADF,EAGE;AACA,WAAO,gCAAC,UAAD,gCAAgBd,UAAhB;AAAA;AAAA;AAAA;AAAA;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AAIM,WAAZ,IAA2BM,UAAxC;AACA,MAAMrC,cAAc,GAAG0B,kBAAkB,IAAIM,qBAAtB,IAA+CM,8BAAtE;AACA,MAAMrC,OAAO,GAAG0B,WAAW,IAAIM,cAAf,IAAiCM,gBAAjD;AACA,MAAMrC,KAAK,GAAG0B,SAAS,IAAIM,YAAb,IAA6BM,YAA3C;AACA,MAAMrC,UAAU,GAAG0B,cAAc,IAAIM,iBAAlB,IAAuCE,UAA1D;AAEA,SACE,gCAAC,kBAAD;AAEIxC,IAAAA,UAAU,EAAVA,UAFJ;AAGIC,IAAAA,iBAAiB,EAAjBA,iBAHJ;AAIIC,IAAAA,IAAI,EAAJA,IAJJ;AAKIC,IAAAA,cAAc,EAAdA,cALJ;AAMIC,IAAAA,OAAO,EAAPA,OANJ;AAOIC,IAAAA,KAAK,EAALA,KAPJ;AAQIC,IAAAA,UAAU,EAAVA,UARJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IADF;AAaD,CAjDM","sourcesContent":["import React from 'react';\n\nimport type { Attachment as AttachmentType } from 'stream-chat';\n\nimport { AttachmentActions as AttachmentActionsDefault } from '../../components/Attachment/AttachmentActions';\nimport { Card as CardDefault } from '../../components/Attachment/Card';\nimport { FileAttachment as FileAttachmentDefault } from '../../components/Attachment/FileAttachment';\nimport { Gallery as GalleryDefault } from '../../components/Attachment/Gallery';\nimport { Giphy as GiphyDefault } from '../../components/Attachment/Giphy';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nexport type ActionHandler = (name: string, value: string) => void;\n\nexport type AttachmentPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'AttachmentActions' | 'Card' | 'FileAttachment' | 'Gallery' | 'Giphy' | 'UrlPreview'\n> & {\n /**\n * The attachment to render\n */\n attachment: AttachmentType<StreamChatGenerics>;\n};\n\nconst AttachmentWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: AttachmentPropsWithContext<StreamChatGenerics>,\n) => {\n const { attachment, AttachmentActions, Card, FileAttachment, Gallery, Giphy, UrlPreview } = props;\n\n const hasAttachmentActions = !!attachment.actions?.length;\n\n if (attachment.type === 'giphy' || attachment.type === 'imgur') {\n return <Giphy attachment={attachment} />;\n }\n\n if (\n (attachment.title_link || attachment.og_scrape_url) &&\n (attachment.image_url || attachment.thumb_url)\n ) {\n return <UrlPreview {...attachment} />;\n }\n\n if (attachment.type === 'image') {\n return (\n <>\n <Gallery images={[attachment]} />\n {hasAttachmentActions && (\n <AttachmentActions key={`key-actions-${attachment.id}`} {...attachment} />\n )}\n </>\n );\n }\n\n if (attachment.type === 'file' || attachment.type === 'audio') {\n return <FileAttachment attachment={attachment} />;\n }\n\n if (attachment.type === 'video' && attachment.asset_url) {\n return (\n // TODO: Put in video component\n <FileAttachment attachment={attachment} />\n );\n }\n\n if (hasAttachmentActions) {\n return (\n <>\n <Card {...attachment} />\n <AttachmentActions key={`key-actions-${attachment.id}`} {...attachment} />\n </>\n );\n } else {\n return <Card {...attachment} />;\n }\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: AttachmentPropsWithContext<StreamChatGenerics>,\n nextProps: AttachmentPropsWithContext<StreamChatGenerics>,\n) => {\n const { attachment: prevAttachment } = prevProps;\n const { attachment: nextAttachment } = nextProps;\n\n const attachmentEqual =\n prevAttachment.actions?.length === nextAttachment.actions?.length &&\n prevAttachment.image_url === nextAttachment.image_url &&\n prevAttachment.thumb_url === nextAttachment.thumb_url;\n\n return attachmentEqual;\n};\n\nconst MemoizedAttachment = React.memo(\n AttachmentWithContext,\n areEqual,\n) as typeof AttachmentWithContext;\n\nexport type AttachmentProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'AttachmentActions' | 'Card' | 'FileAttachment' | 'Gallery' | 'Giphy' | 'UrlPreview'\n >\n> &\n Pick<AttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>;\n\n/**\n * Attachment - The message attachment\n */\nexport const Attachment = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: AttachmentProps<StreamChatGenerics>,\n) => {\n const {\n attachment,\n AttachmentActions: PropAttachmentActions,\n Card: PropCard,\n FileAttachment: PropFileAttachment,\n Gallery: PropGallery,\n Giphy: PropGiphy,\n UrlPreview: PropUrlPreview,\n } = props;\n\n const {\n AttachmentActions: ContextAttachmentActions,\n Card: ContextCard,\n FileAttachment: ContextFileAttachment,\n Gallery: ContextGallery,\n Giphy: ContextGiphy,\n UrlPreview: ContextUrlPreview,\n } = useMessagesContext<StreamChatGenerics>();\n\n if (!attachment) {\n return null;\n }\n\n const AttachmentActions =\n PropAttachmentActions || ContextAttachmentActions || AttachmentActionsDefault;\n const Card = PropCard || ContextCard || CardDefault;\n const FileAttachment = PropFileAttachment || ContextFileAttachment || FileAttachmentDefault;\n const Gallery = PropGallery || ContextGallery || GalleryDefault;\n const Giphy = PropGiphy || ContextGiphy || GiphyDefault;\n const UrlPreview = PropUrlPreview || ContextUrlPreview || CardDefault;\n\n return (\n <MemoizedAttachment\n {...{\n attachment,\n AttachmentActions,\n Card,\n FileAttachment,\n Gallery,\n Giphy,\n UrlPreview,\n }}\n />\n );\n};\n"]}
@@ -70,7 +70,7 @@ var AttachmentActionsWithContext = function AttachmentActionsWithContext(props)
70
70
  __self: _this,
71
71
  __source: {
72
72
  fileName: _jsxFileName,
73
- lineNumber: 95,
73
+ lineNumber: 74,
74
74
  columnNumber: 5
75
75
  }
76
76
  }, actions == null ? void 0 : actions.map(function (action, index) {
@@ -90,7 +90,7 @@ var AttachmentActionsWithContext = function AttachmentActionsWithContext(props)
90
90
  __self: _this,
91
91
  __source: {
92
92
  fileName: _jsxFileName,
93
- lineNumber: 100,
93
+ lineNumber: 79,
94
94
  columnNumber: 11
95
95
  }
96
96
  }, _react["default"].createElement(_reactNative.Text, {
@@ -100,7 +100,7 @@ var AttachmentActionsWithContext = function AttachmentActionsWithContext(props)
100
100
  __self: _this,
101
101
  __source: {
102
102
  fileName: _jsxFileName,
103
- lineNumber: 122,
103
+ lineNumber: 101,
104
104
  columnNumber: 13
105
105
  }
106
106
  }, action.text));
@@ -126,7 +126,7 @@ var AttachmentActions = function AttachmentActions(props) {
126
126
  __self: _this,
127
127
  __source: {
128
128
  fileName: _jsxFileName,
129
- lineNumber: 191,
129
+ lineNumber: 151,
130
130
  columnNumber: 10
131
131
  }
132
132
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["AttachmentActions.tsx"],"names":["styles","StyleSheet","create","actionButton","borderRadius","borderWidth","paddingHorizontal","paddingVertical","container","flexDirection","justifyContent","padding","AttachmentActionsWithContext","props","actions","handleAction","stylesProp","theme","colors","accent_blue","black","border","transparent","white","messageSimple","button","defaultBackgroundColor","defaultBorderColor","primaryBackgroundColor","primaryBorderColor","buttonStyle","buttonText","defaultColor","primaryColor","buttonTextStyle","map","action","index","primary","style","value","name","backgroundColor","borderColor","color","text","areEqual","prevProps","nextProps","prevActions","nextActions","actionsEqual","length","MemoizedAttachmentActions","React","memo","AttachmentActions","displayName"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAUA;;AAIA;;;;;;;;AAeA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,YAAY,EAAE;AACZC,IAAAA,YAAY,EAAE,EADF;AAEZC,IAAAA,WAAW,EAAE,CAFD;AAGZC,IAAAA,iBAAiB,EAAE,EAHP;AAIZC,IAAAA,eAAe,EAAE;AAJL,GADiB;AAO/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,aAAa,EAAE,KADN;AAETC,IAAAA,cAAc,EAAE,eAFP;AAGTC,IAA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OAAwBF,WAAxB,oBAAwBA,WAAW,CAAEE,MAArC,CAArB;AAEA,SAAOD,YAAP;AACD,CAlBD;;AAoBA,IAAME,yBAAyB,GAAGC,kBAAMC,IAAN,CAChC3C,4BADgC,EAEhCkC,QAFgC,CAAlC;;AAmBO,IAAMU,iBAAiB,GAAG,SAApBA,iBAAoB,CAS/B3C,KAT+B,EAU5B;AACH,2BAAyB,wCAAzB;AAAA,MAAQE,YAAR,sBAAQA,YAAR;;AACA,SAAO,gCAAC,yBAAD;AAAiCA,IAAAA,YAAY,EAAZA;AAAjC,KAAqDF,KAArD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAAP;AACD,CAbM;;;AAeP2C,iBAAiB,CAACC,WAAlB,GAAgC,2CAAhC","sourcesContent":["import React from 'react';\nimport {\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\n\nimport type { Attachment } from 'stream-chat';\n\nimport type {\n DefaultAttachmentType,\n DefaultChannelType,\n DefaultCommandType,\n DefaultEventType,\n DefaultMessageType,\n DefaultReactionType,\n DefaultUserType,\n UnknownType,\n} from '../../types/types';\n\nconst styles = StyleSheet.create({\n actionButton: {\n borderRadius: 20,\n borderWidth: 1,\n paddingHorizontal: 10,\n paddingVertical: 5,\n },\n container: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 5,\n },\n});\n\nexport type AttachmentActionsPropsWithContext<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = Pick<Attachment<At>, 'actions'> &\n Pick<MessageContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'handleAction'> & {\n styles?: Partial<{\n actionButton: StyleProp<ViewStyle>;\n buttonText: StyleProp<TextStyle>;\n container: StyleProp<ViewStyle>;\n }>;\n };\n\nconst AttachmentActionsWithContext = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n props: AttachmentActionsPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>,\n) => {\n const { actions, handleAction, styles: stylesProp = {} } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, border, transparent, white },\n messageSimple: {\n actions: {\n button: {\n defaultBackgroundColor,\n defaultBorderColor,\n primaryBackgroundColor,\n primaryBorderColor,\n ...buttonStyle\n },\n buttonText: { defaultColor, primaryColor, ...buttonTextStyle },\n container,\n },\n },\n },\n } = useTheme();\n\n return (\n <View style={[styles.container, container, stylesProp.container]} testID='attachment-actions'>\n {actions?.map((action, index) => {\n const primary = action.style === 'primary';\n\n return (\n <TouchableOpacity\n key={`${index}-${action.value}`}\n onPress={() => {\n if (action.name && action.value && handleAction) {\n handleAction(action.name, action.value);\n }\n }}\n style={[\n styles.actionButton,\n {\n backgroundColor: primary\n ? primaryBackgroundColor || accent_blue\n : defaultBackgroundColor || white,\n borderColor: primary\n ? primaryBorderColor || border\n : defaultBorderColor || transparent,\n },\n buttonStyle,\n stylesProp.actionButton,\n ]}\n testID={`attachment-actions-button-${action.name}`}\n >\n <Text\n style={[\n {\n color: primary ? primaryColor || white : defaultColor || black,\n },\n buttonTextStyle,\n stylesProp.buttonText,\n ]}\n >\n {action.text}\n </Text>\n </TouchableOpacity>\n );\n })}\n </View>\n );\n};\n\nconst areEqual = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n prevProps: AttachmentActionsPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>,\n nextProps: AttachmentActionsPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>,\n) => {\n const { actions: prevActions } = prevProps;\n const { actions: nextActions } = nextProps;\n\n const actionsEqual = prevActions?.length === nextActions?.length;\n\n return actionsEqual;\n};\n\nconst MemoizedAttachmentActions = React.memo(\n AttachmentActionsWithContext,\n areEqual,\n) as typeof AttachmentActionsWithContext;\n\nexport type AttachmentActionsProps<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = Attachment<At> & Partial<Pick<MessageContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'handleAction'>>;\n\n/**\n * AttachmentActions - The actions you can take on an attachment.\n * Actions in combination with attachments can be used to build [commands](https://getstream.io/chat/docs/#channel_commands).\n */\nexport const AttachmentActions = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n props: AttachmentActionsProps<At, Ch, Co, Ev, Me, Re, Us>,\n) => {\n const { handleAction } = useMessageContext<At, Ch, Co, Ev, Me, Re, Us>();\n return <MemoizedAttachmentActions {...{ handleAction }} {...props} />;\n};\n\nAttachmentActions.displayName = 'AttachmentActions{messageSimple{actions}}';\n"]}
1
+ {"version":3,"sources":["AttachmentActions.tsx"],"names":["styles","StyleSheet","create","actionButton","borderRadius","borderWidth","paddingHorizontal","paddingVertical","container","flexDirection","justifyContent","padding","AttachmentActionsWithContext","props","actions","handleAction","stylesProp","theme","colors","accent_blue","black","border","transparent","white","messageSimple","button","defaultBackgroundColor","defaultBorderColor","primaryBackgroundColor","primaryBorderColor","buttonStyle","buttonText","defaultColor","primaryColor","buttonTextStyle","map","action","index","primary","style","value","name","backgroundColor","borderColor","color","text","areEqual","prevProps","nextProps","prevActions","nextActions","actionsEqual","length","MemoizedAttachmentActions","React","memo","AttachmentActions","displayName"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAYA;;AAIA;;;;;;;;AAIA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,YAAY,EAAE;AACZC,IAAAA,YAAY,EAAE,EADF;AAEZC,IAAAA,WAAW,EAAE,CAFD;AAGZC,IAAAA,iBAAiB,EAAE,EAHP;AAIZC,IAAAA,eAAe,EAAE;AAJL,GADiB;AAO/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,aAAa,EAAE,KADN;AAETC,IAAAA,cAAc,EAAE,eAFP;AAGTC,IAAAA,OAAO,EAAE;AAHA;AAPoB,CAAlB,CAAf;;AAyBA,IAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CAGnCC,KAHmC,EAIhC;AACH,MAAQC,OAAR,GAA2DD,KAA3D,CAAQC,OAAR;AAAA,MAAiBC,YAAjB,GAA2DF,KAA3D,CAAiBE,YAAjB;AAAA,sBAA2DF,KAA3D,CAA+Bb,MAA/B;AAAA,MAAuCgB,UAAvC,8BAAoD,EAApD;;AAEA,kBAiBI,6BAjBJ;AAAA,kCACEC,KADF;AAAA,8CAEIC,MAFJ;AAAA,MAEcC,WAFd,yBAEcA,WAFd;AAAA,MAE2BC,KAF3B,yBAE2BA,KAF3B;AAAA,MAEkCC,MAFlC,yBAEkCA,MAFlC;AAAA,MAE0CC,WAF1C,yBAE0CA,WAF1C;AAAA,MAEuDC,KAFvD,yBAEuDA,KAFvD;AAAA,8CAGIC,aAHJ,CAIMV,OAJN;AAAA,qDAKQW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PT;AAoBE,MAAA,MAAM,iCAA+BiC,MAAM,CAACK,IApB9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAsBE,gCAAC,iBAAD;AACE,MAAA,KAAK,EAAE,CACL;AACEG,QAAAA,KAAK,EAAEN,OAAO,GAAGL,YAAY,IAAIV,KAAnB,GAA2BS,YAAY,IAAIZ;AAD3D,OADK,EAILc,eAJK,EAKLlB,UAAU,CAACe,UALN,CADT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OASGK,MAAM,CAACS,IATV,CAtBF,CADF;AAoCD,GAvCA,CADH,CADF;AA4CD,CAtED;;AAwEA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CACfC,SADe,EAEfC,SAFe,EAGZ;AACH,MAAiBC,WAAjB,GAAiCF,SAAjC,CAAQjC,OAAR;AACA,MAAiBoC,WAAjB,GAAiCF,SAAjC,CAAQlC,OAAR;AAEA,MAAMqC,YAAY,GAAG,CAAAF,WAAW,QAAX,YAAAA,WAAW,CAAEG,MAAb,OAAwBF,WAAxB,oBAAwBA,WAAW,CAAEE,MAArC,CAArB;AAEA,SAAOD,YAAP;AACD,CAVD;;AAYA,IAAME,yBAAyB,GAAGC,kBAAMC,IAAN,CAChC3C,4BADgC,EAEhCkC,QAFgC,CAAlC;;AAcO,IAAMU,iBAAiB,GAAG,SAApBA,iBAAoB,CAG/B3C,KAH+B,EAI5B;AACH,2BAAyB,wCAAzB;AAAA,MAAQE,YAAR,sBAAQA,YAAR;;AACA,SAAO,gCAAC,yBAAD;AAAiCA,IAAAA,YAAY,EAAZA;AAAjC,KAAqDF,KAArD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAAP;AACD,CAPM;;;AASP2C,iBAAiB,CAACC,WAAlB,GAAgC,2CAAhC","sourcesContent":["import React from 'react';\nimport {\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n actionButton: {\n borderRadius: 20,\n borderWidth: 1,\n paddingHorizontal: 10,\n paddingVertical: 5,\n },\n container: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 5,\n },\n});\n\nexport type AttachmentActionsPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<Attachment<StreamChatGenerics>, 'actions'> &\n Pick<MessageContextValue<StreamChatGenerics>, 'handleAction'> & {\n styles?: Partial<{\n actionButton: StyleProp<ViewStyle>;\n buttonText: StyleProp<TextStyle>;\n container: StyleProp<ViewStyle>;\n }>;\n };\n\nconst AttachmentActionsWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: AttachmentActionsPropsWithContext<StreamChatGenerics>,\n) => {\n const { actions, handleAction, styles: stylesProp = {} } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, border, transparent, white },\n messageSimple: {\n actions: {\n button: {\n defaultBackgroundColor,\n defaultBorderColor,\n primaryBackgroundColor,\n primaryBorderColor,\n ...buttonStyle\n },\n buttonText: { defaultColor, primaryColor, ...buttonTextStyle },\n container,\n },\n },\n },\n } = useTheme();\n\n return (\n <View style={[styles.container, container, stylesProp.container]} testID='attachment-actions'>\n {actions?.map((action, index) => {\n const primary = action.style === 'primary';\n\n return (\n <TouchableOpacity\n key={`${index}-${action.value}`}\n onPress={() => {\n if (action.name && action.value && handleAction) {\n handleAction(action.name, action.value);\n }\n }}\n style={[\n styles.actionButton,\n {\n backgroundColor: primary\n ? primaryBackgroundColor || accent_blue\n : defaultBackgroundColor || white,\n borderColor: primary\n ? primaryBorderColor || border\n : defaultBorderColor || transparent,\n },\n buttonStyle,\n stylesProp.actionButton,\n ]}\n testID={`attachment-actions-button-${action.name}`}\n >\n <Text\n style={[\n {\n color: primary ? primaryColor || white : defaultColor || black,\n },\n buttonTextStyle,\n stylesProp.buttonText,\n ]}\n >\n {action.text}\n </Text>\n </TouchableOpacity>\n );\n })}\n </View>\n );\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: AttachmentActionsPropsWithContext<StreamChatGenerics>,\n nextProps: AttachmentActionsPropsWithContext<StreamChatGenerics>,\n) => {\n const { actions: prevActions } = prevProps;\n const { actions: nextActions } = nextProps;\n\n const actionsEqual = prevActions?.length === nextActions?.length;\n\n return actionsEqual;\n};\n\nconst MemoizedAttachmentActions = React.memo(\n AttachmentActionsWithContext,\n areEqual,\n) as typeof AttachmentActionsWithContext;\n\nexport type AttachmentActionsProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Partial<Pick<MessageContextValue<StreamChatGenerics>, 'handleAction'>>;\n\n/**\n * AttachmentActions - The actions you can take on an attachment.\n * Actions in combination with attachments can be used to build [commands](https://getstream.io/chat/docs/#channel_commands).\n */\nexport const AttachmentActions = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: AttachmentActionsProps<StreamChatGenerics>,\n) => {\n const { handleAction } = useMessageContext<StreamChatGenerics>();\n return <MemoizedAttachmentActions {...{ handleAction }} {...props} />;\n};\n\nAttachmentActions.displayName = 'AttachmentActions{messageSimple{actions}}';\n"]}
@@ -161,28 +161,28 @@ var CardWithContext = function CardWithContext(props) {
161
161
  __self: _this,
162
162
  __source: {
163
163
  fileName: _jsxFileName,
164
- lineNumber: 175,
164
+ lineNumber: 155,
165
165
  columnNumber: 5
166
166
  }
167
167
  }), CardHeader && _react["default"].createElement(CardHeader, (0, _extends2["default"])({}, props, {
168
168
  __self: _this,
169
169
  __source: {
170
170
  fileName: _jsxFileName,
171
- lineNumber: 207,
171
+ lineNumber: 187,
172
172
  columnNumber: 22
173
173
  }
174
174
  })), CardCover && _react["default"].createElement(CardCover, (0, _extends2["default"])({}, props, {
175
175
  __self: _this,
176
176
  __source: {
177
177
  fileName: _jsxFileName,
178
- lineNumber: 208,
178
+ lineNumber: 188,
179
179
  columnNumber: 21
180
180
  }
181
181
  })), uri && !CardCover && _react["default"].createElement(_reactNative.View, {
182
182
  __self: _this,
183
183
  __source: {
184
184
  fileName: _jsxFileName,
185
- lineNumber: 210,
185
+ lineNumber: 190,
186
186
  columnNumber: 9
187
187
  }
188
188
  }, _react["default"].createElement(_reactNative.Image, {
@@ -194,7 +194,7 @@ var CardWithContext = function CardWithContext(props) {
194
194
  __self: _this,
195
195
  __source: {
196
196
  fileName: _jsxFileName,
197
- lineNumber: 211,
197
+ lineNumber: 191,
198
198
  columnNumber: 11
199
199
  }
200
200
  }), author_name && _react["default"].createElement(_reactNative.View, {
@@ -202,7 +202,7 @@ var CardWithContext = function CardWithContext(props) {
202
202
  __self: _this,
203
203
  __source: {
204
204
  fileName: _jsxFileName,
205
- lineNumber: 217,
205
+ lineNumber: 197,
206
206
  columnNumber: 13
207
207
  }
208
208
  }, _react["default"].createElement(_reactNative.View, {
@@ -212,7 +212,7 @@ var CardWithContext = function CardWithContext(props) {
212
212
  __self: _this,
213
213
  __source: {
214
214
  fileName: _jsxFileName,
215
- lineNumber: 218,
215
+ lineNumber: 198,
216
216
  columnNumber: 15
217
217
  }
218
218
  }, _react["default"].createElement(_reactNative.Text, {
@@ -222,14 +222,14 @@ var CardWithContext = function CardWithContext(props) {
222
222
  __self: _this,
223
223
  __source: {
224
224
  fileName: _jsxFileName,
225
- lineNumber: 226,
225
+ lineNumber: 206,
226
226
  columnNumber: 17
227
227
  }
228
228
  }, author_name)))), CardFooter ? _react["default"].createElement(CardFooter, (0, _extends2["default"])({}, props, {
229
229
  __self: _this,
230
230
  __source: {
231
231
  fileName: _jsxFileName,
232
- lineNumber: 242,
232
+ lineNumber: 222,
233
233
  columnNumber: 9
234
234
  }
235
235
  })) : _react["default"].createElement(_reactNative.View, {
@@ -237,7 +237,7 @@ var CardWithContext = function CardWithContext(props) {
237
237
  __self: _this,
238
238
  __source: {
239
239
  fileName: _jsxFileName,
240
- lineNumber: 244,
240
+ lineNumber: 224,
241
241
  columnNumber: 9
242
242
  }
243
243
  }, _react["default"].createElement(_reactNative.View, {
@@ -249,7 +249,7 @@ var CardWithContext = function CardWithContext(props) {
249
249
  __self: _this,
250
250
  __source: {
251
251
  fileName: _jsxFileName,
252
- lineNumber: 245,
252
+ lineNumber: 225,
253
253
  columnNumber: 11
254
254
  }
255
255
  }, !uri && author_name && _react["default"].createElement(_reactNative.Text, {
@@ -259,7 +259,7 @@ var CardWithContext = function CardWithContext(props) {
259
259
  __self: _this,
260
260
  __source: {
261
261
  fileName: _jsxFileName,
262
- lineNumber: 254,
262
+ lineNumber: 234,
263
263
  columnNumber: 15
264
264
  }
265
265
  }, author_name), title && _react["default"].createElement(_reactNative.Text, {
@@ -270,7 +270,7 @@ var CardWithContext = function CardWithContext(props) {
270
270
  __self: _this,
271
271
  __source: {
272
272
  fileName: _jsxFileName,
273
- lineNumber: 266,
273
+ lineNumber: 246,
274
274
  columnNumber: 15
275
275
  }
276
276
  }, title), text && _react["default"].createElement(_reactNative.Text, {
@@ -281,7 +281,7 @@ var CardWithContext = function CardWithContext(props) {
281
281
  __self: _this,
282
282
  __source: {
283
283
  fileName: _jsxFileName,
284
- lineNumber: 274,
284
+ lineNumber: 254,
285
285
  columnNumber: 15
286
286
  }
287
287
  }, text))));
@@ -293,6 +293,7 @@ var MemoizedCard = _react["default"].memo(CardWithContext, function () {
293
293
 
294
294
  var Card = function Card(props) {
295
295
  var _useMessageContext = (0, _MessageContext.useMessageContext)(),
296
+ message = _useMessageContext.message,
296
297
  onLongPress = _useMessageContext.onLongPress,
297
298
  onPress = _useMessageContext.onPress,
298
299
  onPressIn = _useMessageContext.onPressIn,
@@ -309,6 +310,8 @@ var Card = function Card(props) {
309
310
  CardCover: CardCover,
310
311
  CardFooter: CardFooter,
311
312
  CardHeader: CardHeader,
313
+ channelId: message.cid,
314
+ messageId: message.id,
312
315
  onLongPress: onLongPress,
313
316
  onPress: onPress,
314
317
  onPressIn: onPressIn,
@@ -317,7 +320,7 @@ var Card = function Card(props) {
317
320
  __self: _this,
318
321
  __source: {
319
322
  fileName: _jsxFileName,
320
- lineNumber: 327,
323
+ lineNumber: 295,
321
324
  columnNumber: 5
322
325
  }
323
326
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["Card.tsx"],"names":["styles","StyleSheet","create","authorName","fontSize","fontWeight","authorNameContainer","borderTopRightRadius","paddingHorizontal","paddingTop","authorNameFooter","padding","authorNameMask","bottom","left","position","cardCover","borderRadius","height","marginHorizontal","cardFooter","flexDirection","justifyContent","container","overflow","width","description","title","goToURL","url","Linking","canOpenURL","then","supported","openURL","console","log","CardWithContext","props","additionalTouchableProps","author_name","CardCover","CardFooter","CardHeader","image_url","og_scrape_url","onLongPress","onPress","onPressIn","preventPress","stylesProp","text","thumb_url","theme","colors","accent_blue","black","blue_alice","transparent","messageSimple","card","authorNameFooterContainer","cover","footer","titleStyle","footerStyle","noURI","uri","defaultOnPress","event","emitter","defaultHandler","backgroundColor","color","borderLeftColor","MemoizedCard","React","memo","Card","displayName"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAaA;;AAIA;;AAIA;;AACA;;;;;;;AAeA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,QAAQ,EAAE,IAAZ;AAAkBC,IAAAA,UAAU,EAAE;AAA9B,GADmB;AAE/BC,EAAAA,mBAAmB,EAAE;AACnBC,IAAAA,oBAAoB,EAAE,EADH;AAEnBC,IAAAA,iBAAiB,EAAE,CAFA;AAGnBC,IAAAA,UAAU,EAAE;AAHO,GAFU;AAO/BC,EAAAA,gBAAgB,EAAE;AAChBN,IAAAA,QAAQ,EAA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yB,IAJH,CA7BJ,CADF,CArEJ,CADF;AAgHD,CApKD;;AAsKA,IAAMwB,YAAY,GAAGC,kBAAMC,IAAN,CAAWxC,eAAX,EAA4B;AAAA,SAAM,IAAN;AAAA,CAA5B,CAArB;;AAsBO,IAAMyC,IAAI,GAAG,SAAPA,IAAO,CASlBxC,KATkB,EAUf;AACH,2BACE,wCADF;AAAA,MAAQQ,WAAR,sBAAQA,WAAR;AAAA,MAAqBC,OAArB,sBAAqBA,OAArB;AAAA,MAA8BC,SAA9B,sBAA8BA,SAA9B;AAAA,MAAyCC,YAAzC,sBAAyCA,YAAzC;;AAEA,4BACE,0CADF;AAAA,MAAQV,wBAAR,uBAAQA,wBAAR;AAAA,MAAkCE,SAAlC,uBAAkCA,SAAlC;AAAA,MAA6CC,UAA7C,uBAA6CA,UAA7C;AAAA,MAAyDC,UAAzD,uBAAyDA,UAAzD;;AAGA,SACE,gCAAC,YAAD;AAEIJ,IAAAA,wBAAwB,EAAxBA,wBAFJ;AAGIE,IAAAA,SAAS,EAATA,SAHJ;AAIIC,IAAAA,UAAU,EAAVA,UAJJ;AAKIC,IAAAA,UAAU,EAAVA,UALJ;AAMIG,IAAAA,WAAW,EAAXA,WANJ;AAOIC,IAAAA,OAAO,EAAPA,OAPJ;AAQIC,IAAAA,SAAS,EAATA,SARJ;AASIC,IAAAA,YAAY,EAAZA;AATJ,KAWMX,KAXN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAeD,CA/BM;;;AAiCPwC,IAAI,CAACC,WAAL,GAAmB,2BAAnB","sourcesContent":["import React from 'react';\nimport {\n Image,\n ImageStyle,\n Linking,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { makeImageCompatibleUrl } from '../../utils/utils';\n\nimport type { Attachment } from 'stream-chat';\n\nimport type {\n DefaultAttachmentType,\n DefaultChannelType,\n DefaultCommandType,\n DefaultEventType,\n DefaultMessageType,\n DefaultReactionType,\n DefaultUserType,\n UnknownType,\n} from '../../types/types';\n\nconst styles = StyleSheet.create({\n authorName: { fontSize: 14.5, fontWeight: '600' },\n authorNameContainer: {\n borderTopRightRadius: 15,\n paddingHorizontal: 8,\n paddingTop: 8,\n },\n authorNameFooter: {\n fontSize: 14.5,\n fontWeight: '600',\n padding: 8,\n },\n authorNameMask: {\n bottom: 0,\n left: 8,\n position: 'absolute',\n },\n cardCover: {\n borderRadius: 8,\n height: 140,\n marginHorizontal: 8,\n },\n cardFooter: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n container: {\n overflow: 'hidden',\n width: 256,\n },\n description: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n title: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n});\n\nconst goToURL = (url?: string) => {\n if (!url) return;\n Linking.canOpenURL(url).then((supported) => {\n if (supported) {\n Linking.openURL(url);\n } else {\n console.log(`Don't know how to open URI: ${url}`);\n }\n });\n};\n\nexport type CardPropsWithContext<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = Attachment<At> &\n Pick<\n MessageContextValue<At, Ch, Co, Ev, Me, Re, Us>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'\n > &\n Pick<\n MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n > & {\n styles?: Partial<{\n authorName: StyleProp<TextStyle>;\n authorNameContainer: StyleProp<ViewStyle>;\n authorNameFooter: StyleProp<TextStyle>;\n authorNameFooterContainer: StyleProp<ViewStyle>;\n authorNameMask: StyleProp<ViewStyle>;\n cardCover: StyleProp<ImageStyle>;\n cardFooter: StyleProp<ViewStyle>;\n container: StyleProp<ViewStyle>;\n description: StyleProp<TextStyle>;\n title: StyleProp<TextStyle>;\n }>;\n };\n\nconst CardWithContext = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n props: CardPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>,\n) => {\n const {\n additionalTouchableProps,\n author_name,\n CardCover,\n CardFooter,\n CardHeader,\n image_url,\n og_scrape_url,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n styles: stylesProp = {},\n text,\n thumb_url,\n title,\n } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, blue_alice, transparent },\n messageSimple: {\n card: {\n authorName,\n authorNameContainer,\n authorNameFooter,\n authorNameFooterContainer,\n authorNameMask,\n container,\n cover,\n footer: { description, title: titleStyle, ...footerStyle },\n noURI,\n },\n },\n },\n } = useTheme();\n\n const uri = image_url || thumb_url;\n\n const defaultOnPress = () => goToURL(og_scrape_url || uri);\n\n return (\n <TouchableOpacity\n disabled={preventPress}\n onLongPress={(event) => {\n if (onLongPress) {\n onLongPress({\n emitter: 'card',\n event,\n });\n }\n }}\n onPress={(event) => {\n if (onPress) {\n onPress({\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n onPressIn={(event) => {\n if (onPressIn) {\n onPressIn({\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n style={[styles.container, container, stylesProp.container]}\n testID='card-attachment'\n {...additionalTouchableProps}\n >\n {CardHeader && <CardHeader {...props} />}\n {CardCover && <CardCover {...props} />}\n {uri && !CardCover && (\n <View>\n <Image\n resizeMode='cover'\n source={{ uri: makeImageCompatibleUrl(uri) }}\n style={[styles.cardCover, cover, stylesProp.cardCover]}\n />\n {author_name && (\n <View style={[styles.authorNameMask, authorNameMask, stylesProp.authorNameMask]}>\n <View\n style={[\n styles.authorNameContainer,\n { backgroundColor: blue_alice },\n authorNameContainer,\n stylesProp.authorNameContainer,\n ]}\n >\n <Text\n style={[\n styles.authorName,\n { color: accent_blue },\n authorName,\n stylesProp.authorName,\n ]}\n >\n {author_name}\n </Text>\n </View>\n </View>\n )}\n </View>\n )}\n {CardFooter ? (\n <CardFooter {...props} />\n ) : (\n <View style={[styles.cardFooter, footerStyle, stylesProp.cardFooter]}>\n <View\n style={[\n authorNameFooterContainer,\n { backgroundColor: transparent },\n !uri ? { borderLeftColor: accent_blue, ...noURI } : {},\n stylesProp.authorNameFooterContainer,\n ]}\n >\n {!uri && author_name && (\n <Text\n style={[\n styles.authorNameFooter,\n { color: accent_blue },\n authorNameFooter,\n stylesProp.authorNameFooter,\n ]}\n >\n {author_name}\n </Text>\n )}\n {title && (\n <Text\n numberOfLines={1}\n style={[styles.title, { color: black }, titleStyle, stylesProp.title]}\n >\n {title}\n </Text>\n )}\n {text && (\n <Text\n numberOfLines={3}\n style={[styles.description, { color: black }, description, stylesProp.description]}\n >\n {text}\n </Text>\n )}\n </View>\n </View>\n )}\n </TouchableOpacity>\n );\n};\n\nconst MemoizedCard = React.memo(CardWithContext, () => true) as typeof CardWithContext;\n\nexport type CardProps<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = Attachment<At> &\n Partial<\n Pick<MessageContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'onLongPress' | 'onPress' | 'onPressIn'> &\n Pick<\n MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n >\n >;\n\n/**\n * UI component for card in attachments.\n */\nexport const Card = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n props: CardProps<At, Ch, Co, Ev, Me, Re, Us>,\n) => {\n const { onLongPress, onPress, onPressIn, preventPress } =\n useMessageContext<At, Ch, Co, Ev, Me, Re, Us>();\n const { additionalTouchableProps, CardCover, CardFooter, CardHeader } =\n useMessagesContext<At, Ch, Co, Ev, Me, Re, Us>();\n\n return (\n <MemoizedCard\n {...{\n additionalTouchableProps,\n CardCover,\n CardFooter,\n CardHeader,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n }}\n {...props}\n />\n );\n};\n\nCard.displayName = 'Card{messageSimple{card}}';\n"]}
1
+ {"version":3,"sources":["Card.tsx"],"names":["styles","StyleSheet","create","authorName","fontSize","fontWeight","authorNameContainer","borderTopRightRadius","paddingHorizontal","paddingTop","authorNameFooter","padding","authorNameMask","bottom","left","position","cardCover","borderRadius","height","marginHorizontal","cardFooter","flexDirection","justifyContent","container","overflow","width","description","title","goToURL","url","Linking","canOpenURL","then","supported","openURL","console","log","CardWithContext","props","additionalTouchableProps","author_name","CardCover","CardFooter","CardHeader","image_url","og_scrape_url","onLongPress","onPress","onPressIn","preventPress","stylesProp","text","thumb_url","theme","colors","accent_blue","black","blue_alice","transparent","messageSimple","card","authorNameFooterContainer","cover","footer","titleStyle","footerStyle","noURI","uri","defaultOnPress","event","emitter","defaultHandler","backgroundColor","color","borderLeftColor","MemoizedCard","React","memo","Card","message","channelId","cid","messageId","id","displayName"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAeA;;AAIA;;AAIA;;AAEA;;;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AAXA,WARJ;AASIC,IAAAA,OAAO,EAAPA,OATJ;AAUIC,IAAAA,SAAS,EAATA,SAVJ;AAWIC,IAAAA,YAAY,EAAZA;AAXJ,KAaMX,KAbN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAiBD,CA3BM;;;AA6BPwC,IAAI,CAACM,WAAL,GAAmB,2BAAnB","sourcesContent":["import React from 'react';\nimport {\n Image,\n ImageStyle,\n Linking,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { makeImageCompatibleUrl } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n authorName: { fontSize: 14.5, fontWeight: '600' },\n authorNameContainer: {\n borderTopRightRadius: 15,\n paddingHorizontal: 8,\n paddingTop: 8,\n },\n authorNameFooter: {\n fontSize: 14.5,\n fontWeight: '600',\n padding: 8,\n },\n authorNameMask: {\n bottom: 0,\n left: 8,\n position: 'absolute',\n },\n cardCover: {\n borderRadius: 8,\n height: 140,\n marginHorizontal: 8,\n },\n cardFooter: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n container: {\n overflow: 'hidden',\n width: 256,\n },\n description: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n title: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n});\n\nconst goToURL = (url?: string) => {\n if (!url) return;\n Linking.canOpenURL(url).then((supported) => {\n if (supported) {\n Linking.openURL(url);\n } else {\n console.log(`Don't know how to open URI: ${url}`);\n }\n });\n};\n\nexport type CardPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Pick<\n MessageContextValue<StreamChatGenerics>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'\n > &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n > & {\n channelId: string | undefined;\n messageId: string | undefined;\n styles?: Partial<{\n authorName: StyleProp<TextStyle>;\n authorNameContainer: StyleProp<ViewStyle>;\n authorNameFooter: StyleProp<TextStyle>;\n authorNameFooterContainer: StyleProp<ViewStyle>;\n authorNameMask: StyleProp<ViewStyle>;\n cardCover: StyleProp<ImageStyle>;\n cardFooter: StyleProp<ViewStyle>;\n container: StyleProp<ViewStyle>;\n description: StyleProp<TextStyle>;\n title: StyleProp<TextStyle>;\n }>;\n };\n\nconst CardWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n additionalTouchableProps,\n author_name,\n CardCover,\n CardFooter,\n CardHeader,\n image_url,\n og_scrape_url,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n styles: stylesProp = {},\n text,\n thumb_url,\n title,\n } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, blue_alice, transparent },\n messageSimple: {\n card: {\n authorName,\n authorNameContainer,\n authorNameFooter,\n authorNameFooterContainer,\n authorNameMask,\n container,\n cover,\n footer: { description, title: titleStyle, ...footerStyle },\n noURI,\n },\n },\n },\n } = useTheme();\n\n const uri = image_url || thumb_url;\n\n const defaultOnPress = () => goToURL(og_scrape_url || uri);\n\n return (\n <TouchableOpacity\n disabled={preventPress}\n onLongPress={(event) => {\n if (onLongPress) {\n onLongPress({\n emitter: 'card',\n event,\n });\n }\n }}\n onPress={(event) => {\n if (onPress) {\n onPress({\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n onPressIn={(event) => {\n if (onPressIn) {\n onPressIn({\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n style={[styles.container, container, stylesProp.container]}\n testID='card-attachment'\n {...additionalTouchableProps}\n >\n {CardHeader && <CardHeader {...props} />}\n {CardCover && <CardCover {...props} />}\n {uri && !CardCover && (\n <View>\n <Image\n resizeMode='cover'\n source={{ uri: makeImageCompatibleUrl(uri) }}\n style={[styles.cardCover, cover, stylesProp.cardCover]}\n />\n {author_name && (\n <View style={[styles.authorNameMask, authorNameMask, stylesProp.authorNameMask]}>\n <View\n style={[\n styles.authorNameContainer,\n { backgroundColor: blue_alice },\n authorNameContainer,\n stylesProp.authorNameContainer,\n ]}\n >\n <Text\n style={[\n styles.authorName,\n { color: accent_blue },\n authorName,\n stylesProp.authorName,\n ]}\n >\n {author_name}\n </Text>\n </View>\n </View>\n )}\n </View>\n )}\n {CardFooter ? (\n <CardFooter {...props} />\n ) : (\n <View style={[styles.cardFooter, footerStyle, stylesProp.cardFooter]}>\n <View\n style={[\n authorNameFooterContainer,\n { backgroundColor: transparent },\n !uri ? { borderLeftColor: accent_blue, ...noURI } : {},\n stylesProp.authorNameFooterContainer,\n ]}\n >\n {!uri && author_name && (\n <Text\n style={[\n styles.authorNameFooter,\n { color: accent_blue },\n authorNameFooter,\n stylesProp.authorNameFooter,\n ]}\n >\n {author_name}\n </Text>\n )}\n {title && (\n <Text\n numberOfLines={1}\n style={[styles.title, { color: black }, titleStyle, stylesProp.title]}\n >\n {title}\n </Text>\n )}\n {text && (\n <Text\n numberOfLines={3}\n style={[styles.description, { color: black }, description, stylesProp.description]}\n >\n {text}\n </Text>\n )}\n </View>\n </View>\n )}\n </TouchableOpacity>\n );\n};\n\nconst MemoizedCard = React.memo(CardWithContext, () => true) as typeof CardWithContext;\n\nexport type CardProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Partial<\n Pick<MessageContextValue<StreamChatGenerics>, 'onLongPress' | 'onPress' | 'onPressIn'> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n >\n >;\n\n/**\n * UI component for card in attachments.\n */\nexport const Card = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardProps<StreamChatGenerics>,\n) => {\n const { message, onLongPress, onPress, onPressIn, preventPress } =\n useMessageContext<StreamChatGenerics>();\n const { additionalTouchableProps, CardCover, CardFooter, CardHeader } =\n useMessagesContext<StreamChatGenerics>();\n\n return (\n <MemoizedCard\n {...{\n additionalTouchableProps,\n CardCover,\n CardFooter,\n CardHeader,\n channelId: message.cid,\n messageId: message.id,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n }}\n {...props}\n />\n );\n};\n\nCard.displayName = 'Card{messageSimple{card}}';\n"]}
@@ -110,7 +110,7 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
110
110
  __self: _this,
111
111
  __source: {
112
112
  fileName: _jsxFileName,
113
- lineNumber: 122,
113
+ lineNumber: 100,
114
114
  columnNumber: 5
115
115
  }
116
116
  }), _react["default"].createElement(_reactNative.View, {
@@ -120,7 +120,7 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
120
120
  __self: _this,
121
121
  __source: {
122
122
  fileName: _jsxFileName,
123
- lineNumber: 153,
123
+ lineNumber: 131,
124
124
  columnNumber: 7
125
125
  }
126
126
  }, _react["default"].createElement(FileAttachmentIcon, {
@@ -129,7 +129,7 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
129
129
  __self: _this,
130
130
  __source: {
131
131
  fileName: _jsxFileName,
132
- lineNumber: 154,
132
+ lineNumber: 132,
133
133
  columnNumber: 9
134
134
  }
135
135
  }), _react["default"].createElement(_reactNative.View, {
@@ -137,7 +137,7 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
137
137
  __self: _this,
138
138
  __source: {
139
139
  fileName: _jsxFileName,
140
- lineNumber: 155,
140
+ lineNumber: 133,
141
141
  columnNumber: 9
142
142
  }
143
143
  }, _react["default"].createElement(_reactNative.Text, {
@@ -148,7 +148,7 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
148
148
  __self: _this,
149
149
  __source: {
150
150
  fileName: _jsxFileName,
151
- lineNumber: 156,
151
+ lineNumber: 134,
152
152
  columnNumber: 11
153
153
  }
154
154
  }, attachment.title), _react["default"].createElement(_reactNative.Text, {
@@ -158,14 +158,14 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
158
158
  __self: _this,
159
159
  __source: {
160
160
  fileName: _jsxFileName,
161
- lineNumber: 159,
161
+ lineNumber: 137,
162
162
  columnNumber: 11
163
163
  }
164
164
  }, getFileSizeDisplayText(attachment.file_size)))), (_attachment$actions = attachment.actions) != null && _attachment$actions.length ? _react["default"].createElement(AttachmentActions, (0, _extends2["default"])({}, attachment, {
165
165
  __self: _this,
166
166
  __source: {
167
167
  fileName: _jsxFileName,
168
- lineNumber: 164,
168
+ lineNumber: 142,
169
169
  columnNumber: 37
170
170
  }
171
171
  })) : null);
@@ -197,7 +197,7 @@ var FileAttachment = function FileAttachment(props) {
197
197
  __self: _this,
198
198
  __source: {
199
199
  fileName: _jsxFileName,
200
- lineNumber: 200,
200
+ lineNumber: 165,
201
201
  columnNumber: 5
202
202
  }
203
203
  }));