@sendbird/uikit-react-native 3.1.1 → 3.2.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 (327) hide show
  1. package/README.md +67 -42
  2. package/lib/commonjs/components/ChannelInput/MessageToReplyPreview.js +145 -0
  3. package/lib/commonjs/components/ChannelInput/MessageToReplyPreview.js.map +1 -0
  4. package/lib/commonjs/components/ChannelInput/SendInput.js +147 -312
  5. package/lib/commonjs/components/ChannelInput/SendInput.js.map +1 -1
  6. package/lib/commonjs/components/ChannelInput/VoiceMessageInput.js +238 -0
  7. package/lib/commonjs/components/ChannelInput/VoiceMessageInput.js.map +1 -0
  8. package/lib/commonjs/components/ChannelInput/index.js +5 -1
  9. package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
  10. package/lib/commonjs/components/ChannelMessageList/index.js +1 -1
  11. package/lib/commonjs/components/ChannelMessageList/index.js.map +1 -1
  12. package/lib/commonjs/components/ChatFlatList/index.js +15 -3
  13. package/lib/commonjs/components/ChatFlatList/index.js.map +1 -1
  14. package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js +24 -13
  15. package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js.map +1 -1
  16. package/lib/commonjs/components/GroupChannelMessageRenderer/index.js +100 -5
  17. package/lib/commonjs/components/GroupChannelMessageRenderer/index.js.map +1 -1
  18. package/lib/commonjs/components/MessageSearchResultItem.js +1 -0
  19. package/lib/commonjs/components/MessageSearchResultItem.js.map +1 -1
  20. package/lib/commonjs/components/OpenChannelMessageRenderer/index.js +1 -0
  21. package/lib/commonjs/components/OpenChannelMessageRenderer/index.js.map +1 -1
  22. package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +2 -2
  23. package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
  24. package/lib/commonjs/components/ReactionBottomSheets/index.js.map +1 -1
  25. package/lib/commonjs/components/StatusComposition.js.map +1 -1
  26. package/lib/commonjs/constants.js +5 -1
  27. package/lib/commonjs/constants.js.map +1 -1
  28. package/lib/commonjs/containers/GroupChannelPreviewContainer.js +1 -0
  29. package/lib/commonjs/containers/GroupChannelPreviewContainer.js.map +1 -1
  30. package/lib/commonjs/containers/InternalErrorBoundaryContainer.js.map +1 -1
  31. package/lib/commonjs/containers/SendbirdUIKitContainer.js +84 -34
  32. package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -1
  33. package/lib/commonjs/contexts/PlatformServiceCtx.js +16 -12
  34. package/lib/commonjs/contexts/PlatformServiceCtx.js.map +1 -1
  35. package/lib/commonjs/contexts/ReactionCtx.js +3 -2
  36. package/lib/commonjs/contexts/ReactionCtx.js.map +1 -1
  37. package/lib/commonjs/contexts/SendbirdChatCtx.js +2 -0
  38. package/lib/commonjs/contexts/SendbirdChatCtx.js.map +1 -1
  39. package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +27 -42
  40. package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
  41. package/lib/commonjs/domain/groupChannel/module/moduleContext.js +109 -5
  42. package/lib/commonjs/domain/groupChannel/module/moduleContext.js.map +1 -1
  43. package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
  44. package/lib/commonjs/domain/userList/types.js.map +1 -1
  45. package/lib/commonjs/fragments/createGroupChannelFragment.js +30 -4
  46. package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
  47. package/lib/commonjs/fragments/createMessageSearchFragment.js +1 -1
  48. package/lib/commonjs/fragments/createMessageSearchFragment.js.map +1 -1
  49. package/lib/commonjs/hooks/useChannelInputItems.js +211 -0
  50. package/lib/commonjs/hooks/useChannelInputItems.js.map +1 -0
  51. package/lib/commonjs/hooks/useConnection.js +1 -1
  52. package/lib/commonjs/hooks/useConnection.js.map +1 -1
  53. package/lib/commonjs/hooks/useMentionSuggestion.js +1 -1
  54. package/lib/commonjs/hooks/useMentionSuggestion.js.map +1 -1
  55. package/lib/commonjs/hooks/useVoiceMessageInput.js +207 -0
  56. package/lib/commonjs/hooks/useVoiceMessageInput.js.map +1 -0
  57. package/lib/commonjs/index.js +32 -0
  58. package/lib/commonjs/index.js.map +1 -1
  59. package/lib/commonjs/libs/MentionManager.js.map +1 -1
  60. package/lib/commonjs/libs/SBUUtils.js +4 -0
  61. package/lib/commonjs/libs/SBUUtils.js.map +1 -1
  62. package/lib/commonjs/libs/VoiceMessageConfig.js +30 -0
  63. package/lib/commonjs/libs/VoiceMessageConfig.js.map +1 -0
  64. package/lib/commonjs/localization/StringSet.type.js.map +1 -1
  65. package/lib/commonjs/localization/createBaseStringSet.js +24 -9
  66. package/lib/commonjs/localization/createBaseStringSet.js.map +1 -1
  67. package/lib/commonjs/platform/createFileService.expo.js +10 -0
  68. package/lib/commonjs/platform/createFileService.expo.js.map +1 -1
  69. package/lib/commonjs/platform/createFileService.native.js +19 -0
  70. package/lib/commonjs/platform/createFileService.native.js.map +1 -1
  71. package/lib/commonjs/platform/createPlayerService.expo.js +137 -0
  72. package/lib/commonjs/platform/createPlayerService.expo.js.map +1 -0
  73. package/lib/commonjs/platform/createPlayerService.native.js +139 -0
  74. package/lib/commonjs/platform/createPlayerService.native.js.map +1 -0
  75. package/lib/commonjs/platform/createRecorderService.expo.js +158 -0
  76. package/lib/commonjs/platform/createRecorderService.expo.js.map +1 -0
  77. package/lib/commonjs/platform/createRecorderService.native.js +157 -0
  78. package/lib/commonjs/platform/createRecorderService.native.js.map +1 -0
  79. package/lib/commonjs/platform/types.js.map +1 -1
  80. package/lib/commonjs/types.js.map +1 -1
  81. package/lib/commonjs/version.js +1 -1
  82. package/lib/commonjs/version.js.map +1 -1
  83. package/lib/module/components/ChannelInput/MessageToReplyPreview.js +137 -0
  84. package/lib/module/components/ChannelInput/MessageToReplyPreview.js.map +1 -0
  85. package/lib/module/components/ChannelInput/SendInput.js +149 -314
  86. package/lib/module/components/ChannelInput/SendInput.js.map +1 -1
  87. package/lib/module/components/ChannelInput/VoiceMessageInput.js +228 -0
  88. package/lib/module/components/ChannelInput/VoiceMessageInput.js.map +1 -0
  89. package/lib/module/components/ChannelInput/index.js +5 -1
  90. package/lib/module/components/ChannelInput/index.js.map +1 -1
  91. package/lib/module/components/ChannelMessageList/index.js +2 -2
  92. package/lib/module/components/ChannelMessageList/index.js.map +1 -1
  93. package/lib/module/components/ChatFlatList/index.js +15 -3
  94. package/lib/module/components/ChatFlatList/index.js.map +1 -1
  95. package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js +24 -13
  96. package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js.map +1 -1
  97. package/lib/module/components/GroupChannelMessageRenderer/index.js +99 -6
  98. package/lib/module/components/GroupChannelMessageRenderer/index.js.map +1 -1
  99. package/lib/module/components/MessageSearchResultItem.js +2 -1
  100. package/lib/module/components/MessageSearchResultItem.js.map +1 -1
  101. package/lib/module/components/OpenChannelMessageRenderer/index.js +1 -0
  102. package/lib/module/components/OpenChannelMessageRenderer/index.js.map +1 -1
  103. package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +2 -2
  104. package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
  105. package/lib/module/components/ReactionBottomSheets/index.js.map +1 -1
  106. package/lib/module/components/StatusComposition.js.map +1 -1
  107. package/lib/module/constants.js +2 -0
  108. package/lib/module/constants.js.map +1 -1
  109. package/lib/module/containers/GroupChannelPreviewContainer.js +2 -1
  110. package/lib/module/containers/GroupChannelPreviewContainer.js.map +1 -1
  111. package/lib/module/containers/InternalErrorBoundaryContainer.js.map +1 -1
  112. package/lib/module/containers/SendbirdUIKitContainer.js +86 -36
  113. package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -1
  114. package/lib/module/contexts/PlatformServiceCtx.js +14 -11
  115. package/lib/module/contexts/PlatformServiceCtx.js.map +1 -1
  116. package/lib/module/contexts/ReactionCtx.js +3 -2
  117. package/lib/module/contexts/ReactionCtx.js.map +1 -1
  118. package/lib/module/contexts/SendbirdChatCtx.js +2 -0
  119. package/lib/module/contexts/SendbirdChatCtx.js.map +1 -1
  120. package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +28 -43
  121. package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
  122. package/lib/module/domain/groupChannel/module/moduleContext.js +111 -7
  123. package/lib/module/domain/groupChannel/module/moduleContext.js.map +1 -1
  124. package/lib/module/domain/groupChannel/types.js.map +1 -1
  125. package/lib/module/domain/userList/types.js.map +1 -1
  126. package/lib/module/fragments/createGroupChannelFragment.js +32 -6
  127. package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
  128. package/lib/module/fragments/createMessageSearchFragment.js +1 -1
  129. package/lib/module/fragments/createMessageSearchFragment.js.map +1 -1
  130. package/lib/module/hooks/useChannelInputItems.js +203 -0
  131. package/lib/module/hooks/useChannelInputItems.js.map +1 -0
  132. package/lib/module/hooks/useConnection.js +1 -1
  133. package/lib/module/hooks/useConnection.js.map +1 -1
  134. package/lib/module/hooks/useMentionSuggestion.js +1 -1
  135. package/lib/module/hooks/useMentionSuggestion.js.map +1 -1
  136. package/lib/module/hooks/useVoiceMessageInput.js +199 -0
  137. package/lib/module/hooks/useVoiceMessageInput.js.map +1 -0
  138. package/lib/module/index.js +4 -0
  139. package/lib/module/index.js.map +1 -1
  140. package/lib/module/libs/MentionManager.js.map +1 -1
  141. package/lib/module/libs/SBUUtils.js +4 -0
  142. package/lib/module/libs/SBUUtils.js.map +1 -1
  143. package/lib/module/libs/VoiceMessageConfig.js +23 -0
  144. package/lib/module/libs/VoiceMessageConfig.js.map +1 -0
  145. package/lib/module/localization/StringSet.type.js.map +1 -1
  146. package/lib/module/localization/createBaseStringSet.js +25 -10
  147. package/lib/module/localization/createBaseStringSet.js.map +1 -1
  148. package/lib/module/platform/createFileService.expo.js +10 -0
  149. package/lib/module/platform/createFileService.expo.js.map +1 -1
  150. package/lib/module/platform/createFileService.native.js +19 -0
  151. package/lib/module/platform/createFileService.native.js.map +1 -1
  152. package/lib/module/platform/createPlayerService.expo.js +129 -0
  153. package/lib/module/platform/createPlayerService.expo.js.map +1 -0
  154. package/lib/module/platform/createPlayerService.native.js +132 -0
  155. package/lib/module/platform/createPlayerService.native.js.map +1 -0
  156. package/lib/module/platform/createRecorderService.expo.js +150 -0
  157. package/lib/module/platform/createRecorderService.expo.js.map +1 -0
  158. package/lib/module/platform/createRecorderService.native.js +149 -0
  159. package/lib/module/platform/createRecorderService.native.js.map +1 -0
  160. package/lib/module/platform/types.js.map +1 -1
  161. package/lib/module/types.js.map +1 -1
  162. package/lib/module/version.js +1 -1
  163. package/lib/module/version.js.map +1 -1
  164. package/lib/typescript/src/components/ChannelCover.d.ts +2 -1
  165. package/lib/typescript/src/components/ChannelInput/AttachmentsButton.d.ts +2 -1
  166. package/lib/typescript/src/components/ChannelInput/MessageToReplyPreview.d.ts +7 -0
  167. package/lib/typescript/src/components/ChannelInput/VoiceMessageInput.d.ts +11 -0
  168. package/lib/typescript/src/components/ChannelInput/index.d.ts +7 -3
  169. package/lib/typescript/src/components/ChannelMessageList/index.d.ts +1 -1
  170. package/lib/typescript/src/components/FileViewer.d.ts +2 -1
  171. package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.d.ts +2 -1
  172. package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageFocusAnimation.d.ts +1 -1
  173. package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.d.ts +1 -1
  174. package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.d.ts +4 -2
  175. package/lib/typescript/src/components/NewMessagesButton.d.ts +1 -1
  176. package/lib/typescript/src/components/OpenChannelMessageRenderer/OpenChannelMessageDateSeparator.d.ts +2 -1
  177. package/lib/typescript/src/components/ProviderLayout.d.ts +1 -1
  178. package/lib/typescript/src/components/ReactionAddons/BottomSheetReactionAddon.d.ts +2 -1
  179. package/lib/typescript/src/components/ReactionAddons/MessageReactionAddon.d.ts +2 -1
  180. package/lib/typescript/src/components/ReactionAddons/ReactionRoundedButton.d.ts +3 -2
  181. package/lib/typescript/src/components/ReactionAddons/index.d.ts +3 -2
  182. package/lib/typescript/src/components/ReactionBottomSheets/ReactionListBottomSheet.d.ts +2 -1
  183. package/lib/typescript/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.d.ts +2 -1
  184. package/lib/typescript/src/components/ReactionBottomSheets/index.d.ts +4 -4
  185. package/lib/typescript/src/components/ScrollToBottomButton.d.ts +1 -1
  186. package/lib/typescript/src/components/StatusComposition.d.ts +4 -4
  187. package/lib/typescript/src/components/TypedPlaceholder.d.ts +2 -1
  188. package/lib/typescript/src/components/UserActionBar.d.ts +2 -1
  189. package/lib/typescript/src/components/UserSelectableBar.d.ts +2 -1
  190. package/lib/typescript/src/constants.d.ts +2 -0
  191. package/lib/typescript/src/containers/GroupChannelPreviewContainer.d.ts +2 -1
  192. package/lib/typescript/src/containers/InternalErrorBoundaryContainer.d.ts +3 -3
  193. package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +18 -6
  194. package/lib/typescript/src/contexts/LocalizationCtx.d.ts +1 -1
  195. package/lib/typescript/src/contexts/PlatformServiceCtx.d.ts +8 -8
  196. package/lib/typescript/src/contexts/ReactionCtx.d.ts +5 -2
  197. package/lib/typescript/src/contexts/SendbirdChatCtx.d.ts +6 -3
  198. package/lib/typescript/src/contexts/UserProfileCtx.d.ts +1 -1
  199. package/lib/typescript/src/domain/groupChannel/component/GroupChannelHeader.d.ts +2 -1
  200. package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput.d.ts +1 -1
  201. package/lib/typescript/src/domain/groupChannel/component/GroupChannelMessageList.d.ts +1 -1
  202. package/lib/typescript/src/domain/groupChannel/component/GroupChannelStatusEmpty.d.ts +2 -1
  203. package/lib/typescript/src/domain/groupChannel/component/GroupChannelStatusLoading.d.ts +2 -1
  204. package/lib/typescript/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.d.ts +2 -1
  205. package/lib/typescript/src/domain/groupChannel/types.d.ts +45 -0
  206. package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersHeader.d.ts +2 -1
  207. package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.d.ts +2 -1
  208. package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersStatusEmpty.d.ts +2 -1
  209. package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersStatusLoading.d.ts +2 -1
  210. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListHeader.d.ts +2 -1
  211. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListList.d.ts +2 -1
  212. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListStatusEmpty.d.ts +2 -1
  213. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListStatusLoading.d.ts +2 -1
  214. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListTypeSelector.d.ts +2 -1
  215. package/lib/typescript/src/domain/groupChannelModeration/component/GroupChannelModerationHeader.d.ts +2 -1
  216. package/lib/typescript/src/domain/groupChannelModeration/component/GroupChannelModerationMenu.d.ts +2 -1
  217. package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersHeader.d.ts +2 -1
  218. package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.d.ts +2 -1
  219. package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersStatusEmpty.d.ts +2 -1
  220. package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersStatusLoading.d.ts +2 -1
  221. package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.d.ts +2 -1
  222. package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsView.d.ts +2 -1
  223. package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsHeader.d.ts +2 -1
  224. package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsList.d.ts +2 -1
  225. package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsStatusEmpty.d.ts +2 -1
  226. package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsStatusLoading.d.ts +2 -1
  227. package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsHeader.d.ts +2 -1
  228. package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsInfo.d.ts +2 -1
  229. package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.d.ts +2 -1
  230. package/lib/typescript/src/domain/messageSearch/component/MessageSearchHeader.d.ts +2 -1
  231. package/lib/typescript/src/domain/messageSearch/component/MessageSearchList.d.ts +2 -1
  232. package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusEmpty.d.ts +2 -1
  233. package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusLoading.d.ts +2 -1
  234. package/lib/typescript/src/domain/openChannel/component/OpenChannelHeader.d.ts +2 -2
  235. package/lib/typescript/src/domain/openChannel/component/OpenChannelInput.d.ts +1 -1
  236. package/lib/typescript/src/domain/openChannel/component/OpenChannelMessageList.d.ts +1 -1
  237. package/lib/typescript/src/domain/openChannel/component/OpenChannelStatusEmpty.d.ts +2 -1
  238. package/lib/typescript/src/domain/openChannel/component/OpenChannelStatusLoading.d.ts +2 -1
  239. package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersHeader.d.ts +2 -1
  240. package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersList.d.ts +2 -1
  241. package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersStatusEmpty.d.ts +2 -1
  242. package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersStatusLoading.d.ts +2 -1
  243. package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateHeader.d.ts +2 -1
  244. package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateProfileInput.d.ts +2 -1
  245. package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateStatusLoading.d.ts +2 -1
  246. package/lib/typescript/src/domain/openChannelList/component/OpenChannelListHeader.d.ts +2 -1
  247. package/lib/typescript/src/domain/openChannelList/component/OpenChannelListList.d.ts +2 -1
  248. package/lib/typescript/src/domain/openChannelList/component/OpenChannelListStatusEmpty.d.ts +2 -1
  249. package/lib/typescript/src/domain/openChannelList/component/OpenChannelListStatusLoading.d.ts +2 -1
  250. package/lib/typescript/src/domain/openChannelModeration/component/OpenChannelModerationHeader.d.ts +2 -1
  251. package/lib/typescript/src/domain/openChannelModeration/component/OpenChannelModerationMenu.d.ts +2 -1
  252. package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsHeader.d.ts +2 -1
  253. package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsList.d.ts +2 -1
  254. package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsStatusEmpty.d.ts +2 -1
  255. package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsStatusLoading.d.ts +2 -1
  256. package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsHeader.d.ts +2 -1
  257. package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsList.d.ts +2 -1
  258. package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsStatusEmpty.d.ts +2 -1
  259. package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsStatusLoading.d.ts +2 -1
  260. package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsHeader.d.ts +2 -1
  261. package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsInfo.d.ts +2 -1
  262. package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsMenu.d.ts +2 -1
  263. package/lib/typescript/src/domain/userList/component/UserListHeader.d.ts +3 -3
  264. package/lib/typescript/src/domain/userList/component/UserListList.d.ts +1 -1
  265. package/lib/typescript/src/domain/userList/component/UserListStatusEmpty.d.ts +2 -1
  266. package/lib/typescript/src/domain/userList/component/UserListStatusLoading.d.ts +2 -1
  267. package/lib/typescript/src/domain/userList/types.d.ts +2 -2
  268. package/lib/typescript/src/hooks/useChannelInputItems.d.ts +10 -0
  269. package/lib/typescript/src/hooks/useVoiceMessageInput.d.ts +53 -0
  270. package/lib/typescript/src/index.d.ts +4 -0
  271. package/lib/typescript/src/libs/MentionManager.d.ts +2 -1
  272. package/lib/typescript/src/libs/SBUUtils.d.ts +1 -0
  273. package/lib/typescript/src/libs/VoiceMessageConfig.d.ts +25 -0
  274. package/lib/typescript/src/localization/StringSet.type.d.ts +7 -0
  275. package/lib/typescript/src/platform/createPlayerService.expo.d.ts +7 -0
  276. package/lib/typescript/src/platform/createPlayerService.native.d.ts +9 -0
  277. package/lib/typescript/src/platform/createRecorderService.expo.d.ts +7 -0
  278. package/lib/typescript/src/platform/createRecorderService.native.d.ts +9 -0
  279. package/lib/typescript/src/platform/types.d.ts +100 -1
  280. package/lib/typescript/src/types.d.ts +1 -1
  281. package/lib/typescript/src/version.d.ts +1 -1
  282. package/package.json +9 -11
  283. package/src/components/ChannelInput/MessageToReplyPreview.tsx +133 -0
  284. package/src/components/ChannelInput/SendInput.tsx +129 -320
  285. package/src/components/ChannelInput/VoiceMessageInput.tsx +206 -0
  286. package/src/components/ChannelInput/index.tsx +12 -4
  287. package/src/components/ChannelMessageList/index.tsx +3 -1
  288. package/src/components/ChatFlatList/index.tsx +14 -3
  289. package/src/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.tsx +24 -11
  290. package/src/components/GroupChannelMessageRenderer/index.tsx +80 -3
  291. package/src/components/MessageSearchResultItem.tsx +2 -1
  292. package/src/components/OpenChannelMessageRenderer/index.tsx +1 -0
  293. package/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.tsx +2 -2
  294. package/src/components/ReactionBottomSheets/index.tsx +3 -2
  295. package/src/components/StatusComposition.tsx +3 -3
  296. package/src/constants.ts +2 -0
  297. package/src/containers/GroupChannelPreviewContainer.tsx +2 -0
  298. package/src/containers/InternalErrorBoundaryContainer.tsx +1 -1
  299. package/src/containers/SendbirdUIKitContainer.tsx +105 -54
  300. package/src/contexts/PlatformServiceCtx.tsx +22 -20
  301. package/src/contexts/ReactionCtx.tsx +7 -5
  302. package/src/contexts/SendbirdChatCtx.tsx +10 -2
  303. package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +29 -43
  304. package/src/domain/groupChannel/module/moduleContext.tsx +119 -7
  305. package/src/domain/groupChannel/types.ts +41 -0
  306. package/src/domain/userList/types.ts +2 -2
  307. package/src/fragments/createGroupChannelFragment.tsx +32 -5
  308. package/src/fragments/createMessageSearchFragment.tsx +1 -1
  309. package/src/hooks/useChannelInputItems.ts +215 -0
  310. package/src/hooks/useConnection.ts +1 -1
  311. package/src/hooks/useMentionSuggestion.ts +2 -1
  312. package/src/hooks/useVoiceMessageInput.ts +237 -0
  313. package/src/index.ts +4 -0
  314. package/src/libs/MentionManager.tsx +1 -1
  315. package/src/libs/SBUUtils.ts +5 -0
  316. package/src/libs/VoiceMessageConfig.ts +28 -0
  317. package/src/localization/StringSet.type.ts +8 -0
  318. package/src/localization/createBaseStringSet.ts +27 -11
  319. package/src/platform/createFileService.expo.ts +10 -0
  320. package/src/platform/createFileService.native.ts +19 -0
  321. package/src/platform/createPlayerService.expo.tsx +142 -0
  322. package/src/platform/createPlayerService.native.tsx +148 -0
  323. package/src/platform/createRecorderService.expo.tsx +160 -0
  324. package/src/platform/createRecorderService.native.tsx +170 -0
  325. package/src/platform/types.ts +114 -1
  326. package/src/types.ts +1 -1
  327. package/src/version.ts +1 -1
@@ -23,6 +23,7 @@ var _ImageCompressionConfig = _interopRequireDefault(require("../libs/ImageCompr
23
23
  var _InternalLocalCacheStorage = _interopRequireDefault(require("../libs/InternalLocalCacheStorage"));
24
24
  var _MentionConfig = _interopRequireDefault(require("../libs/MentionConfig"));
25
25
  var _MentionManager = _interopRequireDefault(require("../libs/MentionManager"));
26
+ var _VoiceMessageConfig = _interopRequireDefault(require("../libs/VoiceMessageConfig"));
26
27
  var _StringSet = _interopRequireDefault(require("../localization/StringSet.en"));
27
28
  var _dynamicModule = _interopRequireDefault(require("../platform/dynamicModule"));
28
29
  var _version = _interopRequireDefault(require("../version"));
@@ -30,6 +31,7 @@ var _InternalErrorBoundaryContainer = _interopRequireDefault(require("./Internal
30
31
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
32
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
32
33
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
34
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
33
35
  const NetInfo = _dynamicModule.default.get('@react-native-community/netinfo', 'warn');
34
36
  const SendbirdUIKit = Object.freeze({
35
37
  VERSION: _version.default,
@@ -41,8 +43,16 @@ const SendbirdUIKit = Object.freeze({
41
43
  }
42
44
  });
43
45
  exports.SendbirdUIKit = SendbirdUIKit;
44
- const SendbirdUIKitContainer = _ref => {
45
- let {
46
+ const chatOmitKeys = ['appId', 'newInstance', 'modules', 'debugMode', 'appVersion', 'localCacheEnabled', 'useAsyncStorageStore'];
47
+ function sanitizeChatOptions(chatOptions) {
48
+ const opts = {
49
+ ...chatOptions
50
+ };
51
+ chatOmitKeys.forEach(key => delete opts[key]);
52
+ return opts;
53
+ }
54
+ const SendbirdUIKitContainer = props => {
55
+ const {
46
56
  children,
47
57
  appId,
48
58
  chatOptions,
@@ -53,9 +63,8 @@ const SendbirdUIKitContainer = _ref => {
53
63
  errorBoundary,
54
64
  toast,
55
65
  userProfile,
56
- userMention,
57
- imageCompression
58
- } = _ref;
66
+ reaction
67
+ } = props;
59
68
  if (!chatOptions.localCacheStorage) {
60
69
  throw new Error('SendbirdUIKitContainer: chatOptions.localCacheStorage is required');
61
70
  }
@@ -64,31 +73,26 @@ const SendbirdUIKitContainer = _ref => {
64
73
  const unsubscribes = (0, _react.useRef)([]);
65
74
  const [internalStorage] = (0, _react.useState)(() => new _InternalLocalCacheStorage.default(chatOptions.localCacheStorage));
66
75
  const [sdkInstance, setSdkInstance] = (0, _react.useState)(() => {
67
- const sendbird = initializeSendbird(appId, internalStorage, chatOptions.onInitialized);
76
+ const sendbird = initializeSendbird(appId, {
77
+ internalStorage,
78
+ ...sanitizeChatOptions(chatOptions)
79
+ });
68
80
  unsubscribes.current = sendbird.unsubscribes;
69
81
  return sendbird.chatSDK;
70
82
  });
83
+ const {
84
+ imageCompressionConfig,
85
+ voiceMessageConfig,
86
+ mentionConfig
87
+ } = useConfigInstance(props);
71
88
  const emojiManager = (0, _react.useMemo)(() => new _EmojiManager.default(internalStorage), [internalStorage]);
72
- const mentionManager = (0, _react.useMemo)(() => {
73
- const config = new _MentionConfig.default({
74
- mentionLimit: (userMention === null || userMention === void 0 ? void 0 : userMention.mentionLimit) || _MentionConfig.default.DEFAULT.MENTION_LIMIT,
75
- suggestionLimit: (userMention === null || userMention === void 0 ? void 0 : userMention.suggestionLimit) || _MentionConfig.default.DEFAULT.SUGGESTION_LIMIT,
76
- debounceMills: (userMention === null || userMention === void 0 ? void 0 : userMention.debounceMills) ?? _MentionConfig.default.DEFAULT.DEBOUNCE_MILLS,
77
- delimiter: _MentionConfig.default.DEFAULT.DELIMITER,
78
- trigger: _MentionConfig.default.DEFAULT.TRIGGER
79
- });
80
- return new _MentionManager.default(config);
81
- }, [userMention === null || userMention === void 0 ? void 0 : userMention.mentionLimit, userMention === null || userMention === void 0 ? void 0 : userMention.suggestionLimit, userMention === null || userMention === void 0 ? void 0 : userMention.debounceMills]);
82
- const imageCompressionConfig = (0, _react.useMemo)(() => {
83
- return new _ImageCompressionConfig.default({
84
- compressionRate: (imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.compressionRate) || _ImageCompressionConfig.default.DEFAULT.COMPRESSION_RATE,
85
- width: imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.width,
86
- height: imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.height
87
- });
88
- }, [imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.compressionRate, imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.width, imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.height]);
89
+ const mentionManager = (0, _react.useMemo)(() => new _MentionManager.default(mentionConfig), [mentionConfig]);
89
90
  (0, _react.useLayoutEffect)(() => {
90
91
  if (!isFirstMount) {
91
- const sendbird = initializeSendbird(appId, internalStorage, chatOptions.onInitialized);
92
+ const sendbird = initializeSendbird(appId, {
93
+ internalStorage,
94
+ ...sanitizeChatOptions(chatOptions)
95
+ });
92
96
  setSdkInstance(sendbird.chatSDK);
93
97
  unsubscribes.current = sendbird.unsubscribes;
94
98
  }
@@ -125,6 +129,7 @@ const SendbirdUIKitContainer = _ref => {
125
129
  emojiManager: emojiManager,
126
130
  mentionManager: mentionManager,
127
131
  imageCompressionConfig: imageCompressionConfig,
132
+ voiceMessageConfig: voiceMessageConfig,
128
133
  enableAutoPushTokenRegistration: chatOptions.enableAutoPushTokenRegistration ?? SendbirdUIKit.DEFAULT.AUTO_PUSH_TOKEN_REGISTRATION,
129
134
  enableUseUserIdForNickname: chatOptions.enableUseUserIdForNickname ?? SendbirdUIKit.DEFAULT.USE_USER_ID_FOR_NICKNAME,
130
135
  enableImageCompression: chatOptions.enableImageCompression ?? SendbirdUIKit.DEFAULT.IMAGE_COMPRESSION
@@ -134,7 +139,10 @@ const SendbirdUIKitContainer = _ref => {
134
139
  fileService: platformServices.file,
135
140
  notificationService: platformServices.notification,
136
141
  clipboardService: platformServices.clipboard,
137
- mediaService: platformServices.media
142
+ mediaService: platformServices.media,
143
+ playerService: platformServices.player,
144
+ recorderService: platformServices.recorder,
145
+ voiceMessageConfig: voiceMessageConfig
138
146
  }, /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.UIKitThemeProvider, {
139
147
  theme: (styles === null || styles === void 0 ? void 0 : styles.theme) ?? _uikitReactNativeFoundation.LightUIKitTheme
140
148
  }, /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.HeaderStyleProvider, {
@@ -143,11 +151,9 @@ const SendbirdUIKitContainer = _ref => {
143
151
  statusBarTranslucent: (styles === null || styles === void 0 ? void 0 : styles.statusBarTranslucent) ?? true
144
152
  }, /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.ToastProvider, {
145
153
  dismissTimeout: toast === null || toast === void 0 ? void 0 : toast.dismissTimeout
146
- }, /*#__PURE__*/_react.default.createElement(_UserProfileCtx.UserProfileProvider, {
147
- onCreateChannel: userProfile === null || userProfile === void 0 ? void 0 : userProfile.onCreateChannel,
148
- onBeforeCreateChannel: userProfile === null || userProfile === void 0 ? void 0 : userProfile.onBeforeCreateChannel,
154
+ }, /*#__PURE__*/_react.default.createElement(_UserProfileCtx.UserProfileProvider, _extends({}, userProfile, {
149
155
  statusBarTranslucent: (styles === null || styles === void 0 ? void 0 : styles.statusBarTranslucent) ?? true
150
- }, /*#__PURE__*/_react.default.createElement(_ReactionCtx.ReactionProvider, null, /*#__PURE__*/_react.default.createElement(_LocalizationCtx.LocalizationContext.Consumer, null, value => {
156
+ }), /*#__PURE__*/_react.default.createElement(_ReactionCtx.ReactionProvider, reaction, /*#__PURE__*/_react.default.createElement(_LocalizationCtx.LocalizationContext.Consumer, null, value => {
151
157
  const STRINGS = (value === null || value === void 0 ? void 0 : value.STRINGS) || defaultStringSet;
152
158
  return /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.DialogProvider, {
153
159
  defaultLabels: {
@@ -163,15 +169,21 @@ const SendbirdUIKitContainer = _ref => {
163
169
  }, renderChildren());
164
170
  })))))))))));
165
171
  };
166
- const initializeSendbird = (appId, internalStorage, onInitialized) => {
167
- const unsubscribes = [];
172
+ const initializeSendbird = (appId, options) => {
168
173
  let chatSDK;
174
+ const unsubscribes = [];
175
+ const {
176
+ internalStorage,
177
+ onInitialized,
178
+ ...chatInitParams
179
+ } = options;
169
180
  chatSDK = _chat.default.init({
181
+ ...chatInitParams,
170
182
  appId,
183
+ newInstance: true,
171
184
  modules: [new _groupChannel.GroupChannelModule(), new _openChannel.OpenChannelModule()],
172
- localCacheEnabled: Boolean(internalStorage),
173
- useAsyncStorageStore: internalStorage,
174
- newInstance: true
185
+ localCacheEnabled: true,
186
+ useAsyncStorageStore: internalStorage
175
187
  });
176
188
  if (onInitialized) {
177
189
  chatSDK = onInitialized(chatSDK);
@@ -254,6 +266,44 @@ function getReactNativeVersion() {
254
266
  } = _reactNative.Platform.constants.reactNativeVersion;
255
267
  return `${major}.${minor}.${patch}`;
256
268
  }
269
+ const useConfigInstance = _ref => {
270
+ var _voiceMessage$recorde3, _voiceMessage$recorde4;
271
+ let {
272
+ imageCompression,
273
+ userMention,
274
+ voiceMessage
275
+ } = _ref;
276
+ const mentionConfig = (0, _react.useMemo)(() => {
277
+ return new _MentionConfig.default({
278
+ mentionLimit: (userMention === null || userMention === void 0 ? void 0 : userMention.mentionLimit) || _MentionConfig.default.DEFAULT.MENTION_LIMIT,
279
+ suggestionLimit: (userMention === null || userMention === void 0 ? void 0 : userMention.suggestionLimit) || _MentionConfig.default.DEFAULT.SUGGESTION_LIMIT,
280
+ debounceMills: (userMention === null || userMention === void 0 ? void 0 : userMention.debounceMills) ?? _MentionConfig.default.DEFAULT.DEBOUNCE_MILLS,
281
+ delimiter: _MentionConfig.default.DEFAULT.DELIMITER,
282
+ trigger: _MentionConfig.default.DEFAULT.TRIGGER
283
+ });
284
+ }, [userMention === null || userMention === void 0 ? void 0 : userMention.mentionLimit, userMention === null || userMention === void 0 ? void 0 : userMention.suggestionLimit, userMention === null || userMention === void 0 ? void 0 : userMention.debounceMills]);
285
+ const imageCompressionConfig = (0, _react.useMemo)(() => {
286
+ return new _ImageCompressionConfig.default({
287
+ compressionRate: (imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.compressionRate) || _ImageCompressionConfig.default.DEFAULT.COMPRESSION_RATE,
288
+ width: imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.width,
289
+ height: imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.height
290
+ });
291
+ }, [imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.compressionRate, imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.width, imageCompression === null || imageCompression === void 0 ? void 0 : imageCompression.height]);
292
+ const voiceMessageConfig = (0, _react.useMemo)(() => {
293
+ var _voiceMessage$recorde, _voiceMessage$recorde2;
294
+ return new _VoiceMessageConfig.default({
295
+ recorder: {
296
+ minDuration: (voiceMessage === null || voiceMessage === void 0 ? void 0 : (_voiceMessage$recorde = voiceMessage.recorder) === null || _voiceMessage$recorde === void 0 ? void 0 : _voiceMessage$recorde.minDuration) ?? _VoiceMessageConfig.default.DEFAULT.RECORDER.MIN_DURATION,
297
+ maxDuration: (voiceMessage === null || voiceMessage === void 0 ? void 0 : (_voiceMessage$recorde2 = voiceMessage.recorder) === null || _voiceMessage$recorde2 === void 0 ? void 0 : _voiceMessage$recorde2.maxDuration) ?? _VoiceMessageConfig.default.DEFAULT.RECORDER.MAX_DURATION
298
+ }
299
+ });
300
+ }, [voiceMessage === null || voiceMessage === void 0 ? void 0 : (_voiceMessage$recorde3 = voiceMessage.recorder) === null || _voiceMessage$recorde3 === void 0 ? void 0 : _voiceMessage$recorde3.minDuration, voiceMessage === null || voiceMessage === void 0 ? void 0 : (_voiceMessage$recorde4 = voiceMessage.recorder) === null || _voiceMessage$recorde4 === void 0 ? void 0 : _voiceMessage$recorde4.maxDuration]);
301
+ return {
302
+ mentionConfig,
303
+ imageCompressionConfig,
304
+ voiceMessageConfig
305
+ };
306
+ };
257
307
  var _default = SendbirdUIKitContainer;
258
308
  exports.default = _default;
259
309
  //# sourceMappingURL=SendbirdUIKitContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_chat","_groupChannel","_openChannel","_uikitReactNativeFoundation","_uikitTools","_uikitUtils","_LocalizationCtx","_PlatformServiceCtx","_ReactionCtx","_SendbirdChatCtx","_UserProfileCtx","_EmojiManager","_interopRequireDefault","_ImageCompressionConfig","_InternalLocalCacheStorage","_MentionConfig","_MentionManager","_StringSet","_dynamicModule","_version","_InternalErrorBoundaryContainer","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","NetInfo","SBUDynamicModule","SendbirdUIKit","freeze","VERSION","PLATFORM","Platform","OS","toLowerCase","DEFAULT","AUTO_PUSH_TOKEN_REGISTRATION","USE_USER_ID_FOR_NICKNAME","IMAGE_COMPRESSION","exports","SendbirdUIKitContainer","_ref","children","appId","chatOptions","uikitOptions","platformServices","localization","styles","errorBoundary","toast","userProfile","userMention","imageCompression","localCacheStorage","Error","defaultStringSet","stringSet","StringSetEn","isFirstMount","useIsFirstMount","unsubscribes","useRef","internalStorage","useState","InternalLocalCacheStorage","sdkInstance","setSdkInstance","sendbird","initializeSendbird","onInitialized","current","chatSDK","emojiManager","useMemo","EmojiManager","mentionManager","config","MentionConfig","mentionLimit","MENTION_LIMIT","suggestionLimit","SUGGESTION_LIMIT","debounceMills","DEBOUNCE_MILLS","delimiter","DELIMITER","trigger","TRIGGER","MentionManager","imageCompressionConfig","ImageCompressionConfig","compressionRate","COMPRESSION_RATE","width","height","useLayoutEffect","forEach","u","renderChildren","disabled","createElement","SafeAreaProvider","UIKitConfigProvider","storage","localConfigs","common","groupChannel","channel","channelList","groupChannelList","setting","groupChannelSettings","openChannel","SendbirdChatProvider","enableAutoPushTokenRegistration","enableUseUserIdForNickname","enableImageCompression","LocalizationProvider","PlatformServiceProvider","fileService","file","notificationService","notification","clipboardService","clipboard","mediaService","media","UIKitThemeProvider","theme","LightUIKitTheme","HeaderStyleProvider","HeaderComponent","Header","defaultTitleAlign","defaultHeaderTitleAlign","statusBarTranslucent","ToastProvider","dismissTimeout","UserProfileProvider","onCreateChannel","onBeforeCreateChannel","ReactionProvider","LocalizationContext","Consumer","value","STRINGS","DialogProvider","defaultLabels","alert","ok","DIALOG","ALERT_DEFAULT_OK","prompt","PROMPT_DEFAULT_OK","cancel","PROMPT_DEFAULT_CANCEL","placeholder","PROMPT_DEFAULT_PLACEHOLDER","Sendbird","init","modules","GroupChannelModule","OpenChannelModule","localCacheEnabled","Boolean","useAsyncStorageStore","newInstance","platform","getDeviceOSPlatform","deviceOSInfo","version","String","Version","customData","platform_version","getReactNativeVersion","uikitExtension","product","SendbirdProduct","UIKIT_CHAT","SendbirdPlatform","REACT_NATIVE","addSendbirdExtensions","addExtension","addEventListener","_chatSDK$setOnlineLis","_chatSDK","_chatSDK$setOfflineLi","_chatSDK2","NOOP","listener","callback","callbackType","callCount","unsubscribe","state","online","isConnected","isInternetReachable","push","setOnlineListener","onOnline","setOfflineListener","onOffline","DeviceOsPlatform","ANDROID","IOS","WEB","WINDOWS","undefined","major","minor","patch","constants","reactNativeVersion","_default"],"sources":["SendbirdUIKitContainer.tsx"],"sourcesContent":["import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\nimport Sendbird, { DeviceOsPlatform, SendbirdPlatform, SendbirdProduct } from '@sendbird/chat';\nimport { GroupChannelModule } from '@sendbird/chat/groupChannel';\nimport { OpenChannelModule } from '@sendbird/chat/openChannel';\nimport type { HeaderStyleContextType, UIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport {\n DialogProvider,\n Header,\n HeaderStyleProvider,\n LightUIKitTheme,\n ToastProvider,\n UIKitThemeProvider,\n} from '@sendbird/uikit-react-native-foundation';\nimport { SBUConfig, UIKitConfigProvider } from '@sendbird/uikit-tools';\nimport type {\n PartialDeep,\n SendbirdChatSDK,\n SendbirdGroupChannel,\n SendbirdGroupChannelCreateParams,\n SendbirdMember,\n SendbirdUser,\n} from '@sendbird/uikit-utils';\nimport { NOOP, useIsFirstMount } from '@sendbird/uikit-utils';\n\nimport { LocalizationContext, LocalizationProvider } from '../contexts/LocalizationCtx';\nimport { PlatformServiceProvider } from '../contexts/PlatformServiceCtx';\nimport { ReactionProvider } from '../contexts/ReactionCtx';\nimport type { ChatRelatedFeaturesInUIKit } from '../contexts/SendbirdChatCtx';\nimport { SendbirdChatProvider } from '../contexts/SendbirdChatCtx';\nimport { UserProfileProvider } from '../contexts/UserProfileCtx';\nimport EmojiManager from '../libs/EmojiManager';\nimport type { ImageCompressionConfigInterface } from '../libs/ImageCompressionConfig';\nimport ImageCompressionConfig from '../libs/ImageCompressionConfig';\nimport InternalLocalCacheStorage from '../libs/InternalLocalCacheStorage';\nimport MentionConfig, { MentionConfigInterface } from '../libs/MentionConfig';\nimport MentionManager from '../libs/MentionManager';\nimport StringSetEn from '../localization/StringSet.en';\nimport type { StringSet } from '../localization/StringSet.type';\nimport SBUDynamicModule from '../platform/dynamicModule';\nimport type {\n ClipboardServiceInterface,\n FileServiceInterface,\n MediaServiceInterface,\n NotificationServiceInterface,\n} from '../platform/types';\nimport type { ErrorBoundaryProps, LocalCacheStorage } from '../types';\nimport VERSION from '../version';\nimport InternalErrorBoundaryContainer from './InternalErrorBoundaryContainer';\n\nconst NetInfo = SBUDynamicModule.get('@react-native-community/netinfo', 'warn');\ntype UnimplementedFeatures = 'enableVoiceMessage' | 'threadReplySelectType' | 'replyType';\nexport const SendbirdUIKit = Object.freeze({\n VERSION,\n PLATFORM: Platform.OS.toLowerCase(),\n DEFAULT: {\n AUTO_PUSH_TOKEN_REGISTRATION: true,\n USE_USER_ID_FOR_NICKNAME: false,\n IMAGE_COMPRESSION: true,\n },\n});\n\nexport type SendbirdUIKitContainerProps = React.PropsWithChildren<{\n appId: string;\n platformServices: {\n file: FileServiceInterface;\n notification: NotificationServiceInterface;\n clipboard: ClipboardServiceInterface;\n media: MediaServiceInterface;\n };\n chatOptions: {\n localCacheStorage: LocalCacheStorage;\n onInitialized?: (sdkInstance: SendbirdChatSDK) => SendbirdChatSDK;\n } & Partial<ChatRelatedFeaturesInUIKit>;\n uikitOptions?: PartialDeep<{\n common: SBUConfig['common'];\n groupChannel: Omit<SBUConfig['groupChannel']['channel'], UnimplementedFeatures> & {\n replyType: Extract<SBUConfig['groupChannel']['channel']['replyType'], 'none' | 'quote_reply'>;\n };\n groupChannelList: SBUConfig['groupChannel']['channelList'];\n groupChannelSettings: SBUConfig['groupChannel']['setting'];\n openChannel: SBUConfig['openChannel']['channel'];\n }>;\n localization?: {\n stringSet?: StringSet;\n };\n styles?: {\n theme?: UIKitTheme;\n statusBarTranslucent?: boolean;\n defaultHeaderTitleAlign?: 'left' | 'center';\n defaultHeaderHeight?: number;\n HeaderComponent?: HeaderStyleContextType['HeaderComponent'];\n };\n errorBoundary?: {\n disabled?: boolean;\n onError?: (props: ErrorBoundaryProps) => void;\n ErrorInfoComponent?: (props: ErrorBoundaryProps) => JSX.Element;\n };\n toast?: {\n dismissTimeout?: number;\n };\n userProfile?: {\n onCreateChannel: (channel: SendbirdGroupChannel) => void;\n onBeforeCreateChannel?: (\n channelParams: SendbirdGroupChannelCreateParams,\n users: SendbirdUser[] | SendbirdMember[],\n ) => SendbirdGroupChannelCreateParams | Promise<SendbirdGroupChannelCreateParams>;\n };\n userMention?: Pick<Partial<MentionConfigInterface>, 'mentionLimit' | 'suggestionLimit' | 'debounceMills'>;\n imageCompression?: Partial<ImageCompressionConfigInterface>;\n}>;\n\nconst SendbirdUIKitContainer = ({\n children,\n appId,\n chatOptions,\n uikitOptions,\n platformServices,\n localization,\n styles,\n errorBoundary,\n toast,\n userProfile,\n userMention,\n imageCompression,\n}: SendbirdUIKitContainerProps) => {\n if (!chatOptions.localCacheStorage) {\n throw new Error('SendbirdUIKitContainer: chatOptions.localCacheStorage is required');\n }\n\n const defaultStringSet = localization?.stringSet ?? StringSetEn;\n\n const isFirstMount = useIsFirstMount();\n const unsubscribes = useRef<Array<() => void>>([]);\n\n const [internalStorage] = useState(() => new InternalLocalCacheStorage(chatOptions.localCacheStorage));\n const [sdkInstance, setSdkInstance] = useState<SendbirdChatSDK>(() => {\n const sendbird = initializeSendbird(appId, internalStorage, chatOptions.onInitialized);\n unsubscribes.current = sendbird.unsubscribes;\n return sendbird.chatSDK;\n });\n\n const emojiManager = useMemo(() => new EmojiManager(internalStorage), [internalStorage]);\n\n const mentionManager = useMemo(() => {\n const config = new MentionConfig({\n mentionLimit: userMention?.mentionLimit || MentionConfig.DEFAULT.MENTION_LIMIT,\n suggestionLimit: userMention?.suggestionLimit || MentionConfig.DEFAULT.SUGGESTION_LIMIT,\n debounceMills: userMention?.debounceMills ?? MentionConfig.DEFAULT.DEBOUNCE_MILLS,\n delimiter: MentionConfig.DEFAULT.DELIMITER,\n trigger: MentionConfig.DEFAULT.TRIGGER,\n });\n return new MentionManager(config);\n }, [userMention?.mentionLimit, userMention?.suggestionLimit, userMention?.debounceMills]);\n\n const imageCompressionConfig = useMemo(() => {\n return new ImageCompressionConfig({\n compressionRate: imageCompression?.compressionRate || ImageCompressionConfig.DEFAULT.COMPRESSION_RATE,\n width: imageCompression?.width,\n height: imageCompression?.height,\n });\n }, [imageCompression?.compressionRate, imageCompression?.width, imageCompression?.height]);\n\n useLayoutEffect(() => {\n if (!isFirstMount) {\n const sendbird = initializeSendbird(appId, internalStorage, chatOptions.onInitialized);\n setSdkInstance(sendbird.chatSDK);\n unsubscribes.current = sendbird.unsubscribes;\n }\n\n return () => {\n unsubscribes.current.forEach((u) => {\n try {\n u();\n } catch {}\n });\n };\n }, [appId, internalStorage]);\n\n const renderChildren = () => {\n if (errorBoundary?.disabled) {\n return children;\n } else {\n return <InternalErrorBoundaryContainer {...errorBoundary}>{children}</InternalErrorBoundaryContainer>;\n }\n };\n\n return (\n <SafeAreaProvider>\n <UIKitConfigProvider\n storage={internalStorage}\n localConfigs={{\n common: uikitOptions?.common,\n groupChannel: {\n channel: uikitOptions?.groupChannel,\n channelList: uikitOptions?.groupChannelList,\n setting: uikitOptions?.groupChannelSettings,\n },\n openChannel: {\n channel: uikitOptions?.openChannel,\n },\n }}\n >\n <SendbirdChatProvider\n sdkInstance={sdkInstance}\n emojiManager={emojiManager}\n mentionManager={mentionManager}\n imageCompressionConfig={imageCompressionConfig}\n enableAutoPushTokenRegistration={\n chatOptions.enableAutoPushTokenRegistration ?? SendbirdUIKit.DEFAULT.AUTO_PUSH_TOKEN_REGISTRATION\n }\n enableUseUserIdForNickname={\n chatOptions.enableUseUserIdForNickname ?? SendbirdUIKit.DEFAULT.USE_USER_ID_FOR_NICKNAME\n }\n enableImageCompression={chatOptions.enableImageCompression ?? SendbirdUIKit.DEFAULT.IMAGE_COMPRESSION}\n >\n <LocalizationProvider stringSet={defaultStringSet}>\n <PlatformServiceProvider\n fileService={platformServices.file}\n notificationService={platformServices.notification}\n clipboardService={platformServices.clipboard}\n mediaService={platformServices.media}\n >\n <UIKitThemeProvider theme={styles?.theme ?? LightUIKitTheme}>\n <HeaderStyleProvider\n HeaderComponent={styles?.HeaderComponent ?? Header}\n defaultTitleAlign={styles?.defaultHeaderTitleAlign ?? 'left'}\n statusBarTranslucent={styles?.statusBarTranslucent ?? true}\n >\n <ToastProvider dismissTimeout={toast?.dismissTimeout}>\n <UserProfileProvider\n onCreateChannel={userProfile?.onCreateChannel}\n onBeforeCreateChannel={userProfile?.onBeforeCreateChannel}\n statusBarTranslucent={styles?.statusBarTranslucent ?? true}\n >\n <ReactionProvider>\n <LocalizationContext.Consumer>\n {(value) => {\n const STRINGS = value?.STRINGS || defaultStringSet;\n return (\n <DialogProvider\n defaultLabels={{\n alert: { ok: STRINGS.DIALOG.ALERT_DEFAULT_OK },\n prompt: {\n ok: STRINGS.DIALOG.PROMPT_DEFAULT_OK,\n cancel: STRINGS.DIALOG.PROMPT_DEFAULT_CANCEL,\n placeholder: STRINGS.DIALOG.PROMPT_DEFAULT_PLACEHOLDER,\n },\n }}\n >\n {renderChildren()}\n </DialogProvider>\n );\n }}\n </LocalizationContext.Consumer>\n </ReactionProvider>\n </UserProfileProvider>\n </ToastProvider>\n </HeaderStyleProvider>\n </UIKitThemeProvider>\n </PlatformServiceProvider>\n </LocalizationProvider>\n </SendbirdChatProvider>\n </UIKitConfigProvider>\n </SafeAreaProvider>\n );\n};\n\nconst initializeSendbird = (\n appId: string,\n internalStorage?: InternalLocalCacheStorage,\n onInitialized?: (sdk: SendbirdChatSDK) => SendbirdChatSDK,\n) => {\n const unsubscribes: Array<() => void> = [];\n let chatSDK: SendbirdChatSDK;\n\n chatSDK = Sendbird.init({\n appId,\n modules: [new GroupChannelModule(), new OpenChannelModule()],\n localCacheEnabled: Boolean(internalStorage),\n useAsyncStorageStore: internalStorage as never,\n newInstance: true,\n });\n\n if (onInitialized) {\n chatSDK = onInitialized(chatSDK);\n }\n\n const platform = getDeviceOSPlatform();\n if (SendbirdUIKit.VERSION && platform) {\n const deviceOSInfo = { platform, version: String(Platform.Version) };\n const customData = { platform_version: getReactNativeVersion() };\n const uikitExtension = {\n product: SendbirdProduct.UIKIT_CHAT,\n version: SendbirdUIKit.VERSION,\n platform: SendbirdPlatform.REACT_NATIVE,\n };\n\n chatSDK.addSendbirdExtensions([uikitExtension], deviceOSInfo, customData);\n chatSDK.addExtension('sb_uikit', SendbirdUIKit.VERSION);\n }\n\n if (SendbirdUIKit.PLATFORM) {\n chatSDK.addExtension('device-os-platform', SendbirdUIKit.PLATFORM);\n }\n\n if (NetInfo?.addEventListener) {\n try {\n // NOTE: For removing buggy behavior of NetInfo.addEventListener\n // When you first add an event listener, it is assumed that the initialization of the internal event detector is done simultaneously.\n // In other words, when you call the first event listener two events are triggered immediately\n // - the one that is called when adding the event listener\n // - and the internal initialization event\n NetInfo.addEventListener(NOOP)();\n } catch {}\n\n const listener = (callback: () => void, callbackType: 'online' | 'offline') => {\n let callCount = 0;\n const unsubscribe = NetInfo.addEventListener((state) => {\n const online = Boolean(state.isConnected) || Boolean(state.isInternetReachable);\n\n // NOTE: When NetInfo.addEventListener is called\n // the event is immediately triggered regardless of whether the event actually occurred.\n // This is why it filters the first event.\n if (callCount === 0) {\n callCount++;\n return;\n }\n\n if (online && callbackType === 'online') callback();\n if (!online && callbackType === 'offline') callback();\n });\n unsubscribes.push(unsubscribe);\n return unsubscribe;\n };\n chatSDK.setOnlineListener?.((onOnline) => listener(onOnline, 'online'));\n chatSDK.setOfflineListener?.((onOffline) => listener(onOffline, 'offline'));\n }\n return { chatSDK, unsubscribes };\n};\n\nfunction getDeviceOSPlatform() {\n switch (Platform.OS) {\n case 'android':\n return DeviceOsPlatform.ANDROID;\n case 'ios':\n return DeviceOsPlatform.IOS;\n case 'web':\n return DeviceOsPlatform.WEB;\n case 'windows':\n return DeviceOsPlatform.WINDOWS;\n default:\n return undefined;\n }\n}\n\nfunction getReactNativeVersion() {\n const { major, minor, patch } = Platform.constants.reactNativeVersion;\n return `${major}.${minor}.${patch}`;\n}\n\nexport default SendbirdUIKitContainer;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAEA,IAAAM,2BAAA,GAAAN,OAAA;AAQA,IAAAO,WAAA,GAAAP,OAAA;AASA,IAAAQ,WAAA,GAAAR,OAAA;AAEA,IAAAS,gBAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AAEA,IAAAY,gBAAA,GAAAZ,OAAA;AACA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAC,sBAAA,CAAAf,OAAA;AAEA,IAAAgB,uBAAA,GAAAD,sBAAA,CAAAf,OAAA;AACA,IAAAiB,0BAAA,GAAAF,sBAAA,CAAAf,OAAA;AACA,IAAAkB,cAAA,GAAAH,sBAAA,CAAAf,OAAA;AACA,IAAAmB,eAAA,GAAAJ,sBAAA,CAAAf,OAAA;AACA,IAAAoB,UAAA,GAAAL,sBAAA,CAAAf,OAAA;AAEA,IAAAqB,cAAA,GAAAN,sBAAA,CAAAf,OAAA;AAQA,IAAAsB,QAAA,GAAAP,sBAAA,CAAAf,OAAA;AACA,IAAAuB,+BAAA,GAAAR,sBAAA,CAAAf,OAAA;AAA8E,SAAAe,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF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AiB,cAAAf,qBAAA,uBAAzBA,qBAAA,CAAAnK,IAAA,CAAAoK,QAAA,EAA6Be,QAAQ,IAAKX,QAAQ,CAACW,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACvE,CAAAd,qBAAA,IAAAC,SAAA,GAAArH,OAAO,EAACmI,kBAAkB,cAAAf,qBAAA,uBAA1BA,qBAAA,CAAArK,IAAA,CAAAsK,SAAA,EAA8Be,SAAS,IAAKb,QAAQ,CAACa,SAAS,EAAE,SAAS,CAAC,CAAC;EAC7E;EACA,OAAO;IAAEpI,OAAO;IAAEX;EAAa,CAAC;AAClC,CAAC;AAED,SAAS4G,mBAAmBA,CAAA,EAAG;EAC7B,QAAQzI,qBAAQ,CAACC,EAAE;IACjB,KAAK,SAAS;MACZ,OAAO4K,sBAAgB,CAACC,OAAO;IACjC,KAAK,KAAK;MACR,OAAOD,sBAAgB,CAACE,GAAG;IAC7B,KAAK,KAAK;MACR,OAAOF,sBAAgB,CAACG,GAAG;IAC7B,KAAK,SAAS;MACZ,OAAOH,sBAAgB,CAACI,OAAO;IACjC;MACE,OAAOC,SAAS;EAAC;AAEvB;AAEA,SAASlC,qBAAqBA,CAAA,EAAG;EAC/B,MAAM;IAAEmC,KAAK;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGrL,qBAAQ,CAACsL,SAAS,CAACC,kBAAkB;EACrE,OAAQ,GAAEJ,KAAM,IAAGC,KAAM,IAAGC,KAAM,EAAC;AACrC;AAAC,IAAAG,QAAA,GAEchL,sBAAsB;AAAAD,OAAA,CAAAjC,OAAA,GAAAkN,QAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_chat","_groupChannel","_openChannel","_uikitReactNativeFoundation","_uikitTools","_uikitUtils","_LocalizationCtx","_PlatformServiceCtx","_ReactionCtx","_SendbirdChatCtx","_UserProfileCtx","_EmojiManager","_interopRequireDefault","_ImageCompressionConfig","_InternalLocalCacheStorage","_MentionConfig","_MentionManager","_VoiceMessageConfig","_StringSet","_dynamicModule","_version","_InternalErrorBoundaryContainer","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","NetInfo","SBUDynamicModule","SendbirdUIKit","freeze","VERSION","PLATFORM","Platform","OS","toLowerCase","DEFAULT","AUTO_PUSH_TOKEN_REGISTRATION","USE_USER_ID_FOR_NICKNAME","IMAGE_COMPRESSION","exports","chatOmitKeys","sanitizeChatOptions","chatOptions","opts","forEach","SendbirdUIKitContainer","props","children","appId","uikitOptions","platformServices","localization","styles","errorBoundary","toast","userProfile","reaction","localCacheStorage","Error","defaultStringSet","stringSet","StringSetEn","isFirstMount","useIsFirstMount","unsubscribes","useRef","internalStorage","useState","InternalLocalCacheStorage","sdkInstance","setSdkInstance","sendbird","initializeSendbird","current","chatSDK","imageCompressionConfig","voiceMessageConfig","mentionConfig","useConfigInstance","emojiManager","useMemo","EmojiManager","mentionManager","MentionManager","useLayoutEffect","u","renderChildren","disabled","createElement","SafeAreaProvider","UIKitConfigProvider","storage","localConfigs","common","groupChannel","channel","channelList","groupChannelList","setting","groupChannelSettings","openChannel","SendbirdChatProvider","enableAutoPushTokenRegistration","enableUseUserIdForNickname","enableImageCompression","LocalizationProvider","PlatformServiceProvider","fileService","file","notificationService","notification","clipboardService","clipboard","mediaService","media","playerService","player","recorderService","recorder","UIKitThemeProvider","theme","LightUIKitTheme","HeaderStyleProvider","HeaderComponent","Header","defaultTitleAlign","defaultHeaderTitleAlign","statusBarTranslucent","ToastProvider","dismissTimeout","UserProfileProvider","ReactionProvider","LocalizationContext","Consumer","value","STRINGS","DialogProvider","defaultLabels","alert","ok","DIALOG","ALERT_DEFAULT_OK","prompt","PROMPT_DEFAULT_OK","cancel","PROMPT_DEFAULT_CANCEL","placeholder","PROMPT_DEFAULT_PLACEHOLDER","options","onInitialized","chatInitParams","SendbirdChat","init","newInstance","modules","GroupChannelModule","OpenChannelModule","localCacheEnabled","useAsyncStorageStore","platform","getDeviceOSPlatform","deviceOSInfo","version","String","Version","customData","platform_version","getReactNativeVersion","uikitExtension","product","SendbirdProduct","UIKIT_CHAT","SendbirdPlatform","REACT_NATIVE","addSendbirdExtensions","addExtension","addEventListener","_chatSDK$setOnlineLis","_chatSDK","_chatSDK$setOfflineLi","_chatSDK2","NOOP","listener","callback","callbackType","callCount","unsubscribe","state","online","Boolean","isConnected","isInternetReachable","push","setOnlineListener","onOnline","setOfflineListener","onOffline","DeviceOsPlatform","ANDROID","IOS","WEB","WINDOWS","undefined","major","minor","patch","constants","reactNativeVersion","_ref","_voiceMessage$recorde3","_voiceMessage$recorde4","imageCompression","userMention","voiceMessage","MentionConfig","mentionLimit","MENTION_LIMIT","suggestionLimit","SUGGESTION_LIMIT","debounceMills","DEBOUNCE_MILLS","delimiter","DELIMITER","trigger","TRIGGER","ImageCompressionConfig","compressionRate","COMPRESSION_RATE","width","height","_voiceMessage$recorde","_voiceMessage$recorde2","VoiceMessageConfig","minDuration","RECORDER","MIN_DURATION","maxDuration","MAX_DURATION","_default"],"sources":["SendbirdUIKitContainer.tsx"],"sourcesContent":["import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\nimport SendbirdChat, { DeviceOsPlatform, SendbirdChatParams, SendbirdPlatform, SendbirdProduct } from '@sendbird/chat';\nimport { GroupChannelModule } from '@sendbird/chat/groupChannel';\nimport { OpenChannelModule } from '@sendbird/chat/openChannel';\nimport type { HeaderStyleContextType, UIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport {\n DialogProvider,\n Header,\n HeaderStyleProvider,\n LightUIKitTheme,\n ToastProvider,\n UIKitThemeProvider,\n} from '@sendbird/uikit-react-native-foundation';\nimport { SBUConfig, UIKitConfigProvider } from '@sendbird/uikit-tools';\nimport type {\n PartialDeep,\n SendbirdChatSDK,\n SendbirdGroupChannel,\n SendbirdGroupChannelCreateParams,\n SendbirdMember,\n SendbirdUser,\n} from '@sendbird/uikit-utils';\nimport { NOOP, useIsFirstMount } from '@sendbird/uikit-utils';\n\nimport { LocalizationContext, LocalizationProvider } from '../contexts/LocalizationCtx';\nimport { PlatformServiceProvider } from '../contexts/PlatformServiceCtx';\nimport { ReactionProvider } from '../contexts/ReactionCtx';\nimport type { ChatRelatedFeaturesInUIKit } from '../contexts/SendbirdChatCtx';\nimport { SendbirdChatProvider } from '../contexts/SendbirdChatCtx';\nimport { UserProfileProvider } from '../contexts/UserProfileCtx';\nimport EmojiManager from '../libs/EmojiManager';\nimport type { ImageCompressionConfigInterface } from '../libs/ImageCompressionConfig';\nimport ImageCompressionConfig from '../libs/ImageCompressionConfig';\nimport InternalLocalCacheStorage from '../libs/InternalLocalCacheStorage';\nimport MentionConfig, { MentionConfigInterface } from '../libs/MentionConfig';\nimport MentionManager from '../libs/MentionManager';\nimport VoiceMessageConfig, { VoiceMessageConfigInterface } from '../libs/VoiceMessageConfig';\nimport StringSetEn from '../localization/StringSet.en';\nimport type { StringSet } from '../localization/StringSet.type';\nimport SBUDynamicModule from '../platform/dynamicModule';\nimport type {\n ClipboardServiceInterface,\n FileServiceInterface,\n MediaServiceInterface,\n NotificationServiceInterface,\n PlayerServiceInterface,\n RecorderServiceInterface,\n} from '../platform/types';\nimport type { ErrorBoundaryProps, LocalCacheStorage } from '../types';\nimport VERSION from '../version';\nimport InternalErrorBoundaryContainer from './InternalErrorBoundaryContainer';\n\nconst NetInfo = SBUDynamicModule.get('@react-native-community/netinfo', 'warn');\nexport const SendbirdUIKit = Object.freeze({\n VERSION,\n PLATFORM: Platform.OS.toLowerCase(),\n DEFAULT: {\n AUTO_PUSH_TOKEN_REGISTRATION: true,\n USE_USER_ID_FOR_NICKNAME: false,\n IMAGE_COMPRESSION: true,\n },\n});\n\ntype UnimplementedFeatures = 'threadReplySelectType' | 'replyType';\nexport type ChatOmittedInitParams = Omit<\n SendbirdChatParams<[GroupChannelModule, OpenChannelModule]>,\n (typeof chatOmitKeys)[number]\n>;\n\nconst chatOmitKeys = [\n 'appId',\n 'newInstance',\n 'modules',\n 'debugMode',\n 'appVersion',\n 'localCacheEnabled',\n 'useAsyncStorageStore',\n] as const;\nfunction sanitizeChatOptions<T extends Record<string, unknown>>(chatOptions: T): T {\n const opts = { ...chatOptions };\n chatOmitKeys.forEach((key) => delete opts[key]);\n return opts;\n}\n\nexport type SendbirdUIKitContainerProps = React.PropsWithChildren<{\n appId: string;\n platformServices: {\n file: FileServiceInterface;\n notification: NotificationServiceInterface;\n clipboard: ClipboardServiceInterface;\n media: MediaServiceInterface;\n player: PlayerServiceInterface;\n recorder: RecorderServiceInterface;\n };\n chatOptions: {\n localCacheStorage: LocalCacheStorage;\n onInitialized?: (sdkInstance: SendbirdChatSDK) => SendbirdChatSDK;\n } & Partial<ChatOmittedInitParams> &\n Partial<ChatRelatedFeaturesInUIKit>;\n uikitOptions?: PartialDeep<{\n common: SBUConfig['common'];\n groupChannel: Omit<SBUConfig['groupChannel']['channel'], UnimplementedFeatures> & {\n replyType: Extract<SBUConfig['groupChannel']['channel']['replyType'], 'none' | 'quote_reply'>;\n };\n groupChannelList: SBUConfig['groupChannel']['channelList'];\n groupChannelSettings: SBUConfig['groupChannel']['setting'];\n openChannel: SBUConfig['openChannel']['channel'];\n }>;\n localization?: {\n stringSet?: StringSet;\n };\n styles?: {\n theme?: UIKitTheme;\n statusBarTranslucent?: boolean;\n defaultHeaderTitleAlign?: 'left' | 'center';\n defaultHeaderHeight?: number;\n HeaderComponent?: HeaderStyleContextType['HeaderComponent'];\n };\n errorBoundary?: {\n disabled?: boolean;\n onError?: (props: ErrorBoundaryProps) => void;\n ErrorInfoComponent?: (props: ErrorBoundaryProps) => React.ReactNode;\n };\n toast?: {\n dismissTimeout?: number;\n };\n userProfile?: {\n onCreateChannel: (channel: SendbirdGroupChannel) => void;\n onBeforeCreateChannel?: (\n channelParams: SendbirdGroupChannelCreateParams,\n users: SendbirdUser[] | SendbirdMember[],\n ) => SendbirdGroupChannelCreateParams | Promise<SendbirdGroupChannelCreateParams>;\n };\n reaction?: {\n onPressUserProfile?: (user: SendbirdUser | SendbirdMember) => void;\n };\n userMention?: Pick<Partial<MentionConfigInterface>, 'mentionLimit' | 'suggestionLimit' | 'debounceMills'>;\n imageCompression?: Partial<ImageCompressionConfigInterface>;\n voiceMessage?: PartialDeep<VoiceMessageConfigInterface>;\n}>;\n\nconst SendbirdUIKitContainer = (props: SendbirdUIKitContainerProps) => {\n const {\n children,\n appId,\n chatOptions,\n uikitOptions,\n platformServices,\n localization,\n styles,\n errorBoundary,\n toast,\n userProfile,\n reaction,\n } = props;\n\n if (!chatOptions.localCacheStorage) {\n throw new Error('SendbirdUIKitContainer: chatOptions.localCacheStorage is required');\n }\n\n const defaultStringSet = localization?.stringSet ?? StringSetEn;\n\n const isFirstMount = useIsFirstMount();\n const unsubscribes = useRef<Array<() => void>>([]);\n\n const [internalStorage] = useState(() => new InternalLocalCacheStorage(chatOptions.localCacheStorage));\n const [sdkInstance, setSdkInstance] = useState<SendbirdChatSDK>(() => {\n const sendbird = initializeSendbird(appId, { internalStorage, ...sanitizeChatOptions(chatOptions) });\n unsubscribes.current = sendbird.unsubscribes;\n return sendbird.chatSDK;\n });\n\n const { imageCompressionConfig, voiceMessageConfig, mentionConfig } = useConfigInstance(props);\n const emojiManager = useMemo(() => new EmojiManager(internalStorage), [internalStorage]);\n const mentionManager = useMemo(() => new MentionManager(mentionConfig), [mentionConfig]);\n\n useLayoutEffect(() => {\n if (!isFirstMount) {\n const sendbird = initializeSendbird(appId, { internalStorage, ...sanitizeChatOptions(chatOptions) });\n setSdkInstance(sendbird.chatSDK);\n unsubscribes.current = sendbird.unsubscribes;\n }\n\n return () => {\n unsubscribes.current.forEach((u) => {\n try {\n u();\n } catch {}\n });\n };\n }, [appId, internalStorage]);\n\n const renderChildren = () => {\n if (errorBoundary?.disabled) {\n return children;\n } else {\n return <InternalErrorBoundaryContainer {...errorBoundary}>{children}</InternalErrorBoundaryContainer>;\n }\n };\n\n return (\n <SafeAreaProvider>\n <UIKitConfigProvider\n storage={internalStorage}\n localConfigs={{\n common: uikitOptions?.common,\n groupChannel: {\n channel: uikitOptions?.groupChannel,\n channelList: uikitOptions?.groupChannelList,\n setting: uikitOptions?.groupChannelSettings,\n },\n openChannel: {\n channel: uikitOptions?.openChannel,\n },\n }}\n >\n <SendbirdChatProvider\n sdkInstance={sdkInstance}\n emojiManager={emojiManager}\n mentionManager={mentionManager}\n imageCompressionConfig={imageCompressionConfig}\n voiceMessageConfig={voiceMessageConfig}\n enableAutoPushTokenRegistration={\n chatOptions.enableAutoPushTokenRegistration ?? SendbirdUIKit.DEFAULT.AUTO_PUSH_TOKEN_REGISTRATION\n }\n enableUseUserIdForNickname={\n chatOptions.enableUseUserIdForNickname ?? SendbirdUIKit.DEFAULT.USE_USER_ID_FOR_NICKNAME\n }\n enableImageCompression={chatOptions.enableImageCompression ?? SendbirdUIKit.DEFAULT.IMAGE_COMPRESSION}\n >\n <LocalizationProvider stringSet={defaultStringSet}>\n <PlatformServiceProvider\n fileService={platformServices.file}\n notificationService={platformServices.notification}\n clipboardService={platformServices.clipboard}\n mediaService={platformServices.media}\n playerService={platformServices.player}\n recorderService={platformServices.recorder}\n voiceMessageConfig={voiceMessageConfig}\n >\n <UIKitThemeProvider theme={styles?.theme ?? LightUIKitTheme}>\n <HeaderStyleProvider\n HeaderComponent={styles?.HeaderComponent ?? Header}\n defaultTitleAlign={styles?.defaultHeaderTitleAlign ?? 'left'}\n statusBarTranslucent={styles?.statusBarTranslucent ?? true}\n >\n <ToastProvider dismissTimeout={toast?.dismissTimeout}>\n <UserProfileProvider {...userProfile} statusBarTranslucent={styles?.statusBarTranslucent ?? true}>\n <ReactionProvider {...reaction}>\n <LocalizationContext.Consumer>\n {(value) => {\n const STRINGS = value?.STRINGS || defaultStringSet;\n return (\n <DialogProvider\n defaultLabels={{\n alert: { ok: STRINGS.DIALOG.ALERT_DEFAULT_OK },\n prompt: {\n ok: STRINGS.DIALOG.PROMPT_DEFAULT_OK,\n cancel: STRINGS.DIALOG.PROMPT_DEFAULT_CANCEL,\n placeholder: STRINGS.DIALOG.PROMPT_DEFAULT_PLACEHOLDER,\n },\n }}\n >\n {renderChildren()}\n </DialogProvider>\n );\n }}\n </LocalizationContext.Consumer>\n </ReactionProvider>\n </UserProfileProvider>\n </ToastProvider>\n </HeaderStyleProvider>\n </UIKitThemeProvider>\n </PlatformServiceProvider>\n </LocalizationProvider>\n </SendbirdChatProvider>\n </UIKitConfigProvider>\n </SafeAreaProvider>\n );\n};\n\ninterface InitOptions extends ChatOmittedInitParams {\n internalStorage: InternalLocalCacheStorage;\n onInitialized?: (sdk: SendbirdChatSDK) => SendbirdChatSDK;\n}\nconst initializeSendbird = (appId: string, options: InitOptions) => {\n let chatSDK: SendbirdChatSDK;\n const unsubscribes: Array<() => void> = [];\n const { internalStorage, onInitialized, ...chatInitParams } = options;\n\n chatSDK = SendbirdChat.init({\n ...chatInitParams,\n appId,\n newInstance: true,\n modules: [new GroupChannelModule(), new OpenChannelModule()],\n localCacheEnabled: true,\n useAsyncStorageStore: internalStorage as never,\n });\n\n if (onInitialized) {\n chatSDK = onInitialized(chatSDK);\n }\n\n const platform = getDeviceOSPlatform();\n if (SendbirdUIKit.VERSION && platform) {\n const deviceOSInfo = { platform, version: String(Platform.Version) };\n const customData = { platform_version: getReactNativeVersion() };\n const uikitExtension = {\n product: SendbirdProduct.UIKIT_CHAT,\n version: SendbirdUIKit.VERSION,\n platform: SendbirdPlatform.REACT_NATIVE,\n };\n\n chatSDK.addSendbirdExtensions([uikitExtension], deviceOSInfo, customData);\n chatSDK.addExtension('sb_uikit', SendbirdUIKit.VERSION);\n }\n\n if (SendbirdUIKit.PLATFORM) {\n chatSDK.addExtension('device-os-platform', SendbirdUIKit.PLATFORM);\n }\n\n if (NetInfo?.addEventListener) {\n try {\n // NOTE: For removing buggy behavior of NetInfo.addEventListener\n // When you first add an event listener, it is assumed that the initialization of the internal event detector is done simultaneously.\n // In other words, when you call the first event listener two events are triggered immediately\n // - the one that is called when adding the event listener\n // - and the internal initialization event\n NetInfo.addEventListener(NOOP)();\n } catch {}\n\n const listener = (callback: () => void, callbackType: 'online' | 'offline') => {\n let callCount = 0;\n const unsubscribe = NetInfo.addEventListener((state) => {\n const online = Boolean(state.isConnected) || Boolean(state.isInternetReachable);\n\n // NOTE: When NetInfo.addEventListener is called\n // the event is immediately triggered regardless of whether the event actually occurred.\n // This is why it filters the first event.\n if (callCount === 0) {\n callCount++;\n return;\n }\n\n if (online && callbackType === 'online') callback();\n if (!online && callbackType === 'offline') callback();\n });\n unsubscribes.push(unsubscribe);\n return unsubscribe;\n };\n chatSDK.setOnlineListener?.((onOnline) => listener(onOnline, 'online'));\n chatSDK.setOfflineListener?.((onOffline) => listener(onOffline, 'offline'));\n }\n return { chatSDK, unsubscribes };\n};\n\nfunction getDeviceOSPlatform() {\n switch (Platform.OS) {\n case 'android':\n return DeviceOsPlatform.ANDROID;\n case 'ios':\n return DeviceOsPlatform.IOS;\n case 'web':\n return DeviceOsPlatform.WEB;\n case 'windows':\n return DeviceOsPlatform.WINDOWS;\n default:\n return undefined;\n }\n}\n\nfunction getReactNativeVersion() {\n const { major, minor, patch } = Platform.constants.reactNativeVersion;\n return `${major}.${minor}.${patch}`;\n}\n\nconst useConfigInstance = ({ imageCompression, userMention, voiceMessage }: SendbirdUIKitContainerProps) => {\n const mentionConfig = useMemo(() => {\n return new MentionConfig({\n mentionLimit: userMention?.mentionLimit || MentionConfig.DEFAULT.MENTION_LIMIT,\n suggestionLimit: userMention?.suggestionLimit || MentionConfig.DEFAULT.SUGGESTION_LIMIT,\n debounceMills: userMention?.debounceMills ?? MentionConfig.DEFAULT.DEBOUNCE_MILLS,\n delimiter: MentionConfig.DEFAULT.DELIMITER,\n trigger: MentionConfig.DEFAULT.TRIGGER,\n });\n }, [userMention?.mentionLimit, userMention?.suggestionLimit, userMention?.debounceMills]);\n\n const imageCompressionConfig = useMemo(() => {\n return new ImageCompressionConfig({\n compressionRate: imageCompression?.compressionRate || ImageCompressionConfig.DEFAULT.COMPRESSION_RATE,\n width: imageCompression?.width,\n height: imageCompression?.height,\n });\n }, [imageCompression?.compressionRate, imageCompression?.width, imageCompression?.height]);\n\n const voiceMessageConfig = useMemo(() => {\n return new VoiceMessageConfig({\n recorder: {\n minDuration: voiceMessage?.recorder?.minDuration ?? VoiceMessageConfig.DEFAULT.RECORDER.MIN_DURATION,\n maxDuration: voiceMessage?.recorder?.maxDuration ?? VoiceMessageConfig.DEFAULT.RECORDER.MAX_DURATION,\n },\n });\n }, [voiceMessage?.recorder?.minDuration, voiceMessage?.recorder?.maxDuration]);\n\n return {\n mentionConfig,\n imageCompressionConfig,\n voiceMessageConfig,\n };\n};\n\nexport default SendbirdUIKitContainer;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAEA,IAAAM,2BAAA,GAAAN,OAAA;AAQA,IAAAO,WAAA,GAAAP,OAAA;AASA,IAAAQ,WAAA,GAAAR,OAAA;AAEA,IAAAS,gBAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AAEA,IAAAY,gBAAA,GAAAZ,OAAA;AACA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAC,sBAAA,CAAAf,OAAA;AAEA,IAAAgB,uBAAA,GAAAD,sBAAA,CAAAf,OAAA;AACA,IAAAiB,0BAAA,GAAAF,sBAA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true
5
5
  });
6
6
  exports.PlatformServiceProvider = exports.PlatformServiceContext = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _uikitUtils = require("@sendbird/uikit-utils");
9
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
9
11
  const PlatformServiceContext = /*#__PURE__*/_react.default.createContext(null);
10
12
  exports.PlatformServiceContext = PlatformServiceContext;
11
13
  const PlatformServiceProvider = _ref => {
12
14
  let {
13
15
  children,
14
- fileService,
15
- clipboardService,
16
- notificationService,
17
- mediaService
16
+ voiceMessageConfig,
17
+ ...services
18
18
  } = _ref;
19
- return /*#__PURE__*/_react.default.createElement(PlatformServiceContext.Provider, {
20
- value: {
21
- fileService,
22
- clipboardService,
23
- notificationService,
24
- mediaService
19
+ (0, _react.useEffect)(() => {
20
+ services.recorderService.options.minDuration = voiceMessageConfig.recorder.minDuration;
21
+ services.recorderService.options.maxDuration = voiceMessageConfig.recorder.maxDuration;
22
+ }, [voiceMessageConfig]);
23
+ (0, _uikitUtils.useAppState)('change', state => {
24
+ if (state !== 'active') {
25
+ Promise.allSettled([services.playerService.reset(), services.recorderService.reset()]);
25
26
  }
27
+ });
28
+ return /*#__PURE__*/_react.default.createElement(PlatformServiceContext.Provider, {
29
+ value: services
26
30
  }, children);
27
31
  };
28
32
  exports.PlatformServiceProvider = PlatformServiceProvider;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","obj","__esModule","default","PlatformServiceContext","React","createContext","exports","PlatformServiceProvider","_ref","children","fileService","clipboardService","notificationService","mediaService","createElement","Provider","value"],"sources":["PlatformServiceCtx.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {\n ClipboardServiceInterface,\n FileServiceInterface,\n MediaServiceInterface,\n NotificationServiceInterface,\n} from '../platform/types';\n\ntype Props = React.PropsWithChildren<{\n fileService: FileServiceInterface;\n clipboardService: ClipboardServiceInterface;\n notificationService: NotificationServiceInterface;\n mediaService: MediaServiceInterface;\n}>;\n\nexport type PlatformServiceContextType = {\n fileService: FileServiceInterface;\n clipboardService: ClipboardServiceInterface;\n notificationService: NotificationServiceInterface;\n mediaService: MediaServiceInterface;\n};\n\nexport const PlatformServiceContext = React.createContext<PlatformServiceContextType | null>(null);\nexport const PlatformServiceProvider = ({\n children,\n fileService,\n clipboardService,\n notificationService,\n mediaService,\n}: Props) => {\n return (\n <PlatformServiceContext.Provider value={{ fileService, clipboardService, notificationService, mediaService }}>\n {children}\n </PlatformServiceContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAuBnB,MAAMG,sBAAsB,gBAAGC,cAAK,CAACC,aAAa,CAAoC,IAAI,CAAC;AAACC,OAAA,CAAAH,sBAAA,GAAAA,sBAAA;AAC5F,MAAMI,uBAAuB,GAAGC,IAAA,IAM1B;EAAA,IAN2B;IACtCC,QAAQ;IACRC,WAAW;IACXC,gBAAgB;IAChBC,mBAAmB;IACnBC;EACK,CAAC,GAAAL,IAAA;EACN,oBACEX,MAAA,CAAAK,OAAA,CAAAY,aAAA,CAACX,sBAAsB,CAACY,QAAQ;IAACC,KAAK,EAAE;MAAEN,WAAW;MAAEC,gBAAgB;MAAEC,mBAAmB;MAAEC;IAAa;EAAE,GAC1GJ,QAAQ,CACuB;AAEtC,CAAC;AAACH,OAAA,CAAAC,uBAAA,GAAAA,uBAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_uikitUtils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","PlatformServiceContext","React","createContext","exports","PlatformServiceProvider","_ref","children","voiceMessageConfig","services","useEffect","recorderService","options","minDuration","recorder","maxDuration","useAppState","state","Promise","allSettled","playerService","reset","createElement","Provider","value"],"sources":["PlatformServiceCtx.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\nimport { useAppState } from '@sendbird/uikit-utils';\n\nimport VoiceMessageConfig from '../libs/VoiceMessageConfig';\nimport type {\n ClipboardServiceInterface,\n FileServiceInterface,\n MediaServiceInterface,\n NotificationServiceInterface,\n PlayerServiceInterface,\n RecorderServiceInterface,\n} from '../platform/types';\n\nexport type PlatformServiceContextType = {\n fileService: FileServiceInterface;\n clipboardService: ClipboardServiceInterface;\n notificationService: NotificationServiceInterface;\n mediaService: MediaServiceInterface;\n recorderService: RecorderServiceInterface;\n playerService: PlayerServiceInterface;\n};\ntype Props = React.PropsWithChildren<PlatformServiceContextType & { voiceMessageConfig: VoiceMessageConfig }>;\n\nexport const PlatformServiceContext = React.createContext<PlatformServiceContextType | null>(null);\nexport const PlatformServiceProvider = ({ children, voiceMessageConfig, ...services }: Props) => {\n useEffect(() => {\n services.recorderService.options.minDuration = voiceMessageConfig.recorder.minDuration;\n services.recorderService.options.maxDuration = voiceMessageConfig.recorder.maxDuration;\n }, [voiceMessageConfig]);\n\n useAppState('change', (state) => {\n if (state !== 'active') {\n Promise.allSettled([services.playerService.reset(), services.recorderService.reset()]);\n }\n });\n\n return <PlatformServiceContext.Provider value={services}>{children}</PlatformServiceContext.Provider>;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAAoD,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,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ports.ReactionContext = ReactionContext;
18
18
  const ReactionProvider = _ref => {
19
19
  let {
20
- children
20
+ children,
21
+ onPressUserProfile
21
22
  } = _ref;
22
23
  const chatCtx = (0, _react.useContext)(_SendbirdChatCtx.SendbirdChatContext);
23
24
  const localizationCtx = (0, _react.useContext)(_LocalizationCtx.LocalizationContext);
@@ -72,7 +73,7 @@ const ReactionProvider = _ref => {
72
73
  chatCtx,
73
74
  reactionCtx,
74
75
  localizationCtx,
75
- userProfileCtx,
76
+ onPressUserProfile: onPressUserProfile ?? userProfileCtx.show,
76
77
  onDismiss: () => {
77
78
  var _closeResolver$curren;
78
79
  setState({});
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_uikitUtils","_ReactionBottomSheets","_LocalizationCtx","_SendbirdChatCtx","_UserProfileCtx","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","ReactionContext","React","createContext","exports","ReactionProvider","_ref","children","chatCtx","useContext","SendbirdChatContext","localizationCtx","LocalizationContext","userProfileCtx","UserProfileContext","Error","state","setState","useReducer","prev","next","reactionListVisible","setReactionListVisible","useState","reactionUserListVisible","setReactionUserListVisible","reactionUserListFocusIndex","setReactionUserListFocusIndex","closeResolver","useRef","NOOP","openReactionList","useCallback","params","openReactionUserList","_ref2","channel","message","focusIndex","updateReactionFocusedItem","createOnCloseWithResolver","callback","Promise","resolve","current","reactionCtx","sheetProps","onDismiss","_closeResolver$curren","createElement","Provider","value","ReactionBottomSheets","UserList","visible","onClose","ReactionList"],"sources":["ReactionCtx.tsx"],"sourcesContent":["import React, { useCallback, useContext, useReducer, useRef, useState } from 'react';\n\nimport type { SendbirdBaseChannel, SendbirdBaseMessage } from '@sendbird/uikit-utils';\nimport { NOOP } from '@sendbird/uikit-utils';\n\nimport { ReactionBottomSheets } from '../components/ReactionBottomSheets';\nimport { LocalizationContext } from '../contexts/LocalizationCtx';\nimport { SendbirdChatContext } from '../contexts/SendbirdChatCtx';\nimport { UserProfileContext } from '../contexts/UserProfileCtx';\n\ntype State = {\n message?: SendbirdBaseMessage;\n channel?: SendbirdBaseChannel;\n};\nexport type ReactionContextType = {\n openReactionList(param: Required<State>): void;\n openReactionUserList(param: Required<State> & { focusIndex?: number }): void;\n updateReactionFocusedItem(param?: State): void;\n focusIndex: number;\n} & State;\n\ntype Props = React.PropsWithChildren<{}>;\n\nexport const ReactionContext = React.createContext<ReactionContextType | null>(null);\nexport const ReactionProvider = ({ children }: Props) => {\n const chatCtx = useContext(SendbirdChatContext);\n const localizationCtx = useContext(LocalizationContext);\n const userProfileCtx = useContext(UserProfileContext);\n if (!chatCtx) throw new Error('SendbirdChatContext is not provided');\n if (!localizationCtx) throw new Error('LocalizationContext is not provided');\n if (!userProfileCtx) throw new Error('UserProfileContext is not provided');\n\n const [state, setState] = useReducer((prev: State, next: State) => ({ ...prev, ...next }), {});\n const [reactionListVisible, setReactionListVisible] = useState(false);\n const [reactionUserListVisible, setReactionUserListVisible] = useState(false);\n const [reactionUserListFocusIndex, setReactionUserListFocusIndex] = useState(0);\n\n const closeResolver = useRef<() => void>(NOOP);\n\n const openReactionList: ReactionContextType['openReactionList'] = useCallback((params) => {\n setState(params);\n setReactionListVisible(true);\n }, []);\n\n const openReactionUserList: ReactionContextType['openReactionUserList'] = useCallback(\n ({ channel, message, focusIndex = 0 }) => {\n setState({ channel, message });\n setReactionUserListFocusIndex(focusIndex);\n setReactionUserListVisible(true);\n },\n [],\n );\n\n const updateReactionFocusedItem: ReactionContextType['updateReactionFocusedItem'] = useCallback((params) => {\n if (params) setState(params);\n else setState({});\n }, []);\n\n const createOnCloseWithResolver = (callback: () => void) => {\n return () => {\n return new Promise<void>((resolve) => {\n closeResolver.current = resolve;\n callback();\n });\n };\n };\n\n const reactionCtx = {\n ...state,\n openReactionList,\n openReactionUserList,\n updateReactionFocusedItem,\n focusIndex: reactionUserListFocusIndex,\n };\n\n const sheetProps = {\n chatCtx,\n reactionCtx,\n localizationCtx,\n userProfileCtx,\n onDismiss: () => {\n setState({});\n closeResolver.current?.();\n },\n };\n\n return (\n <ReactionContext.Provider value={reactionCtx}>\n {children}\n <ReactionBottomSheets.UserList\n {...sheetProps}\n visible={reactionUserListVisible}\n onClose={createOnCloseWithResolver(() => setReactionUserListVisible(false))}\n />\n <ReactionBottomSheets.ReactionList\n {...sheetProps}\n visible={reactionListVisible}\n onClose={createOnCloseWithResolver(() => setReactionListVisible(false))}\n />\n </ReactionContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAAgE,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WA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AAA,CAACnF,qBAAA,CAAAsF,oBAAoB,CAACI,YAAY,EAAAhE,QAAA,KAC5BsD,UAAU;IACdQ,OAAO,EAAEjC,mBAAoB;IAC7BkC,OAAO,EAAEf,yBAAyB,CAAC,MAAMlB,sBAAsB,CAAC,KAAK,CAAC;EAAE,GACxE,CACuB;AAE/B,CAAC;AAAClB,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_uikitUtils","_ReactionBottomSheets","_LocalizationCtx","_SendbirdChatCtx","_UserProfileCtx","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","ReactionContext","React","createContext","exports","ReactionProvider","_ref","children","onPressUserProfile","chatCtx","useContext","SendbirdChatContext","localizationCtx","LocalizationContext","userProfileCtx","UserProfileContext","Error","state","setState","useReducer","prev","next","reactionListVisible","setReactionListVisible","useState","reactionUserListVisible","setReactionUserListVisible","reactionUserListFocusIndex","setReactionUserListFocusIndex","closeResolver","useRef","NOOP","openReactionList","useCallback","params","openReactionUserList","_ref2","channel","message","focusIndex","updateReactionFocusedItem","createOnCloseWithResolver","callback","Promise","resolve","current","reactionCtx","sheetProps","show","onDismiss","_closeResolver$curren","createElement","Provider","value","ReactionBottomSheets","UserList","visible","onClose","ReactionList"],"sources":["ReactionCtx.tsx"],"sourcesContent":["import React, { useCallback, useContext, useReducer, useRef, useState } from 'react';\n\nimport type { SendbirdBaseChannel, SendbirdBaseMessage } from '@sendbird/uikit-utils';\nimport { NOOP } from '@sendbird/uikit-utils';\n\nimport { ReactionBottomSheetProps, ReactionBottomSheets } from '../components/ReactionBottomSheets';\nimport { LocalizationContext } from '../contexts/LocalizationCtx';\nimport { SendbirdChatContext } from '../contexts/SendbirdChatCtx';\nimport { UserProfileContext } from '../contexts/UserProfileCtx';\n\ntype State = {\n message?: SendbirdBaseMessage;\n channel?: SendbirdBaseChannel;\n};\nexport type ReactionContextType = {\n openReactionList(param: Required<State>): void;\n openReactionUserList(param: Required<State> & { focusIndex?: number }): void;\n updateReactionFocusedItem(param?: State): void;\n focusIndex: number;\n} & State;\n\ntype Props = React.PropsWithChildren<{\n onPressUserProfile?: ReactionBottomSheetProps['onPressUserProfile'];\n}>;\n\nexport const ReactionContext = React.createContext<ReactionContextType | null>(null);\nexport const ReactionProvider = ({ children, onPressUserProfile }: Props) => {\n const chatCtx = useContext(SendbirdChatContext);\n const localizationCtx = useContext(LocalizationContext);\n const userProfileCtx = useContext(UserProfileContext);\n if (!chatCtx) throw new Error('SendbirdChatContext is not provided');\n if (!localizationCtx) throw new Error('LocalizationContext is not provided');\n if (!userProfileCtx) throw new Error('UserProfileContext is not provided');\n\n const [state, setState] = useReducer((prev: State, next: State) => ({ ...prev, ...next }), {});\n const [reactionListVisible, setReactionListVisible] = useState(false);\n const [reactionUserListVisible, setReactionUserListVisible] = useState(false);\n const [reactionUserListFocusIndex, setReactionUserListFocusIndex] = useState(0);\n\n const closeResolver = useRef<() => void>(NOOP);\n\n const openReactionList: ReactionContextType['openReactionList'] = useCallback((params) => {\n setState(params);\n setReactionListVisible(true);\n }, []);\n\n const openReactionUserList: ReactionContextType['openReactionUserList'] = useCallback(\n ({ channel, message, focusIndex = 0 }) => {\n setState({ channel, message });\n setReactionUserListFocusIndex(focusIndex);\n setReactionUserListVisible(true);\n },\n [],\n );\n\n const updateReactionFocusedItem: ReactionContextType['updateReactionFocusedItem'] = useCallback((params) => {\n if (params) setState(params);\n else setState({});\n }, []);\n\n const createOnCloseWithResolver = (callback: () => void) => {\n return () => {\n return new Promise<void>((resolve) => {\n closeResolver.current = resolve;\n callback();\n });\n };\n };\n\n const reactionCtx = {\n ...state,\n openReactionList,\n openReactionUserList,\n updateReactionFocusedItem,\n focusIndex: reactionUserListFocusIndex,\n };\n\n const sheetProps: Omit<ReactionBottomSheetProps, 'visible' | 'onClose'> = {\n chatCtx,\n reactionCtx,\n localizationCtx,\n onPressUserProfile: onPressUserProfile ?? userProfileCtx.show,\n onDismiss: () => {\n setState({});\n closeResolver.current?.();\n },\n };\n\n return (\n <ReactionContext.Provider value={reactionCtx}>\n {children}\n <ReactionBottomSheets.UserList\n {...sheetProps}\n visible={reactionUserListVisible}\n onClose={createOnCloseWithResolver(() => setReactionUserListVisible(false))}\n />\n <ReactionBottomSheets.ReactionList\n {...sheetProps}\n visible={reactionListVisible}\n onClose={createOnCloseWithResolver(() => setReactionListVisible(false))}\n />\n </ReactionContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAAgE,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,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,KAAK,CAAC;EAAE,GAC5E,eACFhE,MAAA,CAAAe,OAAA,CAAA0E,aAAA,CAACrF,qBAAA,CAAAwF,oBAAoB,CAACI,YAAY,EAAAlE,QAAA,KAC5BuD,UAAU;IACdS,OAAO,EAAElC,mBAAoB;IAC7BmC,OAAO,EAAEhB,yBAAyB,CAAC,MAAMlB,sBAAsB,CAAC,KAAK,CAAC;EAAE,GACxE,CACuB;AAE/B,CAAC;AAACnB,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
@@ -19,6 +19,7 @@ const SendbirdChatProvider = _ref => {
19
19
  emojiManager,
20
20
  mentionManager,
21
21
  imageCompressionConfig,
22
+ voiceMessageConfig,
22
23
  enableAutoPushTokenRegistration,
23
24
  enableUseUserIdForNickname,
24
25
  enableImageCompression
@@ -74,6 +75,7 @@ const SendbirdChatProvider = _ref => {
74
75
  emojiManager,
75
76
  mentionManager,
76
77
  imageCompressionConfig,
78
+ voiceMessageConfig,
77
79
  currentUser,
78
80
  setCurrentUser,
79
81
  updateCurrentUserInfo,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_uikitChatHooks","_uikitTools","_uikitUtils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SendbirdChatContext","React","createContext","exports","SendbirdChatProvider","_ref","children","sdkInstance","emojiManager","mentionManager","imageCompressionConfig","enableAutoPushTokenRegistration","enableUseUserIdForNickname","enableImageCompression","currentUser","_setCurrentUser","useState","forceUpdate","useForceUpdate","appFeatures","useAppFeatures","configs","configsWithAppAttr","useUIKitConfig","setCurrentUser","useCallback","user","updateCurrentUserInfo","nickname","profile","Error","params","profileUrl","profileImage","markAsDeliveredWithChannel","channel","deliveryReceiptEnabled","confirmAndMarkAsDelivered","useAppState","status","connectionState","setForegroundState","setBackgroundState","useEffect","disconnect","then","undefined","value","sdk","sbOptions","appInfo","uikit","uikitWithAppInfo","chat","autoPushTokenRegistrationEnabled","useUserIdForNicknameEnabled","imageCompressionEnabled","createElement","Provider"],"sources":["SendbirdChatCtx.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\n\nimport { useAppFeatures } from '@sendbird/uikit-chat-hooks';\nimport { SBUConfig, useUIKitConfig } from '@sendbird/uikit-tools';\nimport type {\n SendbirdChatSDK,\n SendbirdGroupChannel,\n SendbirdUser,\n SendbirdUserUpdateParams,\n} from '@sendbird/uikit-utils';\nimport { confirmAndMarkAsDelivered, useAppState, useForceUpdate } from '@sendbird/uikit-utils';\n\nimport type EmojiManager from '../libs/EmojiManager';\nimport type ImageCompressionConfig from '../libs/ImageCompressionConfig';\nimport type MentionManager from '../libs/MentionManager';\nimport type { FileType } from '../platform/types';\n\nexport interface ChatRelatedFeaturesInUIKit {\n enableAutoPushTokenRegistration: boolean;\n enableUseUserIdForNickname: boolean;\n enableImageCompression: boolean;\n}\n\ninterface Props extends ChatRelatedFeaturesInUIKit, React.PropsWithChildren {\n sdkInstance: SendbirdChatSDK;\n emojiManager: EmojiManager;\n mentionManager: MentionManager;\n imageCompressionConfig: ImageCompressionConfig;\n}\n\nexport type SendbirdChatContextType = {\n sdk: SendbirdChatSDK;\n emojiManager: EmojiManager;\n mentionManager: MentionManager;\n imageCompressionConfig: ImageCompressionConfig;\n currentUser?: SendbirdUser;\n setCurrentUser: React.Dispatch<React.SetStateAction<SendbirdUser | undefined>>;\n\n // helper functions\n updateCurrentUserInfo: (nickname?: string, profile?: string | FileType) => Promise<SendbirdUser>;\n markAsDeliveredWithChannel: (channel: SendbirdGroupChannel) => void;\n\n sbOptions: {\n // UIKit options\n uikit: SBUConfig;\n uikitWithAppInfo: {\n groupChannel: {\n channel: {\n enableReactions: boolean;\n enableOgtag: boolean;\n };\n setting: {\n enableMessageSearch: boolean;\n };\n };\n openChannel: {\n channel: {\n enableOgtag: boolean;\n };\n };\n };\n\n // Chat related options in UIKit\n chat: {\n imageCompressionEnabled: boolean;\n useUserIdForNicknameEnabled: boolean;\n autoPushTokenRegistrationEnabled: boolean; // RN only\n };\n\n // Sendbird application options\n appInfo: {\n deliveryReceiptEnabled: boolean;\n broadcastChannelEnabled: boolean;\n superGroupChannelEnabled: boolean;\n reactionEnabled: boolean;\n };\n };\n};\n\nexport const SendbirdChatContext = React.createContext<SendbirdChatContextType | null>(null);\nexport const SendbirdChatProvider = ({\n children,\n sdkInstance,\n emojiManager,\n mentionManager,\n imageCompressionConfig,\n enableAutoPushTokenRegistration,\n enableUseUserIdForNickname,\n enableImageCompression,\n}: Props) => {\n const [currentUser, _setCurrentUser] = useState<SendbirdUser>();\n const forceUpdate = useForceUpdate();\n const appFeatures = useAppFeatures(sdkInstance);\n const { configs, configsWithAppAttr } = useUIKitConfig();\n\n const setCurrentUser: SendbirdChatContextType['setCurrentUser'] = useCallback((user) => {\n // NOTE: Sendbird SDK handle User object is always same object, so force update after setCurrentUser\n _setCurrentUser(user);\n forceUpdate();\n }, []);\n\n const updateCurrentUserInfo: SendbirdChatContextType['updateCurrentUserInfo'] = useCallback(\n async (nickname, profile) => {\n let user = currentUser;\n\n if (!user) throw new Error('Current user is not defined, please connect using `useConnection()` hook first');\n\n const params: SendbirdUserUpdateParams = {};\n\n if (!nickname) {\n params.nickname = user.nickname;\n } else {\n params.nickname = nickname;\n }\n\n if (!profile) {\n params.profileUrl = user.profileUrl;\n } else if (typeof profile === 'string') {\n params.profileUrl = profile;\n } else if (typeof profile === 'object') {\n params.profileImage = profile;\n } else {\n throw new Error(`Cannot update profile, not supported profile type(${typeof profile})`);\n }\n\n user = await sdkInstance.updateCurrentUserInfo(params);\n\n setCurrentUser(user);\n return user;\n },\n [sdkInstance, currentUser, setCurrentUser],\n );\n\n const markAsDeliveredWithChannel: SendbirdChatContextType['markAsDeliveredWithChannel'] = useCallback(\n (channel: SendbirdGroupChannel) => {\n if (appFeatures.deliveryReceiptEnabled) confirmAndMarkAsDelivered([channel]);\n },\n [sdkInstance, appFeatures.deliveryReceiptEnabled],\n );\n\n useAppState('change', (status) => {\n // 'active' | 'background' | 'inactive' | 'unknown' | 'extension';\n if (status === 'active') sdkInstance.connectionState === 'CLOSED' && sdkInstance.setForegroundState();\n else if (status === 'background') sdkInstance.connectionState === 'OPEN' && sdkInstance.setBackgroundState();\n });\n\n useEffect(() => {\n return () => {\n sdkInstance.disconnect().then(() => _setCurrentUser(undefined));\n };\n }, [sdkInstance]);\n\n const value: SendbirdChatContextType = {\n sdk: sdkInstance,\n emojiManager,\n mentionManager,\n imageCompressionConfig,\n currentUser,\n setCurrentUser,\n\n updateCurrentUserInfo,\n markAsDeliveredWithChannel,\n\n // TODO: Options should be moved to the common area at the higher level to be passed to the context of each product.\n // For example, common -> chat context, common -> calls context\n sbOptions: {\n appInfo: appFeatures,\n uikit: configs,\n uikitWithAppInfo: configsWithAppAttr(sdkInstance),\n chat: {\n autoPushTokenRegistrationEnabled: enableAutoPushTokenRegistration,\n useUserIdForNicknameEnabled: enableUseUserIdForNickname,\n imageCompressionEnabled: enableImageCompression,\n },\n },\n };\n\n return <SendbirdChatContext.Provider value={value}>{children}</SendbirdChatContext.Provider>;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,WAAA,GAAAH,OAAA;AAA+F,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBA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AAA,oBAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_uikitChatHooks","_uikitTools","_uikitUtils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SendbirdChatContext","React","createContext","exports","SendbirdChatProvider","_ref","children","sdkInstance","emojiManager","mentionManager","imageCompressionConfig","voiceMessageConfig","enableAutoPushTokenRegistration","enableUseUserIdForNickname","enableImageCompression","currentUser","_setCurrentUser","useState","forceUpdate","useForceUpdate","appFeatures","useAppFeatures","configs","configsWithAppAttr","useUIKitConfig","setCurrentUser","useCallback","user","updateCurrentUserInfo","nickname","profile","Error","params","profileUrl","profileImage","markAsDeliveredWithChannel","channel","deliveryReceiptEnabled","confirmAndMarkAsDelivered","useAppState","status","connectionState","setForegroundState","setBackgroundState","useEffect","disconnect","then","undefined","value","sdk","sbOptions","appInfo","uikit","uikitWithAppInfo","chat","autoPushTokenRegistrationEnabled","useUserIdForNicknameEnabled","imageCompressionEnabled","createElement","Provider"],"sources":["SendbirdChatCtx.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\n\nimport { useAppFeatures } from '@sendbird/uikit-chat-hooks';\nimport { SBUConfig, useUIKitConfig } from '@sendbird/uikit-tools';\nimport type {\n SendbirdChatSDK,\n SendbirdGroupChannel,\n SendbirdUser,\n SendbirdUserUpdateParams,\n} from '@sendbird/uikit-utils';\nimport { confirmAndMarkAsDelivered, useAppState, useForceUpdate } from '@sendbird/uikit-utils';\n\nimport type EmojiManager from '../libs/EmojiManager';\nimport type ImageCompressionConfig from '../libs/ImageCompressionConfig';\nimport type MentionManager from '../libs/MentionManager';\nimport type VoiceMessageConfig from '../libs/VoiceMessageConfig';\nimport type { FileType } from '../platform/types';\n\nexport interface ChatRelatedFeaturesInUIKit {\n enableAutoPushTokenRegistration: boolean;\n enableUseUserIdForNickname: boolean;\n enableImageCompression: boolean;\n}\n\ninterface Props extends ChatRelatedFeaturesInUIKit, React.PropsWithChildren {\n sdkInstance: SendbirdChatSDK;\n\n emojiManager: EmojiManager;\n mentionManager: MentionManager;\n imageCompressionConfig: ImageCompressionConfig;\n voiceMessageConfig: VoiceMessageConfig;\n}\n\nexport type SendbirdChatContextType = {\n sdk: SendbirdChatSDK;\n currentUser?: SendbirdUser;\n setCurrentUser: React.Dispatch<React.SetStateAction<SendbirdUser | undefined>>;\n\n // feature related instances\n emojiManager: EmojiManager;\n mentionManager: MentionManager;\n imageCompressionConfig: ImageCompressionConfig;\n voiceMessageConfig: VoiceMessageConfig;\n\n // helper functions\n updateCurrentUserInfo: (nickname?: string, profile?: string | FileType) => Promise<SendbirdUser>;\n markAsDeliveredWithChannel: (channel: SendbirdGroupChannel) => void;\n\n sbOptions: {\n // UIKit options\n uikit: SBUConfig;\n uikitWithAppInfo: {\n groupChannel: {\n channel: {\n enableReactions: boolean;\n enableOgtag: boolean;\n };\n setting: {\n enableMessageSearch: boolean;\n };\n };\n openChannel: {\n channel: {\n enableOgtag: boolean;\n };\n };\n };\n\n // Chat related options in UIKit\n chat: {\n imageCompressionEnabled: boolean;\n useUserIdForNicknameEnabled: boolean;\n autoPushTokenRegistrationEnabled: boolean; // RN only\n };\n\n // Sendbird application options\n appInfo: {\n deliveryReceiptEnabled: boolean;\n broadcastChannelEnabled: boolean;\n superGroupChannelEnabled: boolean;\n reactionEnabled: boolean;\n };\n };\n};\n\nexport const SendbirdChatContext = React.createContext<SendbirdChatContextType | null>(null);\nexport const SendbirdChatProvider = ({\n children,\n sdkInstance,\n emojiManager,\n mentionManager,\n imageCompressionConfig,\n voiceMessageConfig,\n enableAutoPushTokenRegistration,\n enableUseUserIdForNickname,\n enableImageCompression,\n}: Props) => {\n const [currentUser, _setCurrentUser] = useState<SendbirdUser>();\n const forceUpdate = useForceUpdate();\n const appFeatures = useAppFeatures(sdkInstance);\n const { configs, configsWithAppAttr } = useUIKitConfig();\n\n const setCurrentUser: SendbirdChatContextType['setCurrentUser'] = useCallback((user) => {\n // NOTE: Sendbird SDK handle User object is always same object, so force update after setCurrentUser\n _setCurrentUser(user);\n forceUpdate();\n }, []);\n\n const updateCurrentUserInfo: SendbirdChatContextType['updateCurrentUserInfo'] = useCallback(\n async (nickname, profile) => {\n let user = currentUser;\n\n if (!user) throw new Error('Current user is not defined, please connect using `useConnection()` hook first');\n\n const params: SendbirdUserUpdateParams = {};\n\n if (!nickname) {\n params.nickname = user.nickname;\n } else {\n params.nickname = nickname;\n }\n\n if (!profile) {\n params.profileUrl = user.profileUrl;\n } else if (typeof profile === 'string') {\n params.profileUrl = profile;\n } else if (typeof profile === 'object') {\n params.profileImage = profile;\n } else {\n throw new Error(`Cannot update profile, not supported profile type(${typeof profile})`);\n }\n\n user = await sdkInstance.updateCurrentUserInfo(params);\n\n setCurrentUser(user);\n return user;\n },\n [sdkInstance, currentUser, setCurrentUser],\n );\n\n const markAsDeliveredWithChannel: SendbirdChatContextType['markAsDeliveredWithChannel'] = useCallback(\n (channel: SendbirdGroupChannel) => {\n if (appFeatures.deliveryReceiptEnabled) confirmAndMarkAsDelivered([channel]);\n },\n [sdkInstance, appFeatures.deliveryReceiptEnabled],\n );\n\n useAppState('change', (status) => {\n // 'active' | 'background' | 'inactive' | 'unknown' | 'extension';\n if (status === 'active') sdkInstance.connectionState === 'CLOSED' && sdkInstance.setForegroundState();\n else if (status === 'background') sdkInstance.connectionState === 'OPEN' && sdkInstance.setBackgroundState();\n });\n\n useEffect(() => {\n return () => {\n sdkInstance.disconnect().then(() => _setCurrentUser(undefined));\n };\n }, [sdkInstance]);\n\n const value: SendbirdChatContextType = {\n sdk: sdkInstance,\n emojiManager,\n mentionManager,\n imageCompressionConfig,\n voiceMessageConfig,\n currentUser,\n setCurrentUser,\n\n updateCurrentUserInfo,\n markAsDeliveredWithChannel,\n\n // TODO: Options should be moved to the common area at the higher level to be passed to the context of each product.\n // For example, common -> chat context, common -> calls context\n sbOptions: {\n appInfo: appFeatures,\n uikit: configs,\n uikitWithAppInfo: configsWithAppAttr(sdkInstance),\n chat: {\n autoPushTokenRegistrationEnabled: enableAutoPushTokenRegistration,\n useUserIdForNicknameEnabled: enableUseUserIdForNickname,\n imageCompressionEnabled: enableImageCompression,\n },\n },\n };\n\n return <SendbirdChatContext.Provider value={value}>{children}</SendbirdChatContext.Provider>;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,WAAA,GAAAH,OAAA;AAA+F,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA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