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
@@ -2,6 +2,8 @@ import React from 'react';
2
2
 
3
3
  import { Text } from 'react-native';
4
4
 
5
+ import type { ReactTestInstance } from 'react-test-renderer';
6
+
5
7
  import { fireEvent, render } from '@testing-library/react-native';
6
8
 
7
9
  import { ReactionResponse } from 'stream-chat';
@@ -39,6 +41,9 @@ const defaultProps = {
39
41
  supportedReactions: mockSupportedReactions,
40
42
  };
41
43
 
44
+ const filterReactionButtons = (buttons: ReactTestInstance[]) =>
45
+ buttons.filter((button) => button.props.accessibilityLabel !== 'more-reactions-button');
46
+
42
47
  const renderComponent = (props = {}) =>
43
48
  render(
44
49
  <ThemeProvider theme={defaultTheme}>
@@ -87,35 +92,32 @@ describe('MessageUserReactions when the supportedReactions are defined', () => {
87
92
  });
88
93
 
89
94
  it('renders reaction buttons', () => {
90
- const { getByLabelText } = renderComponent();
91
- const likeReactionButton = getByLabelText('reaction-button-like-unselected');
92
- expect(likeReactionButton).toBeDefined();
93
- const loveReactionButton = getByLabelText('reaction-button-love-unselected');
94
- expect(loveReactionButton).toBeDefined();
95
+ const { getAllByRole } = renderComponent();
96
+ expect(filterReactionButtons(getAllByRole('button'))).toHaveLength(2);
95
97
  });
96
98
 
97
99
  it('starts with no reaction filter selected by default', () => {
98
- const { getAllByLabelText } = renderComponent();
99
- const reactionButtons = getAllByLabelText(/\breaction-button[^\s]+/);
100
- expect(reactionButtons[0].props.accessibilityLabel).toBe('reaction-button-like-unselected');
101
- expect(reactionButtons[1].props.accessibilityLabel).toBe('reaction-button-love-unselected');
100
+ const { getAllByRole } = renderComponent();
101
+ const reactionButtons = filterReactionButtons(getAllByRole('button'));
102
+ expect(reactionButtons[0].props.accessibilityState.selected).toBe(false);
103
+ expect(reactionButtons[1].props.accessibilityState.selected).toBe(false);
102
104
  });
103
105
 
104
106
  it('toggles the selected reaction when a reaction button is pressed twice', () => {
105
- const { getAllByLabelText } = renderComponent();
106
- let reactionButtons = getAllByLabelText(/\breaction-button[^\s]+/);
107
+ const { getAllByRole } = renderComponent();
108
+ let reactionButtons = filterReactionButtons(getAllByRole('button'));
107
109
 
108
110
  fireEvent.press(reactionButtons[1]);
109
111
 
110
- expect(reactionButtons[0].props.accessibilityLabel).toBe('reaction-button-like-unselected');
111
- expect(reactionButtons[1].props.accessibilityLabel).toBe('reaction-button-love-selected');
112
+ expect(reactionButtons[0].props.accessibilityState.selected).toBe(false);
113
+ expect(reactionButtons[1].props.accessibilityState.selected).toBe(true);
112
114
 
113
115
  fireEvent.press(reactionButtons[1]);
114
116
 
115
- reactionButtons = getAllByLabelText(/\breaction-button[^\s]+/);
117
+ reactionButtons = filterReactionButtons(getAllByRole('button'));
116
118
 
117
- expect(reactionButtons[0].props.accessibilityLabel).toBe('reaction-button-like-unselected');
118
- expect(reactionButtons[1].props.accessibilityLabel).toBe('reaction-button-love-unselected');
119
+ expect(reactionButtons[0].props.accessibilityState.selected).toBe(false);
120
+ expect(reactionButtons[1].props.accessibilityState.selected).toBe(false);
119
121
  });
120
122
 
121
123
  it('renders reactions list', () => {
@@ -133,10 +135,10 @@ describe('MessageUserReactions when the supportedReactions are defined', () => {
133
135
  });
134
136
 
135
137
  it("don't render reaction buttons that is of unsupported type", () => {
136
- const { queryAllByLabelText } = renderComponent({
138
+ const { queryAllByRole } = renderComponent({
137
139
  message: { ...generateMessage(), reaction_groups: { money: 1 } },
138
140
  });
139
- const reactionButtons = queryAllByLabelText(/\breaction-button[^\s]+/);
141
+ const reactionButtons = filterReactionButtons(queryAllByRole('button'));
140
142
 
141
143
  expect(reactionButtons.length).toBe(0);
142
144
  });
@@ -2,8 +2,9 @@ import React from 'react';
2
2
 
3
3
  import { Text } from 'react-native';
4
4
 
5
- import { cleanup, fireEvent, render } from '@testing-library/react-native';
5
+ import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react-native';
6
6
 
7
+ import { OverlayProvider } from '../../../contexts/overlayContext/OverlayProvider';
7
8
  import { ThemeProvider } from '../../../contexts/themeContext/ThemeContext';
8
9
  import { defaultTheme } from '../../../contexts/themeContext/utils/theme';
9
10
  import { IconProps } from '../../../icons';
@@ -37,28 +38,40 @@ describe('ReactionButton', () => {
37
38
  expect(getByText('24')).toBeTruthy();
38
39
  });
39
40
 
41
+ it('uses the released reaction button label when accessibility labels are translated', async () => {
42
+ render(
43
+ <OverlayProvider accessibility={{ enabled: true }}>
44
+ <ReactionButton {...defaultProps} />
45
+ </OverlayProvider>,
46
+ );
47
+
48
+ await waitFor(() => {
49
+ expect(screen.getByLabelText('reaction-button-like-unselected')).toBeTruthy();
50
+ });
51
+ });
52
+
40
53
  it('should call onPress function with the correct reaction type when pressed', () => {
41
- const { getByLabelText } = render(
54
+ const { getByRole } = render(
42
55
  <ThemeProvider theme={defaultTheme}>
43
56
  <ReactionButton {...defaultProps} />
44
57
  </ThemeProvider>,
45
58
  );
46
59
 
47
60
  // Simulate a press event
48
- fireEvent.press(getByLabelText('reaction-button-like-unselected'));
61
+ fireEvent.press(getByRole('button'));
49
62
 
50
63
  // Verify if the mock function has been called with the correct reaction type
51
64
  expect(mockOnPress).toHaveBeenCalledWith('like');
52
65
  });
53
66
 
54
67
  it('should not call onPress when the onPress prop is not provided', () => {
55
- const { getByLabelText } = render(
68
+ const { getByRole } = render(
56
69
  <ThemeProvider theme={defaultTheme}>
57
70
  <ReactionButton {...defaultProps} onPress={undefined} />
58
71
  </ThemeProvider>,
59
72
  );
60
73
 
61
- fireEvent.press(getByLabelText('reaction-button-like-unselected'));
74
+ fireEvent.press(getByRole('button'));
62
75
 
63
76
  expect(mockOnPress).not.toHaveBeenCalled();
64
77
  });
@@ -3,6 +3,8 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import { LocalMessage, ReactionResponse, ReactionSort } from 'stream-chat';
4
4
 
5
5
  import { useChatContext } from '../../../contexts/chatContext/ChatContext';
6
+ import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
7
+ import { useNotificationApi } from '../../Notifications';
6
8
 
7
9
  export type UseFetchReactionParams = {
8
10
  limit?: number;
@@ -98,6 +100,8 @@ export const useFetchReactions = ({
98
100
  const messageId = message?.id;
99
101
 
100
102
  const { client } = useChatContext();
103
+ const { t } = useTranslationContext();
104
+ const { addNotification } = useNotificationApi();
101
105
 
102
106
  const sortString = useMemo(() => JSON.stringify(sort), [sort]);
103
107
 
@@ -122,10 +126,21 @@ export const useFetchReactions = ({
122
126
  setLoading(false);
123
127
  }
124
128
  } catch (error) {
125
- console.log('Error fetching reactions: ', error);
129
+ addNotification({
130
+ message: t('Error fetching reactions'),
131
+ options: {
132
+ ...(error instanceof Error ? { originalError: error } : {}),
133
+ severity: 'error',
134
+ type: 'api:message:reactions:fetch:failed',
135
+ },
136
+ origin: {
137
+ ...(message ? { context: { message } } : {}),
138
+ emitter: 'Reactions',
139
+ },
140
+ });
126
141
  }
127
142
  },
128
- [messageId, client, reactionType, sort, limit],
143
+ [addNotification, client, limit, message, messageId, reactionType, sort, t],
129
144
  );
130
145
 
131
146
  const loadNextPage = useCallback(async () => {
@@ -0,0 +1,254 @@
1
+ import React, { type ComponentType, useMemo } from 'react';
2
+ import { StyleSheet, Text, useColorScheme, View } from 'react-native';
3
+
4
+ import { Pressable } from 'react-native-gesture-handler';
5
+
6
+ import type { Notification as NotificationType, NotificationSeverity } from 'stream-chat';
7
+
8
+ import { useNotificationApi } from './hooks/useNotificationApi';
9
+ import { getNotificationDisplayMessage } from './notificationTranslations';
10
+
11
+ import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
12
+ import { useTheme } from '../../contexts/themeContext/ThemeContext';
13
+ import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';
14
+ import { Check } from '../../icons/checkmark';
15
+ import { Warning } from '../../icons/exclamation-triangle-fill';
16
+ import { Reload } from '../../icons/refresh';
17
+ import { IconProps } from '../../icons/utils/base';
18
+ import { NewClose } from '../../icons/xmark';
19
+ import { primitives } from '../../theme';
20
+ import { Button } from '../ui/Button';
21
+
22
+ /** Direction from which a snackbar enters and exits the screen. */
23
+ export type NotificationEntryDirection = 'bottom' | 'left' | 'right' | 'top';
24
+ export type NotificationTransitionState = 'enter' | 'exit';
25
+
26
+ export type NotificationIconProps = {
27
+ /** Notification rendered by the icon slot. */
28
+ notification: NotificationType;
29
+ };
30
+
31
+ /** Visual variant resolved from notification severity. Notifications without severity use `default`. */
32
+ export type NotificationVariant = 'default' | NotificationSeverity;
33
+
34
+ /** Resolves the visual variant used by the default notification renderer. */
35
+ export const getNotificationVariant = (notification: NotificationType): NotificationVariant =>
36
+ notification.severity ?? 'default';
37
+
38
+ const IconsByVariant: Partial<Record<NotificationVariant, ComponentType<IconProps> | null>> = {
39
+ error: Warning,
40
+ info: null,
41
+ loading: Reload,
42
+ success: Check,
43
+ warning: Warning,
44
+ };
45
+
46
+ const getNotificationIconComponent = (notification: NotificationType) => {
47
+ const variant = getNotificationVariant(notification);
48
+ if (variant === 'default') return undefined;
49
+
50
+ return IconsByVariant[variant] ?? undefined;
51
+ };
52
+
53
+ export const NotificationIcon = ({ notification }: NotificationIconProps) => {
54
+ const Icon = getNotificationIconComponent(notification);
55
+ const { iconColor, styles } = useNotificationIconStyles();
56
+ if (!Icon) return null;
57
+
58
+ return (
59
+ <View style={styles.iconContainer} testID='notification-icon'>
60
+ <Icon height={20} pathFill={iconColor} stroke={iconColor} width={20} />
61
+ </View>
62
+ );
63
+ };
64
+
65
+ export type NotificationProps = {
66
+ /** Notification object produced by the Stream Chat notification manager. */
67
+ notification: NotificationType;
68
+ /** Direction used by the surrounding list animation. */
69
+ entryDirection?: NotificationEntryDirection;
70
+ /** Optional icon override for this notification instance. */
71
+ Icon?: React.ComponentType<NotificationIconProps>;
72
+ /** Called instead of the default notification removal behavior. */
73
+ onDismiss?: () => void;
74
+ /** Forces a dismiss button for transient notifications. Persistent notifications always show one. */
75
+ showClose?: boolean;
76
+ /** Reserved for custom animated notification implementations. */
77
+ transitionState?: NotificationTransitionState;
78
+ };
79
+
80
+ /** Default snackbar notification renderer used by `NotificationList`. */
81
+ export const Notification = ({
82
+ Icon,
83
+ notification,
84
+ onDismiss,
85
+ showClose = false,
86
+ }: NotificationProps) => {
87
+ const { NotificationIcon: NotificationIconComponent = NotificationIcon } = useComponentsContext();
88
+ const { removeNotification } = useNotificationApi();
89
+ const { t } = useTranslationContext();
90
+ const displayMessage = getNotificationDisplayMessage({ notification, t });
91
+ const ResolvedIcon = Icon ?? NotificationIconComponent;
92
+ const hasResolvedIcon =
93
+ ResolvedIcon === NotificationIcon
94
+ ? !!getNotificationIconComponent(notification)
95
+ : !!ResolvedIcon;
96
+ const { closeIconColor, styles } = useNotificationStyles({ hasResolvedIcon });
97
+ const isPersistent = !notification.duration;
98
+ const closeVisible = showClose || isPersistent;
99
+
100
+ const handleDismiss = () => {
101
+ if (onDismiss) {
102
+ onDismiss();
103
+ return;
104
+ }
105
+
106
+ removeNotification(notification.id);
107
+ };
108
+
109
+ return (
110
+ <View
111
+ accessibilityLiveRegion={notification.severity === 'error' ? 'assertive' : 'polite'}
112
+ accessibilityRole={notification.severity === 'error' ? 'alert' : 'summary'}
113
+ style={styles.container}
114
+ testID='notification'
115
+ >
116
+ <View style={styles.contentContainer}>
117
+ {hasResolvedIcon ? <ResolvedIcon notification={notification} /> : null}
118
+ <Text style={styles.message}>{displayMessage}</Text>
119
+ </View>
120
+ {notification.actions && notification.actions.length > 0 ? (
121
+ <View style={styles.actionsContainer}>
122
+ {notification.actions.map((action, index) => (
123
+ <Button
124
+ accessibilityLabel={action.label}
125
+ key={`${action.label}-${index}`}
126
+ label={action.label}
127
+ onPress={action.handler}
128
+ size='sm'
129
+ style={styles.actionButton}
130
+ type='outline'
131
+ variant='primary'
132
+ />
133
+ ))}
134
+ </View>
135
+ ) : null}
136
+ {closeVisible ? (
137
+ <Pressable
138
+ accessibilityLabel={t('a11y/Dismiss notification')}
139
+ accessibilityRole='button'
140
+ hitSlop={8}
141
+ onPress={handleDismiss}
142
+ style={({ pressed }) => (pressed ? styles.closeButtonPressed : styles.closeButton)}
143
+ testID='notification-close-button'
144
+ >
145
+ <NewClose height={20} stroke={closeIconColor} width={20} />
146
+ </Pressable>
147
+ ) : null}
148
+ </View>
149
+ );
150
+ };
151
+
152
+ const useNotificationIconStyles = () => {
153
+ const {
154
+ theme: { notification: notificationTheme, semantics },
155
+ } = useTheme();
156
+
157
+ return useMemo(() => {
158
+ const baseStyles = StyleSheet.create({
159
+ iconContainer: {
160
+ alignItems: 'center',
161
+ height: 20,
162
+ justifyContent: 'center',
163
+ width: 20,
164
+ },
165
+ });
166
+
167
+ return {
168
+ iconColor: semantics.textOnInverse,
169
+ styles: {
170
+ iconContainer: [baseStyles.iconContainer, notificationTheme.iconContainer],
171
+ },
172
+ };
173
+ }, [notificationTheme.iconContainer, semantics]);
174
+ };
175
+
176
+ const useNotificationStyles = ({ hasResolvedIcon }: { hasResolvedIcon: boolean }) => {
177
+ const {
178
+ theme: { notification: notificationTheme, semantics },
179
+ } = useTheme();
180
+ const scheme = useColorScheme();
181
+ const notificationShadow =
182
+ scheme === 'dark' ? primitives.darkElevation3 : primitives.lightElevation3;
183
+
184
+ return useMemo(() => {
185
+ const baseStyles = StyleSheet.create({
186
+ actionButton: {
187
+ width: 'auto',
188
+ },
189
+ actionsContainer: {
190
+ flexDirection: 'row',
191
+ flexWrap: 'wrap',
192
+ gap: primitives.spacingXs,
193
+ marginTop: primitives.spacingXs,
194
+ },
195
+ closeButton: {
196
+ alignItems: 'center',
197
+ borderRadius: primitives.radiusMax,
198
+ height: 24,
199
+ justifyContent: 'center',
200
+ marginLeft: primitives.spacingXs,
201
+ width: 24,
202
+ },
203
+ closeButtonPressed: {
204
+ backgroundColor: semantics.backgroundUtilityPressed,
205
+ },
206
+ container: {
207
+ alignItems: 'flex-start',
208
+ alignSelf: 'center',
209
+ backgroundColor: semantics.backgroundCoreInverse,
210
+ borderRadius: primitives.radius3xl,
211
+ flexDirection: 'row',
212
+ maxWidth: '100%',
213
+ paddingHorizontal: primitives.spacingSm,
214
+ ...notificationShadow,
215
+ shadowOpacity: 0,
216
+ },
217
+ contentContainer: {
218
+ alignItems: 'center',
219
+ flexDirection: 'row',
220
+ flexShrink: 1,
221
+ gap: primitives.spacingXs,
222
+ minHeight: 48,
223
+ paddingLeft: hasResolvedIcon ? primitives.spacingXxs : primitives.spacingXs,
224
+ paddingRight: primitives.spacingXs,
225
+ paddingVertical: primitives.spacingXxxs,
226
+ },
227
+ message: {
228
+ color: semantics.textOnInverse,
229
+ flexShrink: 1,
230
+ fontSize: primitives.typographyFontSizeSm,
231
+ fontWeight: primitives.typographyFontWeightRegular,
232
+ lineHeight: primitives.typographyLineHeightNormal,
233
+ paddingVertical: primitives.spacingSm,
234
+ },
235
+ });
236
+
237
+ return {
238
+ closeIconColor: semantics.textOnInverse,
239
+ styles: {
240
+ actionButton: [baseStyles.actionButton, notificationTheme.actionButton],
241
+ actionsContainer: [baseStyles.actionsContainer, notificationTheme.actionsContainer],
242
+ closeButton: [baseStyles.closeButton, notificationTheme.closeButton],
243
+ closeButtonPressed: [
244
+ baseStyles.closeButton,
245
+ baseStyles.closeButtonPressed,
246
+ notificationTheme.closeButton,
247
+ ],
248
+ container: [baseStyles.container, notificationTheme.container],
249
+ contentContainer: [baseStyles.contentContainer, notificationTheme.contentContainer],
250
+ message: [baseStyles.message, notificationTheme.message],
251
+ },
252
+ };
253
+ }, [hasResolvedIcon, notificationShadow, notificationTheme, semantics]);
254
+ };
@@ -0,0 +1,160 @@
1
+ import React, { useMemo } from 'react';
2
+ import { StyleSheet } from 'react-native';
3
+
4
+ import Animated from 'react-native-reanimated';
5
+
6
+ import type { Notification as NotificationType } from 'stream-chat';
7
+
8
+ import { useNotificationListController } from './hooks/useNotificationListController';
9
+ import type { NotificationTargetPanel } from './notificationTarget';
10
+
11
+ import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
12
+ import { useTheme } from '../../contexts/themeContext/ThemeContext';
13
+ import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';
14
+ import { primitives } from '../../theme';
15
+ import { transitions } from '../../utils/animations/transitions';
16
+
17
+ /** Predicate used to hide notifications from a specific rendered notification list. */
18
+ export type NotificationListFilter = (notification: NotificationType) => boolean;
19
+ /** Direction from which new snackbars animate into the list. */
20
+ export type NotificationListEnterFrom = 'bottom' | 'left' | 'right' | 'top';
21
+ /** Vertical edge used by the absolutely positioned notification host. */
22
+ export type NotificationListVerticalAlignment = 'bottom' | 'top';
23
+
24
+ export type NotificationListProps = {
25
+ /** Extra distance from the bottom edge, useful when floating composers cover the default host. */
26
+ bottomOffset?: number;
27
+ /** Default enter/exit animation direction when notification metadata does not define one. */
28
+ enterFrom?: NotificationListEnterFrom;
29
+ /** Additional per-list filter applied after target filtering. */
30
+ filter?: NotificationListFilter;
31
+ /** Exact notification host id. Use together with `panel` when rendering outside a target provider. */
32
+ hostId?: string;
33
+ /** Target panel consumed by this list. Defaults to the nearest `NotificationTargetProvider`. */
34
+ panel?: NotificationTargetPanel;
35
+ /** Extra distance from the top edge when `verticalAlignment` is `top`. */
36
+ topOffset?: number;
37
+ /** Whether the host is anchored to the top or bottom of its parent. */
38
+ verticalAlignment?: NotificationListVerticalAlignment;
39
+ };
40
+
41
+ const isEnterFrom = (value: unknown): value is NotificationListEnterFrom =>
42
+ value === 'bottom' || value === 'left' || value === 'right' || value === 'top';
43
+
44
+ const getNotificationEnterFrom = (
45
+ notification: NotificationType,
46
+ fallbackEnterFrom: NotificationListEnterFrom,
47
+ ) => {
48
+ const metadataEnterFrom = notification.metadata?.entryDirection;
49
+ if (isEnterFrom(metadataEnterFrom)) return metadataEnterFrom;
50
+
51
+ const originEnterFrom = notification.origin.context?.entryDirection;
52
+ if (isEnterFrom(originEnterFrom)) return originEnterFrom;
53
+
54
+ return fallbackEnterFrom;
55
+ };
56
+
57
+ const getStringValue = (value: unknown) => (typeof value === 'string' ? value : undefined);
58
+
59
+ const getNotificationPresentationKey = (notification: NotificationType) =>
60
+ notification.type ??
61
+ getStringValue(notification.metadata?.dedupeKey) ??
62
+ getStringValue(notification.origin.context?.dedupeKey) ??
63
+ [notification.origin.emitter, notification.severity, notification.message]
64
+ .filter(Boolean)
65
+ .join(':');
66
+
67
+ /** Renders the newest matching client notification as an animated snackbar. */
68
+ export const NotificationList = ({
69
+ bottomOffset,
70
+ enterFrom = 'bottom',
71
+ filter,
72
+ hostId,
73
+ panel,
74
+ topOffset,
75
+ verticalAlignment = 'bottom',
76
+ }: NotificationListProps) => {
77
+ const { Notification: NotificationComponent } = useComponentsContext();
78
+ const styles = useStyles({ bottomOffset, topOffset, verticalAlignment });
79
+ const { t } = useTranslationContext();
80
+ const { dismissNotification, notification } = useNotificationListController({
81
+ filter,
82
+ hostId,
83
+ panel,
84
+ });
85
+
86
+ if (!notification) return null;
87
+
88
+ const notificationEnterFrom = getNotificationEnterFrom(notification, enterFrom);
89
+ const notificationPresentationKey = getNotificationPresentationKey(notification);
90
+
91
+ return (
92
+ <Animated.View
93
+ accessibilityLabel={t('a11y/Notifications')}
94
+ pointerEvents='box-none'
95
+ layout={transitions.layout200}
96
+ style={styles.container}
97
+ testID='notification-list'
98
+ >
99
+ <Animated.View
100
+ entering={transitions.boundedZoomIn200[notificationEnterFrom]}
101
+ exiting={transitions.boundedZoomOut200[notificationEnterFrom]}
102
+ key={notificationPresentationKey}
103
+ style={styles.notificationWrapper}
104
+ testID='notification-list-item'
105
+ >
106
+ <NotificationComponent
107
+ entryDirection={notificationEnterFrom}
108
+ notification={notification}
109
+ onDismiss={dismissNotification}
110
+ showClose={!notification.duration}
111
+ />
112
+ </Animated.View>
113
+ </Animated.View>
114
+ );
115
+ };
116
+
117
+ const useStyles = ({
118
+ bottomOffset,
119
+ topOffset,
120
+ verticalAlignment,
121
+ }: Pick<NotificationListProps, 'bottomOffset' | 'topOffset'> & {
122
+ verticalAlignment: NotificationListVerticalAlignment;
123
+ }) => {
124
+ const {
125
+ theme: {
126
+ notificationList: { container: notificationListContainer },
127
+ },
128
+ } = useTheme();
129
+
130
+ return useMemo(() => {
131
+ const containerAlignmentStyle =
132
+ verticalAlignment === 'bottom'
133
+ ? { bottom: primitives.spacingMd }
134
+ : { top: primitives.spacingMd };
135
+ const containerOffsetStyle =
136
+ verticalAlignment === 'bottom' && typeof bottomOffset === 'number'
137
+ ? { bottom: primitives.spacingMd + bottomOffset }
138
+ : verticalAlignment === 'top' && typeof topOffset === 'number'
139
+ ? { top: primitives.spacingMd + topOffset }
140
+ : undefined;
141
+
142
+ return StyleSheet.create({
143
+ container: {
144
+ alignItems: 'center',
145
+ left: primitives.spacingMd,
146
+ maxHeight: '100%',
147
+ position: 'absolute',
148
+ right: primitives.spacingMd,
149
+ zIndex: 20,
150
+ ...containerAlignmentStyle,
151
+ ...notificationListContainer,
152
+ ...containerOffsetStyle,
153
+ },
154
+ notificationWrapper: {
155
+ alignSelf: 'center',
156
+ maxWidth: '100%',
157
+ },
158
+ });
159
+ }, [bottomOffset, notificationListContainer, topOffset, verticalAlignment]);
160
+ };
@@ -0,0 +1,45 @@
1
+ import React, { createContext, PropsWithChildren, useContext, useMemo } from 'react';
2
+
3
+ import type { NotificationTarget, NotificationTargetPanel } from './notificationTarget';
4
+
5
+ /** Provides the default notification target for SDK actions rendered inside this subtree. */
6
+ export type NotificationTargetProviderProps = PropsWithChildren<NotificationTarget>;
7
+
8
+ const NotificationTargetContext = createContext<NotificationTarget | undefined>(undefined);
9
+
10
+ /** Makes notifications emitted by descendants resolve to a specific panel and host id. */
11
+ export const NotificationTargetProvider = ({
12
+ children,
13
+ hostId,
14
+ panel,
15
+ }: NotificationTargetProviderProps) => {
16
+ const value = useMemo(() => ({ hostId, panel }), [hostId, panel]);
17
+
18
+ return (
19
+ <NotificationTargetContext.Provider value={value}>
20
+ {children}
21
+ </NotificationTargetContext.Provider>
22
+ );
23
+ };
24
+
25
+ /** Returns the nearest notification target, if the caller is rendered inside a target provider. */
26
+ export const useNotificationTargetContext = () => useContext(NotificationTargetContext);
27
+
28
+ /** Resolves an explicit target or falls back to the nearest compatible target provider. */
29
+ export const useResolvedNotificationTarget = ({
30
+ hostId,
31
+ panel,
32
+ }: {
33
+ hostId?: string;
34
+ panel?: NotificationTargetPanel;
35
+ } = {}) => {
36
+ const contextTarget = useNotificationTargetContext();
37
+
38
+ return useMemo(() => {
39
+ if (hostId && panel) return { hostId, panel };
40
+ if (!hostId && !panel) return contextTarget;
41
+ if (panel && contextTarget?.panel === panel) return contextTarget;
42
+
43
+ return undefined;
44
+ }, [contextTarget, hostId, panel]);
45
+ };