stream-chat-react 12.13.1 → 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 (497) hide show
  1. package/README.md +27 -30
  2. package/dist/components/AIStateIndicator/AIStateIndicator.d.ts +4 -5
  3. package/dist/components/AIStateIndicator/hooks/useAIState.d.ts +2 -3
  4. package/dist/components/Attachment/Attachment.d.ts +8 -9
  5. package/dist/components/Attachment/Attachment.js +6 -5
  6. package/dist/components/Attachment/AttachmentActions.d.ts +2 -3
  7. package/dist/components/Attachment/AttachmentContainer.d.ts +15 -15
  8. package/dist/components/Attachment/AttachmentContainer.js +2 -2
  9. package/dist/components/Attachment/Audio.d.ts +3 -4
  10. package/dist/components/Attachment/Card.d.ts +1 -1
  11. package/dist/components/Attachment/FileAttachment.d.ts +3 -4
  12. package/dist/components/Attachment/FileAttachment.js +1 -1
  13. package/dist/components/Attachment/UnsupportedAttachment.d.ts +3 -4
  14. package/dist/components/Attachment/UnsupportedAttachment.js +1 -1
  15. package/dist/components/Attachment/VoiceRecording.d.ts +4 -5
  16. package/dist/components/Attachment/components/FileSizeIndicator.d.ts +1 -1
  17. package/dist/components/Attachment/components/FileSizeIndicator.js +4 -2
  18. package/dist/components/Attachment/utils.d.ts +8 -22
  19. package/dist/components/Attachment/utils.js +3 -18
  20. package/dist/components/Avatar/Avatar.d.ts +3 -4
  21. package/dist/components/Avatar/ChannelAvatar.d.ts +3 -4
  22. package/dist/components/Avatar/ChannelAvatar.js +1 -1
  23. package/dist/components/Avatar/GroupAvatar.d.ts +2 -2
  24. package/dist/components/Channel/Channel.d.ts +18 -37
  25. package/dist/components/Channel/Channel.js +31 -92
  26. package/dist/components/Channel/channelState.d.ts +17 -18
  27. package/dist/components/Channel/hooks/useChannelContainerClasses.d.ts +2 -3
  28. package/dist/components/Channel/hooks/useCreateChannelStateContext.d.ts +2 -3
  29. package/dist/components/Channel/hooks/useCreateChannelStateContext.js +1 -15
  30. package/dist/components/Channel/hooks/useCreateTypingContext.d.ts +1 -2
  31. package/dist/components/Channel/hooks/useEditMessageHandler.d.ts +3 -4
  32. package/dist/components/Channel/hooks/useMentionsHandlers.d.ts +3 -4
  33. package/dist/components/Channel/utils.d.ts +8 -6
  34. package/dist/components/Channel/utils.js +1 -0
  35. package/dist/components/ChannelHeader/ChannelHeader.d.ts +2 -3
  36. package/dist/components/ChannelList/ChannelList.d.ts +31 -30
  37. package/dist/components/ChannelList/ChannelList.js +8 -10
  38. package/dist/components/ChannelList/ChannelListMessenger.d.ts +6 -6
  39. package/dist/components/ChannelList/hooks/useChannelDeletedListener.d.ts +1 -2
  40. package/dist/components/ChannelList/hooks/useChannelHiddenListener.d.ts +1 -2
  41. package/dist/components/ChannelList/hooks/useChannelListShape.d.ts +44 -44
  42. package/dist/components/ChannelList/hooks/useChannelListShape.js +0 -2
  43. package/dist/components/ChannelList/hooks/useChannelMembershipState.d.ts +3 -3
  44. package/dist/components/ChannelList/hooks/useChannelTruncatedListener.d.ts +1 -2
  45. package/dist/components/ChannelList/hooks/useChannelUpdatedListener.d.ts +1 -2
  46. package/dist/components/ChannelList/hooks/useChannelVisibleListener.d.ts +1 -2
  47. package/dist/components/ChannelList/hooks/useConnectionRecoveredListener.d.ts +1 -2
  48. package/dist/components/ChannelList/hooks/useMessageNewListener.d.ts +1 -2
  49. package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts +1 -2
  50. package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts +1 -2
  51. package/dist/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts +1 -2
  52. package/dist/components/ChannelList/hooks/usePaginatedChannels.d.ts +7 -8
  53. package/dist/components/ChannelList/hooks/usePaginatedChannels.js +3 -3
  54. package/dist/components/ChannelList/hooks/useSelectedChannelState.d.ts +7 -7
  55. package/dist/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts +1 -2
  56. package/dist/components/ChannelList/utils.d.ts +20 -21
  57. package/dist/components/ChannelList/utils.js +2 -2
  58. package/dist/components/ChannelPreview/ChannelPreview.d.ts +15 -16
  59. package/dist/components/ChannelPreview/ChannelPreview.js +1 -1
  60. package/dist/components/ChannelPreview/ChannelPreviewActionButtons.d.ts +4 -4
  61. package/dist/components/ChannelPreview/ChannelPreviewMessenger.d.ts +1 -2
  62. package/dist/components/ChannelPreview/hooks/useChannelPreviewInfo.d.ts +3 -4
  63. package/dist/components/ChannelPreview/hooks/useIsChannelMuted.d.ts +1 -2
  64. package/dist/components/ChannelPreview/hooks/useMessageDeliveryStatus.d.ts +5 -7
  65. package/dist/components/ChannelPreview/icons.d.ts +1 -1
  66. package/dist/components/ChannelPreview/utils.d.ts +7 -7
  67. package/dist/components/ChannelSearch/ChannelSearch.d.ts +5 -6
  68. package/dist/components/ChannelSearch/ChannelSearch.js +2 -2
  69. package/dist/components/ChannelSearch/SearchBar.d.ts +1 -1
  70. package/dist/components/ChannelSearch/SearchBar.js +1 -1
  71. package/dist/components/ChannelSearch/SearchResults.d.ts +13 -14
  72. package/dist/components/ChannelSearch/SearchResults.js +1 -1
  73. package/dist/components/ChannelSearch/hooks/useChannelSearch.d.ts +17 -18
  74. package/dist/components/ChannelSearch/hooks/useChannelSearch.js +2 -6
  75. package/dist/components/ChannelSearch/utils.d.ts +2 -3
  76. package/dist/components/Chat/Chat.d.ts +9 -9
  77. package/dist/components/Chat/hooks/useChannelsQueryState.d.ts +1 -1
  78. package/dist/components/Chat/hooks/useChat.d.ts +10 -10
  79. package/dist/components/Chat/hooks/useChat.js +4 -3
  80. package/dist/components/Chat/hooks/useCreateChatClient.d.ts +4 -4
  81. package/dist/components/Chat/hooks/useCreateChatContext.d.ts +1 -2
  82. package/dist/components/Dialog/DialogAnchor.d.ts +4 -3
  83. package/dist/components/Dialog/DialogAnchor.js +2 -2
  84. package/dist/components/Dialog/DialogMenu.d.ts +2 -1
  85. package/dist/components/Dialog/DialogPortal.d.ts +2 -1
  86. package/dist/components/Dialog/FormDialog.d.ts +2 -1
  87. package/dist/components/Dialog/FormDialog.js +1 -1
  88. package/dist/components/Dialog/PromptDialog.d.ts +2 -1
  89. package/dist/components/DragAndDrop/DragAndDropContainer.d.ts +2 -1
  90. package/dist/components/EventComponent/EventComponent.d.ts +7 -6
  91. package/dist/components/Form/FieldError.d.ts +2 -1
  92. package/dist/components/Form/SwitchField.d.ts +2 -1
  93. package/dist/components/Form/SwitchField.js +1 -1
  94. package/dist/components/Gallery/Gallery.d.ts +5 -5
  95. package/dist/components/Gallery/Image.d.ts +6 -5
  96. package/dist/components/Gallery/ModalGallery.d.ts +3 -4
  97. package/dist/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +2 -1
  98. package/dist/components/InfiniteScrollPaginator/InfiniteScrollPaginator.d.ts +2 -1
  99. package/dist/components/LoadMore/LoadMoreButton.d.ts +2 -1
  100. package/dist/components/LoadMore/LoadMorePaginator.d.ts +3 -2
  101. package/dist/components/LoadMore/LoadMorePaginator.js +1 -1
  102. package/dist/components/MediaRecorder/AudioRecorder/AudioRecorder.js +3 -2
  103. package/dist/components/MediaRecorder/AudioRecorder/AudioRecordingInProgress.js +1 -1
  104. package/dist/components/MediaRecorder/RecordingPermissionDeniedNotification.d.ts +1 -1
  105. package/dist/components/MediaRecorder/classes/MediaRecorderController.d.ts +11 -23
  106. package/dist/components/MediaRecorder/hooks/useMediaRecorder.d.ts +8 -8
  107. package/dist/components/MediaRecorder/hooks/useMediaRecorder.js +6 -4
  108. package/dist/components/MediaRecorder/observable/BehaviorSubject.d.ts +2 -2
  109. package/dist/components/MediaRecorder/observable/Observable.d.ts +1 -1
  110. package/dist/components/MediaRecorder/observable/Subject.d.ts +3 -2
  111. package/dist/components/Message/FixedHeightMessage.d.ts +4 -5
  112. package/dist/components/Message/Message.d.ts +1 -2
  113. package/dist/components/Message/MessageBlocked.d.ts +2 -0
  114. package/dist/components/Message/MessageBlocked.js +16 -0
  115. package/dist/components/Message/MessageDeleted.d.ts +4 -5
  116. package/dist/components/Message/MessageEditedTimestamp.d.ts +2 -3
  117. package/dist/components/Message/MessageErrorText.d.ts +4 -5
  118. package/dist/components/Message/MessageErrorText.js +2 -2
  119. package/dist/components/Message/MessageOptions.d.ts +3 -3
  120. package/dist/components/Message/MessageRepliesCountButton.d.ts +2 -1
  121. package/dist/components/Message/MessageSimple.d.ts +1 -2
  122. package/dist/components/Message/MessageSimple.js +14 -12
  123. package/dist/components/Message/MessageStatus.d.ts +3 -4
  124. package/dist/components/Message/MessageText.d.ts +6 -6
  125. package/dist/components/Message/MessageTimestamp.d.ts +4 -5
  126. package/dist/components/Message/QuotedMessage.d.ts +2 -3
  127. package/dist/components/Message/QuotedMessage.js +1 -1
  128. package/dist/components/Message/StreamedMessageText.d.ts +3 -4
  129. package/dist/components/Message/hooks/useActionHandler.d.ts +2 -3
  130. package/dist/components/Message/hooks/useActionHandler.js +1 -1
  131. package/dist/components/Message/hooks/useDeleteHandler.d.ts +4 -5
  132. package/dist/components/Message/hooks/useFlagHandler.d.ts +5 -6
  133. package/dist/components/Message/hooks/useMarkUnreadHandler.d.ts +5 -6
  134. package/dist/components/Message/hooks/useMentionsHandler.d.ts +6 -8
  135. package/dist/components/Message/hooks/useMessageTextStreaming.d.ts +2 -3
  136. package/dist/components/Message/hooks/useMuteHandler.d.ts +5 -7
  137. package/dist/components/Message/hooks/useMuteHandler.js +1 -1
  138. package/dist/components/Message/hooks/useOpenThreadHandler.d.ts +2 -3
  139. package/dist/components/Message/hooks/usePinHandler.d.ts +4 -5
  140. package/dist/components/Message/hooks/usePinHandler.js +1 -1
  141. package/dist/components/Message/hooks/useReactionHandler.d.ts +3 -4
  142. package/dist/components/Message/hooks/useReactionHandler.js +2 -4
  143. package/dist/components/Message/hooks/useReactionsFetcher.d.ts +5 -7
  144. package/dist/components/Message/hooks/useRetryHandler.d.ts +2 -3
  145. package/dist/components/Message/hooks/useRetryHandler.js +1 -1
  146. package/dist/components/Message/hooks/useUserHandler.d.ts +5 -6
  147. package/dist/components/Message/hooks/useUserRole.d.ts +2 -3
  148. package/dist/components/Message/hooks/useUserRole.js +1 -1
  149. package/dist/components/Message/icons.d.ts +2 -2
  150. package/dist/components/Message/icons.js +1 -1
  151. package/dist/components/Message/renderText/componentRenderers/Anchor.d.ts +2 -1
  152. package/dist/components/Message/renderText/componentRenderers/Emoji.d.ts +1 -1
  153. package/dist/components/Message/renderText/componentRenderers/Mention.d.ts +5 -5
  154. package/dist/components/Message/renderText/componentRenderers/Mention.js +1 -1
  155. package/dist/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.d.ts +1 -2
  156. package/dist/components/Message/renderText/renderText.d.ts +6 -6
  157. package/dist/components/Message/renderText/types.d.ts +1 -1
  158. package/dist/components/Message/types.d.ts +27 -28
  159. package/dist/components/Message/utils.d.ts +21 -21
  160. package/dist/components/Message/utils.js +8 -4
  161. package/dist/components/MessageActions/CustomMessageActionsList.d.ts +6 -7
  162. package/dist/components/MessageActions/MessageActions.d.ts +6 -5
  163. package/dist/components/MessageActions/MessageActions.js +1 -1
  164. package/dist/components/MessageActions/MessageActionsBox.d.ts +5 -5
  165. package/dist/components/MessageActions/MessageActionsBox.js +4 -3
  166. package/dist/components/MessageActions/hooks/useMessageActionsBoxPopper.d.ts +1 -1
  167. package/dist/components/MessageBounce/MessageBounceModal.d.ts +4 -3
  168. package/dist/components/MessageBounce/MessageBouncePrompt.d.ts +1 -2
  169. package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.d.ts +11 -11
  170. package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.js +17 -14
  171. package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.d.ts +4 -12
  172. package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.js +8 -5
  173. package/dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.d.ts +4 -5
  174. package/dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.js +2 -2
  175. package/dist/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.d.ts +7 -5
  176. package/dist/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.js +5 -2
  177. package/dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.d.ts +4 -5
  178. package/dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.js +5 -2
  179. package/dist/components/MessageInput/AttachmentPreviewList/index.d.ts +1 -1
  180. package/dist/components/MessageInput/AttachmentPreviewList/types.d.ts +3 -4
  181. package/dist/components/MessageInput/AttachmentSelector.d.ts +1 -2
  182. package/dist/components/MessageInput/AttachmentSelector.js +5 -3
  183. package/dist/components/MessageInput/EditMessageForm.d.ts +3 -2
  184. package/dist/components/MessageInput/EditMessageForm.js +30 -6
  185. package/dist/components/MessageInput/LinkPreviewList.d.ts +6 -4
  186. package/dist/components/MessageInput/LinkPreviewList.js +24 -10
  187. package/dist/components/MessageInput/MessageInput.d.ts +23 -45
  188. package/dist/components/MessageInput/MessageInput.js +25 -15
  189. package/dist/components/MessageInput/MessageInputFlat.d.ts +1 -2
  190. package/dist/components/MessageInput/MessageInputFlat.js +31 -76
  191. package/dist/components/MessageInput/QuotedMessagePreview.d.ts +4 -7
  192. package/dist/components/MessageInput/QuotedMessagePreview.js +22 -16
  193. package/dist/components/MessageInput/SendButton.d.ts +4 -5
  194. package/dist/components/MessageInput/SendButton.js +6 -2
  195. package/dist/components/MessageInput/WithDragAndDropUpload.d.ts +38 -0
  196. package/dist/components/MessageInput/WithDragAndDropUpload.js +96 -0
  197. package/dist/components/MessageInput/hooks/index.d.ts +5 -1
  198. package/dist/components/MessageInput/hooks/index.js +5 -1
  199. package/dist/components/MessageInput/hooks/useAttachmentManagerState.d.ts +10 -0
  200. package/dist/components/MessageInput/hooks/useAttachmentManagerState.js +19 -0
  201. package/dist/components/MessageInput/hooks/useCanCreatePoll.d.ts +1 -0
  202. package/dist/components/MessageInput/hooks/useCanCreatePoll.js +10 -0
  203. package/dist/components/MessageInput/hooks/useCooldownTimer.d.ts +2 -3
  204. package/dist/components/MessageInput/hooks/useCreateMessageInputContext.d.ts +1 -2
  205. package/dist/components/MessageInput/hooks/useCreateMessageInputContext.js +1 -55
  206. package/dist/components/MessageInput/hooks/useMessageComposer.d.ts +2 -0
  207. package/dist/components/MessageInput/hooks/useMessageComposer.js +80 -0
  208. package/dist/components/MessageInput/hooks/useMessageComposerHasSendableData.d.ts +1 -0
  209. package/dist/components/MessageInput/hooks/useMessageComposerHasSendableData.js +8 -0
  210. package/dist/components/MessageInput/hooks/useMessageInputControls.d.ts +12 -0
  211. package/dist/components/MessageInput/hooks/useMessageInputControls.js +23 -0
  212. package/dist/components/MessageInput/hooks/useMessageInputText.d.ts +1 -5
  213. package/dist/components/MessageInput/hooks/useMessageInputText.js +19 -53
  214. package/dist/components/MessageInput/hooks/usePasteHandler.d.ts +1 -3
  215. package/dist/components/MessageInput/hooks/usePasteHandler.js +6 -8
  216. package/dist/components/MessageInput/hooks/useSubmitHandler.d.ts +2 -6
  217. package/dist/components/MessageInput/hooks/useSubmitHandler.js +30 -98
  218. package/dist/components/MessageInput/hooks/utils.d.ts +0 -27
  219. package/dist/components/MessageInput/hooks/utils.js +0 -124
  220. package/dist/components/MessageInput/index.d.ts +1 -2
  221. package/dist/components/MessageInput/index.js +1 -2
  222. package/dist/components/MessageList/ConnectionStatus.d.ts +1 -2
  223. package/dist/components/MessageList/ConnectionStatus.js +1 -1
  224. package/dist/components/MessageList/CustomNotification.d.ts +2 -1
  225. package/dist/components/MessageList/GiphyPreviewMessage.d.ts +4 -5
  226. package/dist/components/MessageList/MessageList.d.ts +11 -12
  227. package/dist/components/MessageList/MessageList.js +4 -4
  228. package/dist/components/MessageList/MessageNotification.d.ts +2 -1
  229. package/dist/components/MessageList/VirtualizedMessageList.d.ts +22 -21
  230. package/dist/components/MessageList/VirtualizedMessageList.js +6 -6
  231. package/dist/components/MessageList/VirtualizedMessageListComponents.d.ts +10 -10
  232. package/dist/components/MessageList/VirtualizedMessageListComponents.js +7 -7
  233. package/dist/components/MessageList/hooks/MessageList/useEnrichedMessages.d.ts +8 -10
  234. package/dist/components/MessageList/hooks/MessageList/useEnrichedMessages.js +1 -1
  235. package/dist/components/MessageList/hooks/MessageList/useMessageListElements.d.ts +11 -12
  236. package/dist/components/MessageList/hooks/MessageList/useMessageListScrollManager.d.ts +4 -5
  237. package/dist/components/MessageList/hooks/MessageList/useScrollLocationLogic.d.ts +5 -6
  238. package/dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.d.ts +4 -5
  239. package/dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.js +3 -2
  240. package/dist/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.d.ts +4 -5
  241. package/dist/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.js +1 -1
  242. package/dist/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.d.ts +2 -3
  243. package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.d.ts +2 -3
  244. package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.js +6 -2
  245. package/dist/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.d.ts +4 -5
  246. package/dist/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.d.ts +2 -3
  247. package/dist/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.d.ts +3 -4
  248. package/dist/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.js +5 -6
  249. package/dist/components/MessageList/hooks/useLastReadData.d.ts +5 -6
  250. package/dist/components/MessageList/hooks/useLastReadData.js +5 -1
  251. package/dist/components/MessageList/hooks/useMarkRead.d.ts +1 -2
  252. package/dist/components/MessageList/renderMessages.d.ts +14 -14
  253. package/dist/components/MessageList/renderMessages.js +8 -7
  254. package/dist/components/MessageList/utils.d.ts +34 -28
  255. package/dist/components/MessageList/utils.js +26 -21
  256. package/dist/components/Modal/Modal.d.ts +2 -1
  257. package/dist/components/Poll/Poll.d.ts +2 -3
  258. package/dist/components/Poll/Poll.js +1 -1
  259. package/dist/components/Poll/PollActions/AddCommentForm.d.ts +1 -2
  260. package/dist/components/Poll/PollActions/AddCommentForm.js +4 -2
  261. package/dist/components/Poll/PollActions/EndPollDialog.d.ts +1 -2
  262. package/dist/components/Poll/PollActions/EndPollDialog.js +1 -1
  263. package/dist/components/Poll/PollActions/PollAction.d.ts +2 -1
  264. package/dist/components/Poll/PollActions/PollActions.d.ts +7 -8
  265. package/dist/components/Poll/PollActions/PollActions.js +5 -5
  266. package/dist/components/Poll/PollActions/PollAnswerList.d.ts +1 -2
  267. package/dist/components/Poll/PollActions/PollOptionsFullList.d.ts +1 -2
  268. package/dist/components/Poll/PollActions/PollOptionsFullList.js +4 -2
  269. package/dist/components/Poll/PollActions/PollResults/PollOptionVotesList.d.ts +3 -4
  270. package/dist/components/Poll/PollActions/PollResults/PollOptionVotesList.js +1 -1
  271. package/dist/components/Poll/PollActions/PollResults/PollOptionWithLatestVotes.d.ts +3 -4
  272. package/dist/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.d.ts +4 -5
  273. package/dist/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.js +1 -1
  274. package/dist/components/Poll/PollActions/PollResults/PollResults.d.ts +1 -2
  275. package/dist/components/Poll/PollActions/PollResults/PollResults.js +1 -1
  276. package/dist/components/Poll/PollActions/SuggestPollOptionForm.d.ts +1 -2
  277. package/dist/components/Poll/PollActions/SuggestPollOptionForm.js +3 -1
  278. package/dist/components/Poll/PollContent.d.ts +1 -2
  279. package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.d.ts +2 -0
  280. package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.js +35 -0
  281. package/dist/components/Poll/PollCreationDialog/NameField.d.ts +2 -0
  282. package/dist/components/Poll/PollCreationDialog/NameField.js +26 -0
  283. package/dist/components/Poll/PollCreationDialog/OptionFieldSet.d.ts +1 -8
  284. package/dist/components/Poll/PollCreationDialog/OptionFieldSet.js +33 -65
  285. package/dist/components/Poll/PollCreationDialog/PollCreationDialog.js +31 -85
  286. package/dist/components/Poll/PollCreationDialog/PollCreationDialogControls.d.ts +1 -4
  287. package/dist/components/Poll/PollCreationDialog/PollCreationDialogControls.js +15 -41
  288. package/dist/components/Poll/PollCreationDialog/types.d.ts +0 -14
  289. package/dist/components/Poll/PollHeader.d.ts +1 -2
  290. package/dist/components/Poll/PollOptionList.d.ts +1 -2
  291. package/dist/components/Poll/PollOptionList.js +4 -2
  292. package/dist/components/Poll/PollOptionSelector.d.ts +3 -4
  293. package/dist/components/Poll/PollVote.d.ts +6 -7
  294. package/dist/components/Poll/PollVote.js +3 -3
  295. package/dist/components/Poll/QuotedPoll.d.ts +1 -2
  296. package/dist/components/Poll/constants.d.ts +0 -1
  297. package/dist/components/Poll/constants.js +0 -1
  298. package/dist/components/Poll/hooks/useManagePollVotesRealtime.d.ts +2 -3
  299. package/dist/components/Poll/hooks/usePollAnswerPagination.d.ts +2 -3
  300. package/dist/components/Poll/hooks/usePollAnswerPagination.js +2 -2
  301. package/dist/components/Poll/hooks/usePollOptionVotesPagination.d.ts +2 -3
  302. package/dist/components/Poll/hooks/usePollOptionVotesPagination.js +1 -1
  303. package/dist/components/Portal/Portal.d.ts +1 -1
  304. package/dist/components/ReactFileUtilities/FileIcon/FileIcon.d.ts +1 -1
  305. package/dist/components/ReactFileUtilities/FileIcon/FileIconSet.d.ts +2 -1
  306. package/dist/components/ReactFileUtilities/FileIcon/iconMap.d.ts +1 -1
  307. package/dist/components/ReactFileUtilities/UploadButton.d.ts +3 -2
  308. package/dist/components/ReactFileUtilities/UploadButton.js +16 -6
  309. package/dist/components/ReactFileUtilities/index.d.ts +0 -1
  310. package/dist/components/ReactFileUtilities/index.js +0 -1
  311. package/dist/components/ReactFileUtilities/utils.d.ts +2 -2
  312. package/dist/components/Reactions/ReactionSelector.d.ts +4 -5
  313. package/dist/components/Reactions/ReactionSelectorWithButton.d.ts +1 -2
  314. package/dist/components/Reactions/ReactionsList.d.ts +6 -7
  315. package/dist/components/Reactions/ReactionsList.js +2 -2
  316. package/dist/components/Reactions/ReactionsListModal.d.ts +9 -10
  317. package/dist/components/Reactions/SimpleReactionsList.d.ts +5 -6
  318. package/dist/components/Reactions/StreamEmoji.d.ts +1 -1
  319. package/dist/components/Reactions/hooks/useFetchReactions.d.ts +9 -10
  320. package/dist/components/Reactions/hooks/useProcessReactions.d.ts +1 -2
  321. package/dist/components/Reactions/types.d.ts +3 -4
  322. package/dist/components/Reactions/utils/utils.d.ts +1 -1
  323. package/dist/components/SafeAnchor/SafeAnchor.d.ts +2 -1
  324. package/dist/components/{CommandItem → TextareaComposer/SuggestionList}/CommandItem.d.ts +2 -1
  325. package/dist/components/{CommandItem → TextareaComposer/SuggestionList}/CommandItem.js +1 -2
  326. package/dist/components/{EmoticonItem → TextareaComposer/SuggestionList}/EmoticonItem.d.ts +7 -7
  327. package/dist/components/TextareaComposer/SuggestionList/EmoticonItem.js +12 -0
  328. package/dist/components/TextareaComposer/SuggestionList/SuggestionList.d.ts +16 -0
  329. package/dist/components/TextareaComposer/SuggestionList/SuggestionList.js +49 -0
  330. package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.d.ts +18 -0
  331. package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.js +25 -0
  332. package/dist/components/{UserItem → TextareaComposer/SuggestionList}/UserItem.d.ts +7 -4
  333. package/dist/components/TextareaComposer/SuggestionList/UserItem.js +24 -0
  334. package/dist/components/TextareaComposer/SuggestionList/index.d.ts +5 -0
  335. package/dist/components/TextareaComposer/SuggestionList/index.js +5 -0
  336. package/dist/components/TextareaComposer/TextareaComposer.d.ts +13 -0
  337. package/dist/components/TextareaComposer/TextareaComposer.js +155 -0
  338. package/dist/components/TextareaComposer/index.d.ts +2 -0
  339. package/dist/components/TextareaComposer/index.js +2 -0
  340. package/dist/components/Thread/Thread.d.ts +13 -10
  341. package/dist/components/Thread/Thread.js +23 -12
  342. package/dist/components/Thread/ThreadHead.d.ts +2 -3
  343. package/dist/components/Thread/ThreadHeader.d.ts +5 -6
  344. package/dist/components/Thread/ThreadHeader.js +1 -1
  345. package/dist/components/Threads/ThreadContext.d.ts +2 -2
  346. package/dist/components/Threads/ThreadContext.js +1 -4
  347. package/dist/components/Threads/ThreadList/ThreadList.d.ts +1 -1
  348. package/dist/components/Threads/ThreadList/ThreadListItem.d.ts +1 -1
  349. package/dist/components/Threads/hooks/useThreadManagerState.d.ts +1 -1
  350. package/dist/components/Threads/hooks/useThreadState.d.ts +1 -1
  351. package/dist/components/Threads/icons.d.ts +1 -1
  352. package/dist/components/Tooltip/Tooltip.d.ts +3 -2
  353. package/dist/components/Tooltip/hooks/useEnterLeaveHandlers.d.ts +1 -1
  354. package/dist/components/TypingIndicator/TypingIndicator.d.ts +1 -2
  355. package/dist/components/Window/Window.d.ts +6 -6
  356. package/dist/components/index.d.ts +1 -5
  357. package/dist/components/index.js +1 -5
  358. package/dist/context/AttachmentSelectorContext.d.ts +2 -1
  359. package/dist/context/ChannelActionContext.d.ts +26 -35
  360. package/dist/context/ChannelListContext.d.ts +9 -9
  361. package/dist/context/ChannelListContext.js +1 -1
  362. package/dist/context/ChannelStateContext.d.ts +24 -34
  363. package/dist/context/ChatContext.d.ts +18 -17
  364. package/dist/context/ComponentContext.d.ts +41 -37
  365. package/dist/context/DialogManagerContext.d.ts +2 -1
  366. package/dist/context/MessageBounceContext.d.ts +8 -7
  367. package/dist/context/MessageBounceContext.js +1 -1
  368. package/dist/context/MessageContext.d.ts +23 -23
  369. package/dist/context/MessageInputContext.d.ts +8 -26
  370. package/dist/context/MessageInputContext.js +3 -2
  371. package/dist/context/MessageListContext.d.ts +2 -1
  372. package/dist/context/PollContext.d.ts +8 -8
  373. package/dist/context/TranslationContext.d.ts +2 -1
  374. package/dist/context/TypingContext.d.ts +11 -10
  375. package/dist/context/VirtualizedMessageListContext.d.ts +2 -1
  376. package/dist/context/WithComponents.d.ts +3 -2
  377. package/dist/css/v2/index.css +1 -1
  378. package/dist/css/v2/index.layout.css +1 -1
  379. package/dist/experimental/MessageActions/MessageActions.d.ts +1 -1
  380. package/dist/experimental/MessageActions/MessageActions.js +1 -1
  381. package/dist/experimental/MessageActions/defaults.js +4 -3
  382. package/dist/experimental/Search/Search.d.ts +1 -2
  383. package/dist/experimental/Search/SearchContext.d.ts +8 -8
  384. package/dist/experimental/Search/SearchResults/SearchResultItem.d.ts +11 -11
  385. package/dist/experimental/Search/SearchResults/SearchResultItem.js +3 -3
  386. package/dist/experimental/Search/SearchResults/SearchResults.d.ts +1 -2
  387. package/dist/experimental/Search/SearchResults/SearchResultsHeader.d.ts +1 -2
  388. package/dist/experimental/Search/SearchResults/SearchResultsHeader.js +1 -1
  389. package/dist/experimental/Search/SearchResults/SearchSourceResultList.d.ts +2 -3
  390. package/dist/experimental/Search/SearchResults/SearchSourceResultListFooter.d.ts +1 -2
  391. package/dist/experimental/Search/SearchResults/SearchSourceResults.d.ts +1 -2
  392. package/dist/experimental/Search/SearchResults/SearchSourceResults.js +1 -1
  393. package/dist/experimental/Search/SearchSourceResultsContext.d.ts +2 -1
  394. package/dist/experimental/Search/hooks/useSearchFocusedMessage.d.ts +1 -2
  395. package/dist/experimental/Search/hooks/useSearchFocusedMessage.js +3 -1
  396. package/dist/experimental/Search/hooks/useSearchQueriesInProgress.d.ts +3 -4
  397. package/dist/experimental/index.browser.cjs +1139 -1075
  398. package/dist/experimental/index.browser.cjs.map +4 -4
  399. package/dist/experimental/index.node.cjs +1139 -1075
  400. package/dist/experimental/index.node.cjs.map +4 -4
  401. package/dist/i18n/Streami18n.d.ts +2 -1
  402. package/dist/i18n/de.json +1 -0
  403. package/dist/i18n/en.json +1 -0
  404. package/dist/i18n/es.json +1 -0
  405. package/dist/i18n/fr.json +1 -0
  406. package/dist/i18n/hi.json +1 -0
  407. package/dist/i18n/it.json +1 -0
  408. package/dist/i18n/ja.json +1 -0
  409. package/dist/i18n/ko.json +1 -0
  410. package/dist/i18n/nl.json +1 -0
  411. package/dist/i18n/pt.json +1 -0
  412. package/dist/i18n/ru.json +1 -0
  413. package/dist/i18n/tr.json +1 -0
  414. package/dist/i18n/types.d.ts +2 -2
  415. package/dist/i18n/utils.d.ts +1 -1
  416. package/dist/i18n/utils.js +3 -1
  417. package/dist/index.browser.cjs +28774 -30813
  418. package/dist/index.browser.cjs.map +4 -4
  419. package/dist/index.node.cjs +30798 -32844
  420. package/dist/index.node.cjs.map +4 -4
  421. package/dist/plugins/Emojis/index.browser.cjs +133 -5
  422. package/dist/plugins/Emojis/index.browser.cjs.map +4 -4
  423. package/dist/plugins/Emojis/index.d.ts +1 -0
  424. package/dist/plugins/Emojis/index.js +1 -0
  425. package/dist/plugins/Emojis/index.node.cjs +135 -6
  426. package/dist/plugins/Emojis/index.node.cjs.map +4 -4
  427. package/dist/plugins/Emojis/middleware/index.d.ts +1 -0
  428. package/dist/plugins/Emojis/middleware/index.js +1 -0
  429. package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.d.ts +66 -0
  430. package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.js +143 -0
  431. package/dist/plugins/encoders/mp3.browser.cjs.map +2 -2
  432. package/dist/plugins/encoders/mp3.node.cjs.map +2 -2
  433. package/dist/scss/v2/Autocomplete/Autocomplete-layout.scss +14 -0
  434. package/dist/scss/v2/Autocomplete/Autocomplete-theme.scss +11 -0
  435. package/dist/scss/v2/DropzoneContainer/DropzoneContainer-layout.scss +14 -0
  436. package/dist/scss/v2/DropzoneContainer/DropzoneContainer-theme.scss +17 -0
  437. package/dist/scss/v2/LinkPreview/LinkPreview-layout.scss +18 -0
  438. package/dist/scss/v2/LinkPreview/LinkPreview-theme.scss +15 -0
  439. package/dist/scss/v2/Message/Message-layout.scss +8 -0
  440. package/dist/scss/v2/Message/Message-theme.scss +29 -0
  441. package/dist/scss/v2/MessageInput/MessageInput-layout.scss +0 -13
  442. package/dist/scss/v2/MessageInput/MessageInput-theme.scss +8 -19
  443. package/dist/scss/v2/index.layout.scss +2 -1
  444. package/dist/scss/v2/index.scss +1 -0
  445. package/dist/types/defaultDataInterfaces.d.ts +25 -0
  446. package/dist/types/index.d.ts +2 -1
  447. package/dist/types/types.d.ts +2 -62
  448. package/dist/utils/getChannel.d.ts +5 -6
  449. package/dist/utils/mergeDeep.d.ts +2 -3
  450. package/package.json +8 -11
  451. package/dist/components/AutoCompleteTextarea/Item.d.ts +0 -2
  452. package/dist/components/AutoCompleteTextarea/Item.js +0 -10
  453. package/dist/components/AutoCompleteTextarea/List.d.ts +0 -17
  454. package/dist/components/AutoCompleteTextarea/List.js +0 -89
  455. package/dist/components/AutoCompleteTextarea/Textarea.d.ts +0 -114
  456. package/dist/components/AutoCompleteTextarea/Textarea.js +0 -593
  457. package/dist/components/AutoCompleteTextarea/index.d.ts +0 -4
  458. package/dist/components/AutoCompleteTextarea/index.js +0 -4
  459. package/dist/components/AutoCompleteTextarea/types.d.ts +0 -15
  460. package/dist/components/AutoCompleteTextarea/utils.d.ts +0 -6
  461. package/dist/components/AutoCompleteTextarea/utils.js +0 -40
  462. package/dist/components/ChatAutoComplete/ChatAutoComplete.d.ts +0 -78
  463. package/dist/components/ChatAutoComplete/ChatAutoComplete.js +0 -33
  464. package/dist/components/ChatAutoComplete/index.d.ts +0 -1
  465. package/dist/components/ChatAutoComplete/index.js +0 -1
  466. package/dist/components/CommandItem/index.d.ts +0 -1
  467. package/dist/components/CommandItem/index.js +0 -1
  468. package/dist/components/EmoticonItem/EmoticonItem.js +0 -16
  469. package/dist/components/EmoticonItem/index.d.ts +0 -1
  470. package/dist/components/EmoticonItem/index.js +0 -1
  471. package/dist/components/MessageInput/DefaultTriggerProvider.d.ts +0 -35
  472. package/dist/components/MessageInput/DefaultTriggerProvider.js +0 -24
  473. package/dist/components/MessageInput/DropzoneProvider.d.ts +0 -4
  474. package/dist/components/MessageInput/DropzoneProvider.js +0 -23
  475. package/dist/components/MessageInput/hooks/useAttachments.d.ts +0 -14
  476. package/dist/components/MessageInput/hooks/useAttachments.js +0 -209
  477. package/dist/components/MessageInput/hooks/useCommandTrigger.d.ts +0 -3
  478. package/dist/components/MessageInput/hooks/useCommandTrigger.js +0 -62
  479. package/dist/components/MessageInput/hooks/useEmojiTrigger.d.ts +0 -3
  480. package/dist/components/MessageInput/hooks/useEmojiTrigger.js +0 -29
  481. package/dist/components/MessageInput/hooks/useLinkPreviews.d.ts +0 -30
  482. package/dist/components/MessageInput/hooks/useLinkPreviews.js +0 -109
  483. package/dist/components/MessageInput/hooks/useMessageInputState.d.ts +0 -71
  484. package/dist/components/MessageInput/hooks/useMessageInputState.js +0 -200
  485. package/dist/components/MessageInput/hooks/useUserTrigger.d.ts +0 -12
  486. package/dist/components/MessageInput/hooks/useUserTrigger.js +0 -130
  487. package/dist/components/MessageInput/types.d.ts +0 -87
  488. package/dist/components/MessageInput/types.js +0 -19
  489. package/dist/components/ReactFileUtilities/ImageDropzone.d.ts +0 -16
  490. package/dist/components/ReactFileUtilities/ImageDropzone.js +0 -42
  491. package/dist/components/UserItem/UserItem.js +0 -26
  492. package/dist/components/UserItem/index.d.ts +0 -1
  493. package/dist/components/UserItem/index.js +0 -1
  494. /package/dist/components/{MessageInput → MediaRecorder/AudioRecorder}/hooks/useTimeElapsed.d.ts +0 -0
  495. /package/dist/components/{MessageInput → MediaRecorder/AudioRecorder}/hooks/useTimeElapsed.js +0 -0
  496. /package/dist/scss/v2/DragAndDropContainer/{DragAmdDropContainer-layout.scss → DragAndDropContainer-layout.scss} +0 -0
  497. /package/dist/{components/AutoCompleteTextarea/types.js → types/defaultDataInterfaces.js} +0 -0
@@ -1,4 +1,5 @@
1
- import React, { ComponentProps } from 'react';
1
+ import type { ComponentProps } from 'react';
2
+ import React from 'react';
2
3
  export type ConfirmationDialogProps = {
3
4
  actions: ComponentProps<'button'>[];
4
5
  prompt: string;
@@ -1,4 +1,5 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
2
3
  export type DragAndDropContainerProps = PropsWithChildren<{
3
4
  className?: string;
4
5
  draggable?: boolean;
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
- import { AvatarProps } from '../Avatar';
3
- import type { StreamMessage } from '../../context/ChannelStateContext';
4
- import type { DefaultStreamChatGenerics } from '../../types/types';
2
+ import type { Event, LocalMessage } from 'stream-chat';
3
+ import type { AvatarProps } from '../Avatar';
5
4
  import type { TimestampFormatterOptions } from '../../i18n/types';
6
- export type EventComponentProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = TimestampFormatterOptions & {
5
+ export type EventComponentProps = TimestampFormatterOptions & {
7
6
  /** Message object */
8
- message: StreamMessage<StreamChatGenerics>;
7
+ message: LocalMessage & {
8
+ event?: Event;
9
+ };
9
10
  /** Custom UI component to display user avatar, defaults to and accepts same props as: [Avatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/Avatar.tsx) */
10
11
  Avatar?: React.ComponentType<AvatarProps>;
11
12
  };
12
- export declare const EventComponent: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: EventComponentProps<StreamChatGenerics>) => React.JSX.Element | null;
13
+ export declare const EventComponent: (props: EventComponentProps) => React.JSX.Element | null;
@@ -1,4 +1,5 @@
1
- import React, { ComponentProps } from 'react';
1
+ import type { ComponentProps } from 'react';
2
+ import React from 'react';
2
3
  type FieldErrorProps = ComponentProps<'div'> & {
3
4
  text?: string;
4
5
  };
@@ -1,4 +1,5 @@
1
- import React, { ComponentProps, PropsWithChildren } from 'react';
1
+ import type { ComponentProps, PropsWithChildren } from 'react';
2
+ import React from 'react';
2
3
  export type SwitchFieldProps = PropsWithChildren<ComponentProps<'input'>>;
3
4
  export declare const SwitchField: ({ children, ...props }: SwitchFieldProps) => React.JSX.Element;
4
5
  export type SimpleSwitchFieldProps = ComponentProps<'input'> & {
@@ -1,5 +1,5 @@
1
1
  import clsx from 'clsx';
2
- import React, { useRef, } from 'react';
2
+ import React, { useRef } from 'react';
3
3
  export const SwitchField = ({ children, ...props }) => {
4
4
  const inputRef = useRef(null);
5
5
  const handleKeyUp = (event) => {
@@ -1,11 +1,11 @@
1
- import React, { CSSProperties, MutableRefObject } from 'react';
1
+ import type { CSSProperties, MutableRefObject } from 'react';
2
+ import React from 'react';
2
3
  import type { Attachment } from 'stream-chat';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
- export type GalleryProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
4
+ export type GalleryProps = {
5
5
  images: (({
6
6
  image_url?: string | undefined;
7
7
  thumb_url?: string | undefined;
8
- } | Attachment<StreamChatGenerics>) & {
8
+ } | Attachment) & {
9
9
  previewUrl?: string;
10
10
  style?: CSSProperties;
11
11
  })[];
@@ -14,4 +14,4 @@ export type GalleryProps<StreamChatGenerics extends DefaultStreamChatGenerics =
14
14
  /**
15
15
  * Displays images in a simple responsive grid with a light box to view the images.
16
16
  */
17
- export declare const Gallery: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: GalleryProps<StreamChatGenerics>) => React.JSX.Element;
17
+ export declare const Gallery: (props: GalleryProps) => React.JSX.Element;
@@ -1,7 +1,8 @@
1
- import React, { CSSProperties, MutableRefObject } from 'react';
1
+ import type { CSSProperties, MutableRefObject } from 'react';
2
+ import React from 'react';
2
3
  import type { Attachment } from 'stream-chat';
3
- import type { DefaultStreamChatGenerics, Dimensions } from '../../types/types';
4
- export type ImageProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
4
+ import type { Dimensions } from '../../types/types';
5
+ export type ImageProps = {
5
6
  dimensions?: Dimensions;
6
7
  innerRef?: MutableRefObject<HTMLImageElement | null>;
7
8
  previewUrl?: string;
@@ -13,8 +14,8 @@ export type ImageProps<StreamChatGenerics extends DefaultStreamChatGenerics = De
13
14
  image_url?: string;
14
15
  /** The thumb url */
15
16
  thumb_url?: string;
16
- } | Attachment<StreamChatGenerics>);
17
+ } | Attachment);
17
18
  /**
18
19
  * A simple component that displays an image.
19
20
  */
20
- export declare const ImageComponent: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: ImageProps<StreamChatGenerics>) => React.JSX.Element;
21
+ export declare const ImageComponent: (props: ImageProps) => React.JSX.Element;
@@ -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 ModalGalleryProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
3
+ export type ModalGalleryProps = {
5
4
  /** The images for the Carousel component */
6
- images: Attachment<StreamChatGenerics>[];
5
+ images: Attachment[];
7
6
  /** The index for the component */
8
7
  index?: number;
9
8
  };
10
- export declare const ModalGallery: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: ModalGalleryProps<StreamChatGenerics>) => React.JSX.Element;
9
+ export declare const ModalGallery: (props: ModalGalleryProps) => React.JSX.Element;
@@ -1,4 +1,5 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
2
3
  import type { PaginatorProps } from '../../types/types';
3
4
  export type InfiniteScrollProps = PaginatorProps & {
4
5
  className?: string;
@@ -1,4 +1,5 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
2
3
  export type InfiniteScrollPaginatorProps = React.ComponentProps<'div'> & {
3
4
  listenToScroll?: (distanceFromBottom: number, distanceFromTop: number, threshold: number) => void;
4
5
  loadNextDebounceMs?: number;
@@ -1,4 +1,5 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
2
3
  export type LoadMoreButtonProps = {
3
4
  /** onClick handler load more button. Pagination logic should be executed in this handler. */
4
5
  onClick: React.MouseEventHandler<HTMLButtonElement>;
@@ -1,5 +1,6 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { LoadMoreButtonProps } from './LoadMoreButton';
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ import type { LoadMoreButtonProps } from './LoadMoreButton';
3
4
  import type { PaginatorProps } from '../../types/types';
4
5
  export type LoadMorePaginatorProps = PaginatorProps & {
5
6
  /** A UI button component that handles pagination logic */
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect } from 'react';
2
- import { LoadMoreButton as DefaultLoadMoreButton, } from './LoadMoreButton';
2
+ import { LoadMoreButton as DefaultLoadMoreButton } from './LoadMoreButton';
3
3
  import { deprecationAndReplacementWarning } from '../../utils/deprecationWarning';
4
4
  export const UnMemoizedLoadMorePaginator = (props) => {
5
5
  const { children, hasNextPage, isLoading, LoadMoreButton = DefaultLoadMoreButton, loadNextPage, refreshing, reverse, } = props;
@@ -3,9 +3,10 @@ import { AudioRecordingPreview } from './AudioRecordingPreview';
3
3
  import { AudioRecordingInProgress } from './AudioRecordingInProgress';
4
4
  import { MediaRecordingState } from '../classes';
5
5
  import { BinIcon, CheckSignIcon, LoadingIndicatorIcon, MicIcon, PauseIcon, SendIcon, } from '../../MessageInput';
6
- import { useMessageInputContext } from '../../../context';
6
+ import { useMessageInputContext } from '../../../context/MessageInputContext';
7
7
  export const AudioRecorder = () => {
8
- const { recordingController: { completeRecording, recorder, recording, recordingState }, } = useMessageInputContext();
8
+ const messageInputContext = useMessageInputContext();
9
+ const { recordingController: { completeRecording, recorder, recording, recordingState }, } = messageInputContext;
9
10
  const isUploadingFile = recording?.localMetadata?.uploadState === 'uploading';
10
11
  const state = useMemo(() => ({
11
12
  paused: recordingState === MediaRecordingState.PAUSED,
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { useTimeElapsed } from '../../MessageInput/hooks/useTimeElapsed';
2
+ import { useTimeElapsed } from './hooks/useTimeElapsed';
3
3
  import { useMessageInputContext } from '../../../context';
4
4
  import { RecordingTimer } from './RecordingTimer';
5
5
  const AudioRecordingWaveform = ({ maxDataPointsDrawn = 100 }) => {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { RecordingPermission } from './classes/BrowserPermission';
2
+ import type { RecordingPermission } from './classes/BrowserPermission';
3
3
  export type RecordingPermissionDeniedNotificationProps = {
4
4
  onClose: () => void;
5
5
  permissionName: RecordingPermission;
@@ -1,11 +1,11 @@
1
- import { AmplitudeRecorder, AmplitudeRecorderConfig } from './AmplitudeRecorder';
1
+ import { AmplitudeRecorder } from './AmplitudeRecorder';
2
2
  import { BrowserPermission } from './BrowserPermission';
3
3
  import { BehaviorSubject, Subject } from '../observable';
4
- import { TranscoderConfig } from '../transcode';
5
- import { RecordedMediaType } from '../../ReactFileUtilities';
6
- import { TranslationContextValue } from '../../../context';
7
- import type { LocalVoiceRecordingAttachment } from '../../MessageInput';
8
- import type { DefaultStreamChatGenerics } from '../../../types';
4
+ import type { TranscoderConfig } from '../transcode';
5
+ import type { RecordedMediaType } from '../../ReactFileUtilities';
6
+ import type { LocalVoiceRecordingAttachment } from 'stream-chat';
7
+ import type { AmplitudeRecorderConfig } from './AmplitudeRecorder';
8
+ import type { TranslationContextValue } from '../../../context';
9
9
  export declare const RECORDED_MIME_TYPE_BY_BROWSER: {
10
10
  readonly audio: {
11
11
  readonly others: "audio/webm";
@@ -36,7 +36,7 @@ export declare enum MediaRecordingState {
36
36
  export declare enum RecordingAttachmentType {
37
37
  VOICE_RECORDING = "voiceRecording"
38
38
  }
39
- export declare class MediaRecorderController<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> {
39
+ export declare class MediaRecorderController {
40
40
  permission: BrowserPermission;
41
41
  mediaRecorder: MediaRecorder | undefined;
42
42
  amplitudeRecorder: AmplitudeRecorder | undefined;
@@ -48,9 +48,9 @@ export declare class MediaRecorderController<StreamChatGenerics extends DefaultS
48
48
  recordedData: Blob[];
49
49
  recordingUri: string | undefined;
50
50
  mediaType: RecordedMediaType;
51
- signalRecordingReady: ((r: LocalVoiceRecordingAttachment<StreamChatGenerics>) => void) | undefined;
51
+ signalRecordingReady: ((r: LocalVoiceRecordingAttachment) => void) | undefined;
52
52
  recordingState: BehaviorSubject<MediaRecordingState | undefined>;
53
- recording: BehaviorSubject<LocalVoiceRecordingAttachment<StreamChatGenerics> | undefined>;
53
+ recording: BehaviorSubject<LocalVoiceRecordingAttachment | undefined>;
54
54
  error: Subject<Error | undefined>;
55
55
  notification: Subject<{
56
56
  text: string;
@@ -61,19 +61,7 @@ export declare class MediaRecorderController<StreamChatGenerics extends DefaultS
61
61
  constructor({ config, generateRecordingTitle, t }?: AudioRecorderOptions);
62
62
  get durationMs(): number;
63
63
  generateRecordingTitle: (mimeType: string) => string;
64
- makeVoiceRecording: () => Promise<{
65
- asset_url: string;
66
- duration: number;
67
- file_size: number;
68
- localMetadata: {
69
- file: File;
70
- id: string;
71
- };
72
- mime_type: string;
73
- title: string;
74
- type: RecordingAttachmentType;
75
- waveform_data: number[];
76
- } | undefined>;
64
+ makeVoiceRecording: () => Promise<LocalVoiceRecordingAttachment | undefined>;
77
65
  handleErrorEvent: (e: Event) => void;
78
66
  handleDataavailableEvent: (e: BlobEvent) => Promise<void>;
79
67
  resetRecordingState: () => void;
@@ -81,7 +69,7 @@ export declare class MediaRecorderController<StreamChatGenerics extends DefaultS
81
69
  start: () => Promise<void>;
82
70
  pause: () => void;
83
71
  resume: () => void;
84
- stop: () => Promise<undefined> | Promise<LocalVoiceRecordingAttachment<StreamChatGenerics>>;
72
+ stop: () => Promise<LocalVoiceRecordingAttachment> | Promise<undefined>;
85
73
  cancel: () => void;
86
74
  }
87
75
  export {};
@@ -1,18 +1,18 @@
1
- import { MessageInputContextValue } from '../../../context';
2
- import { CustomAudioRecordingConfig, MediaRecorderController, MediaRecordingState } from '../classes';
3
- import type { LocalVoiceRecordingAttachment } from '../../MessageInput';
4
- import type { DefaultStreamChatGenerics } from '../../../types';
5
- export type RecordingController<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
1
+ import { MediaRecorderController } from '../classes';
2
+ import type { LocalVoiceRecordingAttachment } from 'stream-chat';
3
+ import type { CustomAudioRecordingConfig, MediaRecordingState } from '../classes';
4
+ import type { MessageInputContextValue } from '../../../context';
5
+ export type RecordingController = {
6
6
  completeRecording: () => void;
7
7
  permissionState?: PermissionState;
8
8
  recorder?: MediaRecorderController;
9
- recording?: LocalVoiceRecordingAttachment<StreamChatGenerics>;
9
+ recording?: LocalVoiceRecordingAttachment;
10
10
  recordingState?: MediaRecordingState;
11
11
  };
12
- type UseMediaRecorderParams<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<MessageInputContextValue<StreamChatGenerics>, 'asyncMessagesMultiSendEnabled' | 'handleSubmit' | 'uploadAttachment'> & {
12
+ type UseMediaRecorderParams = Pick<MessageInputContextValue, 'asyncMessagesMultiSendEnabled' | 'handleSubmit'> & {
13
13
  enabled: boolean;
14
14
  generateRecordingTitle?: (mimeType: string) => string;
15
15
  recordingConfig?: CustomAudioRecordingConfig;
16
16
  };
17
- export declare const useMediaRecorder: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ asyncMessagesMultiSendEnabled, enabled, generateRecordingTitle, handleSubmit, recordingConfig, uploadAttachment, }: UseMediaRecorderParams<StreamChatGenerics>) => RecordingController<StreamChatGenerics>;
17
+ export declare const useMediaRecorder: ({ asyncMessagesMultiSendEnabled, enabled, generateRecordingTitle, handleSubmit, recordingConfig, }: UseMediaRecorderParams) => RecordingController;
18
18
  export {};
@@ -1,8 +1,10 @@
1
1
  import { useCallback, useEffect, useMemo, useState } from 'react';
2
+ import { MediaRecorderController } from '../classes';
2
3
  import { useTranslationContext } from '../../../context';
3
- import { MediaRecorderController, } from '../classes';
4
- export const useMediaRecorder = ({ asyncMessagesMultiSendEnabled, enabled, generateRecordingTitle, handleSubmit, recordingConfig, uploadAttachment, }) => {
4
+ import { useMessageComposer } from '../../MessageInput';
5
+ export const useMediaRecorder = ({ asyncMessagesMultiSendEnabled, enabled, generateRecordingTitle, handleSubmit, recordingConfig, }) => {
5
6
  const { t } = useTranslationContext('useMediaRecorder');
7
+ const messageComposer = useMessageComposer();
6
8
  const [recording, setRecording] = useState();
7
9
  const [recordingState, setRecordingState] = useState();
8
10
  const [permissionState, setPermissionState] = useState();
@@ -20,13 +22,13 @@ export const useMediaRecorder = ({ asyncMessagesMultiSendEnabled, enabled, gener
20
22
  const recording = await recorder.stop();
21
23
  if (!recording)
22
24
  return;
23
- await uploadAttachment(recording);
25
+ await messageComposer.attachmentManager.uploadAttachment(recording);
24
26
  if (!asyncMessagesMultiSendEnabled) {
25
27
  // FIXME: cannot call handleSubmit() directly as the function has stale reference to attachments
26
28
  scheduleForSubmit(true);
27
29
  }
28
30
  recorder.cleanUp();
29
- }, [asyncMessagesMultiSendEnabled, recorder, uploadAttachment]);
31
+ }, [asyncMessagesMultiSendEnabled, messageComposer, recorder]);
30
32
  useEffect(() => {
31
33
  if (!isScheduledForSubmit)
32
34
  return;
@@ -1,6 +1,6 @@
1
1
  import { Subject } from './Subject';
2
- import { ObserverOrNext } from './Observer';
3
- import { Subscription } from './Subscription';
2
+ import type { ObserverOrNext } from './Observer';
3
+ import type { Subscription } from './Subscription';
4
4
  export declare class BehaviorSubject<T> extends Subject<T> {
5
5
  private _value;
6
6
  constructor(_value: T);
@@ -1,4 +1,4 @@
1
- import { ObserverOrNext } from './Observer';
1
+ import type { ObserverOrNext } from './Observer';
2
2
  import { Subscription } from './Subscription';
3
3
  export interface Unsubscribable {
4
4
  unsubscribe(): void;
@@ -1,6 +1,7 @@
1
1
  import { Observable } from './Observable';
2
- import { Subscription, SubscriptionLike } from './Subscription';
3
- import { Observer, ObserverOrNext } from './Observer';
2
+ import type { SubscriptionLike } from './Subscription';
3
+ import { Subscription } from './Subscription';
4
+ import type { Observer, ObserverOrNext } from './Observer';
4
5
  export declare class Subject<T> extends Observable<T> implements SubscriptionLike {
5
6
  private _observers;
6
7
  private _observerCounter;
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
- import type { StreamMessage } from '../../context/ChannelStateContext';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
- export type FixedHeightMessageProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
2
+ import type { LocalMessage } from 'stream-chat';
3
+ export type FixedHeightMessageProps = {
5
4
  groupedByUser?: boolean;
6
- message?: StreamMessage<StreamChatGenerics>;
5
+ message?: LocalMessage;
7
6
  };
8
7
  /**
9
8
  * @deprecated - This UI component will be removed in the next major release.
@@ -11,4 +10,4 @@ export type FixedHeightMessageProps<StreamChatGenerics extends DefaultStreamChat
11
10
  * FixedHeightMessage - This component renders a single message.
12
11
  * It uses fixed height elements to make sure it works well in VirtualizedMessageList
13
12
  */
14
- export declare const FixedHeightMessage: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: FixedHeightMessageProps<StreamChatGenerics>) => React.JSX.Element;
13
+ export declare const FixedHeightMessage: (props: FixedHeightMessageProps) => React.JSX.Element;
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { MessageProps } from './types';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
3
  /**
5
4
  * The Message component is a context provider which implements all the logic required for rendering
6
5
  * an individual message. The actual UI of the message is delegated via the Message prop on Channel.
7
6
  */
8
- export declare const Message: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: MessageProps<StreamChatGenerics>) => React.JSX.Element;
7
+ export declare const Message: (props: MessageProps) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const MessageBlocked: () => React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import { useUserRole } from './hooks/useUserRole';
4
+ import { useTranslationContext } from '../../context/TranslationContext';
5
+ import { useMessageContext } from '../../context';
6
+ export const MessageBlocked = () => {
7
+ const { message } = useMessageContext();
8
+ const { t } = useTranslationContext('MessageBlocked');
9
+ const { isMyMessage } = useUserRole(message);
10
+ const messageClasses = clsx('str-chat__message str-chat__message-simple str-chat__message--blocked', message.type, {
11
+ 'str-chat__message--me str-chat__message-simple--me': isMyMessage,
12
+ 'str-chat__message--other': !isMyMessage,
13
+ });
14
+ return (React.createElement("div", { className: messageClasses, "data-testid": 'message-blocked-component', key: message.id },
15
+ React.createElement("div", { className: 'str-chat__message--blocked-inner' }, t('Message was blocked by moderation policies'))));
16
+ };
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import type { StreamMessage } from '../../context/ChannelStateContext';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
- export type MessageDeletedProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
5
- message: StreamMessage<StreamChatGenerics>;
2
+ import type { LocalMessage } from 'stream-chat';
3
+ export type MessageDeletedProps = {
4
+ message: LocalMessage;
6
5
  };
7
- export declare const MessageDeleted: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: MessageDeletedProps<StreamChatGenerics>) => React.JSX.Element;
6
+ export declare const MessageDeleted: (props: MessageDeletedProps) => React.JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import type { DefaultStreamChatGenerics } from '../../types';
3
2
  import type { MessageTimestampProps } from './MessageTimestamp';
4
- export type MessageEditedTimestampProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = MessageTimestampProps<StreamChatGenerics> & {
3
+ export type MessageEditedTimestampProps = MessageTimestampProps & {
5
4
  open: boolean;
6
5
  };
7
- export declare function MessageEditedTimestamp<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ message: propMessage, open, ...timestampProps }: MessageEditedTimestampProps<StreamChatGenerics>): React.JSX.Element | null;
6
+ export declare function MessageEditedTimestamp({ message: propMessage, open, ...timestampProps }: MessageEditedTimestampProps): React.JSX.Element | null;
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { StreamMessage } from '../../context';
3
- import { DefaultStreamChatGenerics } from '../../types/types';
4
- export interface MessageErrorTextProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> {
5
- message: StreamMessage<StreamChatGenerics>;
2
+ import type { LocalMessage } from 'stream-chat';
3
+ export interface MessageErrorTextProps {
4
+ message: LocalMessage;
6
5
  theme: string;
7
6
  }
8
- export declare function MessageErrorText<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ message, theme }: MessageErrorTextProps<StreamChatGenerics>): React.JSX.Element | null;
7
+ export declare function MessageErrorText({ message, theme }: MessageErrorTextProps): React.JSX.Element | null;
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
- import { useTranslationContext } from '../../context';
3
2
  import { isMessageBounced } from './utils';
3
+ import { useTranslationContext } from '../../context';
4
4
  export function MessageErrorText({ message, theme }) {
5
5
  const { t } = useTranslationContext('MessageText');
6
6
  if (message.type === 'error' && !isMessageBounced(message)) {
7
7
  return (React.createElement("div", { className: `str-chat__${theme}-message--error-message str-chat__message--error-message` }, t('Error · Unsent')));
8
8
  }
9
9
  if (message.status === 'failed') {
10
- return (React.createElement("div", { className: `str-chat__${theme}-message--error-message str-chat__message--error-message` }, message.errorStatusCode !== 403
10
+ return (React.createElement("div", { className: `str-chat__${theme}-message--error-message str-chat__message--error-message` }, message.error?.status !== 403
11
11
  ? t('Message Failed · Click to try again')
12
12
  : t('Message Failed · Unauthorized')));
13
13
  }
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import type { DefaultStreamChatGenerics, IconProps } from '../../types/types';
2
+ import type { IconProps } from '../../types/types';
3
3
  import type { MessageContextValue } from '../../context/MessageContext';
4
- export type MessageOptionsProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Partial<Pick<MessageContextValue<StreamChatGenerics>, 'handleOpenThread'>> & {
4
+ export type MessageOptionsProps = Partial<Pick<MessageContextValue, 'handleOpenThread'>> & {
5
5
  ActionsIcon?: React.ComponentType<IconProps>;
6
6
  displayReplies?: boolean;
7
7
  ReactionIcon?: React.ComponentType<IconProps>;
8
8
  theme?: string;
9
9
  ThreadIcon?: React.ComponentType<IconProps>;
10
10
  };
11
- export declare const MessageOptions: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: MessageOptionsProps<StreamChatGenerics>) => React.JSX.Element | null;
11
+ export declare const MessageOptions: (props: MessageOptionsProps) => React.JSX.Element | null;
@@ -1,4 +1,5 @@
1
- import React, { MouseEventHandler } from 'react';
1
+ import type { MouseEventHandler } from 'react';
2
+ import React from 'react';
2
3
  export type MessageRepliesCountButtonProps = {
3
4
  labelPlural?: string;
4
5
  labelSingle?: string;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { MessageUIComponentProps } from './types';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
3
  /**
5
4
  * The default UI component that renders a message and receives functionality and logic from the MessageContext.
6
5
  */
7
- export declare const MessageSimple: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: MessageUIComponentProps<StreamChatGenerics>) => React.JSX.Element;
6
+ export declare const MessageSimple: (props: MessageUIComponentProps) => React.JSX.Element;
@@ -3,18 +3,17 @@ import clsx from 'clsx';
3
3
  import { MessageErrorIcon } from './icons';
4
4
  import { MessageBouncePrompt as DefaultMessageBouncePrompt } from '../MessageBounce';
5
5
  import { MessageDeleted as DefaultMessageDeleted } from './MessageDeleted';
6
+ import { MessageBlocked as DefaultMessageBlocked } from './MessageBlocked';
6
7
  import { MessageOptions as DefaultMessageOptions } from './MessageOptions';
7
8
  import { MessageRepliesCountButton as DefaultMessageRepliesCountButton } from './MessageRepliesCountButton';
8
9
  import { MessageStatus as DefaultMessageStatus } from './MessageStatus';
9
10
  import { MessageText } from './MessageText';
10
11
  import { MessageTimestamp as DefaultMessageTimestamp } from './MessageTimestamp';
11
- import { areMessageUIPropsEqual, isMessageBounced, isMessageEdited, messageHasAttachments, messageHasReactions, } from './utils';
12
+ import { areMessageUIPropsEqual, isMessageBlocked, isMessageBounced, isMessageEdited, messageHasAttachments, messageHasReactions, } from './utils';
12
13
  import { Avatar as DefaultAvatar } from '../Avatar';
13
14
  import { Attachment as DefaultAttachment } from '../Attachment';
14
- import { CUSTOM_MESSAGE_TYPE } from '../../constants/messageTypes';
15
- import { EditMessageForm as DefaultEditMessageForm, MessageInput } from '../MessageInput';
15
+ import { EditMessageModal } from '../MessageInput';
16
16
  import { MML } from '../MML';
17
- import { Modal } from '../Modal';
18
17
  import { Poll } from '../Poll';
19
18
  import { ReactionsList as DefaultReactionList } from '../Reactions';
20
19
  import { MessageBounceModal } from '../MessageBounce/MessageBounceModal';
@@ -23,28 +22,32 @@ import { useMessageContext } from '../../context/MessageContext';
23
22
  import { useChatContext, useTranslationContext } from '../../context';
24
23
  import { MessageEditedTimestamp } from './MessageEditedTimestamp';
25
24
  import { StreamedMessageText as DefaultStreamedMessageText } from './StreamedMessageText';
25
+ import { isDateSeparatorMessage } from '../MessageList';
26
26
  const MessageSimpleWithContext = (props) => {
27
- const { additionalMessageInputProps, clearEditingState, editing, endOfGroup, firstOfGroup, groupedByUser, handleAction, handleOpenThread, handleRetry, highlighted, isMessageAIGenerated, isMyMessage, message, onUserClick, onUserHover, renderText, threadList, } = props;
27
+ const { additionalMessageInputProps, editing, endOfGroup, firstOfGroup, groupedByUser, handleAction, handleOpenThread, handleRetry, highlighted, isMessageAIGenerated, isMyMessage, message, onUserClick, onUserHover, renderText, threadList, } = props;
28
28
  const { client } = useChatContext('MessageSimple');
29
29
  const { t } = useTranslationContext('MessageSimple');
30
30
  const [isBounceDialogOpen, setIsBounceDialogOpen] = useState(false);
31
31
  const [isEditedTimestampOpen, setEditedTimestampOpen] = useState(false);
32
- const { Attachment = DefaultAttachment, Avatar = DefaultAvatar, EditMessageInput = DefaultEditMessageForm, MessageOptions = DefaultMessageOptions,
32
+ const { Attachment = DefaultAttachment, Avatar = DefaultAvatar, MessageOptions = DefaultMessageOptions,
33
33
  // TODO: remove this "passthrough" in the next
34
34
  // major release and use the new default instead
35
- MessageActions = MessageOptions, MessageDeleted = DefaultMessageDeleted, MessageBouncePrompt = DefaultMessageBouncePrompt, MessageRepliesCountButton = DefaultMessageRepliesCountButton, MessageStatus = DefaultMessageStatus, MessageTimestamp = DefaultMessageTimestamp, ReactionsList = DefaultReactionList, StreamedMessageText = DefaultStreamedMessageText, PinIndicator, } = useComponentContext('MessageSimple');
35
+ MessageActions = MessageOptions, MessageBlocked = DefaultMessageBlocked, MessageDeleted = DefaultMessageDeleted, MessageBouncePrompt = DefaultMessageBouncePrompt, MessageRepliesCountButton = DefaultMessageRepliesCountButton, MessageStatus = DefaultMessageStatus, MessageTimestamp = DefaultMessageTimestamp, ReactionsList = DefaultReactionList, StreamedMessageText = DefaultStreamedMessageText, PinIndicator, } = useComponentContext('MessageSimple');
36
36
  const hasAttachment = messageHasAttachments(message);
37
37
  const hasReactions = messageHasReactions(message);
38
38
  const isAIGenerated = useMemo(() => isMessageAIGenerated?.(message), [isMessageAIGenerated, message]);
39
- if (message.customType === CUSTOM_MESSAGE_TYPE.date) {
39
+ if (isDateSeparatorMessage(message)) {
40
40
  return null;
41
41
  }
42
42
  if (message.deleted_at || message.type === 'deleted') {
43
43
  return React.createElement(MessageDeleted, { message: message });
44
44
  }
45
+ if (isMessageBlocked(message)) {
46
+ return React.createElement(MessageBlocked, null);
47
+ }
45
48
  const showMetadata = !groupedByUser || endOfGroup;
46
49
  const showReplyCountButton = !threadList && !!message.reply_count;
47
- const allowRetry = message.status === 'failed' && message.errorStatusCode !== 403;
50
+ const allowRetry = message.status === 'failed' && message.error?.status !== 403;
48
51
  const isBounced = isMessageBounced(message);
49
52
  const isEdited = isMessageEdited(message) && !isAIGenerated;
50
53
  let handleClick = undefined;
@@ -64,7 +67,7 @@ const MessageSimpleWithContext = (props) => {
64
67
  'str-chat__message--highlighted': highlighted,
65
68
  'str-chat__message--pinned pinned-message': message.pinned,
66
69
  'str-chat__message--with-reactions': hasReactions,
67
- 'str-chat__message-send-can-be-retried': message?.status === 'failed' && message?.errorStatusCode !== 403,
70
+ 'str-chat__message-send-can-be-retried': message?.status === 'failed' && message?.error?.status !== 403,
68
71
  'str-chat__message-with-thread-link': showReplyCountButton,
69
72
  'str-chat__virtual-message__wrapper--end': endOfGroup,
70
73
  'str-chat__virtual-message__wrapper--first': firstOfGroup,
@@ -72,8 +75,7 @@ const MessageSimpleWithContext = (props) => {
72
75
  });
73
76
  const poll = message.poll_id && client.polls.fromState(message.poll_id);
74
77
  return (React.createElement(React.Fragment, null,
75
- editing && (React.createElement(Modal, { className: 'str-chat__edit-message-modal', onClose: clearEditingState, open: editing },
76
- React.createElement(MessageInput, { clearEditingState: clearEditingState, grow: true, hideSendButton: true, Input: EditMessageInput, message: message, ...additionalMessageInputProps }))),
78
+ editing && (React.createElement(EditMessageModal, { additionalMessageInputProps: additionalMessageInputProps })),
77
79
  isBounceDialogOpen && (React.createElement(MessageBounceModal, { MessageBouncePrompt: MessageBouncePrompt, onClose: () => setIsBounceDialogOpen(false), open: isBounceDialogOpen })),
78
80
  React.createElement("div", { className: rootClassName, key: message.id },
79
81
  PinIndicator && React.createElement(PinIndicator, null),
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { TooltipUsernameMapper } from './utils';
3
- import { AvatarProps } from '../Avatar';
4
- import type { DefaultStreamChatGenerics } from '../../types/types';
2
+ import type { TooltipUsernameMapper } from './utils';
3
+ import type { AvatarProps } from '../Avatar';
5
4
  export type MessageStatusProps = {
6
5
  Avatar?: React.ComponentType<AvatarProps>;
7
6
  MessageDeliveredStatus?: React.ComponentType;
@@ -10,4 +9,4 @@ export type MessageStatusProps = {
10
9
  messageType?: string;
11
10
  tooltipUserNameMapper?: TooltipUsernameMapper;
12
11
  };
13
- export declare const MessageStatus: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: MessageStatusProps) => React.JSX.Element | null;
12
+ export declare const MessageStatus: (props: MessageStatusProps) => React.JSX.Element | null;