@sendbird/uikit-react-native 2.1.0 → 2.3.0

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 (431) hide show
  1. package/README.md +42 -17
  2. package/lib/commonjs/components/ChatFlatList.js +2 -1
  3. package/lib/commonjs/components/ChatFlatList.js.map +1 -1
  4. package/lib/commonjs/components/FileViewer.js +2 -5
  5. package/lib/commonjs/components/FileViewer.js.map +1 -1
  6. package/lib/commonjs/components/MessageRenderer/FileMessage/BaseFileMessage.js +11 -6
  7. package/lib/commonjs/components/MessageRenderer/FileMessage/BaseFileMessage.js.map +1 -1
  8. package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js +12 -2
  9. package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +1 -1
  10. package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js +26 -11
  11. package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -1
  12. package/lib/commonjs/components/MessageRenderer/FileMessage/index.js +1 -6
  13. package/lib/commonjs/components/MessageRenderer/FileMessage/index.js.map +1 -1
  14. package/lib/commonjs/components/MessageRenderer/UserMessage/BaseUserMessage.js +86 -10
  15. package/lib/commonjs/components/MessageRenderer/UserMessage/BaseUserMessage.js.map +1 -1
  16. package/lib/commonjs/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js +102 -15
  17. package/lib/commonjs/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js.map +1 -1
  18. package/lib/commonjs/components/MessageRenderer/UserMessage/index.js.map +1 -1
  19. package/lib/commonjs/components/MessageRenderer/index.js +22 -3
  20. package/lib/commonjs/components/MessageRenderer/index.js.map +1 -1
  21. package/lib/commonjs/components/ReactionAddons/BottomSheetReactionAddon.js +150 -0
  22. package/lib/commonjs/components/ReactionAddons/BottomSheetReactionAddon.js.map +1 -0
  23. package/lib/commonjs/components/ReactionAddons/MessageReactionAddon.js +135 -0
  24. package/lib/commonjs/components/ReactionAddons/MessageReactionAddon.js.map +1 -0
  25. package/lib/commonjs/components/ReactionAddons/ReactionRoundedButton.js +87 -0
  26. package/lib/commonjs/components/ReactionAddons/ReactionRoundedButton.js.map +1 -0
  27. package/lib/commonjs/components/ReactionAddons/index.js +19 -0
  28. package/lib/commonjs/components/ReactionAddons/index.js.map +1 -0
  29. package/lib/commonjs/components/ReactionBottomSheets/ReactionListBottomSheet.js +150 -0
  30. package/lib/commonjs/components/ReactionBottomSheets/ReactionListBottomSheet.js.map +1 -0
  31. package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +276 -0
  32. package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -0
  33. package/lib/commonjs/components/ReactionBottomSheets/index.js +19 -0
  34. package/lib/commonjs/components/ReactionBottomSheets/index.js.map +1 -0
  35. package/lib/commonjs/constants.js +3 -1
  36. package/lib/commonjs/constants.js.map +1 -1
  37. package/lib/commonjs/containers/GroupChannelPreviewContainer.js +4 -1
  38. package/lib/commonjs/containers/GroupChannelPreviewContainer.js.map +1 -1
  39. package/lib/commonjs/containers/SendbirdUIKitContainer.js +130 -79
  40. package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -1
  41. package/lib/commonjs/contexts/PlatformServiceCtx.js.map +1 -1
  42. package/lib/commonjs/contexts/ReactionCtx.js +107 -0
  43. package/lib/commonjs/contexts/ReactionCtx.js.map +1 -0
  44. package/lib/commonjs/contexts/SendbirdChatCtx.js +26 -18
  45. package/lib/commonjs/contexts/SendbirdChatCtx.js.map +1 -1
  46. package/lib/commonjs/contexts/UserProfileCtx.js +9 -0
  47. package/lib/commonjs/contexts/UserProfileCtx.js.map +1 -1
  48. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/EditInput.js +33 -37
  49. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/EditInput.js.map +1 -1
  50. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js +95 -23
  51. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
  52. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/index.js +121 -31
  53. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/index.js.map +1 -1
  54. package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +34 -13
  55. package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
  56. package/lib/commonjs/domain/groupChannel/component/GroupChannelSuggestedMentionList.js +210 -0
  57. package/lib/commonjs/domain/groupChannel/component/GroupChannelSuggestedMentionList.js.map +1 -0
  58. package/lib/commonjs/domain/groupChannel/index.js +8 -0
  59. package/lib/commonjs/domain/groupChannel/index.js.map +1 -1
  60. package/lib/commonjs/domain/groupChannel/module/createGroupChannelModule.js +4 -0
  61. package/lib/commonjs/domain/groupChannel/module/createGroupChannelModule.js.map +1 -1
  62. package/lib/commonjs/domain/groupChannel/module/moduleContext.js +4 -4
  63. package/lib/commonjs/domain/groupChannel/module/moduleContext.js.map +1 -1
  64. package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
  65. package/lib/commonjs/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.js +3 -2
  66. package/lib/commonjs/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.js.map +1 -1
  67. package/lib/commonjs/domain/groupChannelList/component/GroupChannelListList.js +2 -1
  68. package/lib/commonjs/domain/groupChannelList/component/GroupChannelListList.js.map +1 -1
  69. package/lib/commonjs/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.js +2 -1
  70. package/lib/commonjs/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.js.map +1 -1
  71. package/lib/commonjs/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.js +39 -0
  72. package/lib/commonjs/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.js.map +1 -0
  73. package/lib/commonjs/domain/groupChannelNotifications/component/GroupChannelNotificationsView.js +140 -0
  74. package/lib/commonjs/domain/groupChannelNotifications/component/GroupChannelNotificationsView.js.map +1 -0
  75. package/lib/commonjs/domain/groupChannelNotifications/index.js +46 -0
  76. package/lib/commonjs/domain/groupChannelNotifications/index.js.map +1 -0
  77. package/lib/commonjs/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.js +33 -0
  78. package/lib/commonjs/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.js.map +1 -0
  79. package/lib/commonjs/domain/groupChannelNotifications/module/moduleContext.js +45 -0
  80. package/lib/commonjs/domain/groupChannelNotifications/module/moduleContext.js.map +1 -0
  81. package/lib/commonjs/domain/groupChannelNotifications/types.js +6 -0
  82. package/lib/commonjs/domain/groupChannelNotifications/types.js.map +1 -0
  83. package/lib/commonjs/domain/groupChannelOperators/component/GroupChannelOperatorsList.js +2 -1
  84. package/lib/commonjs/domain/groupChannelOperators/component/GroupChannelOperatorsList.js.map +1 -1
  85. package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +49 -6
  86. package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -1
  87. package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js +11 -16
  88. package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
  89. package/lib/commonjs/domain/groupChannelSettings/types.js.map +1 -1
  90. package/lib/commonjs/domain/groupChannelUserList/types.js.map +1 -1
  91. package/lib/commonjs/domain/userList/component/UserListList.js +4 -1
  92. package/lib/commonjs/domain/userList/component/UserListList.js.map +1 -1
  93. package/lib/commonjs/domain/userList/module/createUserListModule.js.map +1 -1
  94. package/lib/commonjs/fragments/createGroupChannelCreateFragment.js.map +1 -1
  95. package/lib/commonjs/fragments/createGroupChannelFragment.js +11 -4
  96. package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
  97. package/lib/commonjs/fragments/createGroupChannelInviteFragment.js.map +1 -1
  98. package/lib/commonjs/fragments/createGroupChannelListFragment.js +4 -14
  99. package/lib/commonjs/fragments/createGroupChannelListFragment.js.map +1 -1
  100. package/lib/commonjs/fragments/createGroupChannelNotificationsFragment.js +34 -0
  101. package/lib/commonjs/fragments/createGroupChannelNotificationsFragment.js.map +1 -0
  102. package/lib/commonjs/fragments/createGroupChannelSettingsFragment.js +3 -1
  103. package/lib/commonjs/fragments/createGroupChannelSettingsFragment.js.map +1 -1
  104. package/lib/commonjs/hooks/useConnection.js +3 -0
  105. package/lib/commonjs/hooks/useConnection.js.map +1 -1
  106. package/lib/commonjs/hooks/useContext.js +11 -1
  107. package/lib/commonjs/hooks/useContext.js.map +1 -1
  108. package/lib/commonjs/hooks/useKeyboardStatus.js +97 -0
  109. package/lib/commonjs/hooks/useKeyboardStatus.js.map +1 -0
  110. package/lib/commonjs/hooks/useMentionSuggestion.js +110 -0
  111. package/lib/commonjs/hooks/useMentionSuggestion.js.map +1 -0
  112. package/lib/commonjs/hooks/useMentionTextInput.js +139 -0
  113. package/lib/commonjs/hooks/useMentionTextInput.js.map +1 -0
  114. package/lib/commonjs/index.js +95 -40
  115. package/lib/commonjs/index.js.map +1 -1
  116. package/lib/commonjs/libs/EmojiManager.js +100 -0
  117. package/lib/commonjs/libs/EmojiManager.js.map +1 -0
  118. package/lib/commonjs/libs/ImageCompressionConfig.js +38 -0
  119. package/lib/commonjs/libs/ImageCompressionConfig.js.map +1 -0
  120. package/lib/commonjs/libs/MentionConfig.js +47 -0
  121. package/lib/commonjs/libs/MentionConfig.js.map +1 -0
  122. package/lib/commonjs/libs/MentionManager.js +235 -0
  123. package/lib/commonjs/libs/MentionManager.js.map +1 -0
  124. package/lib/commonjs/libs/SBUUtils.js +27 -0
  125. package/lib/commonjs/libs/SBUUtils.js.map +1 -1
  126. package/lib/commonjs/localization/StringSet.type.js +20 -5
  127. package/lib/commonjs/localization/StringSet.type.js.map +1 -1
  128. package/lib/commonjs/platform/createMediaService.expo.js +35 -1
  129. package/lib/commonjs/platform/createMediaService.expo.js.map +1 -1
  130. package/lib/commonjs/platform/createMediaService.native.js +41 -6
  131. package/lib/commonjs/platform/createMediaService.native.js.map +1 -1
  132. package/lib/commonjs/platform/dynamicModule.js +9 -57
  133. package/lib/commonjs/platform/dynamicModule.js.map +1 -1
  134. package/lib/commonjs/platform/types.js.map +1 -1
  135. package/lib/commonjs/types.js.map +1 -1
  136. package/lib/commonjs/version.js +1 -1
  137. package/lib/commonjs/version.js.map +1 -1
  138. package/lib/module/components/ChatFlatList.js +3 -2
  139. package/lib/module/components/ChatFlatList.js.map +1 -1
  140. package/lib/module/components/FileViewer.js +2 -5
  141. package/lib/module/components/FileViewer.js.map +1 -1
  142. package/lib/module/components/MessageRenderer/FileMessage/BaseFileMessage.js +11 -6
  143. package/lib/module/components/MessageRenderer/FileMessage/BaseFileMessage.js.map +1 -1
  144. package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js +12 -2
  145. package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +1 -1
  146. package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js +26 -11
  147. package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -1
  148. package/lib/module/components/MessageRenderer/FileMessage/index.js +1 -5
  149. package/lib/module/components/MessageRenderer/FileMessage/index.js.map +1 -1
  150. package/lib/module/components/MessageRenderer/UserMessage/BaseUserMessage.js +86 -12
  151. package/lib/module/components/MessageRenderer/UserMessage/BaseUserMessage.js.map +1 -1
  152. package/lib/module/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js +103 -19
  153. package/lib/module/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js.map +1 -1
  154. package/lib/module/components/MessageRenderer/UserMessage/index.js.map +1 -1
  155. package/lib/module/components/MessageRenderer/index.js +21 -4
  156. package/lib/module/components/MessageRenderer/index.js.map +1 -1
  157. package/lib/module/components/ReactionAddons/BottomSheetReactionAddon.js +132 -0
  158. package/lib/module/components/ReactionAddons/BottomSheetReactionAddon.js.map +1 -0
  159. package/lib/module/components/ReactionAddons/MessageReactionAddon.js +118 -0
  160. package/lib/module/components/ReactionAddons/MessageReactionAddon.js.map +1 -0
  161. package/lib/module/components/ReactionAddons/ReactionRoundedButton.js +74 -0
  162. package/lib/module/components/ReactionAddons/ReactionRoundedButton.js.map +1 -0
  163. package/lib/module/components/ReactionAddons/index.js +7 -0
  164. package/lib/module/components/ReactionAddons/index.js.map +1 -0
  165. package/lib/module/components/ReactionBottomSheets/ReactionListBottomSheet.js +135 -0
  166. package/lib/module/components/ReactionBottomSheets/ReactionListBottomSheet.js.map +1 -0
  167. package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +259 -0
  168. package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -0
  169. package/lib/module/components/ReactionBottomSheets/index.js +7 -0
  170. package/lib/module/components/ReactionBottomSheets/index.js.map +1 -0
  171. package/lib/module/constants.js +1 -0
  172. package/lib/module/constants.js.map +1 -1
  173. package/lib/module/containers/GroupChannelPreviewContainer.js +4 -1
  174. package/lib/module/containers/GroupChannelPreviewContainer.js.map +1 -1
  175. package/lib/module/containers/SendbirdUIKitContainer.js +127 -81
  176. package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -1
  177. package/lib/module/contexts/PlatformServiceCtx.js.map +1 -1
  178. package/lib/module/contexts/ReactionCtx.js +85 -0
  179. package/lib/module/contexts/ReactionCtx.js.map +1 -0
  180. package/lib/module/contexts/SendbirdChatCtx.js +28 -18
  181. package/lib/module/contexts/SendbirdChatCtx.js.map +1 -1
  182. package/lib/module/contexts/UserProfileCtx.js +7 -0
  183. package/lib/module/contexts/UserProfileCtx.js.map +1 -1
  184. package/lib/module/domain/groupChannel/component/GroupChannelInput/EditInput.js +34 -39
  185. package/lib/module/domain/groupChannel/component/GroupChannelInput/EditInput.js.map +1 -1
  186. package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js +92 -26
  187. package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
  188. package/lib/module/domain/groupChannel/component/GroupChannelInput/index.js +118 -33
  189. package/lib/module/domain/groupChannel/component/GroupChannelInput/index.js.map +1 -1
  190. package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +35 -16
  191. package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
  192. package/lib/module/domain/groupChannel/component/GroupChannelSuggestedMentionList.js +188 -0
  193. package/lib/module/domain/groupChannel/component/GroupChannelSuggestedMentionList.js.map +1 -0
  194. package/lib/module/domain/groupChannel/index.js +1 -0
  195. package/lib/module/domain/groupChannel/index.js.map +1 -1
  196. package/lib/module/domain/groupChannel/module/createGroupChannelModule.js +3 -0
  197. package/lib/module/domain/groupChannel/module/createGroupChannelModule.js.map +1 -1
  198. package/lib/module/domain/groupChannel/module/moduleContext.js +4 -4
  199. package/lib/module/domain/groupChannel/module/moduleContext.js.map +1 -1
  200. package/lib/module/domain/groupChannel/types.js.map +1 -1
  201. package/lib/module/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.js +4 -3
  202. package/lib/module/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.js.map +1 -1
  203. package/lib/module/domain/groupChannelList/component/GroupChannelListList.js +3 -2
  204. package/lib/module/domain/groupChannelList/component/GroupChannelListList.js.map +1 -1
  205. package/lib/module/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.js +3 -2
  206. package/lib/module/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.js.map +1 -1
  207. package/lib/module/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.js +25 -0
  208. package/lib/module/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.js.map +1 -0
  209. package/lib/module/domain/groupChannelNotifications/component/GroupChannelNotificationsView.js +122 -0
  210. package/lib/module/domain/groupChannelNotifications/component/GroupChannelNotificationsView.js.map +1 -0
  211. package/lib/module/domain/groupChannelNotifications/index.js +5 -0
  212. package/lib/module/domain/groupChannelNotifications/index.js.map +1 -0
  213. package/lib/module/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.js +21 -0
  214. package/lib/module/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.js.map +1 -0
  215. package/lib/module/domain/groupChannelNotifications/module/moduleContext.js +25 -0
  216. package/lib/module/domain/groupChannelNotifications/module/moduleContext.js.map +1 -0
  217. package/lib/module/domain/groupChannelNotifications/types.js +2 -0
  218. package/lib/module/domain/groupChannelNotifications/types.js.map +1 -0
  219. package/lib/module/domain/groupChannelOperators/component/GroupChannelOperatorsList.js +3 -2
  220. package/lib/module/domain/groupChannelOperators/component/GroupChannelOperatorsList.js.map +1 -1
  221. package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +46 -6
  222. package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -1
  223. package/lib/module/domain/groupChannelSettings/module/moduleContext.js +12 -17
  224. package/lib/module/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
  225. package/lib/module/domain/groupChannelSettings/types.js.map +1 -1
  226. package/lib/module/domain/groupChannelUserList/types.js.map +1 -1
  227. package/lib/module/domain/userList/component/UserListList.js +3 -1
  228. package/lib/module/domain/userList/component/UserListList.js.map +1 -1
  229. package/lib/module/domain/userList/module/createUserListModule.js.map +1 -1
  230. package/lib/module/fragments/createGroupChannelCreateFragment.js.map +1 -1
  231. package/lib/module/fragments/createGroupChannelFragment.js +11 -4
  232. package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
  233. package/lib/module/fragments/createGroupChannelInviteFragment.js.map +1 -1
  234. package/lib/module/fragments/createGroupChannelListFragment.js +5 -9
  235. package/lib/module/fragments/createGroupChannelListFragment.js.map +1 -1
  236. package/lib/module/fragments/createGroupChannelNotificationsFragment.js +22 -0
  237. package/lib/module/fragments/createGroupChannelNotificationsFragment.js.map +1 -0
  238. package/lib/module/fragments/createGroupChannelSettingsFragment.js +3 -1
  239. package/lib/module/fragments/createGroupChannelSettingsFragment.js.map +1 -1
  240. package/lib/module/hooks/useConnection.js +3 -0
  241. package/lib/module/hooks/useConnection.js.map +1 -1
  242. package/lib/module/hooks/useContext.js +6 -0
  243. package/lib/module/hooks/useContext.js.map +1 -1
  244. package/lib/module/hooks/useKeyboardStatus.js +78 -0
  245. package/lib/module/hooks/useKeyboardStatus.js.map +1 -0
  246. package/lib/module/hooks/useMentionSuggestion.js +100 -0
  247. package/lib/module/hooks/useMentionSuggestion.js.map +1 -0
  248. package/lib/module/hooks/useMentionTextInput.js +128 -0
  249. package/lib/module/hooks/useMentionTextInput.js.map +1 -0
  250. package/lib/module/index.js +8 -3
  251. package/lib/module/index.js.map +1 -1
  252. package/lib/module/libs/EmojiManager.js +90 -0
  253. package/lib/module/libs/EmojiManager.js.map +1 -0
  254. package/lib/module/libs/ImageCompressionConfig.js +30 -0
  255. package/lib/module/libs/ImageCompressionConfig.js.map +1 -0
  256. package/lib/module/libs/MentionConfig.js +39 -0
  257. package/lib/module/libs/MentionConfig.js.map +1 -0
  258. package/lib/module/libs/MentionManager.js +223 -0
  259. package/lib/module/libs/MentionManager.js.map +1 -0
  260. package/lib/module/libs/SBUUtils.js +26 -1
  261. package/lib/module/libs/SBUUtils.js.map +1 -1
  262. package/lib/module/localization/StringSet.type.js +21 -6
  263. package/lib/module/localization/StringSet.type.js.map +1 -1
  264. package/lib/module/platform/createMediaService.expo.js +33 -1
  265. package/lib/module/platform/createMediaService.expo.js.map +1 -1
  266. package/lib/module/platform/createMediaService.native.js +38 -5
  267. package/lib/module/platform/createMediaService.native.js.map +1 -1
  268. package/lib/module/platform/dynamicModule.js +10 -56
  269. package/lib/module/platform/dynamicModule.js.map +1 -1
  270. package/lib/module/platform/types.js.map +1 -1
  271. package/lib/module/types.js.map +1 -1
  272. package/lib/module/version.js +1 -1
  273. package/lib/module/version.js.map +1 -1
  274. package/lib/typescript/__template__/types.d.ts +3 -3
  275. package/lib/typescript/src/components/ChannelCover.d.ts +1 -1
  276. package/lib/typescript/src/components/ChatFlatList.d.ts +1 -1
  277. package/lib/typescript/src/components/FileViewer.d.ts +1 -1
  278. package/lib/typescript/src/components/MessageRenderer/AdminMessage/index.d.ts +1 -1
  279. package/lib/typescript/src/components/MessageRenderer/FileMessage/BaseFileMessage.d.ts +2 -2
  280. package/lib/typescript/src/components/MessageRenderer/FileMessage/ImageFileMessage.d.ts +1 -1
  281. package/lib/typescript/src/components/MessageRenderer/FileMessage/VideoFileMessage.d.ts +1 -1
  282. package/lib/typescript/src/components/MessageRenderer/FileMessage/index.d.ts +11 -2
  283. package/lib/typescript/src/components/MessageRenderer/MessageDateSeparator.d.ts +1 -1
  284. package/lib/typescript/src/components/MessageRenderer/MessageIncomingAvatar.d.ts +1 -1
  285. package/lib/typescript/src/components/MessageRenderer/MessageIncomingSenderName.d.ts +1 -1
  286. package/lib/typescript/src/components/MessageRenderer/MessageOutgoingStatus.d.ts +1 -1
  287. package/lib/typescript/src/components/MessageRenderer/MessageTime.d.ts +1 -1
  288. package/lib/typescript/src/components/MessageRenderer/UnknownMessage/index.d.ts +1 -1
  289. package/lib/typescript/src/components/MessageRenderer/UserMessage/BaseUserMessage.d.ts +1 -1
  290. package/lib/typescript/src/components/MessageRenderer/UserMessage/OpenGraphUserMessage.d.ts +2 -2
  291. package/lib/typescript/src/components/MessageRenderer/UserMessage/index.d.ts +4 -1
  292. package/lib/typescript/src/components/MessageRenderer/index.d.ts +4 -3
  293. package/lib/typescript/src/components/NewMessagesButton.d.ts +1 -1
  294. package/lib/typescript/src/components/ReactionAddons/BottomSheetReactionAddon.d.ts +8 -0
  295. package/lib/typescript/src/components/ReactionAddons/MessageReactionAddon.d.ts +6 -0
  296. package/lib/typescript/src/components/ReactionAddons/ReactionRoundedButton.d.ts +14 -0
  297. package/lib/typescript/src/components/ReactionAddons/index.d.ts +11 -0
  298. package/lib/typescript/src/components/ReactionBottomSheets/ReactionListBottomSheet.d.ts +3 -0
  299. package/lib/typescript/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.d.ts +3 -0
  300. package/lib/typescript/src/components/ReactionBottomSheets/index.d.ts +20 -0
  301. package/lib/typescript/src/components/ScrollToBottomButton.d.ts +1 -1
  302. package/lib/typescript/src/components/StatusComposition.d.ts +1 -1
  303. package/lib/typescript/src/components/TypedPlaceholder.d.ts +1 -1
  304. package/lib/typescript/src/components/UserActionBar.d.ts +1 -1
  305. package/lib/typescript/src/components/UserSelectableBar.d.ts +1 -1
  306. package/lib/typescript/src/constants.d.ts +1 -0
  307. package/lib/typescript/src/containers/GroupChannelPreviewContainer.d.ts +1 -1
  308. package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +20 -8
  309. package/lib/typescript/src/contexts/LocalizationCtx.d.ts +2 -2
  310. package/lib/typescript/src/contexts/PlatformServiceCtx.d.ts +9 -3
  311. package/lib/typescript/src/contexts/ReactionCtx.d.ts +18 -0
  312. package/lib/typescript/src/contexts/SendbirdChatCtx.d.ts +16 -3
  313. package/lib/typescript/src/contexts/UserProfileCtx.d.ts +4 -4
  314. package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput/EditInput.d.ts +35 -7
  315. package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput/SendInput.d.ts +32 -5
  316. package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput/index.d.ts +19 -2
  317. package/lib/typescript/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.d.ts +3 -0
  318. package/lib/typescript/src/domain/groupChannel/index.d.ts +1 -0
  319. package/lib/typescript/src/domain/groupChannel/module/createGroupChannelModule.d.ts +1 -1
  320. package/lib/typescript/src/domain/groupChannel/types.d.ts +24 -7
  321. package/lib/typescript/src/domain/groupChannelBannedUsers/types.d.ts +3 -3
  322. package/lib/typescript/src/domain/groupChannelList/types.d.ts +2 -2
  323. package/lib/typescript/src/domain/groupChannelModeration/types.d.ts +3 -3
  324. package/lib/typescript/src/domain/groupChannelMutedMembers/types.d.ts +3 -3
  325. package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.d.ts +3 -0
  326. package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsView.d.ts +2 -0
  327. package/lib/typescript/src/domain/groupChannelNotifications/index.d.ts +4 -0
  328. package/lib/typescript/src/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.d.ts +3 -0
  329. package/lib/typescript/src/domain/groupChannelNotifications/module/moduleContext.d.ts +3 -0
  330. package/lib/typescript/src/domain/groupChannelNotifications/types.d.ts +33 -0
  331. package/lib/typescript/src/domain/groupChannelOperators/types.d.ts +3 -3
  332. package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.d.ts +1 -1
  333. package/lib/typescript/src/domain/groupChannelSettings/types.d.ts +3 -1
  334. package/lib/typescript/src/domain/groupChannelUserList/types.d.ts +6 -6
  335. package/lib/typescript/src/domain/userList/component/UserListList.d.ts +2 -1
  336. package/lib/typescript/src/domain/userList/module/createUserListModule.d.ts +2 -1
  337. package/lib/typescript/src/fragments/createGroupChannelCreateFragment.d.ts +1 -1
  338. package/lib/typescript/src/fragments/createGroupChannelInviteFragment.d.ts +1 -1
  339. package/lib/typescript/src/fragments/createGroupChannelNotificationsFragment.d.ts +3 -0
  340. package/lib/typescript/src/hooks/useConnection.d.ts +1 -1
  341. package/lib/typescript/src/hooks/useContext.d.ts +3 -26
  342. package/lib/typescript/src/hooks/useKeyboardStatus.d.ts +6 -0
  343. package/lib/typescript/src/hooks/useMentionSuggestion.d.ts +17 -0
  344. package/lib/typescript/src/hooks/useMentionTextInput.d.ts +18 -0
  345. package/lib/typescript/src/index.d.ts +8 -3
  346. package/lib/typescript/src/libs/EmojiManager.d.ts +16 -0
  347. package/lib/typescript/src/libs/ImageCompressionConfig.d.ts +16 -0
  348. package/lib/typescript/src/libs/MentionConfig.d.ts +24 -0
  349. package/lib/typescript/src/libs/MentionManager.d.ts +61 -0
  350. package/lib/typescript/src/libs/SBUUtils.d.ts +6 -0
  351. package/lib/typescript/src/localization/StringSet.type.d.ts +19 -2
  352. package/lib/typescript/src/platform/createMediaService.expo.d.ts +6 -2
  353. package/lib/typescript/src/platform/createMediaService.native.d.ts +8 -6
  354. package/lib/typescript/src/platform/dynamicModule.d.ts +8 -13
  355. package/lib/typescript/src/platform/types.d.ts +33 -8
  356. package/lib/typescript/src/types.d.ts +13 -4
  357. package/lib/typescript/src/version.d.ts +1 -1
  358. package/package.json +16 -6
  359. package/src/components/ChatFlatList.tsx +2 -1
  360. package/src/components/FileViewer.tsx +2 -5
  361. package/src/components/MessageRenderer/FileMessage/BaseFileMessage.tsx +17 -12
  362. package/src/components/MessageRenderer/FileMessage/ImageFileMessage.tsx +30 -18
  363. package/src/components/MessageRenderer/FileMessage/VideoFileMessage.tsx +21 -11
  364. package/src/components/MessageRenderer/FileMessage/index.tsx +1 -4
  365. package/src/components/MessageRenderer/UserMessage/BaseUserMessage.tsx +82 -14
  366. package/src/components/MessageRenderer/UserMessage/OpenGraphUserMessage.tsx +136 -62
  367. package/src/components/MessageRenderer/UserMessage/index.tsx +8 -1
  368. package/src/components/MessageRenderer/index.tsx +39 -7
  369. package/src/components/ReactionAddons/BottomSheetReactionAddon.tsx +106 -0
  370. package/src/components/ReactionAddons/MessageReactionAddon.tsx +123 -0
  371. package/src/components/ReactionAddons/ReactionRoundedButton.tsx +71 -0
  372. package/src/components/ReactionAddons/index.tsx +7 -0
  373. package/src/components/ReactionBottomSheets/ReactionListBottomSheet.tsx +113 -0
  374. package/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.tsx +249 -0
  375. package/src/components/ReactionBottomSheets/index.tsx +24 -0
  376. package/src/constants.ts +2 -0
  377. package/src/containers/GroupChannelPreviewContainer.tsx +3 -1
  378. package/src/containers/SendbirdUIKitContainer.tsx +165 -88
  379. package/src/contexts/PlatformServiceCtx.tsx +9 -2
  380. package/src/contexts/ReactionCtx.tsx +102 -0
  381. package/src/contexts/SendbirdChatCtx.tsx +46 -21
  382. package/src/contexts/UserProfileCtx.tsx +9 -0
  383. package/src/domain/groupChannel/component/GroupChannelInput/EditInput.tsx +56 -30
  384. package/src/domain/groupChannel/component/GroupChannelInput/SendInput.tsx +129 -32
  385. package/src/domain/groupChannel/component/GroupChannelInput/index.tsx +138 -43
  386. package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +30 -12
  387. package/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.tsx +173 -0
  388. package/src/domain/groupChannel/index.ts +1 -0
  389. package/src/domain/groupChannel/module/createGroupChannelModule.tsx +12 -1
  390. package/src/domain/groupChannel/module/moduleContext.tsx +4 -4
  391. package/src/domain/groupChannel/types.ts +28 -5
  392. package/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.tsx +3 -2
  393. package/src/domain/groupChannelList/component/GroupChannelListList.tsx +2 -1
  394. package/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.tsx +2 -1
  395. package/src/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.tsx +14 -0
  396. package/src/domain/groupChannelNotifications/component/GroupChannelNotificationsView.tsx +128 -0
  397. package/src/domain/groupChannelNotifications/index.ts +4 -0
  398. package/src/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.tsx +15 -0
  399. package/src/domain/groupChannelNotifications/module/moduleContext.tsx +31 -0
  400. package/src/domain/groupChannelNotifications/types.ts +38 -0
  401. package/src/domain/groupChannelOperators/component/GroupChannelOperatorsList.tsx +2 -1
  402. package/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.tsx +42 -3
  403. package/src/domain/groupChannelSettings/module/moduleContext.tsx +17 -14
  404. package/src/domain/groupChannelSettings/types.ts +2 -0
  405. package/src/domain/groupChannelUserList/types.ts +7 -2
  406. package/src/domain/userList/component/UserListList.tsx +5 -1
  407. package/src/domain/userList/module/createUserListModule.tsx +3 -1
  408. package/src/fragments/createGroupChannelCreateFragment.tsx +8 -2
  409. package/src/fragments/createGroupChannelFragment.tsx +19 -6
  410. package/src/fragments/createGroupChannelInviteFragment.tsx +2 -2
  411. package/src/fragments/createGroupChannelListFragment.tsx +5 -9
  412. package/src/fragments/createGroupChannelNotificationsFragment.tsx +27 -0
  413. package/src/fragments/createGroupChannelSettingsFragment.tsx +2 -0
  414. package/src/hooks/useConnection.ts +3 -1
  415. package/src/hooks/useContext.ts +7 -0
  416. package/src/hooks/useKeyboardStatus.ts +59 -0
  417. package/src/hooks/useMentionSuggestion.ts +106 -0
  418. package/src/hooks/useMentionTextInput.ts +139 -0
  419. package/src/index.ts +14 -2
  420. package/src/libs/EmojiManager.ts +80 -0
  421. package/src/libs/ImageCompressionConfig.ts +31 -0
  422. package/src/libs/MentionConfig.ts +40 -0
  423. package/src/libs/MentionManager.tsx +240 -0
  424. package/src/libs/SBUUtils.ts +28 -1
  425. package/src/localization/StringSet.type.ts +45 -8
  426. package/src/platform/createMediaService.expo.tsx +24 -1
  427. package/src/platform/createMediaService.native.tsx +31 -9
  428. package/src/platform/dynamicModule.ts +17 -59
  429. package/src/platform/types.ts +29 -7
  430. package/src/types.ts +12 -0
  431. package/src/version.ts +1 -1
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
13
+
14
+ var _uikitUtils = require("@sendbird/uikit-utils");
15
+
16
+ let isLayoutAnimationConfigured = false;
17
+
18
+ const configureNextLayoutAnimation = event => {
19
+ if (isLayoutAnimationConfigured) return;
20
+
21
+ const config = _reactNative.LayoutAnimation.create(event.duration, event.easing, _reactNative.LayoutAnimation.Properties.scaleY);
22
+
23
+ isLayoutAnimationConfigured = true;
24
+
25
+ const onEnd = () => isLayoutAnimationConfigured = false;
26
+
27
+ _reactNative.LayoutAnimation.configureNext(config, onEnd, onEnd);
28
+ };
29
+
30
+ const {
31
+ showEvent,
32
+ hideEvent
33
+ } = _reactNative.Platform.select({
34
+ android: {
35
+ showEvent: 'keyboardDidShow',
36
+ hideEvent: 'keyboardDidHide'
37
+ },
38
+ default: {
39
+ showEvent: 'keyboardWillShow',
40
+ hideEvent: 'keyboardWillHide'
41
+ }
42
+ });
43
+
44
+ const useKeyboardStatus = () => {
45
+ const [keyboardStatus, setKeyboardStatus] = (0, _react.useState)({
46
+ visible: false,
47
+ height: 0,
48
+ bottomSpace: 0
49
+ });
50
+ const {
51
+ bottom: bottomInset
52
+ } = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
53
+ (0, _react.useEffect)(() => {
54
+ const subscriptions = [_reactNative.Keyboard.addListener(showEvent, event => {
55
+ const height = event.endCoordinates.height;
56
+
57
+ const bottomSpace = _reactNative.Platform.select({
58
+ ios: height - bottomInset,
59
+ default: 0
60
+ });
61
+
62
+ const nextLayoutAnimation = _reactNative.Platform.select({
63
+ ios: configureNextLayoutAnimation,
64
+ default: _uikitUtils.NOOP
65
+ });
66
+
67
+ nextLayoutAnimation(event);
68
+ setKeyboardStatus({
69
+ visible: true,
70
+ height,
71
+ bottomSpace
72
+ });
73
+ }), _reactNative.Keyboard.addListener(hideEvent, () => {
74
+ const height = 0;
75
+
76
+ const bottomSpace = _reactNative.Platform.select({
77
+ default: height
78
+ }); // const nextLayoutAnimation = Platform.select({ ios: configureNextLayoutAnimation, default: NOOP });
79
+ // nextLayoutAnimation(event);
80
+
81
+
82
+ setKeyboardStatus({
83
+ visible: false,
84
+ height,
85
+ bottomSpace
86
+ });
87
+ })];
88
+ return () => {
89
+ subscriptions.forEach(it => it.remove());
90
+ };
91
+ }, []);
92
+ return keyboardStatus;
93
+ };
94
+
95
+ var _default = useKeyboardStatus;
96
+ exports.default = _default;
97
+ //# sourceMappingURL=useKeyboardStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isLayoutAnimationConfigured","configureNextLayoutAnimation","event","config","LayoutAnimation","create","duration","easing","Properties","scaleY","onEnd","configureNext","showEvent","hideEvent","Platform","select","android","default","useKeyboardStatus","keyboardStatus","setKeyboardStatus","useState","visible","height","bottomSpace","bottom","bottomInset","useSafeAreaInsets","useEffect","subscriptions","Keyboard","addListener","endCoordinates","ios","nextLayoutAnimation","NOOP","forEach","it","remove"],"sources":["useKeyboardStatus.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { Keyboard, KeyboardEvent, KeyboardEventName, LayoutAnimation, Platform } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { NOOP } from '@sendbird/uikit-utils';\n\ntype KeyboardEvents = {\n showEvent: KeyboardEventName;\n hideEvent: KeyboardEventName;\n};\n\nlet isLayoutAnimationConfigured = false;\n\nconst configureNextLayoutAnimation = (event: KeyboardEvent) => {\n if (isLayoutAnimationConfigured) return;\n const config = LayoutAnimation.create(event.duration, event.easing, LayoutAnimation.Properties.scaleY);\n isLayoutAnimationConfigured = true;\n const onEnd = () => (isLayoutAnimationConfigured = false);\n LayoutAnimation.configureNext(config, onEnd, onEnd);\n};\n\nconst { showEvent, hideEvent } = Platform.select<KeyboardEvents>({\n android: { showEvent: 'keyboardDidShow', hideEvent: 'keyboardDidHide' },\n default: { showEvent: 'keyboardWillShow', hideEvent: 'keyboardWillHide' },\n});\n\nconst useKeyboardStatus = () => {\n const [keyboardStatus, setKeyboardStatus] = useState({ visible: false, height: 0, bottomSpace: 0 });\n const { bottom: bottomInset } = useSafeAreaInsets();\n\n useEffect(() => {\n const subscriptions = [\n Keyboard.addListener(showEvent, (event) => {\n const height = event.endCoordinates.height;\n const bottomSpace = Platform.select({ ios: height - bottomInset, default: 0 });\n const nextLayoutAnimation = Platform.select({ ios: configureNextLayoutAnimation, default: NOOP });\n\n nextLayoutAnimation(event);\n setKeyboardStatus({ visible: true, height, bottomSpace });\n }),\n\n Keyboard.addListener(hideEvent, () => {\n const height = 0;\n const bottomSpace = Platform.select({ default: height });\n // const nextLayoutAnimation = Platform.select({ ios: configureNextLayoutAnimation, default: NOOP });\n\n // nextLayoutAnimation(event);\n setKeyboardStatus({ visible: false, height, bottomSpace });\n }),\n ];\n return () => {\n subscriptions.for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CAAqBT,MAApC;;MACA,MAAMC,WAAW,GAAGV,qBAAA,CAASC,MAAT,CAAgB;QAAEkB,GAAG,EAAEV,MAAM,GAAGG,WAAhB;QAA6BT,OAAO,EAAE;MAAtC,CAAhB,CAApB;;MACA,MAAMiB,mBAAmB,GAAGpB,qBAAA,CAASC,MAAT,CAAgB;QAAEkB,GAAG,EAAEhC,4BAAP;QAAqCgB,OAAO,EAAEkB;MAA9C,CAAhB,CAA5B;;MAEAD,mBAAmB,CAAChC,KAAD,CAAnB;MACAkB,iBAAiB,CAAC;QAAEE,OAAO,EAAE,IAAX;QAAiBC,MAAjB;QAAyBC;MAAzB,CAAD,CAAjB;IACD,CAPD,CADoB,EAUpBM,qBAAA,CAASC,WAAT,CAAqBlB,SAArB,EAAgC,MAAM;MACpC,MAAMU,MAAM,GAAG,CAAf;;MACA,MAAMC,WAAW,GAAGV,qBAAA,CAASC,MAAT,CAAgB;QAAEE,OAAO,EAAEM;MAAX,CAAhB,CAApB,CAFoC,CAGpC;MAEA;;;MACAH,iBAAiB,CAAC;QAAEE,OAAO,EAAE,KAAX;QAAkBC,MAAlB;QAA0BC;MAA1B,CAAD,CAAjB;IACD,CAPD,CAVoB,CAAtB;IAmBA,OAAO,MAAM;MACXK,aAAa,CAACO,OAAd,CAAuBC,EAAD,IAAQA,EAAE,CAACC,MAAH,EAA9B;IACD,CAFD;EAGD,CAvBD,EAuBG,EAvBH;EAyBA,OAAOnB,cAAP;AACD,CA9BD;;eAgCeD,iB"}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _uikitUtils = require("@sendbird/uikit-utils");
11
+
12
+ var _useContext = require("../hooks/useContext");
13
+
14
+ const useMentionSuggestion = params => {
15
+ const {
16
+ text,
17
+ selection,
18
+ channel,
19
+ mentionedUsers
20
+ } = params;
21
+ const [freshChannel, setFreshChannel] = (0, _react.useState)(channel);
22
+ (0, _uikitUtils.useAsyncEffect)(async () => {
23
+ setFreshChannel(await channel.refresh());
24
+ }, [channel.url]);
25
+ const {
26
+ mentionManager,
27
+ currentUser
28
+ } = (0, _useContext.useSendbirdChat)();
29
+ const [members, setMembers] = (0, _react.useState)([]);
30
+ const timeoutRef = (0, _react.useRef)();
31
+ const searchStringRangeRef = (0, _react.useRef)({
32
+ start: 0,
33
+ end: 0
34
+ });
35
+ const searchLimitedRef = (0, _react.useRef)(false);
36
+
37
+ const updateSearchStringRange = (selectionIndex, searchString) => {
38
+ searchStringRangeRef.current = mentionManager.getSearchStringRangeInText(selectionIndex, searchString);
39
+ return searchStringRangeRef.current;
40
+ };
41
+
42
+ const updateSearchLimited = (mentionCount, mentionLimit) => {
43
+ searchLimitedRef.current = mentionCount >= mentionLimit;
44
+ return searchLimitedRef.current;
45
+ };
46
+
47
+ const resetRefs = () => {
48
+ searchLimitedRef.current = false;
49
+ searchStringRangeRef.current = {
50
+ start: 0,
51
+ end: 0
52
+ };
53
+ };
54
+
55
+ const fetchMembers = async () => {
56
+ resetRefs();
57
+ const selectionRanged = selection.start !== selection.end;
58
+ if (selectionRanged) return [];
59
+ const selectionContainsMentionedUser = mentionedUsers.some(it => mentionManager.rangeHelpers.overlaps(it.range, selection, 'underMore'));
60
+ if (selectionContainsMentionedUser) return [];
61
+ const {
62
+ isTriggered,
63
+ isValidSearchString,
64
+ searchString
65
+ } = mentionManager.getSearchString(text, selection.start);
66
+ if (!isTriggered() || !isValidSearchString()) return [];
67
+ const limited = updateSearchLimited(mentionedUsers.length, mentionManager.config.mentionLimit);
68
+ if (limited) return [];
69
+ updateSearchStringRange(selection.start, searchString);
70
+
71
+ if (freshChannel.isSuper) {
72
+ return freshChannel.createMemberListQuery({
73
+ nicknameStartsWithFilter: searchString,
74
+ limit: mentionManager.config.suggestionLimit + 1
75
+ }).next().then(members => members.filter(member => member.userId !== (currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId)));
76
+ } else {
77
+ return freshChannel.members.sort((a, b) => {
78
+ var _a$nickname;
79
+
80
+ return (_a$nickname = a.nickname) === null || _a$nickname === void 0 ? void 0 : _a$nickname.localeCompare(b.nickname);
81
+ }).filter(member => {
82
+ var _member$nickname;
83
+
84
+ return ((_member$nickname = member.nickname) === null || _member$nickname === void 0 ? void 0 : _member$nickname.toLowerCase().startsWith(searchString.toLowerCase())) && member.userId !== (currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId);
85
+ }).slice(0, mentionManager.config.suggestionLimit);
86
+ }
87
+ };
88
+
89
+ (0, _react.useEffect)(() => {
90
+ timeoutRef.current = setTimeout(async () => {
91
+ fetchMembers().then(setMembers).catch(() => setMembers([])).finally(() => timeoutRef.current = undefined);
92
+ }, mentionManager.config.debounceMills);
93
+ return () => {
94
+ if (timeoutRef.current) {
95
+ clearTimeout(timeoutRef.current);
96
+ timeoutRef.current = undefined;
97
+ }
98
+ };
99
+ }, [text, selection]);
100
+ return {
101
+ members,
102
+ reset: (0, _react.useCallback)(() => setMembers([]), []),
103
+ searchStringRange: searchStringRangeRef.current,
104
+ searchLimited: searchLimitedRef.current
105
+ };
106
+ };
107
+
108
+ var _default = useMentionSuggestion;
109
+ exports.default = _default;
110
+ //# sourceMappingURL=useMentionSuggestion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMentionSuggestion","params","text","selection","channel","mentionedUsers","freshChannel","setFreshChannel","useState","useAsyncEffect","refresh","url","mentionManager","currentUser","useSendbirdChat","members","setMembers","timeoutRef","useRef","searchStringRangeRef","start","end","searchLimitedRef","updateSearchStringRange","selectionIndex","searchString","current","getSearchStringRangeInText","updateSearchLimited","mentionCount","mentionLimit","resetRefs","fetchMembers","selectionRanged","selectionContainsMentionedUser","some","it","rangeHelpers","overlaps","range","isTriggered","isValidSearchString","getSearchString","limited","length","config","isSuper","createMemberListQuery","nicknameStartsWithFilter","limit","suggestionLimit","next","then","filter","member","userId","sort","a","b","nickname","localeCompare","toLowerCase","startsWith","slice","useEffect","setTimeout","catch","finally","undefined","debounceMills","clearTimeout","reset","useCallback","searchStringRange","searchLimited"],"sources":["useMentionSuggestion.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { SendbirdGroupChannel, SendbirdMember, SendbirdUser } from '@sendbird/uikit-utils';\nimport { useAsyncEffect } from '@sendbird/uikit-utils';\n\nimport { useSendbirdChat } from '../hooks/useContext';\nimport type { Range } from '../types';\n\nconst useMentionSuggestion = (params: {\n text: string;\n selection: Range;\n channel: SendbirdGroupChannel;\n mentionedUsers: { user: SendbirdUser; range: Range }[];\n}) => {\n const { text, selection, channel, mentionedUsers } = params;\n\n const [freshChannel, setFreshChannel] = useState(channel);\n\n useAsyncEffect(async () => {\n setFreshChannel(await channel.refresh());\n }, [channel.url]);\n\n const { mentionManager, currentUser } = useSendbirdChat();\n const [members, setMembers] = useState<SendbirdMember[]>([]);\n const timeoutRef = useRef<NodeJS.Timeout>();\n\n const searchStringRangeRef = useRef<Range>({ start: 0, end: 0 });\n const searchLimitedRef = useRef(false);\n\n const updateSearchStringRange = (selectionIndex: number, searchString: string) => {\n searchStringRangeRef.current = mentionManager.getSearchStringRangeInText(selectionIndex, searchString);\n return searchStringRangeRef.current;\n };\n const updateSearchLimited = (mentionCount: number, mentionLimit: number) => {\n searchLimitedRef.current = mentionCount >= mentionLimit;\n return searchLimitedRef.current;\n };\n const resetRefs = () => {\n searchLimitedRef.current = false;\n searchStringRangeRef.current = { start: 0, end: 0 };\n };\n\n const fetchMembers = async (): Promise<SendbirdMember[]> => {\n resetRefs();\n\n const selectionRanged = selection.start !== selection.end;\n if (selectionRanged) return [];\n\n const selectionContainsMentionedUser = mentionedUsers.some((it) =>\n mentionManager.rangeHelpers.overlaps(it.range, selection, 'underMore'),\n );\n if (selectionContainsMentionedUser) return [];\n\n const { isTriggered, isValidSearchString, searchString } = mentionManager.getSearchString(text, selection.start);\n if (!isTriggered() || !isValidSearchString()) return [];\n\n const limited = updateSearchLimited(mentionedUsers.length, mentionManager.config.mentionLimit);\n if (limited) return [];\n\n updateSearchStringRange(selection.start, searchString);\n\n if (freshChannel.isSuper) {\n return freshChannel\n .createMemberListQuery({\n nicknameStartsWithFilter: searchString,\n limit: mentionManager.config.suggestionLimit + 1,\n })\n .next()\n .then((members) => members.filter((member) => member.userId !== currentUser?.userId));\n } else {\n return freshChannel.members\n .sort((a, b) => a.nickname?.localeCompare(b.nickname))\n .filter(\n (member) =>\n member.nickname?.toLowerCase().startsWith(searchString.toLowerCase()) &&\n member.userId !== currentUser?.userId,\n )\n .slice(0, mentionManager.config.suggestionLimit);\n }\n };\n\n useEffect(() => {\n timeoutRef.current = setTimeout(async () => {\n fetchMembers()\n .then(setMembers)\n .catch(() => setMembers([]))\n .finally(() => (timeoutRef.current = undefined));\n }, mentionManager.config.debounceMills);\n\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n };\n }, [text, selection]);\n\n return {\n members,\n reset: useCallback(() => setMembers([]), []),\n searchStringRange: searchStringRangeRef.current,\n searchLimited: searchLimitedRef.current,\n };\n};\n\nexport default useMentionSuggestion;\n"],"mappings":";;;;;;;AAAA;;AAGA;;AAEA;;AAGA,MAAMA,oBAAoB,GAAIC,MAAD,IAKvB;EACJ,MAAM;IAAEC,IAAF;IAAQC,SAAR;IAAmBC,OAAnB;IAA4BC;EAA5B,IAA+CJ,MAArD;EAEA,MAAM,CAACK,YAAD,EAAeC,eAAf,IAAkC,IAAAC,eAAA,EAASJ,OAAT,CAAxC;EAEA,IAAAK,0BAAA,EAAe,YAAY;IACzBF,eAAe,CAAC,MAAMH,OAAO,CAACM,OAAR,EAAP,CAAf;EACD,CAFD,EAEG,CAACN,OAAO,CAACO,GAAT,CAFH;EAIA,MAAM;IAAEC,cAAF;IAAkBC;EAAlB,IAAkC,IAAAC,2BAAA,GAAxC;EACA,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,IAAAR,eAAA,E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iC,MAAf,CAAsBK,eAP3B,CAAP;IAQD;EACF,CArCD;;EAuCA,IAAAc,gBAAA,EAAU,MAAM;IACd/C,UAAU,CAACS,OAAX,GAAqBuC,UAAU,CAAC,YAAY;MAC1CjC,YAAY,GACToB,IADH,CACQpC,UADR,EAEGkD,KAFH,CAES,MAAMlD,UAAU,CAAC,EAAD,CAFzB,EAGGmD,OAHH,CAGW,MAAOlD,UAAU,CAACS,OAAX,GAAqB0C,SAHvC;IAID,CAL8B,EAK5BxD,cAAc,CAACiC,MAAf,CAAsBwB,aALM,CAA/B;IAOA,OAAO,MAAM;MACX,IAAIpD,UAAU,CAACS,OAAf,EAAwB;QACtB4C,YAAY,CAACrD,UAAU,CAACS,OAAZ,CAAZ;QACAT,UAAU,CAACS,OAAX,GAAqB0C,SAArB;MACD;IACF,CALD;EAMD,CAdD,EAcG,CAAClE,IAAD,EAAOC,SAAP,CAdH;EAgBA,OAAO;IACLY,OADK;IAELwD,KAAK,EAAE,IAAAC,kBAAA,EAAY,MAAMxD,UAAU,CAAC,EAAD,CAA5B,EAAkC,EAAlC,CAFF;IAGLyD,iBAAiB,EAAEtD,oBAAoB,CAACO,OAHnC;IAILgD,aAAa,EAAEpD,gBAAgB,CAACI;EAJ3B,CAAP;AAMD,CA/FD;;eAiGe1B,oB"}
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _uikitUtils = require("@sendbird/uikit-utils");
13
+
14
+ var _useContext = require("./useContext");
15
+
16
+ const useMentionTextInput = params => {
17
+ const {
18
+ mentionManager
19
+ } = (0, _useContext.useSendbirdChat)();
20
+ const mentionedUsersRef = (0, _react.useRef)([]);
21
+ const textInputRef = (0, _react.useRef)();
22
+ const [text, setText] = (0, _react.useState)('');
23
+ const [selection, setSelection] = (0, _react.useState)({
24
+ start: 0,
25
+ end: 0
26
+ }); // TODO: Refactor text edit logic more clearly
27
+
28
+ (0, _react.useEffect)(() => {
29
+ if (mentionManager.shouldUseMentionedMessageTemplate(params.messageToEdit)) {
30
+ const result = mentionManager.templateToTextAndMentionedUsers(params.messageToEdit.mentionedMessageTemplate, params.messageToEdit.mentionedUsers);
31
+ mentionedUsersRef.current = result.mentionedUsers;
32
+ setText(result.mentionedText);
33
+ } else {
34
+ var _params$messageToEdit;
35
+
36
+ mentionedUsersRef.current = [];
37
+
38
+ if ((_params$messageToEdit = params.messageToEdit) !== null && _params$messageToEdit !== void 0 && _params$messageToEdit.isUserMessage()) {
39
+ setText(params.messageToEdit.message);
40
+ }
41
+ }
42
+ }, [params.messageToEdit]);
43
+ const onChangeText = (0, _uikitUtils.useFreshCallback)((_nextText, addedMentionedUser) => {
44
+ const prevText = text;
45
+ let nextText = _nextText;
46
+ let offset = nextText.length - prevText.length; // Text clear
47
+
48
+ if (nextText === '') {
49
+ mentionedUsersRef.current = [];
50
+ } // Text add
51
+ else if (offset > 0) {
52
+ /** Add mentioned user **/
53
+ if (addedMentionedUser) mentionedUsersRef.current.push(addedMentionedUser);
54
+ /** Reconcile mentioned users range on the right side of the selection **/
55
+
56
+ mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(offset, selection.end, mentionedUsersRef.current);
57
+ } // Text remove
58
+ else if (offset < 0) {
59
+ // Ranged remove
60
+ if (selection.start !== selection.end) {
61
+ /** Filter mentioned users in selection range **/
62
+ const {
63
+ filtered,
64
+ lastSelection
65
+ } = mentionManager.removeMentionedUsersInSelection(selection, mentionedUsersRef.current);
66
+ /** Reconcile mentioned users range on the right side of the selection **/
67
+
68
+ mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(offset, Math.max(selection.end, lastSelection), filtered);
69
+ } // Single remove
70
+ else {
71
+ /** Find mentioned user who ranges in removed selection **/
72
+ const foundIndex = mentionedUsersRef.current.findIndex(it => mentionManager.rangeHelpers.overlaps(it.range, selection, 'underMore'));
73
+ /** If found, remove from the mentioned user list and remove remainder text **/
74
+
75
+ if (foundIndex > -1) {
76
+ const it = mentionedUsersRef.current[foundIndex];
77
+ const remainderLength = it.range.end - it.range.start + offset;
78
+ offset = -remainderLength + offset;
79
+ nextText = (0, _uikitUtils.replace)(nextText, it.range.start, it.range.start + remainderLength, '');
80
+ mentionedUsersRef.current.splice(foundIndex, 1);
81
+ }
82
+ /** Reconcile mentioned users range on the right side of the selection **/
83
+
84
+
85
+ mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(offset, selection.end, mentionedUsersRef.current);
86
+ }
87
+ }
88
+
89
+ setText(nextText);
90
+ });
91
+ return {
92
+ textInputRef,
93
+ selection,
94
+ onSelectionChange: (0, _uikitUtils.useFreshCallback)(e => {
95
+ const nativeSelection = { ...e.nativeEvent.selection
96
+ }; // NOTE: To synchronize call onSelectionChange after onChangeText called on each platform.
97
+
98
+ setTimeout(() => {
99
+ const mentionedUser = mentionedUsersRef.current.find(it => mentionManager.rangeHelpers.overlaps(it.range, nativeSelection)); // Selection should be blocked if changed into mentioned area
100
+
101
+ if (mentionedUser) {
102
+ var _textInputRef$current;
103
+
104
+ const selectionBlock = {
105
+ start: mentionedUser.range.start,
106
+ end: mentionedUser.range.end
107
+ };
108
+ (_textInputRef$current = textInputRef.current) === null || _textInputRef$current === void 0 ? void 0 : _textInputRef$current.setNativeProps({
109
+ selection: selectionBlock
110
+ }); // BUG: setNativeProps called again when invoked onChangeText
111
+ // https://github.com/facebook/react-native/issues/33520
112
+
113
+ if (_reactNative.Platform.OS === 'android') {
114
+ setTimeout(() => {
115
+ var _textInputRef$current2;
116
+
117
+ (_textInputRef$current2 = textInputRef.current) === null || _textInputRef$current2 === void 0 ? void 0 : _textInputRef$current2.setNativeProps({
118
+ selection: {
119
+ start: 0
120
+ }
121
+ });
122
+ }, 250);
123
+ }
124
+
125
+ setSelection(selectionBlock);
126
+ } else {
127
+ setSelection(nativeSelection);
128
+ }
129
+ }, 10);
130
+ }),
131
+ text,
132
+ onChangeText,
133
+ mentionedUsers: mentionedUsersRef.current
134
+ };
135
+ };
136
+
137
+ var _default = useMentionTextInput;
138
+ exports.default = _default;
139
+ //# sourceMappingURL=useMentionTextInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMentionTextInput","params","mentionManager","useSendbirdChat","mentionedUsersRef","useRef","textInputRef","text","setText","useState","selection","setSelection","start","end","useEffect","shouldUseMentionedMessageTemplate","messageToEdit","result","templateToTextAndMentionedUsers","mentionedMessageTemplate","mentionedUsers","current","mentionedText","isUserMessage","message","onChangeText","useFreshCallback","_nextText","addedMentionedUser","prevText","nextText","offset","length","push","reconcileRangeOfMentionedUsers","filtered","lastSelection","removeMentionedUsersInSelection","Math","max","foundIndex","findIndex","it","rangeHelpers","overlaps","range","remainderLength","replace","splice","onSelectionChange","e","nativeSelection","nativeEvent","setTimeout","mentionedUser","find","selectionBlock","setNativeProps","Platform","OS"],"sources":["useMentionTextInput.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport type { NativeSyntheticEvent, TextInput, TextInputSelectionChangeEventData } from 'react-native';\nimport { Platform } from 'react-native';\n\nimport { SendbirdFileMessage, SendbirdUserMessage, replace, useFreshCallback } from '@sendbird/uikit-utils';\n\nimport type { MentionedUser } from '../types';\nimport { useSendbirdChat } from './useContext';\n\nconst useMentionTextInput = (params: { messageToEdit?: SendbirdUserMessage | SendbirdFileMessage }) => {\n const { mentionManager } = useSendbirdChat();\n\n const mentionedUsersRef = useRef<MentionedUser[]>([]);\n const textInputRef = useRef<TextInput>();\n\n const [text, setText] = useState('');\n const [selection, setSelection] = useState({ start: 0, end: 0 });\n\n // TODO: Refactor text edit logic more clearly\n useEffect(() => {\n if (mentionManager.shouldUseMentionedMessageTemplate(params.messageToEdit)) {\n const result = mentionManager.templateToTextAndMentionedUsers(\n params.messageToEdit.mentionedMessageTemplate,\n params.messageToEdit.mentionedUsers,\n );\n\n mentionedUsersRef.current = result.mentionedUsers;\n setText(result.mentionedText);\n } else {\n mentionedUsersRef.current = [];\n if (params.messageToEdit?.isUserMessage()) {\n setText(params.messageToEdit.message);\n }\n }\n }, [params.messageToEdit]);\n\n const onChangeText = useFreshCallback((_nextText: string, addedMentionedUser?: MentionedUser) => {\n const prevText = text;\n let nextText = _nextText;\n let offset = nextText.length - prevText.length;\n\n // Text clear\n if (nextText === '') {\n mentionedUsersRef.current = [];\n }\n // Text add\n else if (offset > 0) {\n /** Add mentioned user **/\n if (addedMentionedUser) mentionedUsersRef.current.push(addedMentionedUser);\n\n /** Reconcile mentioned users range on the right side of the selection **/\n mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(\n offset,\n selection.end,\n mentionedUsersRef.current,\n );\n }\n // Text remove\n else if (offset < 0) {\n // Ranged remove\n if (selection.start !== selection.end) {\n /** Filter mentioned users in selection range **/\n const { filtered, lastSelection } = mentionManager.removeMentionedUsersInSelection(\n selection,\n mentionedUsersRef.current,\n );\n\n /** Reconcile mentioned users range on the right side of the selection **/\n mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(\n offset,\n Math.max(selection.end, lastSelection),\n filtered,\n );\n }\n // Single remove\n else {\n /** Find mentioned user who ranges in removed selection **/\n const foundIndex = mentionedUsersRef.current.findIndex((it) =>\n mentionManager.rangeHelpers.overlaps(it.range, selection, 'underMore'),\n );\n /** If found, remove from the mentioned user list and remove remainder text **/\n if (foundIndex > -1) {\n const it = mentionedUsersRef.current[foundIndex];\n const remainderLength = it.range.end - it.range.start + offset;\n\n offset = -remainderLength + offset;\n nextText = replace(nextText, it.range.start, it.range.start + remainderLength, '');\n\n mentionedUsersRef.current.splice(foundIndex, 1);\n }\n\n /** Reconcile mentioned users range on the right side of the selection **/\n mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(\n offset,\n selection.end,\n mentionedUsersRef.current,\n );\n }\n }\n\n setText(nextText);\n });\n\n return {\n textInputRef,\n selection,\n onSelectionChange: useFreshCallback((e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => {\n const nativeSelection = { ...e.nativeEvent.selection };\n\n // NOTE: To synchronize call onSelectionChange after onChangeText called on each platform.\n setTimeout(() => {\n const mentionedUser = mentionedUsersRef.current.find((it) =>\n mentionManager.rangeHelpers.overlaps(it.range, nativeSelection),\n );\n\n // Selection should be blocked if changed into mentioned area\n if (mentionedUser) {\n const selectionBlock = { start: mentionedUser.range.start, end: mentionedUser.range.end };\n textInputRef.current?.setNativeProps({ selection: selectionBlock });\n // BUG: setNativeProps called again when invoked onChangeText\n // https://github.com/facebook/react-native/issues/33520\n if (Platform.OS === 'android') {\n setTimeout(() => {\n textInputRef.current?.setNativeProps({ selection: { start: 0 } });\n }, 250);\n }\n setSelection(selectionBlock);\n } else {\n setSelection(nativeSelection);\n }\n }, 10);\n }),\n text,\n onChangeText,\n mentionedUsers: mentionedUsersRef.current,\n };\n};\n\nexport default useMentionTextInput;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AAGA;;AAEA,MAAMA,mBAAmB,GAAIC,MAAD,IAA2E;EACrG,MAAM;IAAEC;EAAF,IAAqB,IAAAC,2BAAA,GAA3B;EAEA,MAAMC,iBAAiB,GAAG,IAAAC,aAAA,EAAwB,EAAxB,CAA1B;EACA,MAAMC,YAAY,GAAG,IAAAD,aAAA,GAArB;EAEA,MAAM,CAACE,IAAD,EAAOC,OAAP,IAAkB,IAAAC,eAAA,EAAS,EAAT,CAAxB;EACA,MAAM,CAACC,SAAD,EAAYC,YAAZ,IAA4B,IAAAF,eAAA,EAAS;IAAEG,KAAK,EAAE,CAAT;IAAYC,GAAG,EAAE;EAAjB,CAAT,CAAlC,CAPqG,CASrG;;EACA,IAAAC,gBAAA,EAAU,MAAM;IACd,IAAIZ,cAAc,CAACa,iCAAf,CAAiDd,MAAM,CAACe,aAAxD,CAAJ,EAA4E;MAC1E,MAAMC,MAAM,GAAGf,cAAc,CAACgB,+BAAf,CACbjB,MAAM,CAACe,aAAP,CAAq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.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var _exportNames = {
7
7
  MessageRenderer: true,
8
+ ReactionAddons: true,
9
+ ReactionBottomSheets: true,
8
10
  ChannelCover: true,
9
11
  ChatFlatList: true,
10
12
  FileViewer: true,
@@ -26,6 +28,7 @@ var _exportNames = {
26
28
  createGroupChannelRegisterOperatorFragment: true,
27
29
  createGroupChannelMutedMembersFragment: true,
28
30
  createGroupChannelBannedUsersFragment: true,
31
+ createGroupChannelNotificationsFragment: true,
29
32
  SendbirdChatContext: true,
30
33
  SendbirdChatProvider: true,
31
34
  PlatformServiceContext: true,
@@ -36,10 +39,6 @@ var _exportNames = {
36
39
  LocalizationProvider: true,
37
40
  useConnection: true,
38
41
  usePushTokenRegistration: true,
39
- useLocalization: true,
40
- usePlatformService: true,
41
- useSendbirdChat: true,
42
- useUserProfile: true,
43
42
  StringSetEn: true,
44
43
  createBaseStringSet: true,
45
44
  createNativeFileService: true,
@@ -50,6 +49,10 @@ var _exportNames = {
50
49
  createExpoClipboardService: true,
51
50
  createExpoNotificationService: true,
52
51
  createExpoMediaService: true,
52
+ GroupChannelNotificationsProps: true,
53
+ GroupChannelNotificationsContextsType: true,
54
+ GroupChannelNotificationsFragment: true,
55
+ GroupChannelNotificationsModule: true,
53
56
  SendbirdUIKitContainer: true,
54
57
  SendbirdUIKit: true,
55
58
  SBUError: true
@@ -72,6 +75,30 @@ Object.defineProperty(exports, "FileViewer", {
72
75
  return _FileViewer.default;
73
76
  }
74
77
  });
78
+ Object.defineProperty(exports, "GroupChannelNotificationsContextsType", {
79
+ enumerable: true,
80
+ get: function () {
81
+ return _types.GroupChannelNotificationsContextsType;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "GroupChannelNotificationsFragment", {
85
+ enumerable: true,
86
+ get: function () {
87
+ return _types.GroupChannelNotificationsFragment;
88
+ }
89
+ });
90
+ Object.defineProperty(exports, "GroupChannelNotificationsModule", {
91
+ enumerable: true,
92
+ get: function () {
93
+ return _types.GroupChannelNotificationsModule;
94
+ }
95
+ });
96
+ Object.defineProperty(exports, "GroupChannelNotificationsProps", {
97
+ enumerable: true,
98
+ get: function () {
99
+ return _types.GroupChannelNotificationsProps;
100
+ }
101
+ });
75
102
  Object.defineProperty(exports, "LocalizationContext", {
76
103
  enumerable: true,
77
104
  get: function () {
@@ -114,6 +141,18 @@ Object.defineProperty(exports, "ProviderLayout", {
114
141
  return _ProviderLayout.default;
115
142
  }
116
143
  });
144
+ Object.defineProperty(exports, "ReactionAddons", {
145
+ enumerable: true,
146
+ get: function () {
147
+ return _ReactionAddons.ReactionAddons;
148
+ }
149
+ });
150
+ Object.defineProperty(exports, "ReactionBottomSheets", {
151
+ enumerable: true,
152
+ get: function () {
153
+ return _ReactionBottomSheets.ReactionBottomSheets;
154
+ }
155
+ });
117
156
  Object.defineProperty(exports, "SBUError", {
118
157
  enumerable: true,
119
158
  get: function () {
@@ -270,6 +309,12 @@ Object.defineProperty(exports, "createGroupChannelMutedMembersFragment", {
270
309
  return _createGroupChannelMutedMembersFragment.default;
271
310
  }
272
311
  });
312
+ Object.defineProperty(exports, "createGroupChannelNotificationsFragment", {
313
+ enumerable: true,
314
+ get: function () {
315
+ return _createGroupChannelNotificationsFragment.default;
316
+ }
317
+ });
273
318
  Object.defineProperty(exports, "createGroupChannelOperatorsFragment", {
274
319
  enumerable: true,
275
320
  get: function () {
@@ -318,36 +363,12 @@ Object.defineProperty(exports, "useConnection", {
318
363
  return _useConnection.default;
319
364
  }
320
365
  });
321
- Object.defineProperty(exports, "useLocalization", {
322
- enumerable: true,
323
- get: function () {
324
- return _useContext.useLocalization;
325
- }
326
- });
327
- Object.defineProperty(exports, "usePlatformService", {
328
- enumerable: true,
329
- get: function () {
330
- return _useContext.usePlatformService;
331
- }
332
- });
333
366
  Object.defineProperty(exports, "usePushTokenRegistration", {
334
367
  enumerable: true,
335
368
  get: function () {
336
369
  return _usePushTokenRegistration.default;
337
370
  }
338
371
  });
339
- Object.defineProperty(exports, "useSendbirdChat", {
340
- enumerable: true,
341
- get: function () {
342
- return _useContext.useSendbirdChat;
343
- }
344
- });
345
- Object.defineProperty(exports, "useUserProfile", {
346
- enumerable: true,
347
- get: function () {
348
- return _useContext.useUserProfile;
349
- }
350
- });
351
372
 
352
373
  var _reactNative = require("react-native");
353
374
 
@@ -355,6 +376,10 @@ var _uikitUtils = require("@sendbird/uikit-utils");
355
376
 
356
377
  var _MessageRenderer = _interopRequireDefault(require("./components/MessageRenderer"));
357
378
 
379
+ var _ReactionAddons = require("./components/ReactionAddons");
380
+
381
+ var _ReactionBottomSheets = require("./components/ReactionBottomSheets");
382
+
358
383
  var _ChannelCover = _interopRequireDefault(require("./components/ChannelCover"));
359
384
 
360
385
  var _ChatFlatList = _interopRequireDefault(require("./components/ChatFlatList"));
@@ -397,6 +422,8 @@ var _createGroupChannelMutedMembersFragment = _interopRequireDefault(require("./
397
422
 
398
423
  var _createGroupChannelBannedUsersFragment = _interopRequireDefault(require("./fragments/createGroupChannelBannedUsersFragment"));
399
424
 
425
+ var _createGroupChannelNotificationsFragment = _interopRequireDefault(require("./fragments/createGroupChannelNotificationsFragment"));
426
+
400
427
  var _SendbirdChatCtx = require("./contexts/SendbirdChatCtx");
401
428
 
402
429
  var _PlatformServiceCtx = require("./contexts/PlatformServiceCtx");
@@ -411,6 +438,18 @@ var _usePushTokenRegistration = _interopRequireDefault(require("./hooks/usePushT
411
438
 
412
439
  var _useContext = require("./hooks/useContext");
413
440
 
441
+ Object.keys(_useContext).forEach(function (key) {
442
+ if (key === "default" || key === "__esModule") return;
443
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
444
+ if (key in exports && exports[key] === _useContext[key]) return;
445
+ Object.defineProperty(exports, key, {
446
+ enumerable: true,
447
+ get: function () {
448
+ return _useContext[key];
449
+ }
450
+ });
451
+ });
452
+
414
453
  var _StringSet = _interopRequireDefault(require("./localization/StringSet.en"));
415
454
 
416
455
  var _StringSet2 = require("./localization/StringSet.type");
@@ -473,30 +512,46 @@ Object.keys(_groupChannelList).forEach(function (key) {
473
512
  });
474
513
  });
475
514
 
476
- var _userList = require("./domain/userList");
515
+ var _groupChannelNotifications = require("./domain/groupChannelNotifications");
477
516
 
478
- Object.keys(_userList).forEach(function (key) {
517
+ Object.keys(_groupChannelNotifications).forEach(function (key) {
479
518
  if (key === "default" || key === "__esModule") return;
480
519
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
481
- if (key in exports && exports[key] === _userList[key]) return;
520
+ if (key in exports && exports[key] === _groupChannelNotifications[key]) return;
482
521
  Object.defineProperty(exports, key, {
483
522
  enumerable: true,
484
523
  get: function () {
485
- return _userList[key];
524
+ return _groupChannelNotifications[key];
525
+ }
526
+ });
527
+ });
528
+
529
+ var _types = require("./domain/groupChannelNotifications/types");
530
+
531
+ var _types2 = require("./domain/groupChannelUserList/types");
532
+
533
+ Object.keys(_types2).forEach(function (key) {
534
+ if (key === "default" || key === "__esModule") return;
535
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
536
+ if (key in exports && exports[key] === _types2[key]) return;
537
+ Object.defineProperty(exports, key, {
538
+ enumerable: true,
539
+ get: function () {
540
+ return _types2[key];
486
541
  }
487
542
  });
488
543
  });
489
544
 
490
- var _types = require("./domain/groupChannelUserList/types");
545
+ var _userList = require("./domain/userList");
491
546
 
492
- Object.keys(_types).forEach(function (key) {
547
+ Object.keys(_userList).forEach(function (key) {
493
548
  if (key === "default" || key === "__esModule") return;
494
549
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
495
- if (key in exports && exports[key] === _types[key]) return;
550
+ if (key in exports && exports[key] === _userList[key]) return;
496
551
  Object.defineProperty(exports, key, {
497
552
  enumerable: true,
498
553
  get: function () {
499
- return _types[key];
554
+ return _userList[key];
500
555
  }
501
556
  });
502
557
  });
@@ -505,16 +560,16 @@ var _SendbirdUIKitContainer = _interopRequireWildcard(require("./containers/Send
505
560
 
506
561
  var _SBUError = _interopRequireDefault(require("./libs/SBUError"));
507
562
 
508
- var _types2 = require("./types");
563
+ var _types3 = require("./types");
509
564
 
510
- Object.keys(_types2).forEach(function (key) {
565
+ Object.keys(_types3).forEach(function (key) {
511
566
  if (key === "default" || key === "__esModule") return;
512
567
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
513
- if (key in exports && exports[key] === _types2[key]) return;
568
+ if (key in exports && exports[key] === _types3[key]) return;
514
569
  Object.defineProperty(exports, key, {
515
570
  enumerable: true,
516
571
  get: function () {
517
- return _types2[key];
572
+ return _types3[key];
518
573
  }
519
574
  });
520
575
  });