@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.
- package/README.md +67 -42
- package/lib/commonjs/components/ChannelInput/MessageToReplyPreview.js +145 -0
- package/lib/commonjs/components/ChannelInput/MessageToReplyPreview.js.map +1 -0
- package/lib/commonjs/components/ChannelInput/SendInput.js +147 -312
- package/lib/commonjs/components/ChannelInput/SendInput.js.map +1 -1
- package/lib/commonjs/components/ChannelInput/VoiceMessageInput.js +238 -0
- package/lib/commonjs/components/ChannelInput/VoiceMessageInput.js.map +1 -0
- package/lib/commonjs/components/ChannelInput/index.js +5 -1
- package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
- package/lib/commonjs/components/ChannelMessageList/index.js +1 -1
- package/lib/commonjs/components/ChannelMessageList/index.js.map +1 -1
- package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js +24 -13
- package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js.map +1 -1
- package/lib/commonjs/components/GroupChannelMessageRenderer/index.js +100 -5
- package/lib/commonjs/components/GroupChannelMessageRenderer/index.js.map +1 -1
- package/lib/commonjs/components/MessageSearchResultItem.js +1 -0
- package/lib/commonjs/components/MessageSearchResultItem.js.map +1 -1
- package/lib/commonjs/components/OpenChannelMessageRenderer/index.js +1 -0
- package/lib/commonjs/components/OpenChannelMessageRenderer/index.js.map +1 -1
- package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +2 -2
- package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
- package/lib/commonjs/components/ReactionBottomSheets/index.js.map +1 -1
- package/lib/commonjs/components/StatusComposition.js.map +1 -1
- package/lib/commonjs/constants.js +5 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/containers/GroupChannelPreviewContainer.js +1 -0
- package/lib/commonjs/containers/GroupChannelPreviewContainer.js.map +1 -1
- package/lib/commonjs/containers/InternalErrorBoundaryContainer.js.map +1 -1
- package/lib/commonjs/containers/SendbirdUIKitContainer.js +72 -34
- package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -1
- package/lib/commonjs/contexts/PlatformServiceCtx.js +16 -12
- package/lib/commonjs/contexts/PlatformServiceCtx.js.map +1 -1
- package/lib/commonjs/contexts/ReactionCtx.js +3 -2
- package/lib/commonjs/contexts/ReactionCtx.js.map +1 -1
- package/lib/commonjs/contexts/SendbirdChatCtx.js +2 -0
- package/lib/commonjs/contexts/SendbirdChatCtx.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +27 -42
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js +109 -5
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
- package/lib/commonjs/domain/userList/types.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelFragment.js +30 -4
- package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/commonjs/fragments/createMessageSearchFragment.js +1 -1
- package/lib/commonjs/fragments/createMessageSearchFragment.js.map +1 -1
- package/lib/commonjs/hooks/useChannelInputItems.js +211 -0
- package/lib/commonjs/hooks/useChannelInputItems.js.map +1 -0
- package/lib/commonjs/hooks/useConnection.js +1 -1
- package/lib/commonjs/hooks/useConnection.js.map +1 -1
- package/lib/commonjs/hooks/useVoiceMessageInput.js +207 -0
- package/lib/commonjs/hooks/useVoiceMessageInput.js.map +1 -0
- package/lib/commonjs/index.js +32 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/libs/MentionManager.js.map +1 -1
- package/lib/commonjs/libs/SBUUtils.js +4 -0
- package/lib/commonjs/libs/SBUUtils.js.map +1 -1
- package/lib/commonjs/libs/VoiceMessageConfig.js +30 -0
- package/lib/commonjs/libs/VoiceMessageConfig.js.map +1 -0
- package/lib/commonjs/localization/StringSet.type.js.map +1 -1
- package/lib/commonjs/localization/createBaseStringSet.js +24 -9
- package/lib/commonjs/localization/createBaseStringSet.js.map +1 -1
- package/lib/commonjs/platform/createFileService.expo.js +10 -0
- package/lib/commonjs/platform/createFileService.expo.js.map +1 -1
- package/lib/commonjs/platform/createFileService.native.js +19 -0
- package/lib/commonjs/platform/createFileService.native.js.map +1 -1
- package/lib/commonjs/platform/createPlayerService.expo.js +137 -0
- package/lib/commonjs/platform/createPlayerService.expo.js.map +1 -0
- package/lib/commonjs/platform/createPlayerService.native.js +139 -0
- package/lib/commonjs/platform/createPlayerService.native.js.map +1 -0
- package/lib/commonjs/platform/createRecorderService.expo.js +158 -0
- package/lib/commonjs/platform/createRecorderService.expo.js.map +1 -0
- package/lib/commonjs/platform/createRecorderService.native.js +157 -0
- package/lib/commonjs/platform/createRecorderService.native.js.map +1 -0
- package/lib/commonjs/platform/types.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/components/ChannelInput/MessageToReplyPreview.js +137 -0
- package/lib/module/components/ChannelInput/MessageToReplyPreview.js.map +1 -0
- package/lib/module/components/ChannelInput/SendInput.js +149 -314
- package/lib/module/components/ChannelInput/SendInput.js.map +1 -1
- package/lib/module/components/ChannelInput/VoiceMessageInput.js +228 -0
- package/lib/module/components/ChannelInput/VoiceMessageInput.js.map +1 -0
- package/lib/module/components/ChannelInput/index.js +5 -1
- package/lib/module/components/ChannelInput/index.js.map +1 -1
- package/lib/module/components/ChannelMessageList/index.js +2 -2
- package/lib/module/components/ChannelMessageList/index.js.map +1 -1
- package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js +24 -13
- package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js.map +1 -1
- package/lib/module/components/GroupChannelMessageRenderer/index.js +99 -6
- package/lib/module/components/GroupChannelMessageRenderer/index.js.map +1 -1
- package/lib/module/components/MessageSearchResultItem.js +2 -1
- package/lib/module/components/MessageSearchResultItem.js.map +1 -1
- package/lib/module/components/OpenChannelMessageRenderer/index.js +1 -0
- package/lib/module/components/OpenChannelMessageRenderer/index.js.map +1 -1
- package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +2 -2
- package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
- package/lib/module/components/ReactionBottomSheets/index.js.map +1 -1
- package/lib/module/components/StatusComposition.js.map +1 -1
- package/lib/module/constants.js +2 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/containers/GroupChannelPreviewContainer.js +2 -1
- package/lib/module/containers/GroupChannelPreviewContainer.js.map +1 -1
- package/lib/module/containers/InternalErrorBoundaryContainer.js.map +1 -1
- package/lib/module/containers/SendbirdUIKitContainer.js +74 -36
- package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -1
- package/lib/module/contexts/PlatformServiceCtx.js +14 -11
- package/lib/module/contexts/PlatformServiceCtx.js.map +1 -1
- package/lib/module/contexts/ReactionCtx.js +3 -2
- package/lib/module/contexts/ReactionCtx.js.map +1 -1
- package/lib/module/contexts/SendbirdChatCtx.js +2 -0
- package/lib/module/contexts/SendbirdChatCtx.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +28 -43
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/module/domain/groupChannel/module/moduleContext.js +111 -7
- package/lib/module/domain/groupChannel/module/moduleContext.js.map +1 -1
- package/lib/module/domain/groupChannel/types.js.map +1 -1
- package/lib/module/domain/userList/types.js.map +1 -1
- package/lib/module/fragments/createGroupChannelFragment.js +32 -6
- package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/module/fragments/createMessageSearchFragment.js +1 -1
- package/lib/module/fragments/createMessageSearchFragment.js.map +1 -1
- package/lib/module/hooks/useChannelInputItems.js +203 -0
- package/lib/module/hooks/useChannelInputItems.js.map +1 -0
- package/lib/module/hooks/useConnection.js +1 -1
- package/lib/module/hooks/useConnection.js.map +1 -1
- package/lib/module/hooks/useVoiceMessageInput.js +199 -0
- package/lib/module/hooks/useVoiceMessageInput.js.map +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/libs/MentionManager.js.map +1 -1
- package/lib/module/libs/SBUUtils.js +4 -0
- package/lib/module/libs/SBUUtils.js.map +1 -1
- package/lib/module/libs/VoiceMessageConfig.js +23 -0
- package/lib/module/libs/VoiceMessageConfig.js.map +1 -0
- package/lib/module/localization/StringSet.type.js.map +1 -1
- package/lib/module/localization/createBaseStringSet.js +25 -10
- package/lib/module/localization/createBaseStringSet.js.map +1 -1
- package/lib/module/platform/createFileService.expo.js +10 -0
- package/lib/module/platform/createFileService.expo.js.map +1 -1
- package/lib/module/platform/createFileService.native.js +19 -0
- package/lib/module/platform/createFileService.native.js.map +1 -1
- package/lib/module/platform/createPlayerService.expo.js +129 -0
- package/lib/module/platform/createPlayerService.expo.js.map +1 -0
- package/lib/module/platform/createPlayerService.native.js +132 -0
- package/lib/module/platform/createPlayerService.native.js.map +1 -0
- package/lib/module/platform/createRecorderService.expo.js +150 -0
- package/lib/module/platform/createRecorderService.expo.js.map +1 -0
- package/lib/module/platform/createRecorderService.native.js +149 -0
- package/lib/module/platform/createRecorderService.native.js.map +1 -0
- package/lib/module/platform/types.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/components/ChannelCover.d.ts +2 -1
- package/lib/typescript/src/components/ChannelInput/AttachmentsButton.d.ts +2 -1
- package/lib/typescript/src/components/ChannelInput/MessageToReplyPreview.d.ts +7 -0
- package/lib/typescript/src/components/ChannelInput/VoiceMessageInput.d.ts +11 -0
- package/lib/typescript/src/components/ChannelInput/index.d.ts +7 -3
- package/lib/typescript/src/components/ChannelMessageList/index.d.ts +1 -1
- package/lib/typescript/src/components/FileViewer.d.ts +2 -1
- package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.d.ts +2 -1
- package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageFocusAnimation.d.ts +1 -1
- package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.d.ts +1 -1
- package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.d.ts +4 -2
- package/lib/typescript/src/components/NewMessagesButton.d.ts +1 -1
- package/lib/typescript/src/components/OpenChannelMessageRenderer/OpenChannelMessageDateSeparator.d.ts +2 -1
- package/lib/typescript/src/components/ProviderLayout.d.ts +1 -1
- package/lib/typescript/src/components/ReactionAddons/BottomSheetReactionAddon.d.ts +2 -1
- package/lib/typescript/src/components/ReactionAddons/MessageReactionAddon.d.ts +2 -1
- package/lib/typescript/src/components/ReactionAddons/ReactionRoundedButton.d.ts +3 -2
- package/lib/typescript/src/components/ReactionAddons/index.d.ts +3 -2
- package/lib/typescript/src/components/ReactionBottomSheets/ReactionListBottomSheet.d.ts +2 -1
- package/lib/typescript/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.d.ts +2 -1
- package/lib/typescript/src/components/ReactionBottomSheets/index.d.ts +4 -4
- package/lib/typescript/src/components/ScrollToBottomButton.d.ts +1 -1
- package/lib/typescript/src/components/StatusComposition.d.ts +4 -4
- package/lib/typescript/src/components/TypedPlaceholder.d.ts +2 -1
- package/lib/typescript/src/components/UserActionBar.d.ts +2 -1
- package/lib/typescript/src/components/UserSelectableBar.d.ts +2 -1
- package/lib/typescript/src/constants.d.ts +2 -0
- package/lib/typescript/src/containers/GroupChannelPreviewContainer.d.ts +2 -1
- package/lib/typescript/src/containers/InternalErrorBoundaryContainer.d.ts +3 -3
- package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +19 -8
- package/lib/typescript/src/contexts/LocalizationCtx.d.ts +1 -1
- package/lib/typescript/src/contexts/PlatformServiceCtx.d.ts +8 -8
- package/lib/typescript/src/contexts/ReactionCtx.d.ts +5 -2
- package/lib/typescript/src/contexts/SendbirdChatCtx.d.ts +6 -3
- package/lib/typescript/src/contexts/UserProfileCtx.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelMessageList.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannel/types.d.ts +45 -0
- package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListList.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListTypeSelector.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelModeration/component/GroupChannelModerationHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelModeration/component/GroupChannelModerationMenu.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsView.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsList.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsInfo.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.d.ts +2 -1
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchHeader.d.ts +2 -1
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchList.d.ts +2 -1
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannel/component/OpenChannelHeader.d.ts +2 -2
- package/lib/typescript/src/domain/openChannel/component/OpenChannelInput.d.ts +1 -1
- package/lib/typescript/src/domain/openChannel/component/OpenChannelMessageList.d.ts +1 -1
- package/lib/typescript/src/domain/openChannel/component/OpenChannelStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/openChannel/component/OpenChannelStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersList.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateProfileInput.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelList/component/OpenChannelListHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelList/component/OpenChannelListList.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelList/component/OpenChannelListStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelList/component/OpenChannelListStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelModeration/component/OpenChannelModerationHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelModeration/component/OpenChannelModerationMenu.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsList.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsList.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsInfo.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsMenu.d.ts +2 -1
- package/lib/typescript/src/domain/userList/component/UserListHeader.d.ts +3 -3
- package/lib/typescript/src/domain/userList/component/UserListList.d.ts +1 -1
- package/lib/typescript/src/domain/userList/component/UserListStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/userList/component/UserListStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/userList/types.d.ts +2 -2
- package/lib/typescript/src/hooks/useChannelInputItems.d.ts +10 -0
- package/lib/typescript/src/hooks/useVoiceMessageInput.d.ts +53 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/libs/MentionManager.d.ts +2 -1
- package/lib/typescript/src/libs/SBUUtils.d.ts +1 -0
- package/lib/typescript/src/libs/VoiceMessageConfig.d.ts +25 -0
- package/lib/typescript/src/localization/StringSet.type.d.ts +7 -0
- package/lib/typescript/src/platform/createPlayerService.expo.d.ts +7 -0
- package/lib/typescript/src/platform/createPlayerService.native.d.ts +9 -0
- package/lib/typescript/src/platform/createRecorderService.expo.d.ts +7 -0
- package/lib/typescript/src/platform/createRecorderService.native.d.ts +9 -0
- package/lib/typescript/src/platform/types.d.ts +100 -1
- package/lib/typescript/src/types.d.ts +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +9 -11
- package/src/components/ChannelInput/MessageToReplyPreview.tsx +133 -0
- package/src/components/ChannelInput/SendInput.tsx +129 -320
- package/src/components/ChannelInput/VoiceMessageInput.tsx +206 -0
- package/src/components/ChannelInput/index.tsx +12 -4
- package/src/components/ChannelMessageList/index.tsx +3 -1
- package/src/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.tsx +24 -11
- package/src/components/GroupChannelMessageRenderer/index.tsx +80 -3
- package/src/components/MessageSearchResultItem.tsx +2 -1
- package/src/components/OpenChannelMessageRenderer/index.tsx +1 -0
- package/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.tsx +2 -2
- package/src/components/ReactionBottomSheets/index.tsx +3 -2
- package/src/components/StatusComposition.tsx +3 -3
- package/src/constants.ts +2 -0
- package/src/containers/GroupChannelPreviewContainer.tsx +2 -0
- package/src/containers/InternalErrorBoundaryContainer.tsx +1 -1
- package/src/containers/SendbirdUIKitContainer.tsx +103 -59
- package/src/contexts/PlatformServiceCtx.tsx +22 -20
- package/src/contexts/ReactionCtx.tsx +7 -5
- package/src/contexts/SendbirdChatCtx.tsx +10 -2
- package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +29 -43
- package/src/domain/groupChannel/module/moduleContext.tsx +119 -7
- package/src/domain/groupChannel/types.ts +41 -0
- package/src/domain/userList/types.ts +2 -2
- package/src/fragments/createGroupChannelFragment.tsx +32 -5
- package/src/fragments/createMessageSearchFragment.tsx +1 -1
- package/src/hooks/useChannelInputItems.ts +215 -0
- package/src/hooks/useConnection.ts +1 -1
- package/src/hooks/useVoiceMessageInput.ts +237 -0
- package/src/index.ts +4 -0
- package/src/libs/MentionManager.tsx +1 -1
- package/src/libs/SBUUtils.ts +5 -0
- package/src/libs/VoiceMessageConfig.ts +28 -0
- package/src/localization/StringSet.type.ts +8 -0
- package/src/localization/createBaseStringSet.ts +27 -11
- package/src/platform/createFileService.expo.ts +10 -0
- package/src/platform/createFileService.native.ts +19 -0
- package/src/platform/createPlayerService.expo.tsx +142 -0
- package/src/platform/createPlayerService.native.tsx +148 -0
- package/src/platform/createRecorderService.expo.tsx +160 -0
- package/src/platform/createRecorderService.native.tsx +170 -0
- package/src/platform/types.ts +114 -1
- package/src/types.ts +1 -1
- 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,
|
|
5
|
-
import { Logger,
|
|
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
|
-
|
|
43
|
-
|
|
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
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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:
|
|
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)),
|
|
203
|
-
|
|
204
|
-
disabled: inputDisabled
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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
|
-
|
|
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;
|