stream-chat-react 12.15.0 → 13.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (473) 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 -43
  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 +24 -17
  186. package/dist/components/MessageInput/MessageInputFlat.d.ts +1 -2
  187. package/dist/components/MessageInput/MessageInputFlat.js +14 -39
  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 +4 -3
  193. package/dist/components/MessageInput/WithDragAndDropUpload.js +20 -9
  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 +0 -2
  218. package/dist/components/MessageInput/index.js +0 -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/TextareaComposer/SuggestionList/CommandItem.d.ts +7 -0
  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 +14 -0
  326. package/dist/components/TextareaComposer/SuggestionList/SuggestionList.js +50 -0
  327. package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.d.ts +18 -0
  328. package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.js +24 -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/MessageListContext.d.ts +2 -1
  368. package/dist/context/PollContext.d.ts +8 -8
  369. package/dist/context/TranslationContext.d.ts +2 -1
  370. package/dist/context/TypingContext.d.ts +11 -10
  371. package/dist/context/VirtualizedMessageListContext.d.ts +2 -1
  372. package/dist/context/WithComponents.d.ts +3 -2
  373. package/dist/css/v2/index.css +1 -1
  374. package/dist/css/v2/index.layout.css +1 -1
  375. package/dist/experimental/MessageActions/MessageActions.d.ts +1 -1
  376. package/dist/experimental/MessageActions/MessageActions.js +1 -1
  377. package/dist/experimental/MessageActions/defaults.js +4 -3
  378. package/dist/experimental/Search/Search.d.ts +1 -2
  379. package/dist/experimental/Search/SearchContext.d.ts +8 -8
  380. package/dist/experimental/Search/SearchResults/SearchResultItem.d.ts +11 -11
  381. package/dist/experimental/Search/SearchResults/SearchResultItem.js +3 -3
  382. package/dist/experimental/Search/SearchResults/SearchResults.d.ts +1 -2
  383. package/dist/experimental/Search/SearchResults/SearchResultsHeader.d.ts +1 -2
  384. package/dist/experimental/Search/SearchResults/SearchResultsHeader.js +1 -1
  385. package/dist/experimental/Search/SearchResults/SearchSourceResultList.d.ts +2 -3
  386. package/dist/experimental/Search/SearchResults/SearchSourceResultListFooter.d.ts +1 -2
  387. package/dist/experimental/Search/SearchResults/SearchSourceResults.d.ts +1 -2
  388. package/dist/experimental/Search/SearchResults/SearchSourceResults.js +1 -1
  389. package/dist/experimental/Search/SearchSourceResultsContext.d.ts +2 -1
  390. package/dist/experimental/Search/hooks/useSearchFocusedMessage.d.ts +1 -2
  391. package/dist/experimental/Search/hooks/useSearchFocusedMessage.js +3 -1
  392. package/dist/experimental/Search/hooks/useSearchQueriesInProgress.d.ts +3 -4
  393. package/dist/experimental/index.browser.cjs +1139 -1075
  394. package/dist/experimental/index.browser.cjs.map +4 -4
  395. package/dist/experimental/index.node.cjs +1139 -1075
  396. package/dist/experimental/index.node.cjs.map +4 -4
  397. package/dist/i18n/Streami18n.d.ts +1 -1
  398. package/dist/i18n/types.d.ts +2 -2
  399. package/dist/i18n/utils.d.ts +1 -1
  400. package/dist/i18n/utils.js +3 -1
  401. package/dist/index.browser.cjs +28513 -30641
  402. package/dist/index.browser.cjs.map +4 -4
  403. package/dist/index.node.cjs +30740 -32877
  404. package/dist/index.node.cjs.map +4 -4
  405. package/dist/plugins/Emojis/index.browser.cjs +133 -2
  406. package/dist/plugins/Emojis/index.browser.cjs.map +4 -4
  407. package/dist/plugins/Emojis/index.d.ts +1 -0
  408. package/dist/plugins/Emojis/index.js +1 -0
  409. package/dist/plugins/Emojis/index.node.cjs +135 -3
  410. package/dist/plugins/Emojis/index.node.cjs.map +4 -4
  411. package/dist/plugins/Emojis/middleware/index.d.ts +1 -0
  412. package/dist/plugins/Emojis/middleware/index.js +1 -0
  413. package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.d.ts +66 -0
  414. package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.js +143 -0
  415. package/dist/plugins/encoders/mp3.browser.cjs.map +2 -2
  416. package/dist/plugins/encoders/mp3.node.cjs.map +2 -2
  417. package/dist/scss/v2/Autocomplete/Autocomplete-layout.scss +14 -0
  418. package/dist/scss/v2/Autocomplete/Autocomplete-theme.scss +11 -0
  419. package/dist/scss/v2/LinkPreview/LinkPreview-layout.scss +18 -0
  420. package/dist/scss/v2/LinkPreview/LinkPreview-theme.scss +15 -0
  421. package/dist/types/defaultDataInterfaces.d.ts +25 -0
  422. package/dist/types/index.d.ts +2 -1
  423. package/dist/types/types.d.ts +2 -62
  424. package/dist/utils/getChannel.d.ts +5 -6
  425. package/dist/utils/mergeDeep.d.ts +2 -3
  426. package/package.json +5 -5
  427. package/dist/components/AutoCompleteTextarea/Item.d.ts +0 -2
  428. package/dist/components/AutoCompleteTextarea/Item.js +0 -10
  429. package/dist/components/AutoCompleteTextarea/List.d.ts +0 -17
  430. package/dist/components/AutoCompleteTextarea/List.js +0 -89
  431. package/dist/components/AutoCompleteTextarea/Textarea.d.ts +0 -114
  432. package/dist/components/AutoCompleteTextarea/Textarea.js +0 -593
  433. package/dist/components/AutoCompleteTextarea/index.d.ts +0 -4
  434. package/dist/components/AutoCompleteTextarea/index.js +0 -4
  435. package/dist/components/AutoCompleteTextarea/types.d.ts +0 -15
  436. package/dist/components/AutoCompleteTextarea/utils.d.ts +0 -6
  437. package/dist/components/AutoCompleteTextarea/utils.js +0 -40
  438. package/dist/components/ChatAutoComplete/ChatAutoComplete.d.ts +0 -78
  439. package/dist/components/ChatAutoComplete/ChatAutoComplete.js +0 -33
  440. package/dist/components/ChatAutoComplete/index.d.ts +0 -1
  441. package/dist/components/ChatAutoComplete/index.js +0 -1
  442. package/dist/components/CommandItem/CommandItem.d.ts +0 -12
  443. package/dist/components/CommandItem/index.d.ts +0 -1
  444. package/dist/components/CommandItem/index.js +0 -1
  445. package/dist/components/EmoticonItem/EmoticonItem.js +0 -16
  446. package/dist/components/EmoticonItem/index.d.ts +0 -1
  447. package/dist/components/EmoticonItem/index.js +0 -1
  448. package/dist/components/MessageInput/DefaultTriggerProvider.d.ts +0 -35
  449. package/dist/components/MessageInput/DefaultTriggerProvider.js +0 -24
  450. package/dist/components/MessageInput/DropzoneProvider.d.ts +0 -4
  451. package/dist/components/MessageInput/DropzoneProvider.js +0 -23
  452. package/dist/components/MessageInput/hooks/useAttachments.d.ts +0 -14
  453. package/dist/components/MessageInput/hooks/useAttachments.js +0 -209
  454. package/dist/components/MessageInput/hooks/useCommandTrigger.d.ts +0 -3
  455. package/dist/components/MessageInput/hooks/useCommandTrigger.js +0 -62
  456. package/dist/components/MessageInput/hooks/useEmojiTrigger.d.ts +0 -3
  457. package/dist/components/MessageInput/hooks/useEmojiTrigger.js +0 -29
  458. package/dist/components/MessageInput/hooks/useLinkPreviews.d.ts +0 -30
  459. package/dist/components/MessageInput/hooks/useLinkPreviews.js +0 -109
  460. package/dist/components/MessageInput/hooks/useMessageInputState.d.ts +0 -71
  461. package/dist/components/MessageInput/hooks/useMessageInputState.js +0 -200
  462. package/dist/components/MessageInput/hooks/useUserTrigger.d.ts +0 -12
  463. package/dist/components/MessageInput/hooks/useUserTrigger.js +0 -130
  464. package/dist/components/MessageInput/types.d.ts +0 -87
  465. package/dist/components/MessageInput/types.js +0 -19
  466. package/dist/components/ReactFileUtilities/ImageDropzone.d.ts +0 -16
  467. package/dist/components/ReactFileUtilities/ImageDropzone.js +0 -42
  468. package/dist/components/UserItem/UserItem.js +0 -26
  469. package/dist/components/UserItem/index.d.ts +0 -1
  470. package/dist/components/UserItem/index.js +0 -1
  471. /package/dist/components/{MessageInput → MediaRecorder/AudioRecorder}/hooks/useTimeElapsed.d.ts +0 -0
  472. /package/dist/components/{MessageInput → MediaRecorder/AudioRecorder}/hooks/useTimeElapsed.js +0 -0
  473. /package/dist/{components/AutoCompleteTextarea/types.js → types/defaultDataInterfaces.js} +0 -0
@@ -1,9 +1,8 @@
1
1
  import type { TFunction } from 'i18next';
2
- import type { MessageResponse, Mute, StreamChat, UserResponse } from 'stream-chat';
2
+ import type { LocalMessage, MessageResponse, Mute, StreamChat, UserResponse } from 'stream-chat';
3
3
  import type { PinPermissions } from './hooks';
4
4
  import type { MessageProps } from './types';
5
- import type { ComponentContextValue, CustomMessageActions, MessageContextValue, StreamMessage } from '../../context';
6
- import type { DefaultStreamChatGenerics } from '../../types/types';
5
+ import type { ComponentContextValue, CustomMessageActions, MessageContextValue } from '../../context';
7
6
  /**
8
7
  * Following function validates a function which returns notification message.
9
8
  * It validates if the first parameter is function and also if return value of function is string or no.
@@ -12,7 +11,7 @@ export declare const validateAndGetMessage: <T extends unknown[]>(func: (...args
12
11
  /**
13
12
  * Tell if the owner of the current message is muted
14
13
  */
15
- export declare const isUserMuted: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(message: StreamMessage<StreamChatGenerics>, mutes?: Mute<StreamChatGenerics>[]) => boolean;
14
+ export declare const isUserMuted: (message: LocalMessage, mutes?: Mute[]) => boolean;
16
15
  export declare const MESSAGE_ACTIONS: {
17
16
  delete: string;
18
17
  edit: string;
@@ -43,30 +42,30 @@ export declare const ACTIONS_NOT_WORKING_IN_THREAD: string[];
43
42
  * @deprecated use `shouldRenderMessageActions` instead
44
43
  */
45
44
  export declare const showMessageActionsBox: (actions: MessageActionsArray<string>, inThread?: boolean | undefined) => boolean;
46
- export declare const shouldRenderMessageActions: <SCG extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ customMessageActions, CustomMessageActionsList, inThread, messageActions, }: {
45
+ export declare const shouldRenderMessageActions: ({ customMessageActions, CustomMessageActionsList, inThread, messageActions, }: {
47
46
  messageActions: MessageActionsArray;
48
- customMessageActions?: CustomMessageActions<SCG>;
49
- CustomMessageActionsList?: ComponentContextValue<SCG>['CustomMessageActionsList'];
47
+ customMessageActions?: CustomMessageActions;
48
+ CustomMessageActionsList?: ComponentContextValue['CustomMessageActionsList'];
50
49
  inThread?: boolean;
51
50
  }) => boolean;
52
- export declare const areMessagePropsEqual: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(prevProps: MessageProps<StreamChatGenerics> & {
53
- mutes?: Mute<StreamChatGenerics>[];
51
+ export declare const areMessagePropsEqual: (prevProps: MessageProps & {
52
+ mutes?: Mute[];
54
53
  showDetailedReactions?: boolean;
55
- }, nextProps: MessageProps<StreamChatGenerics> & {
56
- mutes?: Mute<StreamChatGenerics>[];
54
+ }, nextProps: MessageProps & {
55
+ mutes?: Mute[];
57
56
  showDetailedReactions?: boolean;
58
57
  }) => boolean;
59
- export declare const areMessageUIPropsEqual: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(prevProps: MessageContextValue<StreamChatGenerics> & {
58
+ export declare const areMessageUIPropsEqual: (prevProps: MessageContextValue & {
60
59
  showDetailedReactions?: boolean;
61
- }, nextProps: MessageContextValue<StreamChatGenerics> & {
60
+ }, nextProps: MessageContextValue & {
62
61
  showDetailedReactions?: boolean;
63
62
  }) => boolean;
64
- export declare const messageHasReactions: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(message?: StreamMessage<StreamChatGenerics>) => boolean;
65
- export declare const messageHasAttachments: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(message?: StreamMessage<StreamChatGenerics>) => boolean;
66
- export declare const getImages: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(message?: MessageResponse<StreamChatGenerics>) => import("stream-chat").Attachment<StreamChatGenerics>[];
67
- export declare const getNonImageAttachments: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(message?: MessageResponse<StreamChatGenerics>) => import("stream-chat").Attachment<StreamChatGenerics>[];
63
+ export declare const messageHasReactions: (message?: LocalMessage) => boolean;
64
+ export declare const messageHasAttachments: (message?: LocalMessage) => boolean;
65
+ export declare const getImages: (message?: MessageResponse) => import("stream-chat").Attachment[];
66
+ export declare const getNonImageAttachments: (message?: MessageResponse) => import("stream-chat").Attachment[];
68
67
  export interface TooltipUsernameMapper {
69
- <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(user: UserResponse<StreamChatGenerics>): string;
68
+ (user: UserResponse): string;
70
69
  }
71
70
  /**
72
71
  * Default Tooltip Username mapper implementation.
@@ -74,8 +73,8 @@ export interface TooltipUsernameMapper {
74
73
  * @param user the user.
75
74
  */
76
75
  export declare const mapToUserNameOrId: TooltipUsernameMapper;
77
- export declare const getReadByTooltipText: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(users: UserResponse<StreamChatGenerics>[], t: TFunction, client: StreamChat<StreamChatGenerics>, tooltipUserNameMapper: TooltipUsernameMapper) => string;
76
+ export declare const getReadByTooltipText: (users: UserResponse[], t: TFunction, client: StreamChat, tooltipUserNameMapper: TooltipUsernameMapper) => string;
78
77
  export declare const isOnlyEmojis: (text?: string) => boolean;
79
- export declare const isMessageBounced: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(message: Pick<StreamMessage<StreamChatGenerics>, 'type' | 'moderation' | 'moderation_details'>) => boolean;
80
- export declare const isMessageBlocked: (message: Pick<StreamMessage, 'type' | 'moderation' | 'moderation_details'>) => boolean;
81
- export declare const isMessageEdited: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(message: Pick<StreamMessage<StreamChatGenerics>, 'message_text_updated_at'>) => boolean;
78
+ export declare const isMessageBounced: (message: Pick<LocalMessage, 'type' | 'moderation' | 'moderation_details'>) => boolean;
79
+ export declare const isMessageBlocked: (message: Pick<LocalMessage, 'type' | 'moderation' | 'moderation_details'>) => boolean;
80
+ export declare const isMessageEdited: (message: Pick<LocalMessage, 'message_text_updated_at'>) => boolean;
@@ -170,7 +170,7 @@ export const shouldRenderMessageActions = ({ customMessageActions, CustomMessage
170
170
  return true;
171
171
  };
172
172
  function areMessagesEqual(prevMessage, nextMessage) {
173
- return (prevMessage.deleted_at === nextMessage.deleted_at &&
173
+ const areBaseMessagesEqual = (prevMessage, nextMessage) => prevMessage.deleted_at === nextMessage.deleted_at &&
174
174
  prevMessage.latest_reactions?.length === nextMessage.latest_reactions?.length &&
175
175
  prevMessage.own_reactions?.length === nextMessage.own_reactions?.length &&
176
176
  prevMessage.pinned === nextMessage.pinned &&
@@ -179,10 +179,11 @@ function areMessagesEqual(prevMessage, nextMessage) {
179
179
  prevMessage.text === nextMessage.text &&
180
180
  prevMessage.type === nextMessage.type &&
181
181
  prevMessage.updated_at === nextMessage.updated_at &&
182
- prevMessage.user?.updated_at === nextMessage.user?.updated_at &&
182
+ prevMessage.user?.updated_at === nextMessage.user?.updated_at;
183
+ return (areBaseMessagesEqual(prevMessage, nextMessage) &&
183
184
  Boolean(prevMessage.quoted_message) === Boolean(nextMessage.quoted_message) &&
184
- (!prevMessage.quoted_message ||
185
- areMessagesEqual(prevMessage.quoted_message, nextMessage.quoted_message)));
185
+ ((!prevMessage.quoted_message && !nextMessage.quoted_message) ||
186
+ areBaseMessagesEqual(prevMessage.quoted_message, nextMessage.quoted_message)));
186
187
  }
187
188
  export const areMessagePropsEqual = (prevProps, nextProps) => {
188
189
  const { message: prevMessage, Message: prevMessageUI } = prevProps;
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
- import { CustomMessageActions } from '../../context/MessageContext';
3
- import type { StreamMessage } from '../../context/ChannelStateContext';
4
- import type { DefaultStreamChatGenerics } from '../../types/types';
5
- export type CustomMessageActionsListProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
6
- message: StreamMessage<StreamChatGenerics>;
7
- customMessageActions?: CustomMessageActions<StreamChatGenerics>;
2
+ import type { LocalMessage } from 'stream-chat';
3
+ import type { CustomMessageActions } from '../../context/MessageContext';
4
+ export type CustomMessageActionsListProps = {
5
+ message: LocalMessage;
6
+ customMessageActions?: CustomMessageActions;
8
7
  };
9
- export declare const CustomMessageActionsList: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: CustomMessageActionsListProps<StreamChatGenerics>) => React.JSX.Element | null;
8
+ export declare const CustomMessageActionsList: (props: CustomMessageActionsListProps) => React.JSX.Element | null;
@@ -1,14 +1,15 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { MessageContextValue } from '../../context/MessageContext';
3
- import type { DefaultStreamChatGenerics, IconProps } from '../../types/types';
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ import type { MessageContextValue } from '../../context/MessageContext';
4
+ import type { IconProps } from '../../types/types';
4
5
  type MessageContextPropsToPick = 'getMessageActions' | 'handleDelete' | 'handleFlag' | 'handleMarkUnread' | 'handleMute' | 'handlePin' | 'message';
5
- export type MessageActionsProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Partial<Pick<MessageContextValue<StreamChatGenerics>, MessageContextPropsToPick>> & {
6
+ export type MessageActionsProps = Partial<Pick<MessageContextValue, MessageContextPropsToPick>> & {
6
7
  ActionsIcon?: React.ComponentType<IconProps>;
7
8
  customWrapperClass?: string;
8
9
  inline?: boolean;
9
10
  mine?: () => boolean;
10
11
  };
11
- export declare const MessageActions: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: MessageActionsProps<StreamChatGenerics>) => React.JSX.Element | null;
12
+ export declare const MessageActions: (props: MessageActionsProps) => React.JSX.Element | null;
12
13
  export type MessageActionsWrapperProps = {
13
14
  customWrapperClass?: string;
14
15
  inline?: boolean;
@@ -36,7 +36,7 @@ export const MessageActions = (props) => {
36
36
  if (!renderMessageActions)
37
37
  return null;
38
38
  return (React.createElement(MessageActionsWrapper, { customWrapperClass: customWrapperClass, inline: inline, toggleOpen: dialog?.toggle },
39
- React.createElement(DialogAnchor, { id: dialogId, placement: isMine ? 'top-end' : 'top-start', referenceElement: actionsBoxButtonRef.current, trapFocus: true },
39
+ React.createElement(DialogAnchor, { id: dialogId, placement: isMine ? 'top-end' : 'top-start', referenceElement: actionsBoxButtonRef.current, tabIndex: -1, trapFocus: true },
40
40
  React.createElement(MessageActionsBox, { getMessageActions: getMessageActions, handleDelete: handleDelete, handleEdit: setEditingState, handleFlag: handleFlag, handleMarkUnread: handleMarkUnread, handleMute: handleMute, handlePin: handlePin, isUserMuted: isMuted, mine: isMine, open: dialogIsOpen })),
41
41
  React.createElement("button", { "aria-expanded": dialogIsOpen, "aria-haspopup": 'true', "aria-label": t('aria/Open Message Actions Menu'), className: 'str-chat__message-actions-box-button', "data-testid": 'message-actions-toggle-button', ref: actionsBoxButtonRef },
42
42
  React.createElement(ActionsIcon, { className: 'str-chat__message-action-icon' }))));
@@ -1,8 +1,8 @@
1
- import React, { ComponentProps } from 'react';
2
- import { MessageContextValue } from '../../context';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
1
+ import type { ComponentProps } from 'react';
2
+ import React from 'react';
3
+ import type { MessageContextValue } from '../../context';
4
4
  type PropsDrilledToMessageActionsBox = 'getMessageActions' | 'handleDelete' | 'handleEdit' | 'handleMarkUnread' | 'handleFlag' | 'handleMute' | 'handlePin';
5
- export type MessageActionsBoxProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<MessageContextValue<StreamChatGenerics>, PropsDrilledToMessageActionsBox> & {
5
+ export type MessageActionsBoxProps = Pick<MessageContextValue, PropsDrilledToMessageActionsBox> & {
6
6
  isUserMuted: () => boolean;
7
7
  mine: boolean;
8
8
  open: boolean;
@@ -10,5 +10,5 @@ export type MessageActionsBoxProps<StreamChatGenerics extends DefaultStreamChatG
10
10
  /**
11
11
  * A popup box that displays the available actions on a message, such as edit, delete, pin, etc.
12
12
  */
13
- export declare const MessageActionsBox: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: MessageActionsBoxProps<StreamChatGenerics>) => React.JSX.Element;
13
+ export declare const MessageActionsBox: (props: MessageActionsBoxProps) => React.JSX.Element;
14
14
  export {};
@@ -1,19 +1,20 @@
1
1
  import clsx from 'clsx';
2
2
  import React from 'react';
3
3
  import { MESSAGE_ACTIONS } from '../Message/utils';
4
- import { useChannelActionContext, useComponentContext, useMessageContext, useTranslationContext, } from '../../context';
4
+ import { useComponentContext, useMessageContext, useTranslationContext, } from '../../context';
5
5
  import { CustomMessageActionsList as DefaultCustomMessageActionsList } from './CustomMessageActionsList';
6
+ import { useMessageComposer } from '../MessageInput';
6
7
  const UnMemoizedMessageActionsBox = (props) => {
7
8
  const { className, getMessageActions, handleDelete, handleEdit, handleFlag, handleMarkUnread, handleMute, handlePin, isUserMuted,
8
9
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
10
  mine, open, ...restDivProps } = props;
10
11
  const { CustomMessageActionsList = DefaultCustomMessageActionsList } = useComponentContext('MessageActionsBox');
11
- const { setQuotedMessage } = useChannelActionContext('MessageActionsBox');
12
12
  const { customMessageActions, message, threadList } = useMessageContext('MessageActionsBox');
13
13
  const { t } = useTranslationContext('MessageActionsBox');
14
+ const messageComposer = useMessageComposer();
14
15
  const messageActions = getMessageActions();
15
16
  const handleQuote = () => {
16
- setQuotedMessage(message);
17
+ messageComposer.setQuotedMessage(message);
17
18
  const elements = message.parent_id
18
19
  ? document.querySelectorAll('.str-chat__thread .str-chat__textarea__textarea')
19
20
  : document.getElementsByClassName('str-chat__textarea__textarea');
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Placement } from '@popperjs/core';
2
+ import type { Placement } from '@popperjs/core';
3
3
  export interface MessageActionsBoxPopperOptions {
4
4
  open: boolean;
5
5
  placement: Placement;
@@ -1,6 +1,7 @@
1
- import React, { ComponentType, PropsWithChildren } from 'react';
2
- import { ModalProps } from '../Modal';
3
- import { MessageBouncePromptProps } from './MessageBouncePrompt';
1
+ import type { ComponentType, PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ import type { ModalProps } from '../Modal';
4
+ import type { MessageBouncePromptProps } from './MessageBouncePrompt';
4
5
  export type MessageBounceModalProps = PropsWithChildren<ModalProps & {
5
6
  MessageBouncePrompt: ComponentType<MessageBouncePromptProps>;
6
7
  }>;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { PropsWithChildren } from 'react';
3
- import type { DefaultStreamChatGenerics } from '../../types/types';
4
3
  import type { ModalProps } from '../Modal';
5
4
  export type MessageBouncePromptProps = PropsWithChildren<Pick<ModalProps, 'onClose'>>;
6
- export declare function MessageBouncePrompt<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ children, onClose }: MessageBouncePromptProps): React.JSX.Element;
5
+ export declare function MessageBouncePrompt({ children, onClose }: MessageBouncePromptProps): React.JSX.Element;
@@ -1,15 +1,15 @@
1
- import React, { ComponentType } from 'react';
2
- import { UnsupportedAttachmentPreviewProps } from './UnsupportedAttachmentPreview';
3
- import { VoiceRecordingPreviewProps } from './VoiceRecordingPreview';
4
- import { FileAttachmentPreviewProps } from './FileAttachmentPreview';
5
- import { ImageAttachmentPreviewProps } from './ImageAttachmentPreview';
6
- import type { DefaultStreamChatGenerics } from '../../../types';
7
- export type AttachmentPreviewListProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
1
+ import type { ComponentType } from 'react';
2
+ import React from 'react';
3
+ import type { UnsupportedAttachmentPreviewProps } from './UnsupportedAttachmentPreview';
4
+ import type { VoiceRecordingPreviewProps } from './VoiceRecordingPreview';
5
+ import type { FileAttachmentPreviewProps } from './FileAttachmentPreview';
6
+ import type { ImageAttachmentPreviewProps } from './ImageAttachmentPreview';
7
+ export type AttachmentPreviewListProps = {
8
8
  AudioAttachmentPreview?: ComponentType<FileAttachmentPreviewProps>;
9
9
  FileAttachmentPreview?: ComponentType<FileAttachmentPreviewProps>;
10
- ImageAttachmentPreview?: ComponentType<ImageAttachmentPreviewProps<StreamChatGenerics>>;
11
- UnsupportedAttachmentPreview?: ComponentType<UnsupportedAttachmentPreviewProps<StreamChatGenerics>>;
10
+ ImageAttachmentPreview?: ComponentType<ImageAttachmentPreviewProps>;
11
+ UnsupportedAttachmentPreview?: ComponentType<UnsupportedAttachmentPreviewProps>;
12
12
  VideoAttachmentPreview?: ComponentType<FileAttachmentPreviewProps>;
13
- VoiceRecordingPreview?: ComponentType<VoiceRecordingPreviewProps<StreamChatGenerics>>;
13
+ VoiceRecordingPreview?: ComponentType<VoiceRecordingPreviewProps>;
14
14
  };
15
- export declare const AttachmentPreviewList: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ AudioAttachmentPreview, FileAttachmentPreview, ImageAttachmentPreview, UnsupportedAttachmentPreview, VideoAttachmentPreview, VoiceRecordingPreview, }: AttachmentPreviewListProps<StreamChatGenerics>) => React.JSX.Element;
15
+ export declare const AttachmentPreviewList: ({ AudioAttachmentPreview, FileAttachmentPreview, ImageAttachmentPreview, UnsupportedAttachmentPreview, VideoAttachmentPreview, VoiceRecordingPreview, }: AttachmentPreviewListProps) => React.JSX.Element | null;
@@ -1,33 +1,36 @@
1
1
  import React from 'react';
2
- import { UnsupportedAttachmentPreview as DefaultUnknownAttachmentPreview, } from './UnsupportedAttachmentPreview';
3
- import { VoiceRecordingPreview as DefaultVoiceRecordingPreview, } from './VoiceRecordingPreview';
4
- import { FileAttachmentPreview as DefaultFilePreview, } from './FileAttachmentPreview';
5
- import { ImageAttachmentPreview as DefaultImagePreview, } from './ImageAttachmentPreview';
6
- import { isLocalAttachment, isLocalAudioAttachment, isLocalFileAttachment, isLocalImageAttachment, isLocalMediaAttachment, isLocalVoiceRecordingAttachment, isScrapedContent, } from '../../Attachment';
7
- import { useMessageInputContext } from '../../../context';
2
+ import { isLocalAttachment, isLocalAudioAttachment, isLocalFileAttachment, isLocalImageAttachment, isLocalVideoAttachment, isLocalVoiceRecordingAttachment, isScrapedContent, } from 'stream-chat';
3
+ import { UnsupportedAttachmentPreview as DefaultUnknownAttachmentPreview } from './UnsupportedAttachmentPreview';
4
+ import { VoiceRecordingPreview as DefaultVoiceRecordingPreview } from './VoiceRecordingPreview';
5
+ import { FileAttachmentPreview as DefaultFilePreview } from './FileAttachmentPreview';
6
+ import { ImageAttachmentPreview as DefaultImagePreview } from './ImageAttachmentPreview';
7
+ import { useAttachmentManagerState, useMessageComposer } from '../hooks';
8
8
  export const AttachmentPreviewList = ({ AudioAttachmentPreview = DefaultFilePreview, FileAttachmentPreview = DefaultFilePreview, ImageAttachmentPreview = DefaultImagePreview, UnsupportedAttachmentPreview = DefaultUnknownAttachmentPreview, VideoAttachmentPreview = DefaultFilePreview, VoiceRecordingPreview = DefaultVoiceRecordingPreview, }) => {
9
- const { attachments, removeAttachments, uploadAttachment } = useMessageInputContext('AttachmentPreviewList');
9
+ const messageComposer = useMessageComposer();
10
+ const { attachments } = useAttachmentManagerState();
11
+ if (!attachments.length)
12
+ return null;
10
13
  return (React.createElement("div", { className: 'str-chat__attachment-preview-list' },
11
14
  React.createElement("div", { className: 'str-chat__attachment-list-scroll-container', "data-testid": 'attachment-list-scroll-container' }, attachments.map((attachment) => {
12
15
  if (isScrapedContent(attachment))
13
16
  return null;
14
17
  if (isLocalVoiceRecordingAttachment(attachment)) {
15
- return (React.createElement(VoiceRecordingPreview, { attachment: attachment, handleRetry: uploadAttachment, key: attachment.localMetadata.id || attachment.asset_url, removeAttachments: removeAttachments }));
18
+ return (React.createElement(VoiceRecordingPreview, { attachment: attachment, handleRetry: messageComposer.attachmentManager.uploadAttachment, key: attachment.localMetadata.id || attachment.asset_url, removeAttachments: messageComposer.attachmentManager.removeAttachments }));
16
19
  }
17
20
  else if (isLocalAudioAttachment(attachment)) {
18
- return (React.createElement(AudioAttachmentPreview, { attachment: attachment, handleRetry: uploadAttachment, key: attachment.localMetadata.id || attachment.asset_url, removeAttachments: removeAttachments }));
21
+ return (React.createElement(AudioAttachmentPreview, { attachment: attachment, handleRetry: messageComposer.attachmentManager.uploadAttachment, key: attachment.localMetadata.id || attachment.asset_url, removeAttachments: messageComposer.attachmentManager.removeAttachments }));
19
22
  }
20
- else if (isLocalMediaAttachment(attachment)) {
21
- return (React.createElement(VideoAttachmentPreview, { attachment: attachment, handleRetry: uploadAttachment, key: attachment.localMetadata.id || attachment.asset_url, removeAttachments: removeAttachments }));
23
+ else if (isLocalVideoAttachment(attachment)) {
24
+ return (React.createElement(VideoAttachmentPreview, { attachment: attachment, handleRetry: messageComposer.attachmentManager.uploadAttachment, key: attachment.localMetadata.id || attachment.asset_url, removeAttachments: messageComposer.attachmentManager.removeAttachments }));
22
25
  }
23
26
  else if (isLocalImageAttachment(attachment)) {
24
- return (React.createElement(ImageAttachmentPreview, { attachment: attachment, handleRetry: uploadAttachment, key: attachment.localMetadata.id || attachment.image_url, removeAttachments: removeAttachments }));
27
+ return (React.createElement(ImageAttachmentPreview, { attachment: attachment, handleRetry: messageComposer.attachmentManager.uploadAttachment, key: attachment.localMetadata.id || attachment.image_url, removeAttachments: messageComposer.attachmentManager.removeAttachments }));
25
28
  }
26
29
  else if (isLocalFileAttachment(attachment)) {
27
- return (React.createElement(FileAttachmentPreview, { attachment: attachment, handleRetry: uploadAttachment, key: attachment.localMetadata.id || attachment.asset_url, removeAttachments: removeAttachments }));
30
+ return (React.createElement(FileAttachmentPreview, { attachment: attachment, handleRetry: messageComposer.attachmentManager.uploadAttachment, key: attachment.localMetadata.id || attachment.asset_url, removeAttachments: messageComposer.attachmentManager.removeAttachments }));
28
31
  }
29
32
  else if (isLocalAttachment(attachment)) {
30
- return (React.createElement(UnsupportedAttachmentPreview, { attachment: attachment, handleRetry: uploadAttachment, key: attachment.localMetadata.id, removeAttachments: removeAttachments }));
33
+ return (React.createElement(UnsupportedAttachmentPreview, { attachment: attachment, handleRetry: messageComposer.attachmentManager.uploadAttachment, key: attachment.localMetadata.id, removeAttachments: messageComposer.attachmentManager.removeAttachments }));
31
34
  }
32
35
  return null;
33
36
  }))));
@@ -1,13 +1,5 @@
1
1
  import React from 'react';
2
- import type { AttachmentPreviewProps } from './types';
3
- import { LocalAttachmentCast, LocalAttachmentUploadMetadata } from '../types';
4
- import type { DefaultStreamChatGenerics } from '../../../types';
5
- type FileLikeAttachment = {
6
- asset_url?: string;
7
- file_size?: number;
8
- mime_type?: string;
9
- title?: string;
10
- };
11
- export type FileAttachmentPreviewProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, CustomLocalMetadata = Record<string, unknown>> = AttachmentPreviewProps<LocalAttachmentCast<FileLikeAttachment, LocalAttachmentUploadMetadata & CustomLocalMetadata>, StreamChatGenerics>;
12
- export declare const FileAttachmentPreview: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, handleRetry, removeAttachments, }: FileAttachmentPreviewProps<StreamChatGenerics>) => React.JSX.Element;
13
- export {};
2
+ import type { LocalAudioAttachment, LocalFileAttachment, LocalVideoAttachment } from 'stream-chat';
3
+ import type { UploadAttachmentPreviewProps } from './types';
4
+ export type FileAttachmentPreviewProps<CustomLocalMetadata = unknown> = UploadAttachmentPreviewProps<LocalFileAttachment<CustomLocalMetadata> | LocalAudioAttachment<CustomLocalMetadata> | LocalVideoAttachment<CustomLocalMetadata>>;
5
+ export declare const FileAttachmentPreview: ({ attachment, handleRetry, removeAttachments, }: FileAttachmentPreviewProps) => React.JSX.Element;
@@ -1,21 +1,24 @@
1
1
  import React from 'react';
2
+ import { useTranslationContext } from '../../../context';
2
3
  import { FileIcon } from '../../ReactFileUtilities';
3
4
  import { CloseIcon, DownloadIcon, LoadingIndicatorIcon, RetryIcon } from '../icons';
4
- import { useTranslationContext } from '../../../context';
5
5
  export const FileAttachmentPreview = ({ attachment, handleRetry, removeAttachments, }) => {
6
6
  const { t } = useTranslationContext('FilePreview');
7
+ const uploadState = attachment.localMetadata?.uploadState;
7
8
  return (React.createElement("div", { className: 'str-chat__attachment-preview-file', "data-testid": 'attachment-preview-file' },
8
9
  React.createElement("div", { className: 'str-chat__attachment-preview-file-icon' },
9
10
  React.createElement(FileIcon, { filename: attachment.title, mimeType: attachment.mime_type })),
10
- React.createElement("button", { "aria-label": t('aria/Remove attachment'), className: 'str-chat__attachment-preview-delete', "data-testid": 'file-preview-item-delete-button', disabled: attachment.localMetadata?.uploadState === 'uploading', onClick: () => attachment.localMetadata?.id &&
11
+ React.createElement("button", { "aria-label": t('aria/Remove attachment'), className: 'str-chat__attachment-preview-delete', "data-testid": 'file-preview-item-delete-button', disabled: uploadState === 'uploading', onClick: () => attachment.localMetadata?.id &&
11
12
  removeAttachments([attachment.localMetadata?.id]) },
12
13
  React.createElement(CloseIcon, null)),
13
- attachment.localMetadata?.uploadState === 'failed' && !!handleRetry && (React.createElement("button", { className: 'str-chat__attachment-preview-error str-chat__attachment-preview-error-file', "data-testid": 'file-preview-item-retry-button', onClick: () => handleRetry(attachment) },
14
+ ['blocked', 'failed'].includes(uploadState) && !!handleRetry && (React.createElement("button", { className: 'str-chat__attachment-preview-error str-chat__attachment-preview-error-file', "data-testid": 'file-preview-item-retry-button', onClick: () => {
15
+ handleRetry(attachment);
16
+ } },
14
17
  React.createElement(RetryIcon, null))),
15
18
  React.createElement("div", { className: 'str-chat__attachment-preview-file-end' },
16
19
  React.createElement("div", { className: 'str-chat__attachment-preview-file-name', title: attachment.title }, attachment.title),
17
- attachment.localMetadata?.uploadState === 'finished' &&
20
+ (typeof uploadState === 'undefined' || uploadState === 'finished') &&
18
21
  !!attachment.asset_url && (React.createElement("a", { "aria-label": t('aria/Download attachment'), className: 'str-chat__attachment-preview-file-download', download: true, href: attachment.asset_url, rel: 'noreferrer', target: '_blank', title: t('Download attachment {{ name }}', { name: attachment.title }) },
19
22
  React.createElement(DownloadIcon, null))),
20
- attachment.localMetadata?.uploadState === 'uploading' && (React.createElement(LoadingIndicatorIcon, { size: 17 })))));
23
+ uploadState === 'uploading' && React.createElement(LoadingIndicatorIcon, { size: 17 }))));
21
24
  };
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import type { AttachmentPreviewProps } from './types';
3
- import type { LocalImageAttachment } from '../types';
4
- import type { DefaultStreamChatGenerics } from '../../../types';
5
- export type ImageAttachmentPreviewProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, CustomLocalMetadata = Record<string, unknown>> = AttachmentPreviewProps<LocalImageAttachment<StreamChatGenerics, CustomLocalMetadata>, StreamChatGenerics>;
6
- export declare const ImageAttachmentPreview: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, handleRetry, removeAttachments, }: ImageAttachmentPreviewProps<StreamChatGenerics>) => React.JSX.Element;
2
+ import type { LocalImageAttachment } from 'stream-chat';
3
+ import type { UploadAttachmentPreviewProps } from './types';
4
+ export type ImageAttachmentPreviewProps<CustomLocalMetadata = Record<string, unknown>> = UploadAttachmentPreviewProps<LocalImageAttachment<CustomLocalMetadata>>;
5
+ export declare const ImageAttachmentPreview: ({ attachment, handleRetry, removeAttachments, }: ImageAttachmentPreviewProps) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import clsx from 'clsx';
2
- import { CloseIcon, LoadingIndicatorIcon, RetryIcon } from '../icons';
3
2
  import React, { useCallback, useState } from 'react';
3
+ import { CloseIcon, LoadingIndicatorIcon, RetryIcon } from '../icons';
4
4
  import { BaseImage as DefaultBaseImage } from '../../Gallery';
5
5
  import { useComponentContext, useTranslationContext } from '../../../context';
6
6
  export const ImageAttachmentPreview = ({ attachment, handleRetry, removeAttachments, }) => {
@@ -15,7 +15,7 @@ export const ImageAttachmentPreview = ({ attachment, handleRetry, removeAttachme
15
15
  }), "data-testid": 'attachment-preview-image' },
16
16
  React.createElement("button", { "aria-label": t('aria/Remove attachment'), className: 'str-chat__attachment-preview-delete', "data-testid": 'image-preview-item-delete-button', disabled: uploadState === 'uploading', onClick: () => id && removeAttachments([id]) },
17
17
  React.createElement(CloseIcon, null)),
18
- uploadState === 'failed' && (React.createElement("button", { className: 'str-chat__attachment-preview-error str-chat__attachment-preview-error-image', "data-testid": 'image-preview-item-retry-button', onClick: () => handleRetry(attachment) },
18
+ ['blocked', 'failed'].includes(uploadState) && (React.createElement("button", { className: 'str-chat__attachment-preview-error str-chat__attachment-preview-error-image', "data-testid": 'image-preview-item-retry-button', onClick: () => handleRetry(attachment) },
19
19
  React.createElement(RetryIcon, null))),
20
20
  uploadState === 'uploading' && (React.createElement("div", { className: 'str-chat__attachment-preview-image-loading' },
21
21
  React.createElement(LoadingIndicatorIcon, { size: 17 }))),
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
- import type { AttachmentPreviewProps } from './types';
3
- import type { AnyLocalAttachment } from '../types';
4
- import type { DefaultStreamChatGenerics } from '../../../types';
5
- export type UnsupportedAttachmentPreviewProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, CustomLocalMetadata = Record<string, unknown>> = AttachmentPreviewProps<AnyLocalAttachment<StreamChatGenerics, CustomLocalMetadata>, StreamChatGenerics>;
6
- export declare const UnsupportedAttachmentPreview: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, handleRetry, removeAttachments, }: UnsupportedAttachmentPreviewProps<StreamChatGenerics>) => React.JSX.Element;
2
+ import type { AnyLocalAttachment, LocalUploadAttachment } from 'stream-chat';
3
+ export type UnsupportedAttachmentPreviewProps<CustomLocalMetadata = Record<string, unknown>> = {
4
+ attachment: AnyLocalAttachment<CustomLocalMetadata>;
5
+ handleRetry: (attachment: LocalUploadAttachment) => void | Promise<LocalUploadAttachment | undefined>;
6
+ removeAttachments: (ids: string[]) => void;
7
+ };
8
+ export declare const UnsupportedAttachmentPreview: ({ attachment, handleRetry, removeAttachments, }: UnsupportedAttachmentPreviewProps) => React.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { isLocalUploadAttachment } from 'stream-chat';
2
3
  import { CloseIcon, DownloadIcon, LoadingIndicatorIcon, RetryIcon } from '../icons';
3
4
  import { FileIcon } from '../../ReactFileUtilities';
4
5
  import { useTranslationContext } from '../../../context';
@@ -8,10 +9,12 @@ export const UnsupportedAttachmentPreview = ({ attachment, handleRetry, removeAt
8
9
  return (React.createElement("div", { className: 'str-chat__attachment-preview-unsupported', "data-testid": 'attachment-preview-unknown' },
9
10
  React.createElement("div", { className: 'str-chat__attachment-preview-file-icon' },
10
11
  React.createElement(FileIcon, { filename: title, mimeType: attachment.mime_type })),
11
- React.createElement("button", { className: 'str-chat__attachment-preview-delete', "data-testid": 'file-preview-item-delete-button', disabled: attachment.localMetadata?.uploadState === 'uploading', onClick: () => attachment.localMetadata?.id &&
12
+ React.createElement("button", { "aria-label": t('aria/Remove attachment'), className: 'str-chat__attachment-preview-delete', "data-testid": 'file-preview-item-delete-button', disabled: attachment.localMetadata?.uploadState === 'uploading', onClick: () => attachment.localMetadata?.id &&
12
13
  removeAttachments([attachment.localMetadata?.id]) },
13
14
  React.createElement(CloseIcon, null)),
14
- attachment.localMetadata?.uploadState === 'failed' && !!handleRetry && (React.createElement("button", { className: 'str-chat__attachment-preview-error str-chat__attachment-preview-error-file', "data-testid": 'file-preview-item-retry-button', onClick: () => handleRetry(attachment) },
15
+ isLocalUploadAttachment(attachment) &&
16
+ ['blocked', 'failed'].includes(attachment.localMetadata?.uploadState) &&
17
+ !!handleRetry && (React.createElement("button", { className: 'str-chat__attachment-preview-error str-chat__attachment-preview-error-file', "data-testid": 'file-preview-item-retry-button', onClick: () => handleRetry(attachment) },
15
18
  React.createElement(RetryIcon, null))),
16
19
  React.createElement("div", { className: 'str-chat__attachment-preview-metadata' },
17
20
  React.createElement("div", { className: 'str-chat__attachment-preview-title', title: title }, title),
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import type { AttachmentPreviewProps } from './types';
3
- import type { LocalVoiceRecordingAttachment } from '../types';
4
- import type { DefaultStreamChatGenerics } from '../../../types';
5
- export type VoiceRecordingPreviewProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, CustomLocalMetadata = Record<string, unknown>> = AttachmentPreviewProps<LocalVoiceRecordingAttachment<StreamChatGenerics, CustomLocalMetadata>, StreamChatGenerics>;
6
- export declare const VoiceRecordingPreview: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, handleRetry, removeAttachments, }: VoiceRecordingPreviewProps<StreamChatGenerics>) => React.JSX.Element;
2
+ import type { LocalVoiceRecordingAttachment } from 'stream-chat';
3
+ import type { UploadAttachmentPreviewProps } from './types';
4
+ export type VoiceRecordingPreviewProps<CustomLocalMetadata = Record<string, unknown>> = UploadAttachmentPreviewProps<LocalVoiceRecordingAttachment<CustomLocalMetadata>>;
5
+ export declare const VoiceRecordingPreview: ({ attachment, handleRetry, removeAttachments, }: VoiceRecordingPreviewProps) => React.JSX.Element;
@@ -4,7 +4,9 @@ import { RecordingTimer } from '../../MediaRecorder';
4
4
  import { CloseIcon, LoadingIndicatorIcon, RetryIcon } from '../icons';
5
5
  import { FileIcon } from '../../ReactFileUtilities';
6
6
  import { useAudioController } from '../../Attachment/hooks/useAudioController';
7
+ import { useTranslationContext } from '../../../context';
7
8
  export const VoiceRecordingPreview = ({ attachment, handleRetry, removeAttachments, }) => {
9
+ const { t } = useTranslationContext();
8
10
  const { audioRef, isPlaying, secondsElapsed, togglePlay } = useAudioController({
9
11
  mimeType: attachment.mime_type,
10
12
  });
@@ -12,9 +14,10 @@ export const VoiceRecordingPreview = ({ attachment, handleRetry, removeAttachmen
12
14
  React.createElement("audio", { ref: audioRef },
13
15
  React.createElement("source", { "data-testid": 'audio-source', src: attachment.asset_url, type: attachment.mime_type })),
14
16
  React.createElement(PlayButton, { isPlaying: isPlaying, onClick: togglePlay }),
15
- React.createElement("button", { className: 'str-chat__attachment-preview-delete', "data-testid": 'file-preview-item-delete-button', disabled: attachment.localMetadata?.uploadState === 'uploading', onClick: () => attachment.localMetadata?.id && removeAttachments([attachment.localMetadata.id]) },
17
+ React.createElement("button", { "aria-label": t('aria/Remove attachment'), className: 'str-chat__attachment-preview-delete', "data-testid": 'file-preview-item-delete-button', disabled: attachment.localMetadata?.uploadState === 'uploading', onClick: () => attachment.localMetadata?.id && removeAttachments([attachment.localMetadata.id]) },
16
18
  React.createElement(CloseIcon, null)),
17
- attachment.localMetadata?.uploadState === 'failed' && !!handleRetry && (React.createElement("button", { className: 'str-chat__attachment-preview-error str-chat__attachment-preview-error-file', "data-testid": 'file-preview-item-retry-button', onClick: () => handleRetry(attachment) },
19
+ ['blocked', 'failed'].includes(attachment.localMetadata?.uploadState) &&
20
+ !!handleRetry && (React.createElement("button", { className: 'str-chat__attachment-preview-error str-chat__attachment-preview-error-file', "data-testid": 'file-preview-item-retry-button', onClick: () => handleRetry(attachment) },
18
21
  React.createElement(RetryIcon, null))),
19
22
  React.createElement("div", { className: 'str-chat__attachment-preview-metadata' },
20
23
  React.createElement("div", { className: 'str-chat__attachment-preview-file-name', title: attachment.title }, attachment.title),
@@ -1,6 +1,6 @@
1
1
  export * from './AttachmentPreviewList';
2
2
  export type { FileAttachmentPreviewProps } from './FileAttachmentPreview';
3
3
  export type { ImageAttachmentPreviewProps } from './ImageAttachmentPreview';
4
- export type { AttachmentPreviewProps } from './types';
4
+ export type { UploadAttachmentPreviewProps as AttachmentPreviewProps } from './types';
5
5
  export type { UnsupportedAttachmentPreviewProps } from './UnsupportedAttachmentPreview';
6
6
  export type { VoiceRecordingPreviewProps } from './VoiceRecordingPreview';
@@ -1,7 +1,6 @@
1
- import { LocalAttachment } from '../types';
2
- import type { DefaultStreamChatGenerics } from '../../../types';
3
- export type AttachmentPreviewProps<A extends LocalAttachment, StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
1
+ import type { LocalUploadAttachment } from 'stream-chat';
2
+ export type UploadAttachmentPreviewProps<A extends LocalUploadAttachment> = {
4
3
  attachment: A;
5
- handleRetry: (attachment: LocalAttachment<StreamChatGenerics>) => void | Promise<LocalAttachment<StreamChatGenerics> | undefined>;
4
+ handleRetry: (attachment: LocalUploadAttachment) => void | Promise<LocalUploadAttachment | undefined>;
6
5
  removeAttachments: (ids: string[]) => void;
7
6
  };
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import type { DefaultStreamChatGenerics } from '../../types';
3
2
  export declare const SimpleAttachmentSelector: () => React.JSX.Element;
4
3
  export type AttachmentSelectorModalContentProps = {
5
4
  close: () => void;
@@ -22,4 +21,4 @@ export type AttachmentSelectorProps = {
22
21
  attachmentSelectorActionSet?: AttachmentSelectorAction[];
23
22
  getModalPortalDestination?: () => HTMLElement | null;
24
23
  };
25
- export declare const AttachmentSelector: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachmentSelectorActionSet, getModalPortalDestination, }: AttachmentSelectorProps) => React.JSX.Element | null;
24
+ export declare const AttachmentSelector: ({ attachmentSelectorActionSet, getModalPortalDestination, }: AttachmentSelectorProps) => React.JSX.Element | null;
@@ -1,6 +1,7 @@
1
1
  import { nanoid } from 'nanoid';
2
- import React, { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
2
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { UploadIcon as DefaultUploadIcon } from './icons';
4
+ import { useAttachmentManagerState } from './hooks/useAttachmentManagerState';
4
5
  import { CHANNEL_CONTAINER_ID } from '../Channel/constants';
5
6
  import { DialogAnchor, useDialog, useDialogIsOpen } from '../Dialog';
6
7
  import { DialogMenuButton } from '../Dialog/DialogMenu';
@@ -47,7 +48,8 @@ export const DefaultAttachmentSelectorComponents = {
47
48
  File({ closeMenu }) {
48
49
  const { t } = useTranslationContext();
49
50
  const { fileInput } = useAttachmentSelectorContext();
50
- return (React.createElement(DialogMenuButton, { className: 'str-chat__attachment-selector-actions-menu__button str-chat__attachment-selector-actions-menu__upload-file-button', onClick: () => {
51
+ const { isUploadEnabled } = useAttachmentManagerState();
52
+ return (React.createElement(DialogMenuButton, { className: 'str-chat__attachment-selector-actions-menu__button str-chat__attachment-selector-actions-menu__upload-file-button', disabled: !isUploadEnabled, onClick: () => {
51
53
  if (fileInput)
52
54
  fileInput.click();
53
55
  closeMenu();
@@ -118,7 +120,7 @@ export const AttachmentSelector = ({ attachmentSelectorActionSet = defaultAttach
118
120
  channelCapabilities['upload-file'] && React.createElement(UploadFileInput, { ref: setFileInput }),
119
121
  React.createElement("button", { "aria-expanded": menuDialogIsOpen, "aria-haspopup": 'true', "aria-label": t('aria/Open Attachment Selector'), className: 'str-chat__attachment-selector__menu-button', "data-testid": 'invoke-attachment-selector-button', onClick: () => menuDialog?.toggle(), ref: menuButtonRef },
120
122
  React.createElement(AttachmentSelectorMenuInitButtonIcon, null)),
121
- React.createElement(DialogAnchor, { id: menuDialogId, placement: 'top-start', referenceElement: menuButtonRef.current, trapFocus: true },
123
+ React.createElement(DialogAnchor, { id: menuDialogId, placement: 'top-start', referenceElement: menuButtonRef.current, tabIndex: -1, trapFocus: true },
122
124
  React.createElement("div", { className: 'str-chat__attachment-selector-actions-menu str-chat__dialog-menu', "data-testid": 'attachment-selector-actions-menu' }, actions.map(({ ActionButton, type }) => (React.createElement(ActionButton, { closeMenu: menuDialog.close, key: `attachment-selector-item-${type}`, openModalForAction: openModal }))))),
123
125
  React.createElement(Portal, { getPortalDestination: getModalPortalDestination ?? getDefaultPortalDestination, isOpen: modalIsOpen },
124
126
  React.createElement(Modal, { className: 'str-chat__create-poll-modal', onClose: closeModal, open: modalIsOpen }, ModalContent && React.createElement(ModalContent, { close: closeModal }))))));
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
- import type { CustomTrigger, DefaultStreamChatGenerics } from '../../types/types';
3
- export declare const EditMessageForm: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, V extends CustomTrigger = CustomTrigger>() => React.JSX.Element;
2
+ import type { MessageUIComponentProps } from '../Message';
3
+ export declare const EditMessageForm: () => React.JSX.Element;
4
+ export declare const EditMessageModal: ({ additionalMessageInputProps, }: Pick<MessageUIComponentProps, 'additionalMessageInputProps'>) => React.JSX.Element;