stream-chat-react 12.14.0 → 13.0.0-rc.1

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 (480) hide show
  1. package/dist/components/AIStateIndicator/AIStateIndicator.d.ts +4 -5
  2. package/dist/components/AIStateIndicator/hooks/useAIState.d.ts +2 -3
  3. package/dist/components/Attachment/Attachment.d.ts +8 -9
  4. package/dist/components/Attachment/Attachment.js +6 -5
  5. package/dist/components/Attachment/AttachmentActions.d.ts +2 -3
  6. package/dist/components/Attachment/AttachmentContainer.d.ts +15 -15
  7. package/dist/components/Attachment/AttachmentContainer.js +2 -2
  8. package/dist/components/Attachment/Audio.d.ts +3 -4
  9. package/dist/components/Attachment/Card.d.ts +1 -1
  10. package/dist/components/Attachment/FileAttachment.d.ts +3 -4
  11. package/dist/components/Attachment/FileAttachment.js +1 -1
  12. package/dist/components/Attachment/UnsupportedAttachment.d.ts +3 -4
  13. package/dist/components/Attachment/UnsupportedAttachment.js +1 -1
  14. package/dist/components/Attachment/VoiceRecording.d.ts +4 -5
  15. package/dist/components/Attachment/components/FileSizeIndicator.d.ts +1 -1
  16. package/dist/components/Attachment/components/FileSizeIndicator.js +4 -2
  17. package/dist/components/Attachment/utils.d.ts +8 -22
  18. package/dist/components/Attachment/utils.js +3 -18
  19. package/dist/components/Avatar/Avatar.d.ts +3 -4
  20. package/dist/components/Avatar/ChannelAvatar.d.ts +3 -4
  21. package/dist/components/Avatar/ChannelAvatar.js +1 -1
  22. package/dist/components/Avatar/GroupAvatar.d.ts +2 -2
  23. package/dist/components/Channel/Channel.d.ts +18 -37
  24. package/dist/components/Channel/Channel.js +25 -88
  25. package/dist/components/Channel/channelState.d.ts +17 -18
  26. package/dist/components/Channel/hooks/useChannelContainerClasses.d.ts +2 -3
  27. package/dist/components/Channel/hooks/useCreateChannelStateContext.d.ts +2 -3
  28. package/dist/components/Channel/hooks/useCreateChannelStateContext.js +1 -15
  29. package/dist/components/Channel/hooks/useCreateTypingContext.d.ts +1 -2
  30. package/dist/components/Channel/hooks/useEditMessageHandler.d.ts +3 -4
  31. package/dist/components/Channel/hooks/useMentionsHandlers.d.ts +3 -4
  32. package/dist/components/Channel/utils.d.ts +8 -6
  33. package/dist/components/Channel/utils.js +1 -0
  34. package/dist/components/ChannelHeader/ChannelHeader.d.ts +2 -3
  35. package/dist/components/ChannelList/ChannelList.d.ts +31 -30
  36. package/dist/components/ChannelList/ChannelList.js +8 -10
  37. package/dist/components/ChannelList/ChannelListMessenger.d.ts +6 -6
  38. package/dist/components/ChannelList/hooks/useChannelDeletedListener.d.ts +1 -2
  39. package/dist/components/ChannelList/hooks/useChannelHiddenListener.d.ts +1 -2
  40. package/dist/components/ChannelList/hooks/useChannelListShape.d.ts +44 -44
  41. package/dist/components/ChannelList/hooks/useChannelListShape.js +0 -2
  42. package/dist/components/ChannelList/hooks/useChannelMembershipState.d.ts +3 -3
  43. package/dist/components/ChannelList/hooks/useChannelTruncatedListener.d.ts +1 -2
  44. package/dist/components/ChannelList/hooks/useChannelUpdatedListener.d.ts +1 -2
  45. package/dist/components/ChannelList/hooks/useChannelVisibleListener.d.ts +1 -2
  46. package/dist/components/ChannelList/hooks/useConnectionRecoveredListener.d.ts +1 -2
  47. package/dist/components/ChannelList/hooks/useMessageNewListener.d.ts +1 -2
  48. package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts +1 -2
  49. package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts +1 -2
  50. package/dist/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts +1 -2
  51. package/dist/components/ChannelList/hooks/usePaginatedChannels.d.ts +7 -8
  52. package/dist/components/ChannelList/hooks/usePaginatedChannels.js +3 -3
  53. package/dist/components/ChannelList/hooks/useSelectedChannelState.d.ts +7 -7
  54. package/dist/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts +1 -2
  55. package/dist/components/ChannelList/utils.d.ts +20 -21
  56. package/dist/components/ChannelList/utils.js +2 -2
  57. package/dist/components/ChannelPreview/ChannelPreview.d.ts +15 -16
  58. package/dist/components/ChannelPreview/ChannelPreview.js +1 -1
  59. package/dist/components/ChannelPreview/ChannelPreviewActionButtons.d.ts +4 -4
  60. package/dist/components/ChannelPreview/ChannelPreviewMessenger.d.ts +1 -2
  61. package/dist/components/ChannelPreview/hooks/useChannelPreviewInfo.d.ts +3 -4
  62. package/dist/components/ChannelPreview/hooks/useIsChannelMuted.d.ts +1 -2
  63. package/dist/components/ChannelPreview/hooks/useMessageDeliveryStatus.d.ts +5 -7
  64. package/dist/components/ChannelPreview/icons.d.ts +1 -1
  65. package/dist/components/ChannelPreview/utils.d.ts +7 -7
  66. package/dist/components/ChannelSearch/ChannelSearch.d.ts +5 -6
  67. package/dist/components/ChannelSearch/ChannelSearch.js +2 -2
  68. package/dist/components/ChannelSearch/SearchBar.d.ts +1 -1
  69. package/dist/components/ChannelSearch/SearchBar.js +1 -1
  70. package/dist/components/ChannelSearch/SearchResults.d.ts +13 -14
  71. package/dist/components/ChannelSearch/SearchResults.js +1 -1
  72. package/dist/components/ChannelSearch/hooks/useChannelSearch.d.ts +17 -18
  73. package/dist/components/ChannelSearch/hooks/useChannelSearch.js +2 -6
  74. package/dist/components/ChannelSearch/utils.d.ts +2 -3
  75. package/dist/components/Chat/Chat.d.ts +9 -9
  76. package/dist/components/Chat/hooks/useChannelsQueryState.d.ts +1 -1
  77. package/dist/components/Chat/hooks/useChat.d.ts +10 -10
  78. package/dist/components/Chat/hooks/useChat.js +3 -3
  79. package/dist/components/Chat/hooks/useCreateChatClient.d.ts +4 -4
  80. package/dist/components/Chat/hooks/useCreateChatContext.d.ts +1 -2
  81. package/dist/components/Dialog/DialogAnchor.d.ts +4 -3
  82. package/dist/components/Dialog/DialogAnchor.js +2 -2
  83. package/dist/components/Dialog/DialogMenu.d.ts +2 -1
  84. package/dist/components/Dialog/DialogPortal.d.ts +2 -1
  85. package/dist/components/Dialog/FormDialog.d.ts +2 -1
  86. package/dist/components/Dialog/FormDialog.js +1 -1
  87. package/dist/components/Dialog/PromptDialog.d.ts +2 -1
  88. package/dist/components/DragAndDrop/DragAndDropContainer.d.ts +2 -1
  89. package/dist/components/EventComponent/EventComponent.d.ts +7 -6
  90. package/dist/components/Form/FieldError.d.ts +2 -1
  91. package/dist/components/Form/SwitchField.d.ts +2 -1
  92. package/dist/components/Form/SwitchField.js +1 -1
  93. package/dist/components/Gallery/Gallery.d.ts +5 -5
  94. package/dist/components/Gallery/Image.d.ts +6 -5
  95. package/dist/components/Gallery/ModalGallery.d.ts +3 -4
  96. package/dist/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +2 -1
  97. package/dist/components/InfiniteScrollPaginator/InfiniteScrollPaginator.d.ts +2 -1
  98. package/dist/components/LoadMore/LoadMoreButton.d.ts +2 -1
  99. package/dist/components/LoadMore/LoadMorePaginator.d.ts +3 -2
  100. package/dist/components/LoadMore/LoadMorePaginator.js +1 -1
  101. package/dist/components/MediaRecorder/AudioRecorder/AudioRecorder.js +3 -2
  102. package/dist/components/MediaRecorder/AudioRecorder/AudioRecordingInProgress.js +1 -1
  103. package/dist/components/MediaRecorder/RecordingPermissionDeniedNotification.d.ts +1 -1
  104. package/dist/components/MediaRecorder/classes/MediaRecorderController.d.ts +11 -23
  105. package/dist/components/MediaRecorder/hooks/useMediaRecorder.d.ts +8 -8
  106. package/dist/components/MediaRecorder/hooks/useMediaRecorder.js +6 -4
  107. package/dist/components/MediaRecorder/observable/BehaviorSubject.d.ts +2 -2
  108. package/dist/components/MediaRecorder/observable/Observable.d.ts +1 -1
  109. package/dist/components/MediaRecorder/observable/Subject.d.ts +3 -2
  110. package/dist/components/Message/FixedHeightMessage.d.ts +4 -5
  111. package/dist/components/Message/Message.d.ts +1 -2
  112. package/dist/components/Message/MessageDeleted.d.ts +4 -5
  113. package/dist/components/Message/MessageEditedTimestamp.d.ts +2 -3
  114. package/dist/components/Message/MessageErrorText.d.ts +4 -5
  115. package/dist/components/Message/MessageErrorText.js +2 -2
  116. package/dist/components/Message/MessageOptions.d.ts +3 -3
  117. package/dist/components/Message/MessageRepliesCountButton.d.ts +2 -1
  118. package/dist/components/Message/MessageSimple.d.ts +1 -2
  119. package/dist/components/Message/MessageSimple.js +8 -10
  120. package/dist/components/Message/MessageStatus.d.ts +3 -4
  121. package/dist/components/Message/MessageText.d.ts +6 -6
  122. package/dist/components/Message/MessageTimestamp.d.ts +4 -5
  123. package/dist/components/Message/QuotedMessage.d.ts +2 -3
  124. package/dist/components/Message/QuotedMessage.js +1 -1
  125. package/dist/components/Message/StreamedMessageText.d.ts +3 -4
  126. package/dist/components/Message/hooks/useActionHandler.d.ts +2 -3
  127. package/dist/components/Message/hooks/useActionHandler.js +1 -1
  128. package/dist/components/Message/hooks/useDeleteHandler.d.ts +4 -5
  129. package/dist/components/Message/hooks/useFlagHandler.d.ts +5 -6
  130. package/dist/components/Message/hooks/useMarkUnreadHandler.d.ts +5 -6
  131. package/dist/components/Message/hooks/useMentionsHandler.d.ts +6 -8
  132. package/dist/components/Message/hooks/useMessageTextStreaming.d.ts +2 -3
  133. package/dist/components/Message/hooks/useMuteHandler.d.ts +5 -7
  134. package/dist/components/Message/hooks/useMuteHandler.js +1 -1
  135. package/dist/components/Message/hooks/useOpenThreadHandler.d.ts +2 -3
  136. package/dist/components/Message/hooks/usePinHandler.d.ts +4 -5
  137. package/dist/components/Message/hooks/usePinHandler.js +1 -1
  138. package/dist/components/Message/hooks/useReactionHandler.d.ts +3 -4
  139. package/dist/components/Message/hooks/useReactionHandler.js +2 -4
  140. package/dist/components/Message/hooks/useReactionsFetcher.d.ts +5 -7
  141. package/dist/components/Message/hooks/useRetryHandler.d.ts +2 -3
  142. package/dist/components/Message/hooks/useRetryHandler.js +1 -1
  143. package/dist/components/Message/hooks/useUserHandler.d.ts +5 -6
  144. package/dist/components/Message/hooks/useUserRole.d.ts +2 -3
  145. package/dist/components/Message/hooks/useUserRole.js +1 -1
  146. package/dist/components/Message/icons.d.ts +2 -2
  147. package/dist/components/Message/icons.js +1 -1
  148. package/dist/components/Message/renderText/componentRenderers/Anchor.d.ts +2 -1
  149. package/dist/components/Message/renderText/componentRenderers/Emoji.d.ts +1 -1
  150. package/dist/components/Message/renderText/componentRenderers/Mention.d.ts +5 -5
  151. package/dist/components/Message/renderText/componentRenderers/Mention.js +1 -1
  152. package/dist/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.d.ts +1 -2
  153. package/dist/components/Message/renderText/renderText.d.ts +6 -6
  154. package/dist/components/Message/renderText/types.d.ts +1 -1
  155. package/dist/components/Message/types.d.ts +27 -28
  156. package/dist/components/Message/utils.d.ts +21 -22
  157. package/dist/components/Message/utils.js +5 -4
  158. package/dist/components/MessageActions/CustomMessageActionsList.d.ts +6 -7
  159. package/dist/components/MessageActions/MessageActions.d.ts +6 -5
  160. package/dist/components/MessageActions/MessageActions.js +1 -1
  161. package/dist/components/MessageActions/MessageActionsBox.d.ts +5 -5
  162. package/dist/components/MessageActions/MessageActionsBox.js +4 -3
  163. package/dist/components/MessageActions/hooks/useMessageActionsBoxPopper.d.ts +1 -1
  164. package/dist/components/MessageBounce/MessageBounceModal.d.ts +4 -3
  165. package/dist/components/MessageBounce/MessageBouncePrompt.d.ts +1 -2
  166. package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.d.ts +11 -11
  167. package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.js +17 -14
  168. package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.d.ts +4 -12
  169. package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.js +8 -5
  170. package/dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.d.ts +4 -5
  171. package/dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.js +2 -2
  172. package/dist/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.d.ts +7 -5
  173. package/dist/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.js +5 -2
  174. package/dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.d.ts +4 -5
  175. package/dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.js +5 -2
  176. package/dist/components/MessageInput/AttachmentPreviewList/index.d.ts +1 -1
  177. package/dist/components/MessageInput/AttachmentPreviewList/types.d.ts +3 -4
  178. package/dist/components/MessageInput/AttachmentSelector.d.ts +1 -2
  179. package/dist/components/MessageInput/AttachmentSelector.js +5 -3
  180. package/dist/components/MessageInput/EditMessageForm.d.ts +3 -2
  181. package/dist/components/MessageInput/EditMessageForm.js +30 -6
  182. package/dist/components/MessageInput/LinkPreviewList.d.ts +6 -4
  183. package/dist/components/MessageInput/LinkPreviewList.js +24 -10
  184. package/dist/components/MessageInput/MessageInput.d.ts +23 -45
  185. package/dist/components/MessageInput/MessageInput.js +25 -15
  186. package/dist/components/MessageInput/MessageInputFlat.d.ts +1 -2
  187. package/dist/components/MessageInput/MessageInputFlat.js +31 -76
  188. package/dist/components/MessageInput/QuotedMessagePreview.d.ts +4 -7
  189. package/dist/components/MessageInput/QuotedMessagePreview.js +22 -16
  190. package/dist/components/MessageInput/SendButton.d.ts +4 -5
  191. package/dist/components/MessageInput/SendButton.js +6 -2
  192. package/dist/components/MessageInput/WithDragAndDropUpload.d.ts +38 -0
  193. package/dist/components/MessageInput/WithDragAndDropUpload.js +96 -0
  194. package/dist/components/MessageInput/hooks/index.d.ts +5 -1
  195. package/dist/components/MessageInput/hooks/index.js +5 -1
  196. package/dist/components/MessageInput/hooks/useAttachmentManagerState.d.ts +10 -0
  197. package/dist/components/MessageInput/hooks/useAttachmentManagerState.js +19 -0
  198. package/dist/components/MessageInput/hooks/useCanCreatePoll.d.ts +1 -0
  199. package/dist/components/MessageInput/hooks/useCanCreatePoll.js +10 -0
  200. package/dist/components/MessageInput/hooks/useCooldownTimer.d.ts +2 -3
  201. package/dist/components/MessageInput/hooks/useCreateMessageInputContext.d.ts +1 -2
  202. package/dist/components/MessageInput/hooks/useCreateMessageInputContext.js +1 -55
  203. package/dist/components/MessageInput/hooks/useMessageComposer.d.ts +2 -0
  204. package/dist/components/MessageInput/hooks/useMessageComposer.js +80 -0
  205. package/dist/components/MessageInput/hooks/useMessageComposerHasSendableData.d.ts +1 -0
  206. package/dist/components/MessageInput/hooks/useMessageComposerHasSendableData.js +8 -0
  207. package/dist/components/MessageInput/hooks/useMessageInputControls.d.ts +12 -0
  208. package/dist/components/MessageInput/hooks/useMessageInputControls.js +23 -0
  209. package/dist/components/MessageInput/hooks/useMessageInputText.d.ts +1 -5
  210. package/dist/components/MessageInput/hooks/useMessageInputText.js +19 -53
  211. package/dist/components/MessageInput/hooks/usePasteHandler.d.ts +1 -3
  212. package/dist/components/MessageInput/hooks/usePasteHandler.js +6 -8
  213. package/dist/components/MessageInput/hooks/useSubmitHandler.d.ts +2 -6
  214. package/dist/components/MessageInput/hooks/useSubmitHandler.js +30 -98
  215. package/dist/components/MessageInput/hooks/utils.d.ts +0 -27
  216. package/dist/components/MessageInput/hooks/utils.js +0 -124
  217. package/dist/components/MessageInput/index.d.ts +1 -2
  218. package/dist/components/MessageInput/index.js +1 -2
  219. package/dist/components/MessageList/ConnectionStatus.d.ts +1 -2
  220. package/dist/components/MessageList/ConnectionStatus.js +1 -1
  221. package/dist/components/MessageList/CustomNotification.d.ts +2 -1
  222. package/dist/components/MessageList/GiphyPreviewMessage.d.ts +4 -5
  223. package/dist/components/MessageList/MessageList.d.ts +11 -12
  224. package/dist/components/MessageList/MessageList.js +4 -4
  225. package/dist/components/MessageList/MessageNotification.d.ts +2 -1
  226. package/dist/components/MessageList/VirtualizedMessageList.d.ts +22 -21
  227. package/dist/components/MessageList/VirtualizedMessageList.js +6 -6
  228. package/dist/components/MessageList/VirtualizedMessageListComponents.d.ts +10 -10
  229. package/dist/components/MessageList/VirtualizedMessageListComponents.js +7 -7
  230. package/dist/components/MessageList/hooks/MessageList/useEnrichedMessages.d.ts +8 -10
  231. package/dist/components/MessageList/hooks/MessageList/useEnrichedMessages.js +1 -1
  232. package/dist/components/MessageList/hooks/MessageList/useMessageListElements.d.ts +11 -12
  233. package/dist/components/MessageList/hooks/MessageList/useMessageListScrollManager.d.ts +4 -5
  234. package/dist/components/MessageList/hooks/MessageList/useScrollLocationLogic.d.ts +5 -6
  235. package/dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.d.ts +4 -5
  236. package/dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.js +3 -2
  237. package/dist/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.d.ts +4 -5
  238. package/dist/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.js +1 -1
  239. package/dist/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.d.ts +2 -3
  240. package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.d.ts +2 -3
  241. package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.js +6 -2
  242. package/dist/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.d.ts +4 -5
  243. package/dist/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.d.ts +2 -3
  244. package/dist/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.d.ts +3 -4
  245. package/dist/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.js +5 -6
  246. package/dist/components/MessageList/hooks/useLastReadData.d.ts +5 -6
  247. package/dist/components/MessageList/hooks/useLastReadData.js +5 -1
  248. package/dist/components/MessageList/hooks/useMarkRead.d.ts +1 -2
  249. package/dist/components/MessageList/renderMessages.d.ts +14 -14
  250. package/dist/components/MessageList/renderMessages.js +8 -7
  251. package/dist/components/MessageList/utils.d.ts +34 -28
  252. package/dist/components/MessageList/utils.js +26 -21
  253. package/dist/components/Modal/Modal.d.ts +2 -1
  254. package/dist/components/Poll/Poll.d.ts +2 -3
  255. package/dist/components/Poll/Poll.js +1 -1
  256. package/dist/components/Poll/PollActions/AddCommentForm.d.ts +1 -2
  257. package/dist/components/Poll/PollActions/AddCommentForm.js +4 -2
  258. package/dist/components/Poll/PollActions/EndPollDialog.d.ts +1 -2
  259. package/dist/components/Poll/PollActions/EndPollDialog.js +1 -1
  260. package/dist/components/Poll/PollActions/PollAction.d.ts +2 -1
  261. package/dist/components/Poll/PollActions/PollActions.d.ts +7 -8
  262. package/dist/components/Poll/PollActions/PollActions.js +5 -5
  263. package/dist/components/Poll/PollActions/PollAnswerList.d.ts +1 -2
  264. package/dist/components/Poll/PollActions/PollOptionsFullList.d.ts +1 -2
  265. package/dist/components/Poll/PollActions/PollOptionsFullList.js +4 -2
  266. package/dist/components/Poll/PollActions/PollResults/PollOptionVotesList.d.ts +3 -4
  267. package/dist/components/Poll/PollActions/PollResults/PollOptionVotesList.js +1 -1
  268. package/dist/components/Poll/PollActions/PollResults/PollOptionWithLatestVotes.d.ts +3 -4
  269. package/dist/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.d.ts +4 -5
  270. package/dist/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.js +1 -1
  271. package/dist/components/Poll/PollActions/PollResults/PollResults.d.ts +1 -2
  272. package/dist/components/Poll/PollActions/PollResults/PollResults.js +1 -1
  273. package/dist/components/Poll/PollActions/SuggestPollOptionForm.d.ts +1 -2
  274. package/dist/components/Poll/PollActions/SuggestPollOptionForm.js +3 -1
  275. package/dist/components/Poll/PollContent.d.ts +1 -2
  276. package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.d.ts +2 -0
  277. package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.js +35 -0
  278. package/dist/components/Poll/PollCreationDialog/NameField.d.ts +2 -0
  279. package/dist/components/Poll/PollCreationDialog/NameField.js +26 -0
  280. package/dist/components/Poll/PollCreationDialog/OptionFieldSet.d.ts +1 -8
  281. package/dist/components/Poll/PollCreationDialog/OptionFieldSet.js +33 -65
  282. package/dist/components/Poll/PollCreationDialog/PollCreationDialog.js +31 -85
  283. package/dist/components/Poll/PollCreationDialog/PollCreationDialogControls.d.ts +1 -4
  284. package/dist/components/Poll/PollCreationDialog/PollCreationDialogControls.js +15 -41
  285. package/dist/components/Poll/PollCreationDialog/types.d.ts +0 -14
  286. package/dist/components/Poll/PollHeader.d.ts +1 -2
  287. package/dist/components/Poll/PollOptionList.d.ts +1 -2
  288. package/dist/components/Poll/PollOptionList.js +4 -2
  289. package/dist/components/Poll/PollOptionSelector.d.ts +3 -4
  290. package/dist/components/Poll/PollVote.d.ts +6 -7
  291. package/dist/components/Poll/PollVote.js +3 -3
  292. package/dist/components/Poll/QuotedPoll.d.ts +1 -2
  293. package/dist/components/Poll/constants.d.ts +0 -1
  294. package/dist/components/Poll/constants.js +0 -1
  295. package/dist/components/Poll/hooks/useManagePollVotesRealtime.d.ts +2 -3
  296. package/dist/components/Poll/hooks/usePollAnswerPagination.d.ts +2 -3
  297. package/dist/components/Poll/hooks/usePollAnswerPagination.js +2 -2
  298. package/dist/components/Poll/hooks/usePollOptionVotesPagination.d.ts +2 -3
  299. package/dist/components/Poll/hooks/usePollOptionVotesPagination.js +1 -1
  300. package/dist/components/Portal/Portal.d.ts +1 -1
  301. package/dist/components/ReactFileUtilities/FileIcon/FileIcon.d.ts +1 -1
  302. package/dist/components/ReactFileUtilities/FileIcon/FileIconSet.d.ts +2 -1
  303. package/dist/components/ReactFileUtilities/FileIcon/iconMap.d.ts +1 -1
  304. package/dist/components/ReactFileUtilities/UploadButton.d.ts +3 -2
  305. package/dist/components/ReactFileUtilities/UploadButton.js +16 -6
  306. package/dist/components/ReactFileUtilities/index.d.ts +0 -1
  307. package/dist/components/ReactFileUtilities/index.js +0 -1
  308. package/dist/components/ReactFileUtilities/utils.d.ts +2 -2
  309. package/dist/components/Reactions/ReactionSelector.d.ts +4 -5
  310. package/dist/components/Reactions/ReactionSelectorWithButton.d.ts +1 -2
  311. package/dist/components/Reactions/ReactionsList.d.ts +6 -7
  312. package/dist/components/Reactions/ReactionsList.js +2 -2
  313. package/dist/components/Reactions/ReactionsListModal.d.ts +9 -10
  314. package/dist/components/Reactions/SimpleReactionsList.d.ts +5 -6
  315. package/dist/components/Reactions/StreamEmoji.d.ts +1 -1
  316. package/dist/components/Reactions/hooks/useFetchReactions.d.ts +9 -10
  317. package/dist/components/Reactions/hooks/useProcessReactions.d.ts +1 -2
  318. package/dist/components/Reactions/types.d.ts +3 -4
  319. package/dist/components/Reactions/utils/utils.d.ts +1 -1
  320. package/dist/components/SafeAnchor/SafeAnchor.d.ts +2 -1
  321. package/dist/components/{CommandItem → TextareaComposer/SuggestionList}/CommandItem.d.ts +2 -1
  322. package/dist/components/{CommandItem → TextareaComposer/SuggestionList}/CommandItem.js +1 -2
  323. package/dist/components/{EmoticonItem → TextareaComposer/SuggestionList}/EmoticonItem.d.ts +7 -7
  324. package/dist/components/TextareaComposer/SuggestionList/EmoticonItem.js +12 -0
  325. package/dist/components/TextareaComposer/SuggestionList/SuggestionList.d.ts +16 -0
  326. package/dist/components/TextareaComposer/SuggestionList/SuggestionList.js +49 -0
  327. package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.d.ts +18 -0
  328. package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.js +25 -0
  329. package/dist/components/{UserItem → TextareaComposer/SuggestionList}/UserItem.d.ts +7 -4
  330. package/dist/components/TextareaComposer/SuggestionList/UserItem.js +24 -0
  331. package/dist/components/TextareaComposer/SuggestionList/index.d.ts +5 -0
  332. package/dist/components/TextareaComposer/SuggestionList/index.js +5 -0
  333. package/dist/components/TextareaComposer/TextareaComposer.d.ts +13 -0
  334. package/dist/components/TextareaComposer/TextareaComposer.js +155 -0
  335. package/dist/components/TextareaComposer/index.d.ts +2 -0
  336. package/dist/components/TextareaComposer/index.js +2 -0
  337. package/dist/components/Thread/Thread.d.ts +13 -10
  338. package/dist/components/Thread/Thread.js +23 -12
  339. package/dist/components/Thread/ThreadHead.d.ts +2 -3
  340. package/dist/components/Thread/ThreadHeader.d.ts +5 -6
  341. package/dist/components/Thread/ThreadHeader.js +1 -1
  342. package/dist/components/Threads/ThreadContext.d.ts +2 -2
  343. package/dist/components/Threads/ThreadContext.js +1 -4
  344. package/dist/components/Threads/ThreadList/ThreadList.d.ts +1 -1
  345. package/dist/components/Threads/ThreadList/ThreadListItem.d.ts +1 -1
  346. package/dist/components/Threads/hooks/useThreadManagerState.d.ts +1 -1
  347. package/dist/components/Threads/hooks/useThreadState.d.ts +1 -1
  348. package/dist/components/Threads/icons.d.ts +1 -1
  349. package/dist/components/Tooltip/Tooltip.d.ts +3 -2
  350. package/dist/components/Tooltip/hooks/useEnterLeaveHandlers.d.ts +1 -1
  351. package/dist/components/TypingIndicator/TypingIndicator.d.ts +1 -2
  352. package/dist/components/Window/Window.d.ts +6 -6
  353. package/dist/components/index.d.ts +1 -5
  354. package/dist/components/index.js +1 -5
  355. package/dist/context/AttachmentSelectorContext.d.ts +2 -1
  356. package/dist/context/ChannelActionContext.d.ts +26 -35
  357. package/dist/context/ChannelListContext.d.ts +9 -9
  358. package/dist/context/ChannelListContext.js +1 -1
  359. package/dist/context/ChannelStateContext.d.ts +24 -34
  360. package/dist/context/ChatContext.d.ts +18 -17
  361. package/dist/context/ComponentContext.d.ts +39 -37
  362. package/dist/context/DialogManagerContext.d.ts +2 -1
  363. package/dist/context/MessageBounceContext.d.ts +8 -7
  364. package/dist/context/MessageBounceContext.js +1 -1
  365. package/dist/context/MessageContext.d.ts +23 -23
  366. package/dist/context/MessageInputContext.d.ts +8 -26
  367. package/dist/context/MessageInputContext.js +3 -2
  368. package/dist/context/MessageListContext.d.ts +2 -1
  369. package/dist/context/PollContext.d.ts +8 -8
  370. package/dist/context/TranslationContext.d.ts +2 -1
  371. package/dist/context/TypingContext.d.ts +11 -10
  372. package/dist/context/VirtualizedMessageListContext.d.ts +2 -1
  373. package/dist/context/WithComponents.d.ts +3 -2
  374. package/dist/css/v2/index.css +1 -1
  375. package/dist/css/v2/index.layout.css +1 -1
  376. package/dist/experimental/MessageActions/MessageActions.d.ts +1 -1
  377. package/dist/experimental/MessageActions/MessageActions.js +1 -1
  378. package/dist/experimental/MessageActions/defaults.js +4 -3
  379. package/dist/experimental/Search/Search.d.ts +1 -2
  380. package/dist/experimental/Search/SearchContext.d.ts +8 -8
  381. package/dist/experimental/Search/SearchResults/SearchResultItem.d.ts +11 -11
  382. package/dist/experimental/Search/SearchResults/SearchResultItem.js +3 -3
  383. package/dist/experimental/Search/SearchResults/SearchResults.d.ts +1 -2
  384. package/dist/experimental/Search/SearchResults/SearchResultsHeader.d.ts +1 -2
  385. package/dist/experimental/Search/SearchResults/SearchResultsHeader.js +1 -1
  386. package/dist/experimental/Search/SearchResults/SearchSourceResultList.d.ts +2 -3
  387. package/dist/experimental/Search/SearchResults/SearchSourceResultListFooter.d.ts +1 -2
  388. package/dist/experimental/Search/SearchResults/SearchSourceResults.d.ts +1 -2
  389. package/dist/experimental/Search/SearchResults/SearchSourceResults.js +1 -1
  390. package/dist/experimental/Search/SearchSourceResultsContext.d.ts +2 -1
  391. package/dist/experimental/Search/hooks/useSearchFocusedMessage.d.ts +1 -2
  392. package/dist/experimental/Search/hooks/useSearchFocusedMessage.js +3 -1
  393. package/dist/experimental/Search/hooks/useSearchQueriesInProgress.d.ts +3 -4
  394. package/dist/experimental/index.browser.cjs +1139 -1075
  395. package/dist/experimental/index.browser.cjs.map +4 -4
  396. package/dist/experimental/index.node.cjs +1139 -1075
  397. package/dist/experimental/index.node.cjs.map +4 -4
  398. package/dist/i18n/Streami18n.d.ts +1 -1
  399. package/dist/i18n/types.d.ts +2 -2
  400. package/dist/i18n/utils.d.ts +1 -1
  401. package/dist/i18n/utils.js +3 -1
  402. package/dist/index.browser.cjs +28545 -30631
  403. package/dist/index.browser.cjs.map +4 -4
  404. package/dist/index.node.cjs +30774 -32868
  405. package/dist/index.node.cjs.map +4 -4
  406. package/dist/plugins/Emojis/index.browser.cjs +133 -5
  407. package/dist/plugins/Emojis/index.browser.cjs.map +4 -4
  408. package/dist/plugins/Emojis/index.d.ts +1 -0
  409. package/dist/plugins/Emojis/index.js +1 -0
  410. package/dist/plugins/Emojis/index.node.cjs +135 -6
  411. package/dist/plugins/Emojis/index.node.cjs.map +4 -4
  412. package/dist/plugins/Emojis/middleware/index.d.ts +1 -0
  413. package/dist/plugins/Emojis/middleware/index.js +1 -0
  414. package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.d.ts +66 -0
  415. package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.js +143 -0
  416. package/dist/plugins/encoders/mp3.browser.cjs.map +2 -2
  417. package/dist/plugins/encoders/mp3.node.cjs.map +2 -2
  418. package/dist/scss/v2/Autocomplete/Autocomplete-layout.scss +14 -0
  419. package/dist/scss/v2/Autocomplete/Autocomplete-theme.scss +11 -0
  420. package/dist/scss/v2/DropzoneContainer/DropzoneContainer-layout.scss +14 -0
  421. package/dist/scss/v2/DropzoneContainer/DropzoneContainer-theme.scss +17 -0
  422. package/dist/scss/v2/LinkPreview/LinkPreview-layout.scss +18 -0
  423. package/dist/scss/v2/LinkPreview/LinkPreview-theme.scss +15 -0
  424. package/dist/scss/v2/MessageInput/MessageInput-layout.scss +0 -13
  425. package/dist/scss/v2/MessageInput/MessageInput-theme.scss +8 -19
  426. package/dist/scss/v2/index.layout.scss +2 -1
  427. package/dist/scss/v2/index.scss +1 -0
  428. package/dist/types/defaultDataInterfaces.d.ts +25 -0
  429. package/dist/types/index.d.ts +2 -1
  430. package/dist/types/types.d.ts +2 -62
  431. package/dist/utils/getChannel.d.ts +5 -6
  432. package/dist/utils/mergeDeep.d.ts +2 -3
  433. package/package.json +5 -5
  434. package/dist/components/AutoCompleteTextarea/Item.d.ts +0 -2
  435. package/dist/components/AutoCompleteTextarea/Item.js +0 -10
  436. package/dist/components/AutoCompleteTextarea/List.d.ts +0 -17
  437. package/dist/components/AutoCompleteTextarea/List.js +0 -89
  438. package/dist/components/AutoCompleteTextarea/Textarea.d.ts +0 -114
  439. package/dist/components/AutoCompleteTextarea/Textarea.js +0 -593
  440. package/dist/components/AutoCompleteTextarea/index.d.ts +0 -4
  441. package/dist/components/AutoCompleteTextarea/index.js +0 -4
  442. package/dist/components/AutoCompleteTextarea/types.d.ts +0 -15
  443. package/dist/components/AutoCompleteTextarea/utils.d.ts +0 -6
  444. package/dist/components/AutoCompleteTextarea/utils.js +0 -40
  445. package/dist/components/ChatAutoComplete/ChatAutoComplete.d.ts +0 -78
  446. package/dist/components/ChatAutoComplete/ChatAutoComplete.js +0 -33
  447. package/dist/components/ChatAutoComplete/index.d.ts +0 -1
  448. package/dist/components/ChatAutoComplete/index.js +0 -1
  449. package/dist/components/CommandItem/index.d.ts +0 -1
  450. package/dist/components/CommandItem/index.js +0 -1
  451. package/dist/components/EmoticonItem/EmoticonItem.js +0 -16
  452. package/dist/components/EmoticonItem/index.d.ts +0 -1
  453. package/dist/components/EmoticonItem/index.js +0 -1
  454. package/dist/components/MessageInput/DefaultTriggerProvider.d.ts +0 -35
  455. package/dist/components/MessageInput/DefaultTriggerProvider.js +0 -24
  456. package/dist/components/MessageInput/DropzoneProvider.d.ts +0 -4
  457. package/dist/components/MessageInput/DropzoneProvider.js +0 -23
  458. package/dist/components/MessageInput/hooks/useAttachments.d.ts +0 -14
  459. package/dist/components/MessageInput/hooks/useAttachments.js +0 -209
  460. package/dist/components/MessageInput/hooks/useCommandTrigger.d.ts +0 -3
  461. package/dist/components/MessageInput/hooks/useCommandTrigger.js +0 -62
  462. package/dist/components/MessageInput/hooks/useEmojiTrigger.d.ts +0 -3
  463. package/dist/components/MessageInput/hooks/useEmojiTrigger.js +0 -29
  464. package/dist/components/MessageInput/hooks/useLinkPreviews.d.ts +0 -30
  465. package/dist/components/MessageInput/hooks/useLinkPreviews.js +0 -109
  466. package/dist/components/MessageInput/hooks/useMessageInputState.d.ts +0 -71
  467. package/dist/components/MessageInput/hooks/useMessageInputState.js +0 -200
  468. package/dist/components/MessageInput/hooks/useUserTrigger.d.ts +0 -12
  469. package/dist/components/MessageInput/hooks/useUserTrigger.js +0 -130
  470. package/dist/components/MessageInput/types.d.ts +0 -87
  471. package/dist/components/MessageInput/types.js +0 -19
  472. package/dist/components/ReactFileUtilities/ImageDropzone.d.ts +0 -16
  473. package/dist/components/ReactFileUtilities/ImageDropzone.js +0 -42
  474. package/dist/components/UserItem/UserItem.js +0 -26
  475. package/dist/components/UserItem/index.d.ts +0 -1
  476. package/dist/components/UserItem/index.js +0 -1
  477. /package/dist/components/{MessageInput → MediaRecorder/AudioRecorder}/hooks/useTimeElapsed.d.ts +0 -0
  478. /package/dist/components/{MessageInput → MediaRecorder/AudioRecorder}/hooks/useTimeElapsed.js +0 -0
  479. /package/dist/scss/v2/DragAndDropContainer/{DragAmdDropContainer-layout.scss → DragAndDropContainer-layout.scss} +0 -0
  480. /package/dist/{components/AutoCompleteTextarea/types.js → types/defaultDataInterfaces.js} +0 -0
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { Channel } from 'stream-chat';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
- export type AIStateIndicatorProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
5
- channel?: Channel<StreamChatGenerics>;
2
+ import type { Channel } from 'stream-chat';
3
+ export type AIStateIndicatorProps = {
4
+ channel?: Channel;
6
5
  };
7
- export declare const AIStateIndicator: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channel: channelFromProps, }: AIStateIndicatorProps<StreamChatGenerics>) => React.JSX.Element | null;
6
+ export declare const AIStateIndicator: ({ channel: channelFromProps, }: AIStateIndicatorProps) => React.JSX.Element | null;
@@ -1,5 +1,4 @@
1
- import { AIState, Channel } from 'stream-chat';
2
- import type { DefaultStreamChatGenerics } from '../../../types/types';
1
+ import type { AIState, Channel } from 'stream-chat';
3
2
  export declare const AIStates: {
4
3
  Error: string;
5
4
  ExternalSources: string;
@@ -12,6 +11,6 @@ export declare const AIStates: {
12
11
  * @param {Channel} channel - The channel for which we want to know the AI state.
13
12
  * @returns {{ aiState: AIState }} The current AI state for the given channel.
14
13
  */
15
- export declare const useAIState: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(channel?: Channel<StreamChatGenerics>) => {
14
+ export declare const useAIState: (channel?: Channel) => {
16
15
  aiState: AIState;
17
16
  };
@@ -9,23 +9,22 @@ import type { FileAttachmentProps } from './FileAttachment';
9
9
  import type { GalleryProps, ImageProps } from '../Gallery';
10
10
  import type { UnsupportedAttachmentProps } from './UnsupportedAttachment';
11
11
  import type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler';
12
- import type { DefaultStreamChatGenerics } from '../../types/types';
13
12
  export declare const ATTACHMENT_GROUPS_ORDER: readonly ["card", "gallery", "image", "media", "audio", "voiceRecording", "file", "unsupported"];
14
- export type AttachmentProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
13
+ export type AttachmentProps = {
15
14
  /** The message attachments to render, see [attachment structure](https://getstream.io/chat/docs/javascript/message_format/?language=javascript) **/
16
- attachments: StreamAttachment<StreamChatGenerics>[];
15
+ attachments: StreamAttachment[];
17
16
  /** The handler function to call when an action is performed on an attachment, examples include canceling a \/giphy command or shuffling the results. */
18
17
  actionHandler?: ActionHandlerReturnType;
19
18
  /** Custom UI component for displaying attachment actions, defaults to and accepts same props as: [AttachmentActions](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/AttachmentActions.tsx) */
20
- AttachmentActions?: React.ComponentType<AttachmentActionsProps<StreamChatGenerics>>;
19
+ AttachmentActions?: React.ComponentType<AttachmentActionsProps>;
21
20
  /** Custom UI component for displaying an audio type attachment, defaults to and accepts same props as: [Audio](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/Audio.tsx) */
22
- Audio?: React.ComponentType<AudioProps<StreamChatGenerics>>;
21
+ Audio?: React.ComponentType<AudioProps>;
23
22
  /** Custom UI component for displaying a card type attachment, defaults to and accepts same props as: [Card](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/Card.tsx) */
24
23
  Card?: React.ComponentType<CardProps>;
25
24
  /** Custom UI component for displaying a file type attachment, defaults to and accepts same props as: [File](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/FileAttachment.tsx) */
26
- File?: React.ComponentType<FileAttachmentProps<StreamChatGenerics>>;
25
+ File?: React.ComponentType<FileAttachmentProps>;
27
26
  /** Custom UI component for displaying a gallery of image type attachments, defaults to and accepts same props as: [Gallery](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Gallery/Gallery.tsx) */
28
- Gallery?: React.ComponentType<GalleryProps<StreamChatGenerics>>;
27
+ Gallery?: React.ComponentType<GalleryProps>;
29
28
  /** Custom UI component for displaying an image type attachment, defaults to and accepts same props as: [Image](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Gallery/Image.tsx) */
30
29
  Image?: React.ComponentType<ImageProps>;
31
30
  /** Optional flag to signal that an attachment is a displayed as a part of a quoted message */
@@ -35,9 +34,9 @@ export type AttachmentProps<StreamChatGenerics extends DefaultStreamChatGenerics
35
34
  /** Custom UI component for displaying unsupported attachment types, defaults to NullComponent */
36
35
  UnsupportedAttachment?: React.ComponentType<UnsupportedAttachmentProps>;
37
36
  /** Custom UI component for displaying an audio recording attachment, defaults to and accepts same props as: [VoiceRecording](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/VoiceRecording.tsx) */
38
- VoiceRecording?: React.ComponentType<VoiceRecordingProps<StreamChatGenerics>>;
37
+ VoiceRecording?: React.ComponentType<VoiceRecordingProps>;
39
38
  };
40
39
  /**
41
40
  * A component used for rendering message attachments. By default, the component supports: AttachmentActions, Audio, Card, File, Gallery, Image, and Video
42
41
  */
43
- export declare const Attachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: AttachmentProps<StreamChatGenerics>) => React.JSX.Element;
42
+ export declare const Attachment: (props: AttachmentProps) => React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import React, { useMemo } from 'react';
2
- import { isAudioAttachment, isFileAttachment, isMediaAttachment, isScrapedContent, isUploadedImage, isVoiceRecordingAttachment, } from './utils';
2
+ import { isAudioAttachment, isFileAttachment, isImageAttachment, isScrapedContent, isVideoAttachment, isVoiceRecordingAttachment, } from 'stream-chat';
3
3
  import { AudioContainer, CardContainer, FileContainer, GalleryContainer, ImageContainer, MediaContainer, UnsupportedAttachmentContainer, VoiceRecordingContainer, } from './AttachmentContainer';
4
+ import { SUPPORTED_VIDEO_FORMATS } from './utils';
4
5
  const CONTAINER_MAP = {
5
6
  audio: AudioContainer,
6
7
  card: CardContainer,
@@ -30,9 +31,9 @@ export const Attachment = (props) => {
30
31
  return (React.createElement("div", { className: 'str-chat__attachment-list' }, ATTACHMENT_GROUPS_ORDER.reduce((acc, groupName) => [...acc, ...groupedAttachments[groupName]], [])));
31
32
  };
32
33
  const renderGroupedAttachments = ({ attachments, ...rest }) => {
33
- const uploadedImages = attachments.filter((attachment) => isUploadedImage(attachment));
34
+ const uploadedImages = attachments.filter((attachment) => isImageAttachment(attachment));
34
35
  const containers = attachments
35
- .filter((attachment) => !isUploadedImage(attachment))
36
+ .filter((attachment) => !isImageAttachment(attachment))
36
37
  .reduce((typeMap, attachment) => {
37
38
  const attachmentType = getAttachmentType(attachment);
38
39
  const Container = CONTAINER_MAP[attachmentType];
@@ -70,7 +71,7 @@ const getAttachmentType = (attachment) => {
70
71
  if (isScrapedContent(attachment)) {
71
72
  return 'card';
72
73
  }
73
- else if (isMediaAttachment(attachment)) {
74
+ else if (isVideoAttachment(attachment, SUPPORTED_VIDEO_FORMATS)) {
74
75
  return 'media';
75
76
  }
76
77
  else if (isAudioAttachment(attachment)) {
@@ -79,7 +80,7 @@ const getAttachmentType = (attachment) => {
79
80
  else if (isVoiceRecordingAttachment(attachment)) {
80
81
  return 'voiceRecording';
81
82
  }
82
- else if (isFileAttachment(attachment)) {
83
+ else if (isFileAttachment(attachment, SUPPORTED_VIDEO_FORMATS)) {
83
84
  return 'file';
84
85
  }
85
86
  return 'unsupported';
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { Action, Attachment } from 'stream-chat';
3
3
  import type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler';
4
- import type { DefaultStreamChatGenerics } from '../../types/types';
5
- export type AttachmentActionsProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Attachment<StreamChatGenerics> & {
4
+ export type AttachmentActionsProps = Attachment & {
6
5
  /** A list of actions */
7
6
  actions: Action[];
8
7
  /** Unique id for action button key. Key is generated by concatenating this id with action value - {`${id}-${action.value}`} */
@@ -15,4 +14,4 @@ export type AttachmentActionsProps<StreamChatGenerics extends DefaultStreamChatG
15
14
  /**
16
15
  * A component for rendering the actions you can take on an attachment.
17
16
  */
18
- export declare const AttachmentActions: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: AttachmentActionsProps<StreamChatGenerics>) => React.JSX.Element;
17
+ export declare const AttachmentActions: (props: AttachmentActionsProps) => React.JSX.Element;
@@ -1,18 +1,18 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { AttachmentComponentType, GalleryAttachment, RenderAttachmentProps, RenderGalleryProps } from './utils';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
4
3
  import type { Attachment } from 'stream-chat';
5
- export type AttachmentContainerProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
6
- attachment: Attachment<StreamChatGenerics> | GalleryAttachment<StreamChatGenerics>;
4
+ import type { AttachmentComponentType, GalleryAttachment, RenderAttachmentProps, RenderGalleryProps } from './utils';
5
+ export type AttachmentContainerProps = {
6
+ attachment: Attachment | GalleryAttachment;
7
7
  componentType: AttachmentComponentType;
8
8
  };
9
- export declare const AttachmentWithinContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, children, componentType, }: PropsWithChildren<AttachmentContainerProps<StreamChatGenerics>>) => React.JSX.Element;
10
- export declare const AttachmentActionsContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ actionHandler, attachment, AttachmentActions, }: RenderAttachmentProps<StreamChatGenerics>) => React.JSX.Element | null;
11
- export declare const GalleryContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, Gallery, }: RenderGalleryProps<StreamChatGenerics>) => React.JSX.Element;
12
- export declare const ImageContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: RenderAttachmentProps<StreamChatGenerics>) => React.JSX.Element;
13
- export declare const CardContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: RenderAttachmentProps<StreamChatGenerics>) => React.JSX.Element;
14
- export declare const FileContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, File, }: RenderAttachmentProps<StreamChatGenerics>) => React.JSX.Element | null;
15
- export declare const AudioContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, Audio, }: RenderAttachmentProps<StreamChatGenerics>) => React.JSX.Element;
16
- export declare const VoiceRecordingContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, isQuoted, VoiceRecording, }: RenderAttachmentProps<StreamChatGenerics>) => React.JSX.Element;
17
- export declare const MediaContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: RenderAttachmentProps<StreamChatGenerics>) => React.JSX.Element;
18
- export declare const UnsupportedAttachmentContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, UnsupportedAttachment, }: RenderAttachmentProps<StreamChatGenerics>) => React.JSX.Element;
9
+ export declare const AttachmentWithinContainer: ({ attachment, children, componentType, }: PropsWithChildren<AttachmentContainerProps>) => React.JSX.Element;
10
+ export declare const AttachmentActionsContainer: ({ actionHandler, attachment, AttachmentActions, }: RenderAttachmentProps) => React.JSX.Element | null;
11
+ export declare const GalleryContainer: ({ attachment, Gallery, }: RenderGalleryProps) => React.JSX.Element;
12
+ export declare const ImageContainer: (props: RenderAttachmentProps) => React.JSX.Element;
13
+ export declare const CardContainer: (props: RenderAttachmentProps) => React.JSX.Element;
14
+ export declare const FileContainer: ({ attachment, File, }: RenderAttachmentProps) => React.JSX.Element | null;
15
+ export declare const AudioContainer: ({ attachment, Audio, }: RenderAttachmentProps) => React.JSX.Element;
16
+ export declare const VoiceRecordingContainer: ({ attachment, isQuoted, VoiceRecording, }: RenderAttachmentProps) => React.JSX.Element;
17
+ export declare const MediaContainer: (props: RenderAttachmentProps) => React.JSX.Element;
18
+ export declare const UnsupportedAttachmentContainer: ({ attachment, UnsupportedAttachment, }: RenderAttachmentProps) => React.JSX.Element;
@@ -9,7 +9,7 @@ import { Gallery as DefaultGallery, ImageComponent as DefaultImage } from '../Ga
9
9
  import { Card as DefaultCard } from './Card';
10
10
  import { FileAttachment as DefaultFile } from './FileAttachment';
11
11
  import { UnsupportedAttachment as DefaultUnsupportedAttachment } from './UnsupportedAttachment';
12
- import { isGalleryAttachmentType, isSvgAttachment, } from './utils';
12
+ import { isGalleryAttachmentType, isSvgAttachment } from './utils';
13
13
  import { useChannelStateContext } from '../../context/ChannelStateContext';
14
14
  export const AttachmentWithinContainer = ({ attachment, children, componentType, }) => {
15
15
  const isGAT = isGalleryAttachmentType(attachment);
@@ -34,7 +34,7 @@ export const AttachmentWithinContainer = ({ attachment, children, componentType,
34
34
  export const AttachmentActionsContainer = ({ actionHandler, attachment, AttachmentActions = DefaultAttachmentActions, }) => {
35
35
  if (!attachment.actions?.length)
36
36
  return null;
37
- return (React.createElement(AttachmentActions, { ...attachment, actionHandler: actionHandler, actions: attachment.actions, id: attachment.id || '', text: attachment.text || '' }));
37
+ return (React.createElement(AttachmentActions, { ...attachment, actionHandler: actionHandler, actions: attachment.actions, id: attachment.localMetadata?.id || '', text: attachment.text || '' }));
38
38
  };
39
39
  function getCssDimensionsVariables(url) {
40
40
  const cssVars = {
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { Attachment } from 'stream-chat';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
- export type AudioProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
5
- og: Attachment<StreamChatGenerics>;
3
+ export type AudioProps = {
4
+ og: Attachment;
6
5
  };
7
6
  /**
8
7
  * Audio attachment with play/pause button and progress bar
9
8
  */
10
- export declare const Audio: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: AudioProps<StreamChatGenerics>) => React.JSX.Element | null;
9
+ export declare const Audio: (props: AudioProps) => React.JSX.Element | null;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { AudioProps } from './Audio';
2
+ import type { AudioProps } from './Audio';
3
3
  import type { RenderAttachmentProps } from './utils';
4
4
  export declare const CardAudio: ({ og: { asset_url, author_name, mime_type, og_scrape_url, text, title, title_link }, }: AudioProps) => React.JSX.Element;
5
5
  export type CardProps = RenderAttachmentProps['attachment'];
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { Attachment } from 'stream-chat';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
- export type FileAttachmentProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
5
- attachment: Attachment<StreamChatGenerics>;
3
+ export type FileAttachmentProps = {
4
+ attachment: Attachment;
6
5
  };
7
- export declare const FileAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, }: FileAttachmentProps<StreamChatGenerics>) => React.JSX.Element;
6
+ export declare const FileAttachment: ({ attachment }: FileAttachmentProps) => React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { FileIcon } from '../ReactFileUtilities';
3
3
  import { DownloadButton, FileSizeIndicator } from './components';
4
- const UnMemoizedFileAttachment = ({ attachment, }) => (React.createElement("div", { className: 'str-chat__message-attachment-file--item', "data-testid": 'attachment-file' },
4
+ const UnMemoizedFileAttachment = ({ attachment }) => (React.createElement("div", { className: 'str-chat__message-attachment-file--item', "data-testid": 'attachment-file' },
5
5
  React.createElement(FileIcon, { className: 'str-chat__file-icon', mimeType: attachment.mime_type }),
6
6
  React.createElement("div", { className: 'str-chat__message-attachment-file--item-text' },
7
7
  React.createElement("div", { className: 'str-chat__message-attachment-file--item-first-row' },
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { Attachment } from 'stream-chat';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
- export type UnsupportedAttachmentProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
5
- attachment: Attachment<StreamChatGenerics>;
3
+ export type UnsupportedAttachmentProps = {
4
+ attachment: Attachment;
6
5
  };
7
- export declare const UnsupportedAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, }: UnsupportedAttachmentProps<StreamChatGenerics>) => React.JSX.Element;
6
+ export declare const UnsupportedAttachment: ({ attachment }: UnsupportedAttachmentProps) => React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { FileIcon } from '../ReactFileUtilities';
3
3
  import { useTranslationContext } from '../../context';
4
- export const UnsupportedAttachment = ({ attachment, }) => {
4
+ export const UnsupportedAttachment = ({ attachment }) => {
5
5
  const { t } = useTranslationContext('UnsupportedAttachment');
6
6
  return (React.createElement("div", { className: 'str-chat__message-attachment-unsupported', "data-testid": 'attachment-unsupported' },
7
7
  React.createElement(FileIcon, { className: 'str-chat__file-icon' }),
@@ -1,16 +1,15 @@
1
1
  import React from 'react';
2
2
  import type { Attachment } from 'stream-chat';
3
- import type { DefaultStreamChatGenerics } from '../../types';
4
- export type VoiceRecordingPlayerProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<VoiceRecordingProps<StreamChatGenerics>, 'attachment'> & {
3
+ export type VoiceRecordingPlayerProps = Pick<VoiceRecordingProps, 'attachment'> & {
5
4
  /** An array of fractional numeric values of playback speed to override the defaults (1.0, 1.5, 2.0) */
6
5
  playbackRates?: number[];
7
6
  };
8
7
  export declare const VoiceRecordingPlayer: ({ attachment, playbackRates, }: VoiceRecordingPlayerProps) => React.JSX.Element | null;
9
- export type QuotedVoiceRecordingProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<VoiceRecordingProps<StreamChatGenerics>, 'attachment'>;
8
+ export type QuotedVoiceRecordingProps = Pick<VoiceRecordingProps, 'attachment'>;
10
9
  export declare const QuotedVoiceRecording: ({ attachment }: QuotedVoiceRecordingProps) => React.JSX.Element;
11
- export type VoiceRecordingProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
10
+ export type VoiceRecordingProps = {
12
11
  /** The attachment object from the message's attachment list. */
13
- attachment: Attachment<StreamChatGenerics>;
12
+ attachment: Attachment;
14
13
  /** A boolean flag to signal whether the attachment will be rendered inside the quoted reply. */
15
14
  isQuoted?: boolean;
16
15
  };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  type FileSizeIndicatorProps = {
3
3
  /** file size in byte */
4
- fileSize?: number;
4
+ fileSize?: number | string;
5
5
  /**
6
6
  The maximum number of fraction digits to display. If not set, the default behavior is to round to 3 significant digits.
7
7
  @default undefined
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { prettifyFileSize } from '../../MessageInput/hooks/utils';
3
3
  export const FileSizeIndicator = ({ fileSize, maximumFractionDigits, }) => {
4
- if (!(fileSize && Number.isFinite(Number(fileSize))))
4
+ const actualFileSize = typeof fileSize === 'string' ? parseFloat(fileSize) : fileSize;
5
+ if (typeof actualFileSize === 'undefined' || !Number.isFinite(Number(actualFileSize))) {
5
6
  return null;
6
- return (React.createElement("span", { className: 'str-chat__message-attachment-file--item-size', "data-testid": 'file-size-indicator' }, prettifyFileSize(fileSize, maximumFractionDigits)));
7
+ }
8
+ return (React.createElement("span", { className: 'str-chat__message-attachment-file--item-size', "data-testid": 'file-size-indicator' }, prettifyFileSize(actualFileSize, maximumFractionDigits)));
7
9
  };
@@ -1,34 +1,20 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  import type { Attachment } from 'stream-chat';
3
3
  import type { ATTACHMENT_GROUPS_ORDER, AttachmentProps } from './Attachment';
4
- import type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';
5
- import type { LocalAttachment, LocalAudioAttachment, LocalFileAttachment, LocalImageAttachment, LocalVideoAttachment, LocalVoiceRecordingAttachment, VoiceRecordingAttachment } from '../MessageInput';
6
4
  export declare const SUPPORTED_VIDEO_FORMATS: string[];
7
5
  export type AttachmentComponentType = (typeof ATTACHMENT_GROUPS_ORDER)[number];
8
6
  export type GroupedRenderedAttachment = Record<AttachmentComponentType, ReactNode[]>;
9
- export type GalleryAttachment<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
10
- images: Attachment<StreamChatGenerics>[];
7
+ export type GalleryAttachment = {
8
+ images: Attachment[];
11
9
  type: 'gallery';
12
10
  };
13
- export type RenderAttachmentProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Omit<AttachmentProps<StreamChatGenerics>, 'attachments'> & {
14
- attachment: Attachment<StreamChatGenerics>;
11
+ export type RenderAttachmentProps = Omit<AttachmentProps, 'attachments'> & {
12
+ attachment: Attachment;
15
13
  };
16
- export type RenderGalleryProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Omit<AttachmentProps<StreamChatGenerics>, 'attachments'> & {
17
- attachment: GalleryAttachment<StreamChatGenerics>;
14
+ export type RenderGalleryProps = Omit<AttachmentProps, 'attachments'> & {
15
+ attachment: GalleryAttachment;
18
16
  };
19
- export declare const isLocalAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: UnknownType) => attachment is LocalAttachment<StreamChatGenerics>;
20
- export declare const isScrapedContent: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics>) => string | undefined;
21
- export declare const isUploadedImage: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics>) => boolean;
22
- export declare const isLocalImageAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics> | LocalAttachment<StreamChatGenerics>) => attachment is LocalImageAttachment<StreamChatGenerics>;
23
- export declare const isGalleryAttachmentType: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(output: Attachment<StreamChatGenerics> | GalleryAttachment<StreamChatGenerics>) => output is GalleryAttachment<StreamChatGenerics>;
24
- export declare const isAudioAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics> | LocalAttachment<StreamChatGenerics>) => boolean;
25
- export declare const isLocalAudioAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics> | LocalAttachment<StreamChatGenerics>) => attachment is LocalAudioAttachment<StreamChatGenerics>;
26
- export declare const isVoiceRecordingAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics> | LocalAttachment<StreamChatGenerics>) => attachment is VoiceRecordingAttachment;
27
- export declare const isLocalVoiceRecordingAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics> | LocalAttachment<StreamChatGenerics>) => attachment is LocalVoiceRecordingAttachment<StreamChatGenerics>;
28
- export declare const isFileAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics> | LocalAttachment<StreamChatGenerics>) => boolean;
29
- export declare const isLocalFileAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics> | LocalAttachment<StreamChatGenerics>) => attachment is LocalFileAttachment<StreamChatGenerics>;
30
- export declare const isMediaAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics> | LocalAttachment<StreamChatGenerics>) => boolean;
31
- export declare const isLocalMediaAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(attachment: Attachment<StreamChatGenerics> | LocalAttachment<StreamChatGenerics>) => attachment is LocalVideoAttachment<StreamChatGenerics>;
17
+ export declare const isGalleryAttachmentType: (attachment: Attachment | GalleryAttachment) => attachment is GalleryAttachment;
32
18
  export declare const isSvgAttachment: (attachment: Attachment) => boolean;
33
19
  export declare const divMod: (num: number, divisor: number) => number[];
34
20
  export declare const displayDuration: (totalSeconds?: number) => string;
@@ -4,24 +4,9 @@ export const SUPPORTED_VIDEO_FORMATS = [
4
4
  'video/webm',
5
5
  'video/quicktime',
6
6
  ];
7
- export const isLocalAttachment = (attachment) => !!attachment.localMetadata?.id;
8
- export const isScrapedContent = (attachment) => attachment.og_scrape_url || attachment.title_link;
9
- export const isUploadedImage = (attachment) => attachment.type === 'image' && !isScrapedContent(attachment);
10
- export const isLocalImageAttachment = (attachment) => isUploadedImage(attachment) && isLocalAttachment(attachment);
11
- export const isGalleryAttachmentType = (output) => Array.isArray(output.images);
12
- export const isAudioAttachment = (attachment) => attachment.type === 'audio';
13
- export const isLocalAudioAttachment = (attachment) => isAudioAttachment(attachment) && isLocalAttachment(attachment);
14
- export const isVoiceRecordingAttachment = (attachment) => attachment.type === 'voiceRecording';
15
- export const isLocalVoiceRecordingAttachment = (attachment) => isVoiceRecordingAttachment(attachment) && isLocalAttachment(attachment);
16
- export const isFileAttachment = (attachment) => attachment.type === 'file' ||
17
- !!(attachment.mime_type &&
18
- SUPPORTED_VIDEO_FORMATS.indexOf(attachment.mime_type) === -1 &&
19
- attachment.type !== 'video');
20
- export const isLocalFileAttachment = (attachment) => isFileAttachment(attachment) && isLocalAttachment(attachment);
21
- export const isMediaAttachment = (attachment) => (attachment.mime_type &&
22
- SUPPORTED_VIDEO_FORMATS.indexOf(attachment.mime_type) !== -1) ||
23
- attachment.type === 'video';
24
- export const isLocalMediaAttachment = (attachment) => isMediaAttachment(attachment) && isLocalAttachment(attachment);
7
+ // This identity function determines attachment type specific to React.
8
+ // Once made sure other SDKs support the same logic, move to stream-chat-js
9
+ export const isGalleryAttachmentType = (attachment) => Array.isArray(attachment.images);
25
10
  export const isSvgAttachment = (attachment) => {
26
11
  const filename = attachment.fallback || '';
27
12
  return filename.toLowerCase().endsWith('.svg');
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { UserResponse } from 'stream-chat';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
- export type AvatarProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
3
+ export type AvatarProps = {
5
4
  /** Custom root element class that will be merged with the default class */
6
5
  className?: string;
7
6
  /** Image URL or default is an image of the first initial of the name if there is one */
@@ -13,9 +12,9 @@ export type AvatarProps<StreamChatGenerics extends DefaultStreamChatGenerics = D
13
12
  /** mouseOver event handler attached to the component root element */
14
13
  onMouseOver?: (event: React.BaseSyntheticEvent) => void;
15
14
  /** The entire user object for the chat user displayed in the component */
16
- user?: UserResponse<StreamChatGenerics>;
15
+ user?: UserResponse;
17
16
  };
18
17
  /**
19
18
  * A round avatar image with fallback to username's first letter
20
19
  */
21
- export declare const Avatar: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: AvatarProps<StreamChatGenerics>) => React.JSX.Element;
20
+ export declare const Avatar: (props: AvatarProps) => React.JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { AvatarProps, GroupAvatarProps } from './index';
3
- import type { DefaultStreamChatGenerics } from '../../types';
4
- export type ChannelAvatarProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Partial<GroupAvatarProps> & AvatarProps<StreamChatGenerics>;
5
- export declare const ChannelAvatar: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ groupChannelDisplayInfo, image, name, user, ...sharedProps }: ChannelAvatarProps<StreamChatGenerics>) => React.JSX.Element;
2
+ import type { AvatarProps, GroupAvatarProps } from './';
3
+ export type ChannelAvatarProps = Partial<GroupAvatarProps> & AvatarProps;
4
+ export declare const ChannelAvatar: ({ groupChannelDisplayInfo, image, name, user, ...sharedProps }: ChannelAvatarProps) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Avatar, GroupAvatar } from './index';
2
+ import { Avatar, GroupAvatar } from './';
3
3
  export const ChannelAvatar = ({ groupChannelDisplayInfo, image, name, user, ...sharedProps }) => {
4
4
  if (groupChannelDisplayInfo) {
5
5
  return (React.createElement(GroupAvatar, { groupChannelDisplayInfo: groupChannelDisplayInfo, ...sharedProps }));
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { AvatarProps } from './Avatar';
3
- import { GroupChannelDisplayInfo } from '../ChannelPreview';
2
+ import type { AvatarProps } from './Avatar';
3
+ import type { GroupChannelDisplayInfo } from '../ChannelPreview';
4
4
  export type GroupAvatarProps = Pick<AvatarProps, 'className' | 'onClick' | 'onMouseOver'> & {
5
5
  /** Mapping of image URLs to names which initials will be used as fallbacks in case image assets fail to load. */
6
6
  groupChannelDisplayInfo: GroupChannelDisplayInfo;
@@ -1,46 +1,33 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { OnMentionAction } from './hooks/useMentionsHandlers';
3
- import { LoadingErrorIndicatorProps } from '../Loading';
4
- import { ComponentContextValue, StreamMessage } from '../../context';
5
- import type { ChannelQueryOptions, EventAPIResponse, Message, MessageResponse, Channel as StreamChannel, StreamChat, UpdatedMessage } from 'stream-chat';
6
- import type { MessageInputProps } from '../MessageInput';
7
- import type { ChannelUnreadUiState, CustomTrigger, DefaultStreamChatGenerics, GiphyVersions, ImageAttachmentSizeHandler, SendMessageOptions, UpdateMessageOptions, VideoAttachmentSizeHandler } from '../../types/types';
8
- import type { URLEnrichmentConfig } from '../MessageInput/hooks/useLinkPreviews';
9
- type ChannelPropsForwardedToComponentContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<ComponentContextValue<StreamChatGenerics>, 'Attachment' | 'AttachmentPreviewList' | 'AttachmentSelector' | 'AttachmentSelectorInitiationButtonContents' | 'AudioRecorder' | 'AutocompleteSuggestionItem' | 'AutocompleteSuggestionList' | 'Avatar' | 'BaseImage' | 'CooldownTimer' | 'CustomMessageActionsList' | 'DateSeparator' | 'EditMessageInput' | 'EmojiPicker' | 'emojiSearchIndex' | 'EmptyStateIndicator' | 'FileUploadIcon' | 'GiphyPreviewMessage' | 'HeaderComponent' | 'Input' | 'LinkPreviewList' | 'LoadingIndicator' | 'Message' | 'MessageActions' | 'MessageBouncePrompt' | 'MessageBlocked' | 'MessageDeleted' | 'MessageListNotifications' | 'MessageListMainPanel' | 'MessageNotification' | 'MessageOptions' | 'MessageRepliesCountButton' | 'MessageStatus' | 'MessageSystem' | 'MessageTimestamp' | 'ModalGallery' | 'PinIndicator' | 'PollActions' | 'PollContent' | 'PollCreationDialog' | 'PollHeader' | 'PollOptionSelector' | 'QuotedMessage' | 'QuotedMessagePreview' | 'QuotedPoll' | 'reactionOptions' | 'ReactionSelector' | 'ReactionsList' | 'ReactionsListModal' | 'SendButton' | 'StartRecordingAudioButton' | 'ThreadHead' | 'ThreadHeader' | 'ThreadStart' | 'Timestamp' | 'TriggerProvider' | 'TypingIndicator' | 'UnreadMessagesNotification' | 'UnreadMessagesSeparator' | 'VirtualMessage' | 'StopAIGenerationButton' | 'StreamedMessageText'>;
10
- export type ChannelProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, V extends CustomTrigger = CustomTrigger> = ChannelPropsForwardedToComponentContext<StreamChatGenerics> & {
11
- /** List of accepted file types */
12
- acceptedFiles?: string[];
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ import type { ChannelQueryOptions, EventAPIResponse, LocalMessage, Message, MessageResponse, SendMessageOptions, Channel as StreamChannel, StreamChat, UpdateMessageOptions } from 'stream-chat';
4
+ import type { OnMentionAction } from './hooks/useMentionsHandlers';
5
+ import type { LoadingErrorIndicatorProps } from '../Loading';
6
+ import type { ComponentContextValue } from '../../context';
7
+ import type { ChannelUnreadUiState, GiphyVersions, ImageAttachmentSizeHandler, VideoAttachmentSizeHandler } from '../../types/types';
8
+ type ChannelPropsForwardedToComponentContext = Pick<ComponentContextValue, 'Attachment' | 'AttachmentPreviewList' | 'AttachmentSelector' | 'AttachmentSelectorInitiationButtonContents' | 'AudioRecorder' | 'AutocompleteSuggestionItem' | 'AutocompleteSuggestionList' | 'Avatar' | 'BaseImage' | 'CooldownTimer' | 'CustomMessageActionsList' | 'DateSeparator' | 'EditMessageInput' | 'EmojiPicker' | 'emojiSearchIndex' | 'EmptyStateIndicator' | 'FileUploadIcon' | 'GiphyPreviewMessage' | 'HeaderComponent' | 'Input' | 'LinkPreviewList' | 'LoadingIndicator' | 'Message' | 'MessageActions' | 'MessageBouncePrompt' | 'MessageBlocked' | 'MessageDeleted' | 'MessageListNotifications' | 'MessageListMainPanel' | 'MessageNotification' | 'MessageOptions' | 'MessageRepliesCountButton' | 'MessageStatus' | 'MessageSystem' | 'MessageTimestamp' | 'ModalGallery' | 'PinIndicator' | 'PollActions' | 'PollContent' | 'PollCreationDialog' | 'PollHeader' | 'PollOptionSelector' | 'QuotedMessage' | 'QuotedMessagePreview' | 'QuotedPoll' | 'reactionOptions' | 'ReactionSelector' | 'ReactionsList' | 'ReactionsListModal' | 'SendButton' | 'StartRecordingAudioButton' | 'ThreadHead' | 'ThreadHeader' | 'ThreadStart' | 'Timestamp' | 'TypingIndicator' | 'UnreadMessagesNotification' | 'UnreadMessagesSeparator' | 'VirtualMessage' | 'StopAIGenerationButton' | 'StreamedMessageText'>;
9
+ export type ChannelProps = ChannelPropsForwardedToComponentContext & {
13
10
  /** Custom handler function that runs when the active channel has unread messages and the app is running on a separate browser tab */
14
11
  activeUnreadHandler?: (unread: number, documentTitle: string) => void;
15
12
  /** The connected and active channel */
16
- channel?: StreamChannel<StreamChatGenerics>;
13
+ channel?: StreamChannel;
17
14
  /**
18
15
  * Optional configuration parameters used for the initial channel query.
19
16
  * Applied only if the value of channel.initialized is false.
20
17
  * If the channel instance has already been initialized (channel has been queried),
21
18
  * then the channel query will be skipped and channelQueryOptions will not be applied.
22
19
  */
23
- channelQueryOptions?: ChannelQueryOptions<StreamChatGenerics>;
20
+ channelQueryOptions?: ChannelQueryOptions;
24
21
  /** Custom action handler to override the default `client.deleteMessage(message.id)` function */
25
- doDeleteMessageRequest?: (message: StreamMessage<StreamChatGenerics>) => Promise<MessageResponse<StreamChatGenerics>>;
22
+ doDeleteMessageRequest?: (message: LocalMessage) => Promise<MessageResponse>;
26
23
  /** Custom action handler to override the default `channel.markRead` request function (advanced usage only) */
27
- doMarkReadRequest?: (channel: StreamChannel<StreamChatGenerics>, setChannelUnreadUiState?: (state: ChannelUnreadUiState) => void) => Promise<EventAPIResponse<StreamChatGenerics>> | void;
24
+ doMarkReadRequest?: (channel: StreamChannel, setChannelUnreadUiState?: (state: ChannelUnreadUiState) => void) => Promise<EventAPIResponse> | void;
28
25
  /** Custom action handler to override the default `channel.sendMessage` request function (advanced usage only) */
29
- doSendMessageRequest?: (channel: StreamChannel<StreamChatGenerics>, message: Message<StreamChatGenerics>, options?: SendMessageOptions) => ReturnType<StreamChannel<StreamChatGenerics>['sendMessage']> | void;
26
+ doSendMessageRequest?: (channel: StreamChannel, message: Message, options?: SendMessageOptions) => ReturnType<StreamChannel['sendMessage']> | void;
30
27
  /** Custom action handler to override the default `client.updateMessage` request function (advanced usage only) */
31
- doUpdateMessageRequest?: (cid: string, updatedMessage: UpdatedMessage<StreamChatGenerics>, options?: UpdateMessageOptions) => ReturnType<StreamChat<StreamChatGenerics>['updateMessage']>;
32
- /** If true, chat users will be able to drag and drop file uploads to the entire channel window */
33
- dragAndDropWindow?: boolean;
28
+ doUpdateMessageRequest?: (cid: string, updatedMessage: LocalMessage | MessageResponse, options?: UpdateMessageOptions) => ReturnType<StreamChat['updateMessage']>;
34
29
  /** Custom UI component to be shown if no active channel is set, defaults to null and skips rendering the Channel component */
35
30
  EmptyPlaceholder?: React.ReactElement;
36
- /**
37
- * A global flag to toggle the URL enrichment and link previews in `MessageInput` components.
38
- * By default, the feature is disabled. Can be overridden on Thread, MessageList level through additionalMessageInputProps
39
- * or directly on MessageInput level through urlEnrichmentConfig.
40
- */
41
- enrichURLForPreview?: URLEnrichmentConfig['enrichURLForPreview'];
42
- /** Global configuration for link preview generation in all the MessageInput components */
43
- enrichURLForPreviewConfig?: Omit<URLEnrichmentConfig, 'enrichURLForPreview'>;
44
31
  /** The giphy version to render - check the keys of the [Image Object](https://developers.giphy.com/docs/api/schema#image-object) for possible values. Uses 'fixed_height' by default */
45
32
  giphyVersion?: GiphyVersions;
46
33
  /** A custom function to provide size configuration for image attachments */
@@ -55,16 +42,10 @@ export type ChannelProps<StreamChatGenerics extends DefaultStreamChatGenerics =
55
42
  LoadingErrorIndicator?: React.ComponentType<LoadingErrorIndicatorProps>;
56
43
  /** Configuration parameter to mark the active channel as read when mounted (opened). By default, the channel is marked read on mount. */
57
44
  markReadOnMount?: boolean;
58
- /** Maximum number of attachments allowed per message */
59
- maxNumberOfFiles?: number;
60
- /** Whether to allow multiple attachment uploads */
61
- multipleUploads?: boolean;
62
45
  /** Custom action handler function to run on click of an @mention in a message */
63
- onMentionsClick?: OnMentionAction<StreamChatGenerics>;
46
+ onMentionsClick?: OnMentionAction;
64
47
  /** Custom action handler function to run on hover of an @mention in a message */
65
- onMentionsHover?: OnMentionAction<StreamChatGenerics>;
66
- /** If `dragAndDropWindow` prop is true, the props to pass to the MessageInput component (overrides props placed directly on MessageInput) */
67
- optionalMessageInputProps?: MessageInputProps<StreamChatGenerics, V>;
48
+ onMentionsHover?: OnMentionAction;
68
49
  /** You can turn on/off thumbnail generation for video attachments */
69
50
  shouldGenerateVideoThumbnail?: boolean;
70
51
  /** If true, skips the message data string comparison used to memoize the current channel messages (helpful for channels with 1000s of messages) */
@@ -80,5 +61,5 @@ export type ChannelProps<StreamChatGenerics extends DefaultStreamChatGenerics =
80
61
  * - [ComponentContext](https://getstream.io/chat/docs/sdk/react/contexts/component_context/)
81
62
  * - [TypingContext](https://getstream.io/chat/docs/sdk/react/contexts/typing_context/)
82
63
  */
83
- export declare const Channel: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, V extends CustomTrigger = CustomTrigger>(props: PropsWithChildren<ChannelProps<StreamChatGenerics, V>>) => React.JSX.Element;
64
+ export declare const Channel: (props: PropsWithChildren<ChannelProps>) => React.JSX.Element;
84
65
  export {};