stream-chat-react-native-core 9.2.0-beta.1 → 9.2.0-beta.3

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 (579) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/a11y/hooks/useA11yLabel.js +4 -3
  3. package/lib/commonjs/a11y/hooks/useA11yLabel.js.map +1 -1
  4. package/lib/commonjs/a11y/hooks/useAccessibilityActivateAction.js +25 -0
  5. package/lib/commonjs/a11y/hooks/useAccessibilityActivateAction.js.map +1 -0
  6. package/lib/commonjs/a11y/index.js +11 -0
  7. package/lib/commonjs/a11y/index.js.map +1 -1
  8. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +20 -0
  9. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  10. package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js +1 -0
  11. package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js.map +1 -1
  12. package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +19 -2
  13. package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
  14. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js +4 -3
  15. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
  16. package/lib/commonjs/components/AttachmentPicker/components/AttachmentTypePickerButton.js +9 -1
  17. package/lib/commonjs/components/AttachmentPicker/components/AttachmentTypePickerButton.js.map +1 -1
  18. package/lib/commonjs/components/Channel/Channel.js +10 -1
  19. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  20. package/lib/commonjs/components/Channel/hooks/useMessageListPagination.js +26 -3
  21. package/lib/commonjs/components/Channel/hooks/useMessageListPagination.js.map +1 -1
  22. package/lib/commonjs/components/ChannelList/ChannelList.js +29 -4
  23. package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
  24. package/lib/commonjs/components/ChannelList/hooks/useChannelActions.js +314 -11
  25. package/lib/commonjs/components/ChannelList/hooks/useChannelActions.js.map +1 -1
  26. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +2 -2
  27. package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  28. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
  29. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  30. package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
  31. package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
  32. package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js +202 -15
  33. package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
  34. package/lib/commonjs/components/MessageInput/MessageComposer.js +1 -1
  35. package/lib/commonjs/components/MessageInput/MessageComposerLeadingView.js +1 -1
  36. package/lib/commonjs/components/MessageInput/MessageComposerLeadingView.js.map +1 -1
  37. package/lib/commonjs/components/MessageInput/MessageInputHeaderView.js +1 -1
  38. package/lib/commonjs/components/MessageInput/MessageInputHeaderView.js.map +1 -1
  39. package/lib/commonjs/components/MessageInput/MessageInputTrailingView.js +1 -1
  40. package/lib/commonjs/components/MessageInput/MessageInputTrailingView.js.map +1 -1
  41. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.js +16 -4
  42. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.js.map +1 -1
  43. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +7 -13
  44. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
  45. package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecorder.js +30 -6
  46. package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecorder.js.map +1 -1
  47. package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js +34 -9
  48. package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js.map +1 -1
  49. package/lib/commonjs/components/MessageInput/components/InputButtons/AttachButton.js +12 -3
  50. package/lib/commonjs/components/MessageInput/components/InputButtons/AttachButton.js.map +1 -1
  51. package/lib/commonjs/components/MessageInput/components/OutputButtons/EditButton.js +1 -0
  52. package/lib/commonjs/components/MessageInput/components/OutputButtons/EditButton.js.map +1 -1
  53. package/lib/commonjs/components/MessageInput/components/OutputButtons/SendButton.js +1 -0
  54. package/lib/commonjs/components/MessageInput/components/OutputButtons/SendButton.js.map +1 -1
  55. package/lib/commonjs/components/MessageInput/components/OutputButtons/index.js +1 -1
  56. package/lib/commonjs/components/MessageList/MessageFlashList.js +24 -4
  57. package/lib/commonjs/components/MessageList/MessageFlashList.js.map +1 -1
  58. package/lib/commonjs/components/MessageList/MessageList.js +24 -4
  59. package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
  60. package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +12 -6
  61. package/lib/commonjs/components/MessageList/ScrollToBottomButton.js.map +1 -1
  62. package/lib/commonjs/components/MessageList/UnreadMessagesNotification.js +1 -0
  63. package/lib/commonjs/components/MessageList/UnreadMessagesNotification.js.map +1 -1
  64. package/lib/commonjs/components/MessageList/hooks/useScrollToBottomAccessibilityAction.js +47 -0
  65. package/lib/commonjs/components/MessageList/hooks/useScrollToBottomAccessibilityAction.js.map +1 -0
  66. package/lib/commonjs/components/MessageMenu/MessageActionListItem.js +12 -4
  67. package/lib/commonjs/components/MessageMenu/MessageActionListItem.js.map +1 -1
  68. package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js +1 -0
  69. package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js.map +1 -1
  70. package/lib/commonjs/components/MessageMenu/ReactionButton.js +9 -6
  71. package/lib/commonjs/components/MessageMenu/ReactionButton.js.map +1 -1
  72. package/lib/commonjs/components/MessageMenu/hooks/useFetchReactions.js +23 -2
  73. package/lib/commonjs/components/MessageMenu/hooks/useFetchReactions.js.map +1 -1
  74. package/lib/commonjs/components/Notifications/Notification.js +232 -0
  75. package/lib/commonjs/components/Notifications/Notification.js.map +1 -0
  76. package/lib/commonjs/components/Notifications/NotificationList.js +120 -0
  77. package/lib/commonjs/components/Notifications/NotificationList.js.map +1 -0
  78. package/lib/commonjs/components/Notifications/NotificationTargetContext.js +45 -0
  79. package/lib/commonjs/components/Notifications/NotificationTargetContext.js.map +1 -0
  80. package/lib/commonjs/components/Notifications/hooks/index.js +59 -0
  81. package/lib/commonjs/components/Notifications/hooks/index.js.map +1 -0
  82. package/lib/commonjs/components/Notifications/hooks/useNotificationApi.js +133 -0
  83. package/lib/commonjs/components/Notifications/hooks/useNotificationApi.js.map +1 -0
  84. package/lib/commonjs/components/Notifications/hooks/useNotificationListController.js +133 -0
  85. package/lib/commonjs/components/Notifications/hooks/useNotificationListController.js.map +1 -0
  86. package/lib/commonjs/components/Notifications/hooks/useNotificationTarget.js +26 -0
  87. package/lib/commonjs/components/Notifications/hooks/useNotificationTarget.js.map +1 -0
  88. package/lib/commonjs/components/Notifications/hooks/useNotifications.js +26 -0
  89. package/lib/commonjs/components/Notifications/hooks/useNotifications.js.map +1 -0
  90. package/lib/commonjs/components/Notifications/hooks/useSystemNotifications.js +22 -0
  91. package/lib/commonjs/components/Notifications/hooks/useSystemNotifications.js.map +1 -0
  92. package/lib/commonjs/components/Notifications/index.js +59 -0
  93. package/lib/commonjs/components/Notifications/index.js.map +1 -0
  94. package/lib/commonjs/components/Notifications/notificationTarget.js +220 -0
  95. package/lib/commonjs/components/Notifications/notificationTarget.js.map +1 -0
  96. package/lib/commonjs/components/Notifications/notificationTranslations.js +137 -0
  97. package/lib/commonjs/components/Notifications/notificationTranslations.js.map +1 -0
  98. package/lib/commonjs/components/Poll/components/CreatePollHeader.js +2 -0
  99. package/lib/commonjs/components/Poll/components/CreatePollHeader.js.map +1 -1
  100. package/lib/commonjs/components/Poll/components/MultipleVotesSettings.js +2 -0
  101. package/lib/commonjs/components/Poll/components/MultipleVotesSettings.js.map +1 -1
  102. package/lib/commonjs/components/Poll/components/PollModalHeader.js +1 -0
  103. package/lib/commonjs/components/Poll/components/PollModalHeader.js.map +1 -1
  104. package/lib/commonjs/components/Poll/components/PollOption.js +14 -9
  105. package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
  106. package/lib/commonjs/components/Poll/hooks/usePollState.js +35 -3
  107. package/lib/commonjs/components/Poll/hooks/usePollState.js.map +1 -1
  108. package/lib/commonjs/components/Reply/Reply.js +1 -0
  109. package/lib/commonjs/components/Reply/Reply.js.map +1 -1
  110. package/lib/commonjs/components/Thread/Thread.js +19 -11
  111. package/lib/commonjs/components/Thread/Thread.js.map +1 -1
  112. package/lib/commonjs/components/ThreadList/ThreadList.js +30 -9
  113. package/lib/commonjs/components/ThreadList/ThreadList.js.map +1 -1
  114. package/lib/commonjs/components/index.js +11 -0
  115. package/lib/commonjs/components/index.js.map +1 -1
  116. package/lib/commonjs/components/ui/Avatar/Avatar.js +6 -3
  117. package/lib/commonjs/components/ui/Avatar/Avatar.js.map +1 -1
  118. package/lib/commonjs/components/ui/Button/Button.js +16 -3
  119. package/lib/commonjs/components/ui/Button/Button.js.map +1 -1
  120. package/lib/commonjs/contexts/accessibilityContext/AccessibilityContext.js +21 -1
  121. package/lib/commonjs/contexts/accessibilityContext/AccessibilityContext.js.map +1 -1
  122. package/lib/commonjs/contexts/componentsContext/defaultComponents.js +4 -0
  123. package/lib/commonjs/contexts/componentsContext/defaultComponents.js.map +1 -1
  124. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +37 -0
  125. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  126. package/lib/commonjs/contexts/themeContext/utils/theme.js +13 -0
  127. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  128. package/lib/commonjs/hooks/index.js +11 -0
  129. package/lib/commonjs/hooks/index.js.map +1 -1
  130. package/lib/commonjs/hooks/useAudioPlayer.js +34 -1
  131. package/lib/commonjs/hooks/useAudioPlayer.js.map +1 -1
  132. package/lib/commonjs/hooks/useInAppNotificationsState.js.map +1 -1
  133. package/lib/commonjs/hooks/useLazyRef.js +13 -0
  134. package/lib/commonjs/hooks/useLazyRef.js.map +1 -0
  135. package/lib/commonjs/i18n/en.json +94 -1
  136. package/lib/commonjs/i18n/es.json +96 -3
  137. package/lib/commonjs/i18n/fr.json +94 -1
  138. package/lib/commonjs/i18n/he.json +94 -1
  139. package/lib/commonjs/i18n/hi.json +94 -1
  140. package/lib/commonjs/i18n/it.json +94 -1
  141. package/lib/commonjs/i18n/ja.json +94 -1
  142. package/lib/commonjs/i18n/ko.json +94 -1
  143. package/lib/commonjs/i18n/nl.json +94 -1
  144. package/lib/commonjs/i18n/pt-br.json +94 -1
  145. package/lib/commonjs/i18n/ru.json +94 -1
  146. package/lib/commonjs/i18n/tr.json +94 -1
  147. package/lib/commonjs/mock-builders/DB/mock.js +3 -1
  148. package/lib/commonjs/mock-builders/DB/mock.js.map +1 -1
  149. package/lib/commonjs/state-store/audio-player-pool.js +1 -0
  150. package/lib/commonjs/state-store/audio-player-pool.js.map +1 -1
  151. package/lib/commonjs/state-store/audio-player.js +92 -13
  152. package/lib/commonjs/state-store/audio-player.js.map +1 -1
  153. package/lib/commonjs/test-utils/BetterSqlite.js +3 -2
  154. package/lib/commonjs/test-utils/BetterSqlite.js.map +1 -1
  155. package/lib/commonjs/theme/generated/dark/StreamTokens.android.js +16 -16
  156. package/lib/commonjs/theme/generated/dark/StreamTokens.android.js.map +1 -1
  157. package/lib/commonjs/theme/generated/dark/StreamTokens.ios.js +8 -8
  158. package/lib/commonjs/theme/generated/dark/StreamTokens.ios.js.map +1 -1
  159. package/lib/commonjs/theme/generated/dark/StreamTokens.web.js +8 -8
  160. package/lib/commonjs/theme/generated/dark/StreamTokens.web.js.map +1 -1
  161. package/lib/commonjs/theme/generated/light/StreamTokens.android.js +16 -16
  162. package/lib/commonjs/theme/generated/light/StreamTokens.android.js.map +1 -1
  163. package/lib/commonjs/theme/generated/light/StreamTokens.ios.js +8 -8
  164. package/lib/commonjs/theme/generated/light/StreamTokens.ios.js.map +1 -1
  165. package/lib/commonjs/theme/generated/light/StreamTokens.web.js +8 -8
  166. package/lib/commonjs/theme/generated/light/StreamTokens.web.js.map +1 -1
  167. package/lib/commonjs/utils/animations/createBoundedZoomTransition.js +151 -0
  168. package/lib/commonjs/utils/animations/createBoundedZoomTransition.js.map +1 -0
  169. package/lib/commonjs/utils/{transitions.js → animations/transitions.js} +6 -0
  170. package/lib/commonjs/utils/animations/transitions.js.map +1 -0
  171. package/lib/commonjs/version.json +1 -1
  172. package/lib/module/a11y/hooks/useA11yLabel.js +4 -3
  173. package/lib/module/a11y/hooks/useA11yLabel.js.map +1 -1
  174. package/lib/module/a11y/hooks/useAccessibilityActivateAction.js +25 -0
  175. package/lib/module/a11y/hooks/useAccessibilityActivateAction.js.map +1 -0
  176. package/lib/module/a11y/index.js +11 -0
  177. package/lib/module/a11y/index.js.map +1 -1
  178. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +20 -0
  179. package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  180. package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js +1 -0
  181. package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js.map +1 -1
  182. package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +19 -2
  183. package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
  184. package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js +4 -3
  185. package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
  186. package/lib/module/components/AttachmentPicker/components/AttachmentTypePickerButton.js +9 -1
  187. package/lib/module/components/AttachmentPicker/components/AttachmentTypePickerButton.js.map +1 -1
  188. package/lib/module/components/Channel/Channel.js +10 -1
  189. package/lib/module/components/Channel/Channel.js.map +1 -1
  190. package/lib/module/components/Channel/hooks/useMessageListPagination.js +26 -3
  191. package/lib/module/components/Channel/hooks/useMessageListPagination.js.map +1 -1
  192. package/lib/module/components/ChannelList/ChannelList.js +29 -4
  193. package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
  194. package/lib/module/components/ChannelList/hooks/useChannelActions.js +314 -11
  195. package/lib/module/components/ChannelList/hooks/useChannelActions.js.map +1 -1
  196. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +2 -2
  197. package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
  198. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
  199. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  200. package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
  201. package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
  202. package/lib/module/components/Message/hooks/useMessageActionHandlers.js +202 -15
  203. package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
  204. package/lib/module/components/MessageInput/MessageComposer.js +1 -1
  205. package/lib/module/components/MessageInput/MessageComposerLeadingView.js +1 -1
  206. package/lib/module/components/MessageInput/MessageComposerLeadingView.js.map +1 -1
  207. package/lib/module/components/MessageInput/MessageInputHeaderView.js +1 -1
  208. package/lib/module/components/MessageInput/MessageInputHeaderView.js.map +1 -1
  209. package/lib/module/components/MessageInput/MessageInputTrailingView.js +1 -1
  210. package/lib/module/components/MessageInput/MessageInputTrailingView.js.map +1 -1
  211. package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.js +16 -4
  212. package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.js.map +1 -1
  213. package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +7 -13
  214. package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
  215. package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecorder.js +30 -6
  216. package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecorder.js.map +1 -1
  217. package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js +34 -9
  218. package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js.map +1 -1
  219. package/lib/module/components/MessageInput/components/InputButtons/AttachButton.js +12 -3
  220. package/lib/module/components/MessageInput/components/InputButtons/AttachButton.js.map +1 -1
  221. package/lib/module/components/MessageInput/components/OutputButtons/EditButton.js +1 -0
  222. package/lib/module/components/MessageInput/components/OutputButtons/EditButton.js.map +1 -1
  223. package/lib/module/components/MessageInput/components/OutputButtons/SendButton.js +1 -0
  224. package/lib/module/components/MessageInput/components/OutputButtons/SendButton.js.map +1 -1
  225. package/lib/module/components/MessageInput/components/OutputButtons/index.js +1 -1
  226. package/lib/module/components/MessageList/MessageFlashList.js +24 -4
  227. package/lib/module/components/MessageList/MessageFlashList.js.map +1 -1
  228. package/lib/module/components/MessageList/MessageList.js +24 -4
  229. package/lib/module/components/MessageList/MessageList.js.map +1 -1
  230. package/lib/module/components/MessageList/ScrollToBottomButton.js +12 -6
  231. package/lib/module/components/MessageList/ScrollToBottomButton.js.map +1 -1
  232. package/lib/module/components/MessageList/UnreadMessagesNotification.js +1 -0
  233. package/lib/module/components/MessageList/UnreadMessagesNotification.js.map +1 -1
  234. package/lib/module/components/MessageList/hooks/useScrollToBottomAccessibilityAction.js +47 -0
  235. package/lib/module/components/MessageList/hooks/useScrollToBottomAccessibilityAction.js.map +1 -0
  236. package/lib/module/components/MessageMenu/MessageActionListItem.js +12 -4
  237. package/lib/module/components/MessageMenu/MessageActionListItem.js.map +1 -1
  238. package/lib/module/components/MessageMenu/MessageReactionPicker.js +1 -0
  239. package/lib/module/components/MessageMenu/MessageReactionPicker.js.map +1 -1
  240. package/lib/module/components/MessageMenu/ReactionButton.js +9 -6
  241. package/lib/module/components/MessageMenu/ReactionButton.js.map +1 -1
  242. package/lib/module/components/MessageMenu/hooks/useFetchReactions.js +23 -2
  243. package/lib/module/components/MessageMenu/hooks/useFetchReactions.js.map +1 -1
  244. package/lib/module/components/Notifications/Notification.js +232 -0
  245. package/lib/module/components/Notifications/Notification.js.map +1 -0
  246. package/lib/module/components/Notifications/NotificationList.js +120 -0
  247. package/lib/module/components/Notifications/NotificationList.js.map +1 -0
  248. package/lib/module/components/Notifications/NotificationTargetContext.js +45 -0
  249. package/lib/module/components/Notifications/NotificationTargetContext.js.map +1 -0
  250. package/lib/module/components/Notifications/hooks/index.js +59 -0
  251. package/lib/module/components/Notifications/hooks/index.js.map +1 -0
  252. package/lib/module/components/Notifications/hooks/useNotificationApi.js +133 -0
  253. package/lib/module/components/Notifications/hooks/useNotificationApi.js.map +1 -0
  254. package/lib/module/components/Notifications/hooks/useNotificationListController.js +133 -0
  255. package/lib/module/components/Notifications/hooks/useNotificationListController.js.map +1 -0
  256. package/lib/module/components/Notifications/hooks/useNotificationTarget.js +26 -0
  257. package/lib/module/components/Notifications/hooks/useNotificationTarget.js.map +1 -0
  258. package/lib/module/components/Notifications/hooks/useNotifications.js +26 -0
  259. package/lib/module/components/Notifications/hooks/useNotifications.js.map +1 -0
  260. package/lib/module/components/Notifications/hooks/useSystemNotifications.js +22 -0
  261. package/lib/module/components/Notifications/hooks/useSystemNotifications.js.map +1 -0
  262. package/lib/module/components/Notifications/index.js +59 -0
  263. package/lib/module/components/Notifications/index.js.map +1 -0
  264. package/lib/module/components/Notifications/notificationTarget.js +220 -0
  265. package/lib/module/components/Notifications/notificationTarget.js.map +1 -0
  266. package/lib/module/components/Notifications/notificationTranslations.js +137 -0
  267. package/lib/module/components/Notifications/notificationTranslations.js.map +1 -0
  268. package/lib/module/components/Poll/components/CreatePollHeader.js +2 -0
  269. package/lib/module/components/Poll/components/CreatePollHeader.js.map +1 -1
  270. package/lib/module/components/Poll/components/MultipleVotesSettings.js +2 -0
  271. package/lib/module/components/Poll/components/MultipleVotesSettings.js.map +1 -1
  272. package/lib/module/components/Poll/components/PollModalHeader.js +1 -0
  273. package/lib/module/components/Poll/components/PollModalHeader.js.map +1 -1
  274. package/lib/module/components/Poll/components/PollOption.js +14 -9
  275. package/lib/module/components/Poll/components/PollOption.js.map +1 -1
  276. package/lib/module/components/Poll/hooks/usePollState.js +35 -3
  277. package/lib/module/components/Poll/hooks/usePollState.js.map +1 -1
  278. package/lib/module/components/Reply/Reply.js +1 -0
  279. package/lib/module/components/Reply/Reply.js.map +1 -1
  280. package/lib/module/components/Thread/Thread.js +19 -11
  281. package/lib/module/components/Thread/Thread.js.map +1 -1
  282. package/lib/module/components/ThreadList/ThreadList.js +30 -9
  283. package/lib/module/components/ThreadList/ThreadList.js.map +1 -1
  284. package/lib/module/components/index.js +11 -0
  285. package/lib/module/components/index.js.map +1 -1
  286. package/lib/module/components/ui/Avatar/Avatar.js +6 -3
  287. package/lib/module/components/ui/Avatar/Avatar.js.map +1 -1
  288. package/lib/module/components/ui/Button/Button.js +16 -3
  289. package/lib/module/components/ui/Button/Button.js.map +1 -1
  290. package/lib/module/contexts/accessibilityContext/AccessibilityContext.js +21 -1
  291. package/lib/module/contexts/accessibilityContext/AccessibilityContext.js.map +1 -1
  292. package/lib/module/contexts/componentsContext/defaultComponents.js +4 -0
  293. package/lib/module/contexts/componentsContext/defaultComponents.js.map +1 -1
  294. package/lib/module/contexts/messageInputContext/MessageInputContext.js +37 -0
  295. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  296. package/lib/module/contexts/themeContext/utils/theme.js +13 -0
  297. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  298. package/lib/module/hooks/index.js +11 -0
  299. package/lib/module/hooks/index.js.map +1 -1
  300. package/lib/module/hooks/useAudioPlayer.js +34 -1
  301. package/lib/module/hooks/useAudioPlayer.js.map +1 -1
  302. package/lib/module/hooks/useInAppNotificationsState.js.map +1 -1
  303. package/lib/module/hooks/useLazyRef.js +13 -0
  304. package/lib/module/hooks/useLazyRef.js.map +1 -0
  305. package/lib/module/i18n/en.json +94 -1
  306. package/lib/module/i18n/es.json +96 -3
  307. package/lib/module/i18n/fr.json +94 -1
  308. package/lib/module/i18n/he.json +94 -1
  309. package/lib/module/i18n/hi.json +94 -1
  310. package/lib/module/i18n/it.json +94 -1
  311. package/lib/module/i18n/ja.json +94 -1
  312. package/lib/module/i18n/ko.json +94 -1
  313. package/lib/module/i18n/nl.json +94 -1
  314. package/lib/module/i18n/pt-br.json +94 -1
  315. package/lib/module/i18n/ru.json +94 -1
  316. package/lib/module/i18n/tr.json +94 -1
  317. package/lib/module/mock-builders/DB/mock.js +3 -1
  318. package/lib/module/mock-builders/DB/mock.js.map +1 -1
  319. package/lib/module/state-store/audio-player-pool.js +1 -0
  320. package/lib/module/state-store/audio-player-pool.js.map +1 -1
  321. package/lib/module/state-store/audio-player.js +92 -13
  322. package/lib/module/state-store/audio-player.js.map +1 -1
  323. package/lib/module/test-utils/BetterSqlite.js +3 -2
  324. package/lib/module/test-utils/BetterSqlite.js.map +1 -1
  325. package/lib/module/theme/generated/dark/StreamTokens.android.js +16 -16
  326. package/lib/module/theme/generated/dark/StreamTokens.android.js.map +1 -1
  327. package/lib/module/theme/generated/dark/StreamTokens.ios.js +8 -8
  328. package/lib/module/theme/generated/dark/StreamTokens.ios.js.map +1 -1
  329. package/lib/module/theme/generated/dark/StreamTokens.web.js +8 -8
  330. package/lib/module/theme/generated/dark/StreamTokens.web.js.map +1 -1
  331. package/lib/module/theme/generated/light/StreamTokens.android.js +16 -16
  332. package/lib/module/theme/generated/light/StreamTokens.android.js.map +1 -1
  333. package/lib/module/theme/generated/light/StreamTokens.ios.js +8 -8
  334. package/lib/module/theme/generated/light/StreamTokens.ios.js.map +1 -1
  335. package/lib/module/theme/generated/light/StreamTokens.web.js +8 -8
  336. package/lib/module/theme/generated/light/StreamTokens.web.js.map +1 -1
  337. package/lib/module/utils/animations/createBoundedZoomTransition.js +151 -0
  338. package/lib/module/utils/animations/createBoundedZoomTransition.js.map +1 -0
  339. package/lib/module/utils/{transitions.js → animations/transitions.js} +6 -0
  340. package/lib/module/utils/animations/transitions.js.map +1 -0
  341. package/lib/module/version.json +1 -1
  342. package/lib/typescript/a11y/a11yUtils.d.ts +3 -3
  343. package/lib/typescript/a11y/a11yUtils.d.ts.map +1 -1
  344. package/lib/typescript/a11y/hooks/useA11yLabel.d.ts +2 -1
  345. package/lib/typescript/a11y/hooks/useA11yLabel.d.ts.map +1 -1
  346. package/lib/typescript/a11y/hooks/useAccessibilityActivateAction.d.ts +17 -0
  347. package/lib/typescript/a11y/hooks/useAccessibilityActivateAction.d.ts.map +1 -0
  348. package/lib/typescript/a11y/index.d.ts +1 -0
  349. package/lib/typescript/a11y/index.d.ts.map +1 -1
  350. package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts.map +1 -1
  351. package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.d.ts.map +1 -1
  352. package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.d.ts.map +1 -1
  353. package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerContent.d.ts.map +1 -1
  354. package/lib/typescript/components/AttachmentPicker/components/AttachmentTypePickerButton.d.ts +2 -1
  355. package/lib/typescript/components/AttachmentPicker/components/AttachmentTypePickerButton.d.ts.map +1 -1
  356. package/lib/typescript/components/Channel/Channel.d.ts +1 -0
  357. package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
  358. package/lib/typescript/components/Channel/hooks/useMessageListPagination.d.ts.map +1 -1
  359. package/lib/typescript/components/ChannelList/ChannelList.d.ts +1 -0
  360. package/lib/typescript/components/ChannelList/ChannelList.d.ts.map +1 -1
  361. package/lib/typescript/components/ChannelList/hooks/useChannelActions.d.ts.map +1 -1
  362. package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts.map +1 -1
  363. package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.d.ts +5 -2
  364. package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.d.ts.map +1 -1
  365. package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.d.ts.map +1 -1
  366. package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecorder.d.ts.map +1 -1
  367. package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingButton.d.ts.map +1 -1
  368. package/lib/typescript/components/MessageInput/components/InputButtons/AttachButton.d.ts +1 -0
  369. package/lib/typescript/components/MessageInput/components/InputButtons/AttachButton.d.ts.map +1 -1
  370. package/lib/typescript/components/MessageInput/components/OutputButtons/EditButton.d.ts.map +1 -1
  371. package/lib/typescript/components/MessageInput/components/OutputButtons/SendButton.d.ts.map +1 -1
  372. package/lib/typescript/components/MessageList/MessageFlashList.d.ts.map +1 -1
  373. package/lib/typescript/components/MessageList/MessageList.d.ts.map +1 -1
  374. package/lib/typescript/components/MessageList/ScrollToBottomButton.d.ts +2 -0
  375. package/lib/typescript/components/MessageList/ScrollToBottomButton.d.ts.map +1 -1
  376. package/lib/typescript/components/MessageList/UnreadMessagesNotification.d.ts.map +1 -1
  377. package/lib/typescript/components/MessageList/hooks/useScrollToBottomAccessibilityAction.d.ts +20 -0
  378. package/lib/typescript/components/MessageList/hooks/useScrollToBottomAccessibilityAction.d.ts.map +1 -0
  379. package/lib/typescript/components/MessageMenu/MessageActionListItem.d.ts.map +1 -1
  380. package/lib/typescript/components/MessageMenu/MessageReactionPicker.d.ts.map +1 -1
  381. package/lib/typescript/components/MessageMenu/ReactionButton.d.ts.map +1 -1
  382. package/lib/typescript/components/MessageMenu/hooks/useFetchReactions.d.ts.map +1 -1
  383. package/lib/typescript/components/Notifications/Notification.d.ts +31 -0
  384. package/lib/typescript/components/Notifications/Notification.d.ts.map +1 -0
  385. package/lib/typescript/components/Notifications/NotificationList.d.ts +28 -0
  386. package/lib/typescript/components/Notifications/NotificationList.d.ts.map +1 -0
  387. package/lib/typescript/components/Notifications/NotificationTargetContext.d.ts +14 -0
  388. package/lib/typescript/components/Notifications/NotificationTargetContext.d.ts.map +1 -0
  389. package/lib/typescript/components/Notifications/hooks/index.d.ts +6 -0
  390. package/lib/typescript/components/Notifications/hooks/index.d.ts.map +1 -0
  391. package/lib/typescript/components/Notifications/hooks/useNotificationApi.d.ts +48 -0
  392. package/lib/typescript/components/Notifications/hooks/useNotificationApi.d.ts.map +1 -0
  393. package/lib/typescript/components/Notifications/hooks/useNotificationListController.d.ts +14 -0
  394. package/lib/typescript/components/Notifications/hooks/useNotificationListController.d.ts.map +1 -0
  395. package/lib/typescript/components/Notifications/hooks/useNotificationTarget.d.ts +3 -0
  396. package/lib/typescript/components/Notifications/hooks/useNotificationTarget.d.ts.map +1 -0
  397. package/lib/typescript/components/Notifications/hooks/useNotifications.d.ts +14 -0
  398. package/lib/typescript/components/Notifications/hooks/useNotifications.d.ts.map +1 -0
  399. package/lib/typescript/components/Notifications/hooks/useSystemNotifications.d.ts +9 -0
  400. package/lib/typescript/components/Notifications/hooks/useSystemNotifications.d.ts.map +1 -0
  401. package/lib/typescript/components/Notifications/index.d.ts +6 -0
  402. package/lib/typescript/components/Notifications/index.d.ts.map +1 -0
  403. package/lib/typescript/components/Notifications/notificationTarget.d.ts +55 -0
  404. package/lib/typescript/components/Notifications/notificationTarget.d.ts.map +1 -0
  405. package/lib/typescript/components/Notifications/notificationTranslations.d.ts +7 -0
  406. package/lib/typescript/components/Notifications/notificationTranslations.d.ts.map +1 -0
  407. package/lib/typescript/components/Poll/components/CreatePollHeader.d.ts.map +1 -1
  408. package/lib/typescript/components/Poll/components/MultipleVotesSettings.d.ts.map +1 -1
  409. package/lib/typescript/components/Poll/components/PollModalHeader.d.ts.map +1 -1
  410. package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
  411. package/lib/typescript/components/Poll/hooks/usePollState.d.ts.map +1 -1
  412. package/lib/typescript/components/Reply/Reply.d.ts.map +1 -1
  413. package/lib/typescript/components/Thread/Thread.d.ts +1 -0
  414. package/lib/typescript/components/Thread/Thread.d.ts.map +1 -1
  415. package/lib/typescript/components/ThreadList/ThreadList.d.ts +3 -1
  416. package/lib/typescript/components/ThreadList/ThreadList.d.ts.map +1 -1
  417. package/lib/typescript/components/index.d.ts +1 -0
  418. package/lib/typescript/components/index.d.ts.map +1 -1
  419. package/lib/typescript/components/ui/Avatar/Avatar.d.ts.map +1 -1
  420. package/lib/typescript/components/ui/Button/Button.d.ts +10 -1
  421. package/lib/typescript/components/ui/Button/Button.d.ts.map +1 -1
  422. package/lib/typescript/contexts/accessibilityContext/AccessibilityContext.d.ts +1 -1
  423. package/lib/typescript/contexts/accessibilityContext/AccessibilityContext.d.ts.map +1 -1
  424. package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts +3 -0
  425. package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts.map +1 -1
  426. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
  427. package/lib/typescript/contexts/themeContext/ThemeContext.d.ts +13 -0
  428. package/lib/typescript/contexts/themeContext/ThemeContext.d.ts.map +1 -1
  429. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +13 -0
  430. package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
  431. package/lib/typescript/hooks/index.d.ts +1 -0
  432. package/lib/typescript/hooks/index.d.ts.map +1 -1
  433. package/lib/typescript/hooks/useAudioPlayer.d.ts.map +1 -1
  434. package/lib/typescript/hooks/useInAppNotificationsState.d.ts +6 -0
  435. package/lib/typescript/hooks/useInAppNotificationsState.d.ts.map +1 -1
  436. package/lib/typescript/hooks/useLazyRef.d.ts +7 -0
  437. package/lib/typescript/hooks/useLazyRef.d.ts.map +1 -0
  438. package/lib/typescript/i18n/en.json +94 -1
  439. package/lib/typescript/i18n/es.json +96 -3
  440. package/lib/typescript/i18n/fr.json +94 -1
  441. package/lib/typescript/i18n/he.json +94 -1
  442. package/lib/typescript/i18n/hi.json +94 -1
  443. package/lib/typescript/i18n/it.json +94 -1
  444. package/lib/typescript/i18n/ja.json +94 -1
  445. package/lib/typescript/i18n/ko.json +94 -1
  446. package/lib/typescript/i18n/nl.json +94 -1
  447. package/lib/typescript/i18n/pt-br.json +94 -1
  448. package/lib/typescript/i18n/ru.json +94 -1
  449. package/lib/typescript/i18n/tr.json +94 -1
  450. package/lib/typescript/state-store/audio-player-pool.d.ts.map +1 -1
  451. package/lib/typescript/state-store/audio-player.d.ts +13 -0
  452. package/lib/typescript/state-store/audio-player.d.ts.map +1 -1
  453. package/lib/typescript/test-utils/BetterSqlite.d.ts.map +1 -1
  454. package/lib/typescript/utils/animations/createBoundedZoomTransition.d.ts +21 -0
  455. package/lib/typescript/utils/animations/createBoundedZoomTransition.d.ts.map +1 -0
  456. package/lib/typescript/utils/animations/transitions.d.ts +21 -0
  457. package/lib/typescript/utils/animations/transitions.d.ts.map +1 -0
  458. package/lib/typescript/utils/i18n/Streami18n.d.ts +93 -0
  459. package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
  460. package/package.json +2 -2
  461. package/src/__tests__/offline-support/offline-feature.tsx +40 -34
  462. package/src/a11y/a11yUtils.ts +2 -2
  463. package/src/a11y/hooks/useA11yLabel.ts +7 -4
  464. package/src/a11y/hooks/useAccessibilityActivateAction.ts +44 -0
  465. package/src/a11y/index.ts +1 -0
  466. package/src/components/AttachmentPicker/AttachmentPicker.tsx +23 -1
  467. package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.tsx +1 -0
  468. package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx +15 -2
  469. package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx +4 -3
  470. package/src/components/AttachmentPicker/components/AttachmentTypePickerButton.tsx +9 -0
  471. package/src/components/AttachmentPicker/components/__tests__/AttachmentPickerContent.test.tsx +19 -18
  472. package/src/components/Channel/Channel.tsx +15 -1
  473. package/src/components/Channel/__tests__/useMessageListPagination.test.tsx +34 -2
  474. package/src/components/Channel/hooks/useMessageListPagination.tsx +19 -3
  475. package/src/components/ChannelList/ChannelList.tsx +27 -5
  476. package/src/components/ChannelList/__tests__/ChannelListView.test.tsx +16 -5
  477. package/src/components/ChannelList/hooks/__tests__/useChannelActions.test.tsx +123 -0
  478. package/src/components/ChannelList/hooks/useChannelActions.ts +181 -12
  479. package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +9 -3
  480. package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx +4 -1
  481. package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +2 -2
  482. package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +1 -1
  483. package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +1 -1
  484. package/src/components/Message/hooks/__tests__/useMessageActionHandlers.test.tsx +131 -0
  485. package/src/components/Message/hooks/useMessageActionHandlers.ts +133 -23
  486. package/src/components/MessageInput/MessageComposer.tsx +1 -1
  487. package/src/components/MessageInput/MessageComposerLeadingView.tsx +1 -1
  488. package/src/components/MessageInput/MessageInputHeaderView.tsx +1 -1
  489. package/src/components/MessageInput/MessageInputTrailingView.tsx +1 -1
  490. package/src/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.tsx +18 -2
  491. package/src/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.tsx +1 -10
  492. package/src/components/MessageInput/components/AudioRecorder/AudioRecorder.tsx +13 -2
  493. package/src/components/MessageInput/components/AudioRecorder/AudioRecordingButton.tsx +35 -14
  494. package/src/components/MessageInput/components/InputButtons/AttachButton.tsx +13 -3
  495. package/src/components/MessageInput/components/OutputButtons/EditButton.tsx +1 -0
  496. package/src/components/MessageInput/components/OutputButtons/SendButton.tsx +1 -0
  497. package/src/components/MessageInput/components/OutputButtons/index.tsx +1 -1
  498. package/src/components/MessageList/MessageFlashList.tsx +26 -3
  499. package/src/components/MessageList/MessageList.tsx +26 -3
  500. package/src/components/MessageList/ScrollToBottomButton.tsx +18 -6
  501. package/src/components/MessageList/UnreadMessagesNotification.tsx +1 -0
  502. package/src/components/MessageList/__tests__/MessageList.test.tsx +221 -0
  503. package/src/components/MessageList/__tests__/ScrollToBottomButton.test.tsx +2 -2
  504. package/src/components/MessageList/__tests__/__snapshots__/ScrollToBottomButton.test.tsx.snap +3 -1
  505. package/src/components/MessageList/hooks/useScrollToBottomAccessibilityAction.ts +74 -0
  506. package/src/components/MessageMenu/MessageActionListItem.tsx +10 -4
  507. package/src/components/MessageMenu/MessageReactionPicker.tsx +1 -0
  508. package/src/components/MessageMenu/ReactionButton.tsx +7 -9
  509. package/src/components/MessageMenu/__tests__/MessageReactionPicker.test.tsx +13 -15
  510. package/src/components/MessageMenu/__tests__/MessageUserReactions.test.tsx +20 -18
  511. package/src/components/MessageMenu/__tests__/ReactionButton.test.tsx +18 -5
  512. package/src/components/MessageMenu/hooks/useFetchReactions.ts +17 -2
  513. package/src/components/Notifications/Notification.tsx +254 -0
  514. package/src/components/Notifications/NotificationList.tsx +160 -0
  515. package/src/components/Notifications/NotificationTargetContext.tsx +45 -0
  516. package/src/components/Notifications/__tests__/NotificationList.test.tsx +480 -0
  517. package/src/components/Notifications/__tests__/notificationTarget.test.ts +157 -0
  518. package/src/components/Notifications/hooks/__tests__/useNotificationApi.test.tsx +172 -0
  519. package/src/components/Notifications/hooks/__tests__/useNotificationTarget.test.tsx +85 -0
  520. package/src/components/Notifications/hooks/index.ts +5 -0
  521. package/src/components/Notifications/hooks/useNotificationApi.ts +248 -0
  522. package/src/components/Notifications/hooks/useNotificationListController.ts +160 -0
  523. package/src/components/Notifications/hooks/useNotificationTarget.ts +37 -0
  524. package/src/components/Notifications/hooks/useNotifications.ts +43 -0
  525. package/src/components/Notifications/hooks/useSystemNotifications.ts +33 -0
  526. package/src/components/Notifications/index.ts +5 -0
  527. package/src/components/Notifications/notificationTarget.ts +305 -0
  528. package/src/components/Notifications/notificationTranslations.ts +142 -0
  529. package/src/components/Poll/components/CreatePollHeader.tsx +2 -0
  530. package/src/components/Poll/components/MultipleVotesSettings.tsx +2 -0
  531. package/src/components/Poll/components/PollModalHeader.tsx +1 -0
  532. package/src/components/Poll/components/PollOption.tsx +10 -6
  533. package/src/components/Poll/hooks/usePollState.ts +26 -2
  534. package/src/components/Reply/Reply.tsx +4 -1
  535. package/src/components/Thread/Thread.tsx +24 -16
  536. package/src/components/Thread/__tests__/__snapshots__/Thread.test.tsx.snap +3 -0
  537. package/src/components/ThreadList/ThreadList.tsx +33 -9
  538. package/src/components/index.ts +2 -0
  539. package/src/components/ui/Avatar/Avatar.tsx +2 -1
  540. package/src/components/ui/Button/Button.tsx +26 -0
  541. package/src/components/ui/Button/__tests__/Button.test.tsx +44 -0
  542. package/src/contexts/accessibilityContext/AccessibilityContext.tsx +35 -1
  543. package/src/contexts/componentsContext/defaultComponents.ts +4 -0
  544. package/src/contexts/messageInputContext/MessageInputContext.tsx +36 -0
  545. package/src/contexts/themeContext/utils/theme.ts +26 -0
  546. package/src/hooks/index.ts +1 -0
  547. package/src/hooks/useAudioPlayer.ts +44 -3
  548. package/src/hooks/useInAppNotificationsState.ts +6 -0
  549. package/src/hooks/useLazyRef.ts +15 -0
  550. package/src/i18n/en.json +94 -1
  551. package/src/i18n/es.json +96 -3
  552. package/src/i18n/fr.json +94 -1
  553. package/src/i18n/he.json +94 -1
  554. package/src/i18n/hi.json +94 -1
  555. package/src/i18n/it.json +94 -1
  556. package/src/i18n/ja.json +94 -1
  557. package/src/i18n/ko.json +94 -1
  558. package/src/i18n/nl.json +94 -1
  559. package/src/i18n/pt-br.json +94 -1
  560. package/src/i18n/ru.json +94 -1
  561. package/src/i18n/tr.json +94 -1
  562. package/src/mock-builders/DB/mock.ts +2 -1
  563. package/src/state-store/__tests__/audio-player.test.ts +45 -0
  564. package/src/state-store/audio-player-pool.ts +1 -0
  565. package/src/state-store/audio-player.ts +108 -16
  566. package/src/test-utils/BetterSqlite.ts +3 -1
  567. package/src/theme/generated/dark/StreamTokens.android.ts +16 -16
  568. package/src/theme/generated/dark/StreamTokens.ios.ts +8 -8
  569. package/src/theme/generated/dark/StreamTokens.web.ts +8 -8
  570. package/src/theme/generated/light/StreamTokens.android.ts +16 -16
  571. package/src/theme/generated/light/StreamTokens.ios.ts +8 -8
  572. package/src/theme/generated/light/StreamTokens.web.ts +8 -8
  573. package/src/utils/animations/createBoundedZoomTransition.ts +117 -0
  574. package/src/utils/{transitions.ts → animations/transitions.ts} +6 -0
  575. package/src/version.json +1 -1
  576. package/lib/commonjs/utils/transitions.js.map +0 -1
  577. package/lib/module/utils/transitions.js.map +0 -1
  578. package/lib/typescript/utils/transitions.d.ts +0 -9
  579. package/lib/typescript/utils/transitions.d.ts.map +0 -1
@@ -0,0 +1,37 @@
1
+ import { useContext } from 'react';
2
+
3
+ import {
4
+ ChannelContext,
5
+ type ChannelContextValue,
6
+ } from '../../../contexts/channelContext/ChannelContext';
7
+ import {
8
+ ChannelsContext,
9
+ type ChannelsContextValue,
10
+ } from '../../../contexts/channelsContext/ChannelsContext';
11
+ import {
12
+ ThreadContext,
13
+ type ThreadContextValue,
14
+ } from '../../../contexts/threadContext/ThreadContext';
15
+ import {
16
+ ThreadsContext,
17
+ type ThreadsContextValue,
18
+ } from '../../../contexts/threadsContext/ThreadsContext';
19
+ import { DEFAULT_BASE_CONTEXT_VALUE } from '../../../contexts/utils/defaultBaseContextValue';
20
+ import type { NotificationTargetPanel } from '../notificationTarget';
21
+
22
+ const isProvided = <T>(value: T) => value !== (DEFAULT_BASE_CONTEXT_VALUE as T);
23
+
24
+ export const useNotificationTarget = (): NotificationTargetPanel | undefined => {
25
+ const channelContext = useContext(ChannelContext) as ChannelContextValue;
26
+ const channelsContext = useContext(ChannelsContext) as ChannelsContextValue;
27
+ const threadContext = useContext(ThreadContext) as ThreadContextValue;
28
+ const threadsContext = useContext(ThreadsContext) as ThreadsContextValue;
29
+
30
+ if (isProvided(channelContext) && channelContext.threadList) return 'thread';
31
+ if (isProvided(threadContext) && threadContext.threadInstance) return 'thread';
32
+ if (isProvided(channelContext) && channelContext.channel) return 'channel';
33
+ if (isProvided(threadsContext)) return 'thread-list';
34
+ if (isProvided(channelsContext)) return 'channel-list';
35
+
36
+ return undefined;
37
+ };
@@ -0,0 +1,43 @@
1
+ import { useCallback } from 'react';
2
+
3
+ import type { Notification, NotificationManagerState } from 'stream-chat';
4
+
5
+ import { useChatContext } from '../../../contexts/chatContext/ChatContext';
6
+ import { useStateStore } from '../../../hooks/useStateStore';
7
+ import { isNotificationForTarget, type NotificationTarget } from '../notificationTarget';
8
+
9
+ export type UseNotificationsFilter = (notification: Notification) => boolean;
10
+
11
+ export type UseNotificationsOptions = {
12
+ /** Additional filter applied after optional target filtering. */
13
+ filter?: UseNotificationsFilter;
14
+ /** When true, returns an empty list unless an exact target is provided. */
15
+ requireTarget?: boolean;
16
+ /** Exact target used to select notifications for one host. */
17
+ target?: NotificationTarget;
18
+ };
19
+
20
+ /** Subscribes to the client notification store and returns matching non-system notifications. */
21
+ export const useNotifications = (options?: UseNotificationsOptions): Notification[] => {
22
+ const { client } = useChatContext();
23
+ const selector = useCallback(
24
+ (state: NotificationManagerState) => {
25
+ const notifications = state.notifications;
26
+ const target = options?.target;
27
+ const byTarget = target
28
+ ? notifications.filter((notification) => isNotificationForTarget(notification, target))
29
+ : options?.requireTarget
30
+ ? []
31
+ : notifications;
32
+
33
+ return {
34
+ notifications: options?.filter ? byTarget.filter(options.filter) : byTarget,
35
+ };
36
+ },
37
+ [options?.filter, options?.requireTarget, options?.target],
38
+ );
39
+
40
+ const { notifications } = useStateStore(client.notifications.store, selector);
41
+
42
+ return notifications;
43
+ };
@@ -0,0 +1,33 @@
1
+ import { useCallback } from 'react';
2
+
3
+ import type { Notification, NotificationManagerState } from 'stream-chat';
4
+
5
+ import { hasSystemNotificationTag } from './useNotificationApi';
6
+
7
+ import { useChatContext } from '../../../contexts/chatContext/ChatContext';
8
+ import { useStateStore } from '../../../hooks/useStateStore';
9
+
10
+ export type UseSystemNotificationsFilter = (notification: Notification) => boolean;
11
+
12
+ export type UseSystemNotificationsOptions = {
13
+ /** Additional filter applied to system-tagged notifications. */
14
+ filter?: UseSystemNotificationsFilter;
15
+ };
16
+
17
+ /** Subscribes to notifications tagged as system notifications. */
18
+ export const useSystemNotifications = (options?: UseSystemNotificationsOptions): Notification[] => {
19
+ const { client } = useChatContext();
20
+ const selector = useCallback(
21
+ (state: NotificationManagerState) => {
22
+ const withSystemTag = state.notifications.filter(hasSystemNotificationTag);
23
+ return {
24
+ notifications: options?.filter ? withSystemTag.filter(options.filter) : withSystemTag,
25
+ };
26
+ },
27
+ [options?.filter],
28
+ );
29
+
30
+ const { notifications } = useStateStore(client.notifications.store, selector);
31
+
32
+ return notifications;
33
+ };
@@ -0,0 +1,5 @@
1
+ export * from './Notification';
2
+ export * from './NotificationList';
3
+ export * from './NotificationTargetContext';
4
+ export * from './hooks';
5
+ export * from './notificationTarget';
@@ -0,0 +1,305 @@
1
+ import type { Notification } from 'stream-chat';
2
+
3
+ const NOTIFICATION_TARGET_PANELS = ['channel', 'thread', 'channel-list', 'thread-list'] as const;
4
+ const NOTIFICATION_TARGET_TAG_PREFIX = 'target:' as const;
5
+
6
+ /** Built-in SDK surfaces that can host snackbar notifications. */
7
+ export type BuiltInNotificationTargetPanel = (typeof NOTIFICATION_TARGET_PANELS)[number];
8
+ /** Notification surface name. Custom panel strings are supported for integrator-defined hosts. */
9
+ export type NotificationTargetPanel = BuiltInNotificationTargetPanel | (string & {});
10
+ /** Exact notification host within a panel. */
11
+ export type NotificationTarget = {
12
+ /** Stable id for a mounted notification host, for example a channel cid-derived id. */
13
+ hostId: string;
14
+ /** Surface that owns the host. */
15
+ panel: NotificationTargetPanel;
16
+ };
17
+ /** Owner object used to keep target stacks scoped to a notification manager instance. */
18
+ export type NotificationTargetOwner = object;
19
+
20
+ type ParsedNotificationTargetTag = {
21
+ hostId?: string;
22
+ panel: NotificationTargetPanel;
23
+ };
24
+
25
+ type NotificationTargetStackItem = {
26
+ target: NotificationTarget;
27
+ token: symbol;
28
+ };
29
+
30
+ const activeNotificationTargets = new WeakMap<
31
+ NotificationTargetOwner,
32
+ NotificationTargetStackItem[]
33
+ >();
34
+ const actionNotificationTargets = new WeakMap<
35
+ NotificationTargetOwner,
36
+ NotificationTargetStackItem[]
37
+ >();
38
+
39
+ /** Returns whether a value can be encoded as a notification target panel segment. */
40
+ export const isNotificationTargetPanel = (value: unknown): value is NotificationTargetPanel =>
41
+ typeof value === 'string' && value.length > 0 && !value.includes(':');
42
+
43
+ /** Returns whether a value is one of the SDK's built-in notification panels. */
44
+ export const isBuiltInNotificationTargetPanel = (
45
+ value: unknown,
46
+ ): value is BuiltInNotificationTargetPanel =>
47
+ typeof value === 'string' && (NOTIFICATION_TARGET_PANELS as readonly string[]).includes(value);
48
+
49
+ /** Builds a notification target tag. Without `hostId`, the tag targets every host in the panel. */
50
+ export const getNotificationTargetTag = (panel: NotificationTargetPanel, hostId?: string) =>
51
+ `${NOTIFICATION_TARGET_TAG_PREFIX}${panel}${hostId ? `:${hostId}` : ''}`;
52
+
53
+ /** Adds a broad or exact target tag to a notification tag list without duplicating tags. */
54
+ export const addNotificationTargetTag = (
55
+ panel: NotificationTargetPanel | undefined,
56
+ tags?: string[],
57
+ hostId?: string,
58
+ ) => {
59
+ if (!panel) return tags ?? [];
60
+
61
+ return Array.from(new Set([getNotificationTargetTag(panel, hostId), ...(tags ?? [])]));
62
+ };
63
+
64
+ /** Adds an exact panel and host target tag to a notification tag list. */
65
+ export const addExactNotificationTargetTag = (target: NotificationTarget, tags?: string[]) =>
66
+ addNotificationTargetTag(target.panel, tags, target.hostId);
67
+
68
+ /** Host id helper for channel notification targets. */
69
+ export const getChannelNotificationHostId = (cid: string) => `channel:${cid}` as const;
70
+
71
+ /** Host id helper for thread notification targets. */
72
+ export const getThreadNotificationHostId = (threadId: string) => `thread:${threadId}` as const;
73
+
74
+ /** Compares notification targets by panel and host id. */
75
+ export const isNotificationTargetEqual = (
76
+ left: NotificationTarget | undefined,
77
+ right: NotificationTarget | undefined,
78
+ ) => !!left && !!right && left.panel === right.panel && left.hostId === right.hostId;
79
+
80
+ const isRecord = (value: unknown): value is Record<string, unknown> =>
81
+ typeof value === 'object' && value !== null;
82
+
83
+ const getStringValue = (value: unknown) => (typeof value === 'string' ? value : undefined);
84
+
85
+ const parseNotificationTargetTag = (tag: string): ParsedNotificationTargetTag | undefined => {
86
+ if (!tag.startsWith(NOTIFICATION_TARGET_TAG_PREFIX)) return undefined;
87
+
88
+ const tagValue = tag.slice(NOTIFICATION_TARGET_TAG_PREFIX.length);
89
+ const hostSeparatorIndex = tagValue.indexOf(':');
90
+ const panel = hostSeparatorIndex === -1 ? tagValue : tagValue.slice(0, hostSeparatorIndex);
91
+
92
+ if (!isNotificationTargetPanel(panel)) return undefined;
93
+
94
+ const hostId = hostSeparatorIndex === -1 ? undefined : tagValue.slice(hostSeparatorIndex + 1);
95
+
96
+ return hostId ? { hostId, panel } : { panel };
97
+ };
98
+
99
+ const getNotificationTargetTags = (notification: Notification) =>
100
+ (notification.tags ?? [])
101
+ .map(parseNotificationTargetTag)
102
+ .filter((target): target is ParsedNotificationTargetTag => !!target);
103
+
104
+ /** Returns whether a tag list already contains a notification target tag. */
105
+ export const hasNotificationTargetTag = (tags: string[] | undefined) =>
106
+ tags?.some((tag) => !!parseNotificationTargetTag(tag)) ?? false;
107
+
108
+ const getExactNotificationTargetTags = (notification: Notification): NotificationTarget[] =>
109
+ getNotificationTargetTags(notification).filter(
110
+ (target): target is NotificationTarget => !!target.hostId,
111
+ );
112
+
113
+ const getNotificationTargetFromTags = (
114
+ notification: Notification,
115
+ ): NotificationTarget | undefined => getExactNotificationTargetTags(notification)[0];
116
+
117
+ const getNotificationTargetFromComposer = (
118
+ notification: Notification,
119
+ ): NotificationTarget | undefined => {
120
+ const composer = notification.origin.context?.composer;
121
+ if (!isRecord(composer)) return undefined;
122
+
123
+ const threadId = getStringValue(composer.threadId);
124
+ if (threadId) {
125
+ return { hostId: getThreadNotificationHostId(threadId), panel: 'thread' };
126
+ }
127
+
128
+ const channel = composer.channel;
129
+ if (!isRecord(channel)) return undefined;
130
+
131
+ const cid = getStringValue(channel.cid);
132
+ return cid ? { hostId: getChannelNotificationHostId(cid), panel: 'channel' } : undefined;
133
+ };
134
+
135
+ /** Resolves an exact notification target from tags or composer origin metadata. */
136
+ export const getNotificationTarget = (notification: Notification): NotificationTarget | undefined =>
137
+ getNotificationTargetFromTags(notification) ?? getNotificationTargetFromComposer(notification);
138
+
139
+ const getExplicitNotificationTargetPanels = (
140
+ notification: Notification,
141
+ ): NotificationTargetPanel[] => {
142
+ const targetPanels = getNotificationTargetTags(notification).map(({ panel }) => panel);
143
+
144
+ if (targetPanels.length > 0) {
145
+ return Array.from(new Set(targetPanels));
146
+ }
147
+
148
+ const panel = notification.origin.context?.panel;
149
+ return isNotificationTargetPanel(panel) ? [panel] : [];
150
+ };
151
+
152
+ /** Resolves the first target panel declared or inferred for a notification. */
153
+ export const getNotificationTargetPanel = (
154
+ notification: Notification,
155
+ ): NotificationTargetPanel | undefined => {
156
+ const explicitPanels = getExplicitNotificationTargetPanels(notification);
157
+ if (explicitPanels.length > 0) return explicitPanels[0];
158
+
159
+ return getNotificationTarget(notification)?.panel;
160
+ };
161
+
162
+ /** Resolves all target panels declared or inferred for a notification. */
163
+ export const getNotificationTargetPanels = (
164
+ notification: Notification,
165
+ ): NotificationTargetPanel[] => {
166
+ const explicitPanels = getExplicitNotificationTargetPanels(notification);
167
+ if (explicitPanels.length > 0) return explicitPanels;
168
+
169
+ const target = getNotificationTarget(notification);
170
+ return target ? [target.panel] : [];
171
+ };
172
+
173
+ const getNotificationTargetStack = (
174
+ stackMap: WeakMap<NotificationTargetOwner, NotificationTargetStackItem[]>,
175
+ owner: NotificationTargetOwner,
176
+ ) => {
177
+ const stack = stackMap.get(owner) ?? [];
178
+ stackMap.set(owner, stack);
179
+ return stack;
180
+ };
181
+
182
+ const registerNotificationTarget = (
183
+ stackMap: WeakMap<NotificationTargetOwner, NotificationTargetStackItem[]>,
184
+ owner: NotificationTargetOwner,
185
+ target: NotificationTarget,
186
+ ) => {
187
+ const token = Symbol('notification-target');
188
+ const stack = getNotificationTargetStack(stackMap, owner);
189
+
190
+ stack.push({ target, token });
191
+
192
+ return () => {
193
+ const currentStack = stackMap.get(owner);
194
+ if (!currentStack) return;
195
+
196
+ const itemIndex = currentStack.findIndex((item) => item.token === token);
197
+ if (itemIndex !== -1) {
198
+ currentStack.splice(itemIndex, 1);
199
+ }
200
+
201
+ if (currentStack.length === 0) {
202
+ stackMap.delete(owner);
203
+ }
204
+ };
205
+ };
206
+
207
+ const getLastNotificationTarget = (
208
+ stackMap: WeakMap<NotificationTargetOwner, NotificationTargetStackItem[]>,
209
+ owner: NotificationTargetOwner,
210
+ ) => {
211
+ const stack = stackMap.get(owner);
212
+ return stack?.[stack.length - 1]?.target;
213
+ };
214
+
215
+ /** Registers a mounted notification host as the latest active fallback target. */
216
+ export const registerActiveNotificationTarget = (
217
+ owner: NotificationTargetOwner,
218
+ target: NotificationTarget,
219
+ ) => registerNotificationTarget(activeNotificationTargets, owner, target);
220
+
221
+ /** Registers the target for notifications emitted while an action is running. */
222
+ export const registerNotificationActionTarget = (
223
+ owner: NotificationTargetOwner,
224
+ target: NotificationTarget,
225
+ ) => registerNotificationTarget(actionNotificationTargets, owner, target);
226
+
227
+ /** Returns the latest mounted fallback target for a notification manager owner. */
228
+ export const getActiveNotificationTarget = (owner: NotificationTargetOwner) =>
229
+ getLastNotificationTarget(activeNotificationTargets, owner);
230
+
231
+ /** Returns the latest action-scoped target for a notification manager owner. */
232
+ export const getNotificationActionTarget = (owner: NotificationTargetOwner) =>
233
+ getLastNotificationTarget(actionNotificationTargets, owner);
234
+
235
+ const hasExactNotificationTargetTag = (notification: Notification) =>
236
+ getExactNotificationTargetTags(notification).length > 0;
237
+
238
+ const hasExplicitNotificationTargetPanel = (notification: Notification) =>
239
+ getExplicitNotificationTargetPanels(notification).length > 0;
240
+
241
+ const setNotificationTargetTag = (notification: Notification, target: NotificationTarget) => {
242
+ notification.tags = addExactNotificationTargetTag(target, notification.tags);
243
+ };
244
+
245
+ /** Mutates an unscoped notification by adding the best available exact target tag. */
246
+ export const resolveNotificationTargetTagIfNeeded = (
247
+ owner: NotificationTargetOwner,
248
+ notification: Notification,
249
+ ) => {
250
+ if (hasExactNotificationTargetTag(notification)) return false;
251
+ if (hasExplicitNotificationTargetPanel(notification)) return false;
252
+
253
+ const composerTarget = getNotificationTargetFromComposer(notification);
254
+ if (composerTarget) {
255
+ setNotificationTargetTag(notification, composerTarget);
256
+ return true;
257
+ }
258
+
259
+ const actionTarget = getNotificationActionTarget(owner);
260
+ if (actionTarget) {
261
+ setNotificationTargetTag(notification, actionTarget);
262
+ return true;
263
+ }
264
+
265
+ const activeTarget = getActiveNotificationTarget(owner);
266
+ if (activeTarget) {
267
+ setNotificationTargetTag(notification, activeTarget);
268
+ return true;
269
+ }
270
+
271
+ return false;
272
+ };
273
+
274
+ /** Returns whether a notification should be consumed by an exact target host. */
275
+ export const isNotificationForTarget = (notification: Notification, target: NotificationTarget) => {
276
+ const exactTargets = getExactNotificationTargetTags(notification);
277
+ if (exactTargets.length > 0) {
278
+ return exactTargets.some((exactTarget) => isNotificationTargetEqual(exactTarget, target));
279
+ }
280
+
281
+ const explicitTargetPanels = getExplicitNotificationTargetPanels(notification);
282
+ if (explicitTargetPanels.length > 0) {
283
+ return explicitTargetPanels.includes(target.panel);
284
+ }
285
+
286
+ const inferredTarget = getNotificationTargetFromComposer(notification);
287
+ if (inferredTarget) {
288
+ return isNotificationTargetEqual(inferredTarget, target);
289
+ }
290
+
291
+ return false;
292
+ };
293
+
294
+ /** Returns whether a notification should be consumed by any host in a panel. */
295
+ export const isNotificationForPanel = (
296
+ notification: Notification,
297
+ panel: NotificationTargetPanel,
298
+ ) => {
299
+ const explicitTargetPanels = getNotificationTargetPanels(notification);
300
+ if (explicitTargetPanels.length > 0) {
301
+ return explicitTargetPanels.includes(panel);
302
+ }
303
+
304
+ return false;
305
+ };
@@ -0,0 +1,142 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { Notification } from 'stream-chat';
3
+
4
+ const normalizeReason = (notification?: Notification) => {
5
+ const reason = notification?.metadata?.reason;
6
+ if (typeof reason !== 'string' || !reason.length) return undefined;
7
+
8
+ return reason.toLowerCase();
9
+ };
10
+
11
+ const withReasonFallback = ({
12
+ fallbackTranslationKey,
13
+ notification,
14
+ reasonTranslationKey,
15
+ t,
16
+ }: {
17
+ fallbackTranslationKey: string;
18
+ notification?: Notification;
19
+ reasonTranslationKey: string;
20
+ t: TFunction;
21
+ }) => {
22
+ const reason = normalizeReason(notification);
23
+ if (!reason) return t(fallbackTranslationKey);
24
+
25
+ return t(reasonTranslationKey, { reason });
26
+ };
27
+
28
+ const translateAttachmentUploadBlocked = ({
29
+ notification,
30
+ t,
31
+ }: {
32
+ notification?: Notification;
33
+ t: TFunction;
34
+ }) => {
35
+ const rawReason = notification?.metadata?.reason;
36
+ let reason = t('unsupported file type');
37
+ if (typeof rawReason !== 'string') reason = t('unknown error');
38
+ if (rawReason === 'size_limit') reason = t('size limit');
39
+
40
+ return t('Attachment upload blocked due to {{reason}}', { reason });
41
+ };
42
+
43
+ const translateAttachmentUploadFailed = ({
44
+ notification,
45
+ t,
46
+ }: {
47
+ notification?: Notification;
48
+ t: TFunction;
49
+ }) =>
50
+ withReasonFallback({
51
+ fallbackTranslationKey: 'Error uploading attachment',
52
+ notification,
53
+ reasonTranslationKey: 'Attachment upload failed due to {{reason}}',
54
+ t,
55
+ });
56
+
57
+ const translatePollCreateFailed = ({
58
+ notification,
59
+ t,
60
+ }: {
61
+ notification?: Notification;
62
+ t: TFunction;
63
+ }) =>
64
+ withReasonFallback({
65
+ fallbackTranslationKey: 'Failed to create the poll',
66
+ notification,
67
+ reasonTranslationKey: 'Failed to create the poll due to {{reason}}',
68
+ t,
69
+ });
70
+
71
+ const translatePollEndFailed = ({
72
+ notification,
73
+ t,
74
+ }: {
75
+ notification?: Notification;
76
+ t: TFunction;
77
+ }) =>
78
+ withReasonFallback({
79
+ fallbackTranslationKey: 'Failed to end the poll',
80
+ notification,
81
+ reasonTranslationKey: 'Failed to end the poll due to {{reason}}',
82
+ t,
83
+ });
84
+
85
+ const translateCommandDisabled = ({
86
+ notification,
87
+ t,
88
+ }: {
89
+ notification?: Notification;
90
+ t: TFunction;
91
+ }) => {
92
+ const reason = normalizeReason(notification);
93
+
94
+ if (reason === 'editing') {
95
+ return t('Command not available while editing');
96
+ }
97
+
98
+ if (reason === 'quoted_message') {
99
+ return t('Command not available while replying');
100
+ }
101
+
102
+ return t(notification?.message || 'Command not available');
103
+ };
104
+
105
+ const notificationTranslatorsByType: Record<
106
+ string,
107
+ (options: { notification: Notification; t: TFunction }) => string
108
+ > = {
109
+ 'api:attachment:upload:failed': translateAttachmentUploadFailed,
110
+ 'api:location:create:failed': ({ t }) => t('Failed to share location'),
111
+ 'api:location:share:failed': ({ t }) => t('Failed to share location'),
112
+ 'api:poll:create:failed': translatePollCreateFailed,
113
+ 'api:poll:end:failed': translatePollEndFailed,
114
+ 'api:poll:end:success': ({ t }) => t('Poll ended'),
115
+ 'api:reply:search:failed': ({ t }) => t('Thread has not been found'),
116
+ 'browser:audio:playback:error': ({ notification, t }) =>
117
+ notification.message ? t(notification.message) : t('Error reproducing the recording'),
118
+ 'browser:location:get:failed': ({ t }) => t('Failed to retrieve location'),
119
+ 'channel:jumpToFirstUnread:failed': ({ t }) => t('Failed to jump to the first unread message'),
120
+ 'validation:attachment:file:missing': ({ t }) => t('File is required for upload attachment'),
121
+ 'validation:attachment:id:missing': ({ t }) => t('Local upload attachment missing local id'),
122
+ 'validation:attachment:upload:blocked': translateAttachmentUploadBlocked,
123
+ 'validation:attachment:upload:in-progress': ({ t }) =>
124
+ t('Wait until all attachments have uploaded'),
125
+ 'validation:command:disabled': translateCommandDisabled,
126
+ 'validation:poll:castVote:limit': ({ t }) =>
127
+ t('Reached the vote limit. Remove an existing vote first.'),
128
+ };
129
+
130
+ export const getNotificationDisplayMessage = ({
131
+ notification,
132
+ t,
133
+ }: {
134
+ notification: Notification;
135
+ t: TFunction;
136
+ }) => {
137
+ const translator = notification.type
138
+ ? notificationTranslatorsByType[notification.type]
139
+ : undefined;
140
+
141
+ return translator ? translator({ notification, t }) : t(notification.message);
142
+ };
@@ -51,6 +51,7 @@ export const CreatePollHeader = ({
51
51
  return (
52
52
  <View style={[styles.headerContainer, headerContainer]}>
53
53
  <Button
54
+ accessibilityLabelKey='a11y/Close poll creation'
54
55
  variant='secondary'
55
56
  onPress={onBackPressHandler}
56
57
  type='solid'
@@ -63,6 +64,7 @@ export const CreatePollHeader = ({
63
64
  </Text>
64
65
 
65
66
  <Button
67
+ accessibilityLabelKey='a11y/Create poll'
66
68
  variant='primary'
67
69
  onPress={onCreatePollPressHandler}
68
70
  type='solid'
@@ -163,6 +163,7 @@ export const MultipleVotesSettings = () => {
163
163
  style={[styles.row, multipleAnswers.row]}
164
164
  >
165
165
  <Button
166
+ accessibilityLabelKey='a11y/Decrease maximum votes'
166
167
  variant='secondary'
167
168
  type='outline'
168
169
  size='md'
@@ -175,6 +176,7 @@ export const MultipleVotesSettings = () => {
175
176
  />
176
177
  <MaxVotesTextInput />
177
178
  <Button
179
+ accessibilityLabelKey='a11y/Increase maximum votes'
178
180
  variant='secondary'
179
181
  type='outline'
180
182
  size='md'
@@ -25,6 +25,7 @@ export const PollModalHeader = ({ onPress, title }: PollModalHeaderProps) => {
25
25
  <View style={[styles.container, container]}>
26
26
  <View style={styles.sideContainer}>
27
27
  <Button
28
+ accessibilityLabelKey='a11y/Close poll'
28
29
  variant='secondary'
29
30
  type='solid'
30
31
  size='md'
@@ -20,6 +20,7 @@ import { useComponentsContext } from '../../../contexts/componentsContext/Compon
20
20
 
21
21
  import { Check } from '../../../icons';
22
22
  import { primitives } from '../../../theme';
23
+ import { useNotificationApi } from '../../Notifications';
23
24
  import { ProgressBar } from '../../ProgressControl/ProgressBar';
24
25
  import { UserAvatarStack } from '../../ui/Avatar/AvatarStack';
25
26
  import { useIsPollCreatedByCurrentUser } from '../hook/useIsPollCreatedByCurrentUser';
@@ -160,6 +161,7 @@ export const PollOption = ({ option, showProgressBar = true, forceIncoming }: Po
160
161
  export const VoteButton = ({ onPress, option }: PollVoteButtonProps) => {
161
162
  const { message, poll } = usePollContext();
162
163
  const { isClosed, ownVotesByOptionId } = usePollState();
164
+ const { runWithNotificationTarget } = useNotificationApi();
163
165
  const ownCapabilities = useOwnCapabilitiesContext();
164
166
  const {
165
167
  theme: { semantics },
@@ -178,12 +180,14 @@ export const VoteButton = ({ onPress, option }: PollVoteButtonProps) => {
178
180
  } = useTheme();
179
181
 
180
182
  const toggleVote = useCallback(async () => {
181
- if (ownVotesByOptionId[option.id]) {
182
- await poll.removeVote(ownVotesByOptionId[option.id]?.id, message.id);
183
- } else {
184
- await poll.castVote(option.id, message.id);
185
- }
186
- }, [message.id, option.id, ownVotesByOptionId, poll]);
183
+ await runWithNotificationTarget(async () => {
184
+ if (ownVotesByOptionId[option.id]) {
185
+ await poll.removeVote(ownVotesByOptionId[option.id]?.id, message.id);
186
+ } else {
187
+ await poll.castVote(option.id, message.id);
188
+ }
189
+ });
190
+ }, [message.id, option.id, ownVotesByOptionId, poll, runWithNotificationTarget]);
187
191
 
188
192
  const onPressHandler = useCallback(() => {
189
193
  if (onPress) {