@sendbird/uikit-react-native 3.1.2 → 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 (317) 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/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js +24 -13
  13. package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js.map +1 -1
  14. package/lib/commonjs/components/GroupChannelMessageRenderer/index.js +100 -5
  15. package/lib/commonjs/components/GroupChannelMessageRenderer/index.js.map +1 -1
  16. package/lib/commonjs/components/MessageSearchResultItem.js +1 -0
  17. package/lib/commonjs/components/MessageSearchResultItem.js.map +1 -1
  18. package/lib/commonjs/components/OpenChannelMessageRenderer/index.js +1 -0
  19. package/lib/commonjs/components/OpenChannelMessageRenderer/index.js.map +1 -1
  20. package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +2 -2
  21. package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
  22. package/lib/commonjs/components/ReactionBottomSheets/index.js.map +1 -1
  23. package/lib/commonjs/components/StatusComposition.js.map +1 -1
  24. package/lib/commonjs/constants.js +5 -1
  25. package/lib/commonjs/constants.js.map +1 -1
  26. package/lib/commonjs/containers/GroupChannelPreviewContainer.js +1 -0
  27. package/lib/commonjs/containers/GroupChannelPreviewContainer.js.map +1 -1
  28. package/lib/commonjs/containers/InternalErrorBoundaryContainer.js.map +1 -1
  29. package/lib/commonjs/containers/SendbirdUIKitContainer.js +72 -34
  30. package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -1
  31. package/lib/commonjs/contexts/PlatformServiceCtx.js +16 -12
  32. package/lib/commonjs/contexts/PlatformServiceCtx.js.map +1 -1
  33. package/lib/commonjs/contexts/ReactionCtx.js +3 -2
  34. package/lib/commonjs/contexts/ReactionCtx.js.map +1 -1
  35. package/lib/commonjs/contexts/SendbirdChatCtx.js +2 -0
  36. package/lib/commonjs/contexts/SendbirdChatCtx.js.map +1 -1
  37. package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +27 -42
  38. package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
  39. package/lib/commonjs/domain/groupChannel/module/moduleContext.js +109 -5
  40. package/lib/commonjs/domain/groupChannel/module/moduleContext.js.map +1 -1
  41. package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
  42. package/lib/commonjs/domain/userList/types.js.map +1 -1
  43. package/lib/commonjs/fragments/createGroupChannelFragment.js +30 -4
  44. package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
  45. package/lib/commonjs/fragments/createMessageSearchFragment.js +1 -1
  46. package/lib/commonjs/fragments/createMessageSearchFragment.js.map +1 -1
  47. package/lib/commonjs/hooks/useChannelInputItems.js +211 -0
  48. package/lib/commonjs/hooks/useChannelInputItems.js.map +1 -0
  49. package/lib/commonjs/hooks/useConnection.js +1 -1
  50. package/lib/commonjs/hooks/useConnection.js.map +1 -1
  51. package/lib/commonjs/hooks/useVoiceMessageInput.js +207 -0
  52. package/lib/commonjs/hooks/useVoiceMessageInput.js.map +1 -0
  53. package/lib/commonjs/index.js +32 -0
  54. package/lib/commonjs/index.js.map +1 -1
  55. package/lib/commonjs/libs/MentionManager.js.map +1 -1
  56. package/lib/commonjs/libs/SBUUtils.js +4 -0
  57. package/lib/commonjs/libs/SBUUtils.js.map +1 -1
  58. package/lib/commonjs/libs/VoiceMessageConfig.js +30 -0
  59. package/lib/commonjs/libs/VoiceMessageConfig.js.map +1 -0
  60. package/lib/commonjs/localization/StringSet.type.js.map +1 -1
  61. package/lib/commonjs/localization/createBaseStringSet.js +24 -9
  62. package/lib/commonjs/localization/createBaseStringSet.js.map +1 -1
  63. package/lib/commonjs/platform/createFileService.expo.js +10 -0
  64. package/lib/commonjs/platform/createFileService.expo.js.map +1 -1
  65. package/lib/commonjs/platform/createFileService.native.js +19 -0
  66. package/lib/commonjs/platform/createFileService.native.js.map +1 -1
  67. package/lib/commonjs/platform/createPlayerService.expo.js +137 -0
  68. package/lib/commonjs/platform/createPlayerService.expo.js.map +1 -0
  69. package/lib/commonjs/platform/createPlayerService.native.js +139 -0
  70. package/lib/commonjs/platform/createPlayerService.native.js.map +1 -0
  71. package/lib/commonjs/platform/createRecorderService.expo.js +158 -0
  72. package/lib/commonjs/platform/createRecorderService.expo.js.map +1 -0
  73. package/lib/commonjs/platform/createRecorderService.native.js +157 -0
  74. package/lib/commonjs/platform/createRecorderService.native.js.map +1 -0
  75. package/lib/commonjs/platform/types.js.map +1 -1
  76. package/lib/commonjs/types.js.map +1 -1
  77. package/lib/commonjs/version.js +1 -1
  78. package/lib/commonjs/version.js.map +1 -1
  79. package/lib/module/components/ChannelInput/MessageToReplyPreview.js +137 -0
  80. package/lib/module/components/ChannelInput/MessageToReplyPreview.js.map +1 -0
  81. package/lib/module/components/ChannelInput/SendInput.js +149 -314
  82. package/lib/module/components/ChannelInput/SendInput.js.map +1 -1
  83. package/lib/module/components/ChannelInput/VoiceMessageInput.js +228 -0
  84. package/lib/module/components/ChannelInput/VoiceMessageInput.js.map +1 -0
  85. package/lib/module/components/ChannelInput/index.js +5 -1
  86. package/lib/module/components/ChannelInput/index.js.map +1 -1
  87. package/lib/module/components/ChannelMessageList/index.js +2 -2
  88. package/lib/module/components/ChannelMessageList/index.js.map +1 -1
  89. package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js +24 -13
  90. package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js.map +1 -1
  91. package/lib/module/components/GroupChannelMessageRenderer/index.js +99 -6
  92. package/lib/module/components/GroupChannelMessageRenderer/index.js.map +1 -1
  93. package/lib/module/components/MessageSearchResultItem.js +2 -1
  94. package/lib/module/components/MessageSearchResultItem.js.map +1 -1
  95. package/lib/module/components/OpenChannelMessageRenderer/index.js +1 -0
  96. package/lib/module/components/OpenChannelMessageRenderer/index.js.map +1 -1
  97. package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +2 -2
  98. package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
  99. package/lib/module/components/ReactionBottomSheets/index.js.map +1 -1
  100. package/lib/module/components/StatusComposition.js.map +1 -1
  101. package/lib/module/constants.js +2 -0
  102. package/lib/module/constants.js.map +1 -1
  103. package/lib/module/containers/GroupChannelPreviewContainer.js +2 -1
  104. package/lib/module/containers/GroupChannelPreviewContainer.js.map +1 -1
  105. package/lib/module/containers/InternalErrorBoundaryContainer.js.map +1 -1
  106. package/lib/module/containers/SendbirdUIKitContainer.js +74 -36
  107. package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -1
  108. package/lib/module/contexts/PlatformServiceCtx.js +14 -11
  109. package/lib/module/contexts/PlatformServiceCtx.js.map +1 -1
  110. package/lib/module/contexts/ReactionCtx.js +3 -2
  111. package/lib/module/contexts/ReactionCtx.js.map +1 -1
  112. package/lib/module/contexts/SendbirdChatCtx.js +2 -0
  113. package/lib/module/contexts/SendbirdChatCtx.js.map +1 -1
  114. package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +28 -43
  115. package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
  116. package/lib/module/domain/groupChannel/module/moduleContext.js +111 -7
  117. package/lib/module/domain/groupChannel/module/moduleContext.js.map +1 -1
  118. package/lib/module/domain/groupChannel/types.js.map +1 -1
  119. package/lib/module/domain/userList/types.js.map +1 -1
  120. package/lib/module/fragments/createGroupChannelFragment.js +32 -6
  121. package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
  122. package/lib/module/fragments/createMessageSearchFragment.js +1 -1
  123. package/lib/module/fragments/createMessageSearchFragment.js.map +1 -1
  124. package/lib/module/hooks/useChannelInputItems.js +203 -0
  125. package/lib/module/hooks/useChannelInputItems.js.map +1 -0
  126. package/lib/module/hooks/useConnection.js +1 -1
  127. package/lib/module/hooks/useConnection.js.map +1 -1
  128. package/lib/module/hooks/useVoiceMessageInput.js +199 -0
  129. package/lib/module/hooks/useVoiceMessageInput.js.map +1 -0
  130. package/lib/module/index.js +4 -0
  131. package/lib/module/index.js.map +1 -1
  132. package/lib/module/libs/MentionManager.js.map +1 -1
  133. package/lib/module/libs/SBUUtils.js +4 -0
  134. package/lib/module/libs/SBUUtils.js.map +1 -1
  135. package/lib/module/libs/VoiceMessageConfig.js +23 -0
  136. package/lib/module/libs/VoiceMessageConfig.js.map +1 -0
  137. package/lib/module/localization/StringSet.type.js.map +1 -1
  138. package/lib/module/localization/createBaseStringSet.js +25 -10
  139. package/lib/module/localization/createBaseStringSet.js.map +1 -1
  140. package/lib/module/platform/createFileService.expo.js +10 -0
  141. package/lib/module/platform/createFileService.expo.js.map +1 -1
  142. package/lib/module/platform/createFileService.native.js +19 -0
  143. package/lib/module/platform/createFileService.native.js.map +1 -1
  144. package/lib/module/platform/createPlayerService.expo.js +129 -0
  145. package/lib/module/platform/createPlayerService.expo.js.map +1 -0
  146. package/lib/module/platform/createPlayerService.native.js +132 -0
  147. package/lib/module/platform/createPlayerService.native.js.map +1 -0
  148. package/lib/module/platform/createRecorderService.expo.js +150 -0
  149. package/lib/module/platform/createRecorderService.expo.js.map +1 -0
  150. package/lib/module/platform/createRecorderService.native.js +149 -0
  151. package/lib/module/platform/createRecorderService.native.js.map +1 -0
  152. package/lib/module/platform/types.js.map +1 -1
  153. package/lib/module/types.js.map +1 -1
  154. package/lib/module/version.js +1 -1
  155. package/lib/module/version.js.map +1 -1
  156. package/lib/typescript/src/components/ChannelCover.d.ts +2 -1
  157. package/lib/typescript/src/components/ChannelInput/AttachmentsButton.d.ts +2 -1
  158. package/lib/typescript/src/components/ChannelInput/MessageToReplyPreview.d.ts +7 -0
  159. package/lib/typescript/src/components/ChannelInput/VoiceMessageInput.d.ts +11 -0
  160. package/lib/typescript/src/components/ChannelInput/index.d.ts +7 -3
  161. package/lib/typescript/src/components/ChannelMessageList/index.d.ts +1 -1
  162. package/lib/typescript/src/components/FileViewer.d.ts +2 -1
  163. package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.d.ts +2 -1
  164. package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageFocusAnimation.d.ts +1 -1
  165. package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.d.ts +1 -1
  166. package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.d.ts +4 -2
  167. package/lib/typescript/src/components/NewMessagesButton.d.ts +1 -1
  168. package/lib/typescript/src/components/OpenChannelMessageRenderer/OpenChannelMessageDateSeparator.d.ts +2 -1
  169. package/lib/typescript/src/components/ProviderLayout.d.ts +1 -1
  170. package/lib/typescript/src/components/ReactionAddons/BottomSheetReactionAddon.d.ts +2 -1
  171. package/lib/typescript/src/components/ReactionAddons/MessageReactionAddon.d.ts +2 -1
  172. package/lib/typescript/src/components/ReactionAddons/ReactionRoundedButton.d.ts +3 -2
  173. package/lib/typescript/src/components/ReactionAddons/index.d.ts +3 -2
  174. package/lib/typescript/src/components/ReactionBottomSheets/ReactionListBottomSheet.d.ts +2 -1
  175. package/lib/typescript/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.d.ts +2 -1
  176. package/lib/typescript/src/components/ReactionBottomSheets/index.d.ts +4 -4
  177. package/lib/typescript/src/components/ScrollToBottomButton.d.ts +1 -1
  178. package/lib/typescript/src/components/StatusComposition.d.ts +4 -4
  179. package/lib/typescript/src/components/TypedPlaceholder.d.ts +2 -1
  180. package/lib/typescript/src/components/UserActionBar.d.ts +2 -1
  181. package/lib/typescript/src/components/UserSelectableBar.d.ts +2 -1
  182. package/lib/typescript/src/constants.d.ts +2 -0
  183. package/lib/typescript/src/containers/GroupChannelPreviewContainer.d.ts +2 -1
  184. package/lib/typescript/src/containers/InternalErrorBoundaryContainer.d.ts +3 -3
  185. package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +19 -8
  186. package/lib/typescript/src/contexts/LocalizationCtx.d.ts +1 -1
  187. package/lib/typescript/src/contexts/PlatformServiceCtx.d.ts +8 -8
  188. package/lib/typescript/src/contexts/ReactionCtx.d.ts +5 -2
  189. package/lib/typescript/src/contexts/SendbirdChatCtx.d.ts +6 -3
  190. package/lib/typescript/src/contexts/UserProfileCtx.d.ts +1 -1
  191. package/lib/typescript/src/domain/groupChannel/component/GroupChannelHeader.d.ts +2 -1
  192. package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput.d.ts +1 -1
  193. package/lib/typescript/src/domain/groupChannel/component/GroupChannelMessageList.d.ts +1 -1
  194. package/lib/typescript/src/domain/groupChannel/component/GroupChannelStatusEmpty.d.ts +2 -1
  195. package/lib/typescript/src/domain/groupChannel/component/GroupChannelStatusLoading.d.ts +2 -1
  196. package/lib/typescript/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.d.ts +2 -1
  197. package/lib/typescript/src/domain/groupChannel/types.d.ts +45 -0
  198. package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersHeader.d.ts +2 -1
  199. package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.d.ts +2 -1
  200. package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersStatusEmpty.d.ts +2 -1
  201. package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersStatusLoading.d.ts +2 -1
  202. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListHeader.d.ts +2 -1
  203. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListList.d.ts +2 -1
  204. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListStatusEmpty.d.ts +2 -1
  205. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListStatusLoading.d.ts +2 -1
  206. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListTypeSelector.d.ts +2 -1
  207. package/lib/typescript/src/domain/groupChannelModeration/component/GroupChannelModerationHeader.d.ts +2 -1
  208. package/lib/typescript/src/domain/groupChannelModeration/component/GroupChannelModerationMenu.d.ts +2 -1
  209. package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersHeader.d.ts +2 -1
  210. package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.d.ts +2 -1
  211. package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersStatusEmpty.d.ts +2 -1
  212. package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersStatusLoading.d.ts +2 -1
  213. package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.d.ts +2 -1
  214. package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsView.d.ts +2 -1
  215. package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsHeader.d.ts +2 -1
  216. package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsList.d.ts +2 -1
  217. package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsStatusEmpty.d.ts +2 -1
  218. package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsStatusLoading.d.ts +2 -1
  219. package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsHeader.d.ts +2 -1
  220. package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsInfo.d.ts +2 -1
  221. package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.d.ts +2 -1
  222. package/lib/typescript/src/domain/messageSearch/component/MessageSearchHeader.d.ts +2 -1
  223. package/lib/typescript/src/domain/messageSearch/component/MessageSearchList.d.ts +2 -1
  224. package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusEmpty.d.ts +2 -1
  225. package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusLoading.d.ts +2 -1
  226. package/lib/typescript/src/domain/openChannel/component/OpenChannelHeader.d.ts +2 -2
  227. package/lib/typescript/src/domain/openChannel/component/OpenChannelInput.d.ts +1 -1
  228. package/lib/typescript/src/domain/openChannel/component/OpenChannelMessageList.d.ts +1 -1
  229. package/lib/typescript/src/domain/openChannel/component/OpenChannelStatusEmpty.d.ts +2 -1
  230. package/lib/typescript/src/domain/openChannel/component/OpenChannelStatusLoading.d.ts +2 -1
  231. package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersHeader.d.ts +2 -1
  232. package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersList.d.ts +2 -1
  233. package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersStatusEmpty.d.ts +2 -1
  234. package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersStatusLoading.d.ts +2 -1
  235. package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateHeader.d.ts +2 -1
  236. package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateProfileInput.d.ts +2 -1
  237. package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateStatusLoading.d.ts +2 -1
  238. package/lib/typescript/src/domain/openChannelList/component/OpenChannelListHeader.d.ts +2 -1
  239. package/lib/typescript/src/domain/openChannelList/component/OpenChannelListList.d.ts +2 -1
  240. package/lib/typescript/src/domain/openChannelList/component/OpenChannelListStatusEmpty.d.ts +2 -1
  241. package/lib/typescript/src/domain/openChannelList/component/OpenChannelListStatusLoading.d.ts +2 -1
  242. package/lib/typescript/src/domain/openChannelModeration/component/OpenChannelModerationHeader.d.ts +2 -1
  243. package/lib/typescript/src/domain/openChannelModeration/component/OpenChannelModerationMenu.d.ts +2 -1
  244. package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsHeader.d.ts +2 -1
  245. package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsList.d.ts +2 -1
  246. package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsStatusEmpty.d.ts +2 -1
  247. package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsStatusLoading.d.ts +2 -1
  248. package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsHeader.d.ts +2 -1
  249. package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsList.d.ts +2 -1
  250. package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsStatusEmpty.d.ts +2 -1
  251. package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsStatusLoading.d.ts +2 -1
  252. package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsHeader.d.ts +2 -1
  253. package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsInfo.d.ts +2 -1
  254. package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsMenu.d.ts +2 -1
  255. package/lib/typescript/src/domain/userList/component/UserListHeader.d.ts +3 -3
  256. package/lib/typescript/src/domain/userList/component/UserListList.d.ts +1 -1
  257. package/lib/typescript/src/domain/userList/component/UserListStatusEmpty.d.ts +2 -1
  258. package/lib/typescript/src/domain/userList/component/UserListStatusLoading.d.ts +2 -1
  259. package/lib/typescript/src/domain/userList/types.d.ts +2 -2
  260. package/lib/typescript/src/hooks/useChannelInputItems.d.ts +10 -0
  261. package/lib/typescript/src/hooks/useVoiceMessageInput.d.ts +53 -0
  262. package/lib/typescript/src/index.d.ts +4 -0
  263. package/lib/typescript/src/libs/MentionManager.d.ts +2 -1
  264. package/lib/typescript/src/libs/SBUUtils.d.ts +1 -0
  265. package/lib/typescript/src/libs/VoiceMessageConfig.d.ts +25 -0
  266. package/lib/typescript/src/localization/StringSet.type.d.ts +7 -0
  267. package/lib/typescript/src/platform/createPlayerService.expo.d.ts +7 -0
  268. package/lib/typescript/src/platform/createPlayerService.native.d.ts +9 -0
  269. package/lib/typescript/src/platform/createRecorderService.expo.d.ts +7 -0
  270. package/lib/typescript/src/platform/createRecorderService.native.d.ts +9 -0
  271. package/lib/typescript/src/platform/types.d.ts +100 -1
  272. package/lib/typescript/src/types.d.ts +1 -1
  273. package/lib/typescript/src/version.d.ts +1 -1
  274. package/package.json +9 -11
  275. package/src/components/ChannelInput/MessageToReplyPreview.tsx +133 -0
  276. package/src/components/ChannelInput/SendInput.tsx +129 -320
  277. package/src/components/ChannelInput/VoiceMessageInput.tsx +206 -0
  278. package/src/components/ChannelInput/index.tsx +12 -4
  279. package/src/components/ChannelMessageList/index.tsx +3 -1
  280. package/src/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.tsx +24 -11
  281. package/src/components/GroupChannelMessageRenderer/index.tsx +80 -3
  282. package/src/components/MessageSearchResultItem.tsx +2 -1
  283. package/src/components/OpenChannelMessageRenderer/index.tsx +1 -0
  284. package/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.tsx +2 -2
  285. package/src/components/ReactionBottomSheets/index.tsx +3 -2
  286. package/src/components/StatusComposition.tsx +3 -3
  287. package/src/constants.ts +2 -0
  288. package/src/containers/GroupChannelPreviewContainer.tsx +2 -0
  289. package/src/containers/InternalErrorBoundaryContainer.tsx +1 -1
  290. package/src/containers/SendbirdUIKitContainer.tsx +103 -59
  291. package/src/contexts/PlatformServiceCtx.tsx +22 -20
  292. package/src/contexts/ReactionCtx.tsx +7 -5
  293. package/src/contexts/SendbirdChatCtx.tsx +10 -2
  294. package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +29 -43
  295. package/src/domain/groupChannel/module/moduleContext.tsx +119 -7
  296. package/src/domain/groupChannel/types.ts +41 -0
  297. package/src/domain/userList/types.ts +2 -2
  298. package/src/fragments/createGroupChannelFragment.tsx +32 -5
  299. package/src/fragments/createMessageSearchFragment.tsx +1 -1
  300. package/src/hooks/useChannelInputItems.ts +215 -0
  301. package/src/hooks/useConnection.ts +1 -1
  302. package/src/hooks/useVoiceMessageInput.ts +237 -0
  303. package/src/index.ts +4 -0
  304. package/src/libs/MentionManager.tsx +1 -1
  305. package/src/libs/SBUUtils.ts +5 -0
  306. package/src/libs/VoiceMessageConfig.ts +28 -0
  307. package/src/localization/StringSet.type.ts +8 -0
  308. package/src/localization/createBaseStringSet.ts +27 -11
  309. package/src/platform/createFileService.expo.ts +10 -0
  310. package/src/platform/createFileService.native.ts +19 -0
  311. package/src/platform/createPlayerService.expo.tsx +142 -0
  312. package/src/platform/createPlayerService.native.tsx +148 -0
  313. package/src/platform/createRecorderService.expo.tsx +160 -0
  314. package/src/platform/createRecorderService.native.tsx +170 -0
  315. package/src/platform/types.ts +114 -1
  316. package/src/types.ts +1 -1
  317. package/src/version.ts +1 -1
@@ -1,13 +1,16 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { Platform, TouchableOpacity, View } from 'react-native';
3
- import { MentionType } from '@sendbird/chat/message';
4
- import { Icon, ImageWithPlaceholder, Text, TextInput, VideoThumbnail, createStyleSheet, useAlert, useBottomSheet, useToast, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
5
- import { Logger, getFileIconFromMessageType, getMessageType, getThumbnailUriFromFileMessage, isImage, shouldCompressImage, useIIFE } from '@sendbird/uikit-utils';
3
+ import { MentionType, MessageMetaArray } from '@sendbird/chat/message';
4
+ import { Icon, Modal, TextInput, createStyleSheet, useAlert, useBottomSheet, useToast, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
5
+ import { Logger, useDeferredModalState, useIIFE } from '@sendbird/uikit-utils';
6
+ import { VOICE_MESSAGE_META_ARRAY_DURATION_KEY, VOICE_MESSAGE_META_ARRAY_MESSAGE_TYPE_KEY } from '../../constants';
7
+ import { useChannelInputItems } from '../../hooks/useChannelInputItems';
6
8
  import { useLocalization, usePlatformService, useSendbirdChat } from '../../hooks/useContext';
7
- import SBUError from '../../libs/SBUError';
8
9
  import SBUUtils from '../../libs/SBUUtils';
9
10
  const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
10
11
  let {
12
+ VoiceMessageInput,
13
+ MessageToReplyPreview,
11
14
  AttachmentsButton,
12
15
  onPressSendUserMessage,
13
16
  onPressSendFileMessage,
@@ -22,15 +25,14 @@ const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
22
25
  messageToReply,
23
26
  setMessageToReply
24
27
  } = _ref;
28
+ const {
29
+ playerService,
30
+ recorderService
31
+ } = usePlatformService();
25
32
  const {
26
33
  mentionManager,
27
34
  sbOptions
28
35
  } = useSendbirdChat();
29
- const {
30
- select,
31
- colors,
32
- palette
33
- } = useUIKitTheme();
34
36
  const {
35
37
  STRINGS
36
38
  } = useLocalization();
@@ -39,8 +41,11 @@ const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
39
41
  } = useBottomSheet();
40
42
  const toast = useToast();
41
43
  const {
42
- mediaService
43
- } = usePlatformService();
44
+ onClose,
45
+ onDismiss,
46
+ visible: voiceMessageInputVisible,
47
+ setVisible: setVoiceMessageInputVisible
48
+ } = useDeferredModalState();
44
49
  const messageReplyParams = useIIFE(() => {
45
50
  const {
46
51
  groupChannel
@@ -82,10 +87,30 @@ const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
82
87
  }).catch(onFailureToSend);
83
88
  setMessageToReply === null || setMessageToReply === void 0 ? void 0 : setMessageToReply();
84
89
  };
90
+ const sendVoiceMessage = (file, durationMills) => {
91
+ if (inputMuted) {
92
+ toast.show(STRINGS.TOAST.USER_MUTED_ERROR, 'error');
93
+ Logger.error(STRINGS.TOAST.USER_MUTED_ERROR);
94
+ } else if (inputFrozen) {
95
+ toast.show(STRINGS.TOAST.CHANNEL_FROZEN_ERROR, 'error');
96
+ Logger.error(STRINGS.TOAST.CHANNEL_FROZEN_ERROR);
97
+ } else {
98
+ onPressSendFileMessage({
99
+ file,
100
+ metaArrays: [new MessageMetaArray({
101
+ key: VOICE_MESSAGE_META_ARRAY_DURATION_KEY,
102
+ value: [String(durationMills)]
103
+ }), new MessageMetaArray({
104
+ key: VOICE_MESSAGE_META_ARRAY_MESSAGE_TYPE_KEY,
105
+ value: [`voice/${recorderService.options.extension}`]
106
+ })],
107
+ ...messageReplyParams
108
+ }).catch(onFailureToSend);
109
+ }
110
+ onChangeText('');
111
+ setMessageToReply === null || setMessageToReply === void 0 ? void 0 : setMessageToReply();
112
+ };
85
113
  const sheetItems = useChannelInputItems(channel, sendFileMessage);
86
- const onPressAttachment = () => openSheet({
87
- sheetItems
88
- });
89
114
  const getPlaceholder = () => {
90
115
  if (inputMuted) return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_MUTED;
91
116
  if (inputFrozen) return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_DISABLED;
@@ -93,102 +118,17 @@ const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
93
118
  if (messageToReply) return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_REPLY;
94
119
  return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_ACTIVE;
95
120
  };
96
- const getFileIconAsImage = url => {
97
- return /*#__PURE__*/React.createElement(ImageWithPlaceholder, {
98
- source: {
99
- uri: url
100
- },
101
- style: styles.previewImage
102
- });
103
- };
104
- const getFileIconAsVideoThumbnail = url => {
105
- return /*#__PURE__*/React.createElement(VideoThumbnail, {
106
- style: styles.previewImage,
107
- iconSize: 0,
108
- source: url,
109
- fetchThumbnailFromVideoSource: uri => mediaService.getVideoThumbnail({
110
- url: uri,
111
- timeMills: 1000
112
- })
113
- });
114
- };
115
- const getFileIconAsSymbol = icon => {
116
- return /*#__PURE__*/React.createElement(Icon, {
117
- icon: icon,
118
- size: 20,
119
- color: colors.onBackground02,
120
- containerStyle: {
121
- backgroundColor: select({
122
- light: palette.background100,
123
- dark: palette.background500
124
- }),
125
- width: 36,
126
- height: 36,
127
- borderRadius: 10,
128
- marginRight: 10,
129
- marginTop: 2
130
- }
131
- });
132
- };
133
- const getFileIcon = messageToReply => {
134
- if (messageToReply !== null && messageToReply !== void 0 && messageToReply.isFileMessage()) {
135
- const messageType = getMessageType(messageToReply);
136
- switch (messageType) {
137
- case 'file.image':
138
- return getFileIconAsImage(getThumbnailUriFromFileMessage(messageToReply));
139
- case 'file.video':
140
- return getFileIconAsVideoThumbnail(getThumbnailUriFromFileMessage(messageToReply));
141
- default:
142
- return getFileIconAsSymbol(getFileIconFromMessageType(messageType));
143
- }
144
- }
145
- return null;
146
- };
147
- return /*#__PURE__*/React.createElement(View, null, messageToReply && /*#__PURE__*/React.createElement(View, {
148
- style: {
149
- flexDirection: 'row',
150
- paddingLeft: 18,
151
- paddingRight: 16,
152
- paddingTop: 10,
153
- paddingBottom: 8,
154
- alignItems: 'center',
155
- borderTopWidth: 1,
156
- borderColor: colors.onBackground04
157
- }
158
- }, /*#__PURE__*/React.createElement(View, {
159
- style: {
160
- flex: 1,
161
- flexDirection: 'row'
162
- }
163
- }, getFileIcon(messageToReply), /*#__PURE__*/React.createElement(View, {
164
- style: {
165
- flex: 1,
166
- flexDirection: 'column'
167
- }
168
- }, /*#__PURE__*/React.createElement(Text, {
169
- numberOfLines: 1,
170
- style: {
171
- fontSize: 13,
172
- fontWeight: '900',
173
- marginBottom: 4
174
- }
175
- }, STRINGS.LABELS.CHANNEL_INPUT_REPLY_PREVIEW_TITLE(messageToReply.sender)), /*#__PURE__*/React.createElement(Text, {
176
- numberOfLines: 1,
177
- style: {
178
- fontSize: 13,
179
- color: colors.onBackground03
180
- }
181
- }, STRINGS.LABELS.CHANNEL_INPUT_REPLY_PREVIEW_BODY(messageToReply)))), /*#__PURE__*/React.createElement(TouchableOpacity, {
182
- onPress: () => setMessageToReply === null || setMessageToReply === void 0 ? void 0 : setMessageToReply(undefined)
183
- }, /*#__PURE__*/React.createElement(Icon, {
184
- icon: 'close',
185
- size: 24,
186
- color: colors.onBackground01,
187
- containerStyle: styles.iconSend
188
- }))), /*#__PURE__*/React.createElement(View, {
121
+ const voiceMessageEnabled = channel.isGroupChannel() && sbOptions.uikit.groupChannel.channel.enableVoiceMessage;
122
+ const sendButtonVisible = Boolean(text.trim());
123
+ return /*#__PURE__*/React.createElement(View, null, MessageToReplyPreview && /*#__PURE__*/React.createElement(MessageToReplyPreview, {
124
+ messageToReply: messageToReply,
125
+ setMessageToReply: setMessageToReply
126
+ }), /*#__PURE__*/React.createElement(View, {
189
127
  style: styles.sendInputContainer
190
128
  }, AttachmentsButton && /*#__PURE__*/React.createElement(AttachmentsButton, {
191
- onPress: onPressAttachment,
129
+ onPress: () => openSheet({
130
+ sheetItems
131
+ }),
192
132
  disabled: inputDisabled
193
133
  }), /*#__PURE__*/React.createElement(TextInput, {
194
134
  ref: ref,
@@ -199,212 +139,115 @@ const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
199
139
  onChangeText: onChangeText,
200
140
  style: styles.input,
201
141
  placeholder: getPlaceholder()
202
- }, mentionManager.textToMentionedComponents(text, mentionedUsers, sbOptions.uikit.groupChannel.channel.enableMention)), Boolean(text.trim()) && /*#__PURE__*/React.createElement(TouchableOpacity, {
203
- onPress: sendUserMessage,
204
- disabled: inputDisabled
205
- }, /*#__PURE__*/React.createElement(Icon, {
206
- color: inputDisabled ? colors.ui.input.default.disabled.highlight : colors.ui.input.default.active.highlight,
207
- icon: 'send',
208
- size: 24,
209
- containerStyle: styles.iconSend
142
+ }, mentionManager.textToMentionedComponents(text, mentionedUsers, sbOptions.uikit.groupChannel.channel.enableMention)), voiceMessageEnabled && /*#__PURE__*/React.createElement(VoiceMessageButton, {
143
+ visible: !sendButtonVisible,
144
+ disabled: inputDisabled,
145
+ onPress: () => setVoiceMessageInputVisible(true)
146
+ }), /*#__PURE__*/React.createElement(UserMessageSendButton, {
147
+ visible: sendButtonVisible,
148
+ disabled: inputDisabled,
149
+ onPress: sendUserMessage
150
+ }), voiceMessageEnabled && VoiceMessageInput && /*#__PURE__*/React.createElement(Modal, {
151
+ disableBackgroundClose: true,
152
+ onClose: onClose,
153
+ onDismiss: () => {
154
+ onDismiss();
155
+ Promise.allSettled([playerService.reset(), recorderService.reset()]);
156
+ },
157
+ backgroundStyle: {
158
+ justifyContent: 'flex-end'
159
+ },
160
+ visible: voiceMessageInputVisible,
161
+ type: 'slide-no-gesture'
162
+ }, /*#__PURE__*/React.createElement(VoiceMessageInput, {
163
+ onClose: onClose,
164
+ onSend: _ref2 => {
165
+ let {
166
+ file,
167
+ duration
168
+ } = _ref2;
169
+ return sendVoiceMessage(file, duration);
170
+ }
210
171
  }))));
211
172
  });
212
- const useChannelInputItems = (channel, sendFileMessage) => {
213
- const {
214
- sbOptions,
215
- imageCompressionConfig
216
- } = useSendbirdChat();
173
+ const VoiceMessageButton = _ref3 => {
174
+ let {
175
+ visible,
176
+ disabled,
177
+ onPress
178
+ } = _ref3;
217
179
  const {
218
180
  STRINGS
219
181
  } = useLocalization();
220
- const {
221
- fileService,
222
- mediaService
223
- } = usePlatformService();
224
182
  const {
225
183
  alert
226
184
  } = useAlert();
227
- const toast = useToast();
228
- const sheetItems = [];
229
- const input = useIIFE(() => {
230
- switch (true) {
231
- case channel.isOpenChannel():
232
- return sbOptions.uikit.openChannel.channel.input;
233
- case channel.isGroupChannel():
234
- return sbOptions.uikit.groupChannel.channel.input;
235
- default:
236
- return {
237
- enableDocument: true,
238
- camera: {
239
- enablePhoto: true,
240
- enableVideo: true
241
- },
242
- gallery: {
243
- enablePhoto: true,
244
- enableVideo: true
245
- }
246
- };
185
+ const {
186
+ playerService,
187
+ recorderService
188
+ } = usePlatformService();
189
+ const {
190
+ colors
191
+ } = useUIKitTheme();
192
+ if (!visible) return null;
193
+ const onPressWithPermissionCheck = async () => {
194
+ const recorderGranted = await recorderService.requestPermission();
195
+ if (!recorderGranted) {
196
+ alert({
197
+ title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
198
+ message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_MICROPHONE, STRINGS.LABELS.PERMISSION_APP_NAME),
199
+ buttons: [{
200
+ text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
201
+ onPress: () => SBUUtils.openSettings()
202
+ }]
203
+ });
204
+ Logger.error('Failed to request permission for recorder');
205
+ return;
247
206
  }
248
- });
249
- if (input.camera.enablePhoto) {
250
- sheetItems.push({
251
- title: STRINGS.LABELS.CHANNEL_INPUT_ATTACHMENT_CAMERA_PHOTO,
252
- icon: 'camera',
253
- onPress: async () => {
254
- const mediaFile = await fileService.openCamera({
255
- mediaType: 'photo',
256
- onOpenFailure: error => {
257
- if (error.code === SBUError.CODE.ERR_PERMISSIONS_DENIED) {
258
- alert({
259
- title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
260
- message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_CAMERA, STRINGS.LABELS.PERMISSION_APP_NAME),
261
- buttons: [{
262
- text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
263
- onPress: () => SBUUtils.openSettings()
264
- }]
265
- });
266
- } else {
267
- toast.show(STRINGS.TOAST.OPEN_CAMERA_ERROR, 'error');
268
- }
269
- }
270
- });
271
- if (mediaFile) {
272
- // Image compression
273
- if (isImage(mediaFile.uri, mediaFile.type) && shouldCompressImage(mediaFile.type, sbOptions.chat.imageCompressionEnabled)) {
274
- await SBUUtils.safeRun(async () => {
275
- const compressed = await mediaService.compressImage({
276
- uri: mediaFile.uri,
277
- maxWidth: imageCompressionConfig.width,
278
- maxHeight: imageCompressionConfig.height,
279
- compressionRate: imageCompressionConfig.compressionRate
280
- });
281
- if (compressed) {
282
- mediaFile.uri = compressed.uri;
283
- mediaFile.size = compressed.size;
284
- }
285
- });
286
- }
287
- sendFileMessage(mediaFile);
288
- }
289
- }
290
- });
291
- }
292
- if (input.camera.enableVideo) {
293
- sheetItems.push({
294
- title: STRINGS.LABELS.CHANNEL_INPUT_ATTACHMENT_CAMERA_VIDEO,
295
- icon: 'camera',
296
- onPress: async () => {
297
- const mediaFile = await fileService.openCamera({
298
- mediaType: 'video',
299
- onOpenFailure: error => {
300
- if (error.code === SBUError.CODE.ERR_PERMISSIONS_DENIED) {
301
- alert({
302
- title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
303
- message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_CAMERA, STRINGS.LABELS.PERMISSION_APP_NAME),
304
- buttons: [{
305
- text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
306
- onPress: () => SBUUtils.openSettings()
307
- }]
308
- });
309
- } else {
310
- toast.show(STRINGS.TOAST.OPEN_CAMERA_ERROR, 'error');
311
- }
312
- }
313
- });
314
- if (mediaFile) {
315
- sendFileMessage(mediaFile);
316
- }
317
- }
318
- });
319
- }
320
- if (input.gallery.enablePhoto || input.gallery.enableVideo) {
321
- const mediaType = (() => {
322
- switch (true) {
323
- case input.gallery.enablePhoto && input.gallery.enableVideo:
324
- return 'all';
325
- case input.gallery.enablePhoto && !input.gallery.enableVideo:
326
- return 'photo';
327
- case !input.gallery.enablePhoto && input.gallery.enableVideo:
328
- return 'video';
329
- default:
330
- return 'all';
331
- }
332
- })();
333
- sheetItems.push({
334
- title: STRINGS.LABELS.CHANNEL_INPUT_ATTACHMENT_PHOTO_LIBRARY,
335
- icon: 'photo',
336
- onPress: async () => {
337
- const mediaFiles = await fileService.openMediaLibrary({
338
- selectionLimit: 1,
339
- mediaType,
340
- onOpenFailure: error => {
341
- if (error.code === SBUError.CODE.ERR_PERMISSIONS_DENIED) {
342
- alert({
343
- title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
344
- message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_DEVICE_STORAGE, STRINGS.LABELS.PERMISSION_APP_NAME),
345
- buttons: [{
346
- text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
347
- onPress: () => SBUUtils.openSettings()
348
- }]
349
- });
350
- } else {
351
- toast.show(STRINGS.TOAST.OPEN_PHOTO_LIBRARY_ERROR, 'error');
352
- }
353
- }
354
- });
355
- if (mediaFiles && mediaFiles[0]) {
356
- const mediaFile = mediaFiles[0];
357
-
358
- // Image compression
359
- if (isImage(mediaFile.uri, mediaFile.type) && shouldCompressImage(mediaFile.type, sbOptions.chat.imageCompressionEnabled)) {
360
- await SBUUtils.safeRun(async () => {
361
- const compressed = await mediaService.compressImage({
362
- uri: mediaFile.uri,
363
- maxWidth: imageCompressionConfig.width,
364
- maxHeight: imageCompressionConfig.height,
365
- compressionRate: imageCompressionConfig.compressionRate
366
- });
367
- if (compressed) {
368
- mediaFile.uri = compressed.uri;
369
- mediaFile.size = compressed.size;
370
- }
371
- });
372
- }
373
- sendFileMessage(mediaFile);
374
- }
375
- }
376
- });
377
- }
378
- if (input.enableDocument) {
379
- sheetItems.push({
380
- title: STRINGS.LABELS.CHANNEL_INPUT_ATTACHMENT_FILES,
381
- icon: 'document',
382
- onPress: async () => {
383
- const documentFile = await fileService.openDocument({
384
- onOpenFailure: () => toast.show(STRINGS.TOAST.OPEN_FILES_ERROR, 'error')
385
- });
386
- if (documentFile) {
387
- // Image compression
388
- if (isImage(documentFile.uri, documentFile.type) && shouldCompressImage(documentFile.type, sbOptions.chat.imageCompressionEnabled)) {
389
- await SBUUtils.safeRun(async () => {
390
- const compressed = await mediaService.compressImage({
391
- uri: documentFile.uri,
392
- maxWidth: imageCompressionConfig.width,
393
- maxHeight: imageCompressionConfig.height,
394
- compressionRate: imageCompressionConfig.compressionRate
395
- });
396
- if (compressed) {
397
- documentFile.uri = compressed.uri;
398
- documentFile.size = compressed.size;
399
- }
400
- });
401
- }
402
- sendFileMessage(documentFile);
403
- }
404
- }
405
- });
406
- }
407
- return sheetItems;
207
+ const playerGranted = await playerService.requestPermission();
208
+ if (!playerGranted) {
209
+ alert({
210
+ title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
211
+ message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_DEVICE_STORAGE, STRINGS.LABELS.PERMISSION_APP_NAME),
212
+ buttons: [{
213
+ text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
214
+ onPress: () => SBUUtils.openSettings()
215
+ }]
216
+ });
217
+ Logger.error('Failed to request permission for player');
218
+ return;
219
+ }
220
+ onPress();
221
+ };
222
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
223
+ onPress: onPressWithPermissionCheck,
224
+ disabled: disabled
225
+ }, /*#__PURE__*/React.createElement(Icon, {
226
+ color: disabled ? colors.ui.input.default.disabled.highlight : colors.ui.input.default.active.highlight,
227
+ icon: 'audio-on',
228
+ size: 24,
229
+ containerStyle: styles.sendIcon
230
+ }));
231
+ };
232
+ const UserMessageSendButton = _ref4 => {
233
+ let {
234
+ visible,
235
+ disabled,
236
+ onPress
237
+ } = _ref4;
238
+ const {
239
+ colors
240
+ } = useUIKitTheme();
241
+ if (!visible) return null;
242
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
243
+ onPress: onPress,
244
+ disabled: disabled
245
+ }, /*#__PURE__*/React.createElement(Icon, {
246
+ color: disabled ? colors.ui.input.default.disabled.highlight : colors.ui.input.default.active.highlight,
247
+ icon: 'send',
248
+ size: 24,
249
+ containerStyle: styles.sendIcon
250
+ }));
408
251
  };
409
252
  const styles = createStyleSheet({
410
253
  sendInputContainer: {
@@ -423,17 +266,9 @@ const styles = createStyleSheet({
423
266
  }),
424
267
  borderRadius: 20
425
268
  },
426
- iconSend: {
269
+ sendIcon: {
427
270
  marginLeft: 4,
428
271
  padding: 4
429
- },
430
- previewImage: {
431
- width: 36,
432
- height: 36,
433
- borderRadius: 10,
434
- marginTop: 2,
435
- marginRight: 10,
436
- overflow: 'hidden'
437
272
  }
438
273
  });
439
274
  export default SendInput;