@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
|
@@ -9,14 +9,17 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _message = require("@sendbird/chat/message");
|
|
10
10
|
var _uikitReactNativeFoundation = require("@sendbird/uikit-react-native-foundation");
|
|
11
11
|
var _uikitUtils = require("@sendbird/uikit-utils");
|
|
12
|
+
var _constants = require("../../constants");
|
|
13
|
+
var _useChannelInputItems = require("../../hooks/useChannelInputItems");
|
|
12
14
|
var _useContext = require("../../hooks/useContext");
|
|
13
|
-
var _SBUError = _interopRequireDefault(require("../../libs/SBUError"));
|
|
14
15
|
var _SBUUtils = _interopRequireDefault(require("../../libs/SBUUtils"));
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
17
|
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); }
|
|
17
18
|
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; }
|
|
18
19
|
const SendInput = /*#__PURE__*/(0, _react.forwardRef)(function SendInput(_ref, ref) {
|
|
19
20
|
let {
|
|
21
|
+
VoiceMessageInput,
|
|
22
|
+
MessageToReplyPreview,
|
|
20
23
|
AttachmentsButton,
|
|
21
24
|
onPressSendUserMessage,
|
|
22
25
|
onPressSendFileMessage,
|
|
@@ -31,15 +34,14 @@ const SendInput = /*#__PURE__*/(0, _react.forwardRef)(function SendInput(_ref, r
|
|
|
31
34
|
messageToReply,
|
|
32
35
|
setMessageToReply
|
|
33
36
|
} = _ref;
|
|
37
|
+
const {
|
|
38
|
+
playerService,
|
|
39
|
+
recorderService
|
|
40
|
+
} = (0, _useContext.usePlatformService)();
|
|
34
41
|
const {
|
|
35
42
|
mentionManager,
|
|
36
43
|
sbOptions
|
|
37
44
|
} = (0, _useContext.useSendbirdChat)();
|
|
38
|
-
const {
|
|
39
|
-
select,
|
|
40
|
-
colors,
|
|
41
|
-
palette
|
|
42
|
-
} = (0, _uikitReactNativeFoundation.useUIKitTheme)();
|
|
43
45
|
const {
|
|
44
46
|
STRINGS
|
|
45
47
|
} = (0, _useContext.useLocalization)();
|
|
@@ -48,8 +50,11 @@ const SendInput = /*#__PURE__*/(0, _react.forwardRef)(function SendInput(_ref, r
|
|
|
48
50
|
} = (0, _uikitReactNativeFoundation.useBottomSheet)();
|
|
49
51
|
const toast = (0, _uikitReactNativeFoundation.useToast)();
|
|
50
52
|
const {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
onClose,
|
|
54
|
+
onDismiss,
|
|
55
|
+
visible: voiceMessageInputVisible,
|
|
56
|
+
setVisible: setVoiceMessageInputVisible
|
|
57
|
+
} = (0, _uikitUtils.useDeferredModalState)();
|
|
53
58
|
const messageReplyParams = (0, _uikitUtils.useIIFE)(() => {
|
|
54
59
|
const {
|
|
55
60
|
groupChannel
|
|
@@ -91,10 +96,30 @@ const SendInput = /*#__PURE__*/(0, _react.forwardRef)(function SendInput(_ref, r
|
|
|
91
96
|
}).catch(onFailureToSend);
|
|
92
97
|
setMessageToReply === null || setMessageToReply === void 0 ? void 0 : setMessageToReply();
|
|
93
98
|
};
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
const sendVoiceMessage = (file, durationMills) => {
|
|
100
|
+
if (inputMuted) {
|
|
101
|
+
toast.show(STRINGS.TOAST.USER_MUTED_ERROR, 'error');
|
|
102
|
+
_uikitUtils.Logger.error(STRINGS.TOAST.USER_MUTED_ERROR);
|
|
103
|
+
} else if (inputFrozen) {
|
|
104
|
+
toast.show(STRINGS.TOAST.CHANNEL_FROZEN_ERROR, 'error');
|
|
105
|
+
_uikitUtils.Logger.error(STRINGS.TOAST.CHANNEL_FROZEN_ERROR);
|
|
106
|
+
} else {
|
|
107
|
+
onPressSendFileMessage({
|
|
108
|
+
file,
|
|
109
|
+
metaArrays: [new _message.MessageMetaArray({
|
|
110
|
+
key: _constants.VOICE_MESSAGE_META_ARRAY_DURATION_KEY,
|
|
111
|
+
value: [String(durationMills)]
|
|
112
|
+
}), new _message.MessageMetaArray({
|
|
113
|
+
key: _constants.VOICE_MESSAGE_META_ARRAY_MESSAGE_TYPE_KEY,
|
|
114
|
+
value: [`voice/${recorderService.options.extension}`]
|
|
115
|
+
})],
|
|
116
|
+
...messageReplyParams
|
|
117
|
+
}).catch(onFailureToSend);
|
|
118
|
+
}
|
|
119
|
+
onChangeText('');
|
|
120
|
+
setMessageToReply === null || setMessageToReply === void 0 ? void 0 : setMessageToReply();
|
|
121
|
+
};
|
|
122
|
+
const sheetItems = (0, _useChannelInputItems.useChannelInputItems)(channel, sendFileMessage);
|
|
98
123
|
const getPlaceholder = () => {
|
|
99
124
|
if (inputMuted) return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_MUTED;
|
|
100
125
|
if (inputFrozen) return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_DISABLED;
|
|
@@ -102,102 +127,17 @@ const SendInput = /*#__PURE__*/(0, _react.forwardRef)(function SendInput(_ref, r
|
|
|
102
127
|
if (messageToReply) return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_REPLY;
|
|
103
128
|
return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_ACTIVE;
|
|
104
129
|
};
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
const getFileIconAsVideoThumbnail = url => {
|
|
114
|
-
return /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.VideoThumbnail, {
|
|
115
|
-
style: styles.previewImage,
|
|
116
|
-
iconSize: 0,
|
|
117
|
-
source: url,
|
|
118
|
-
fetchThumbnailFromVideoSource: uri => mediaService.getVideoThumbnail({
|
|
119
|
-
url: uri,
|
|
120
|
-
timeMills: 1000
|
|
121
|
-
})
|
|
122
|
-
});
|
|
123
|
-
};
|
|
124
|
-
const getFileIconAsSymbol = icon => {
|
|
125
|
-
return /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.Icon, {
|
|
126
|
-
icon: icon,
|
|
127
|
-
size: 20,
|
|
128
|
-
color: colors.onBackground02,
|
|
129
|
-
containerStyle: {
|
|
130
|
-
backgroundColor: select({
|
|
131
|
-
light: palette.background100,
|
|
132
|
-
dark: palette.background500
|
|
133
|
-
}),
|
|
134
|
-
width: 36,
|
|
135
|
-
height: 36,
|
|
136
|
-
borderRadius: 10,
|
|
137
|
-
marginRight: 10,
|
|
138
|
-
marginTop: 2
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
const getFileIcon = messageToReply => {
|
|
143
|
-
if (messageToReply !== null && messageToReply !== void 0 && messageToReply.isFileMessage()) {
|
|
144
|
-
const messageType = (0, _uikitUtils.getMessageType)(messageToReply);
|
|
145
|
-
switch (messageType) {
|
|
146
|
-
case 'file.image':
|
|
147
|
-
return getFileIconAsImage((0, _uikitUtils.getThumbnailUriFromFileMessage)(messageToReply));
|
|
148
|
-
case 'file.video':
|
|
149
|
-
return getFileIconAsVideoThumbnail((0, _uikitUtils.getThumbnailUriFromFileMessage)(messageToReply));
|
|
150
|
-
default:
|
|
151
|
-
return getFileIconAsSymbol((0, _uikitUtils.getFileIconFromMessageType)(messageType));
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return null;
|
|
155
|
-
};
|
|
156
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, messageToReply && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
157
|
-
style: {
|
|
158
|
-
flexDirection: 'row',
|
|
159
|
-
paddingLeft: 18,
|
|
160
|
-
paddingRight: 16,
|
|
161
|
-
paddingTop: 10,
|
|
162
|
-
paddingBottom: 8,
|
|
163
|
-
alignItems: 'center',
|
|
164
|
-
borderTopWidth: 1,
|
|
165
|
-
borderColor: colors.onBackground04
|
|
166
|
-
}
|
|
167
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
168
|
-
style: {
|
|
169
|
-
flex: 1,
|
|
170
|
-
flexDirection: 'row'
|
|
171
|
-
}
|
|
172
|
-
}, getFileIcon(messageToReply), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
173
|
-
style: {
|
|
174
|
-
flex: 1,
|
|
175
|
-
flexDirection: 'column'
|
|
176
|
-
}
|
|
177
|
-
}, /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.Text, {
|
|
178
|
-
numberOfLines: 1,
|
|
179
|
-
style: {
|
|
180
|
-
fontSize: 13,
|
|
181
|
-
fontWeight: '900',
|
|
182
|
-
marginBottom: 4
|
|
183
|
-
}
|
|
184
|
-
}, STRINGS.LABELS.CHANNEL_INPUT_REPLY_PREVIEW_TITLE(messageToReply.sender)), /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.Text, {
|
|
185
|
-
numberOfLines: 1,
|
|
186
|
-
style: {
|
|
187
|
-
fontSize: 13,
|
|
188
|
-
color: colors.onBackground03
|
|
189
|
-
}
|
|
190
|
-
}, STRINGS.LABELS.CHANNEL_INPUT_REPLY_PREVIEW_BODY(messageToReply)))), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
191
|
-
onPress: () => setMessageToReply === null || setMessageToReply === void 0 ? void 0 : setMessageToReply(undefined)
|
|
192
|
-
}, /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.Icon, {
|
|
193
|
-
icon: 'close',
|
|
194
|
-
size: 24,
|
|
195
|
-
color: colors.onBackground01,
|
|
196
|
-
containerStyle: styles.iconSend
|
|
197
|
-
}))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
130
|
+
const voiceMessageEnabled = channel.isGroupChannel() && sbOptions.uikit.groupChannel.channel.enableVoiceMessage;
|
|
131
|
+
const sendButtonVisible = Boolean(text.trim());
|
|
132
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, MessageToReplyPreview && /*#__PURE__*/_react.default.createElement(MessageToReplyPreview, {
|
|
133
|
+
messageToReply: messageToReply,
|
|
134
|
+
setMessageToReply: setMessageToReply
|
|
135
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
198
136
|
style: styles.sendInputContainer
|
|
199
137
|
}, AttachmentsButton && /*#__PURE__*/_react.default.createElement(AttachmentsButton, {
|
|
200
|
-
onPress:
|
|
138
|
+
onPress: () => openSheet({
|
|
139
|
+
sheetItems
|
|
140
|
+
}),
|
|
201
141
|
disabled: inputDisabled
|
|
202
142
|
}), /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.TextInput, {
|
|
203
143
|
ref: ref,
|
|
@@ -208,212 +148,115 @@ const SendInput = /*#__PURE__*/(0, _react.forwardRef)(function SendInput(_ref, r
|
|
|
208
148
|
onChangeText: onChangeText,
|
|
209
149
|
style: styles.input,
|
|
210
150
|
placeholder: getPlaceholder()
|
|
211
|
-
}, mentionManager.textToMentionedComponents(text, mentionedUsers, sbOptions.uikit.groupChannel.channel.enableMention)),
|
|
212
|
-
|
|
213
|
-
disabled: inputDisabled
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
151
|
+
}, mentionManager.textToMentionedComponents(text, mentionedUsers, sbOptions.uikit.groupChannel.channel.enableMention)), voiceMessageEnabled && /*#__PURE__*/_react.default.createElement(VoiceMessageButton, {
|
|
152
|
+
visible: !sendButtonVisible,
|
|
153
|
+
disabled: inputDisabled,
|
|
154
|
+
onPress: () => setVoiceMessageInputVisible(true)
|
|
155
|
+
}), /*#__PURE__*/_react.default.createElement(UserMessageSendButton, {
|
|
156
|
+
visible: sendButtonVisible,
|
|
157
|
+
disabled: inputDisabled,
|
|
158
|
+
onPress: sendUserMessage
|
|
159
|
+
}), voiceMessageEnabled && VoiceMessageInput && /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.Modal, {
|
|
160
|
+
disableBackgroundClose: true,
|
|
161
|
+
onClose: onClose,
|
|
162
|
+
onDismiss: () => {
|
|
163
|
+
onDismiss();
|
|
164
|
+
Promise.allSettled([playerService.reset(), recorderService.reset()]);
|
|
165
|
+
},
|
|
166
|
+
backgroundStyle: {
|
|
167
|
+
justifyContent: 'flex-end'
|
|
168
|
+
},
|
|
169
|
+
visible: voiceMessageInputVisible,
|
|
170
|
+
type: 'slide-no-gesture'
|
|
171
|
+
}, /*#__PURE__*/_react.default.createElement(VoiceMessageInput, {
|
|
172
|
+
onClose: onClose,
|
|
173
|
+
onSend: _ref2 => {
|
|
174
|
+
let {
|
|
175
|
+
file,
|
|
176
|
+
duration
|
|
177
|
+
} = _ref2;
|
|
178
|
+
return sendVoiceMessage(file, duration);
|
|
179
|
+
}
|
|
219
180
|
}))));
|
|
220
181
|
});
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
182
|
+
const VoiceMessageButton = _ref3 => {
|
|
183
|
+
let {
|
|
184
|
+
visible,
|
|
185
|
+
disabled,
|
|
186
|
+
onPress
|
|
187
|
+
} = _ref3;
|
|
226
188
|
const {
|
|
227
189
|
STRINGS
|
|
228
190
|
} = (0, _useContext.useLocalization)();
|
|
229
|
-
const {
|
|
230
|
-
fileService,
|
|
231
|
-
mediaService
|
|
232
|
-
} = (0, _useContext.usePlatformService)();
|
|
233
191
|
const {
|
|
234
192
|
alert
|
|
235
193
|
} = (0, _uikitReactNativeFoundation.useAlert)();
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
194
|
+
const {
|
|
195
|
+
playerService,
|
|
196
|
+
recorderService
|
|
197
|
+
} = (0, _useContext.usePlatformService)();
|
|
198
|
+
const {
|
|
199
|
+
colors
|
|
200
|
+
} = (0, _uikitReactNativeFoundation.useUIKitTheme)();
|
|
201
|
+
if (!visible) return null;
|
|
202
|
+
const onPressWithPermissionCheck = async () => {
|
|
203
|
+
const recorderGranted = await recorderService.requestPermission();
|
|
204
|
+
if (!recorderGranted) {
|
|
205
|
+
alert({
|
|
206
|
+
title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
|
|
207
|
+
message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_MICROPHONE, STRINGS.LABELS.PERMISSION_APP_NAME),
|
|
208
|
+
buttons: [{
|
|
209
|
+
text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
|
|
210
|
+
onPress: () => _SBUUtils.default.openSettings()
|
|
211
|
+
}]
|
|
212
|
+
});
|
|
213
|
+
_uikitUtils.Logger.error('Failed to request permission for recorder');
|
|
214
|
+
return;
|
|
256
215
|
}
|
|
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
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
if (input.camera.enableVideo) {
|
|
302
|
-
sheetItems.push({
|
|
303
|
-
title: STRINGS.LABELS.CHANNEL_INPUT_ATTACHMENT_CAMERA_VIDEO,
|
|
304
|
-
icon: 'camera',
|
|
305
|
-
onPress: async () => {
|
|
306
|
-
const mediaFile = await fileService.openCamera({
|
|
307
|
-
mediaType: 'video',
|
|
308
|
-
onOpenFailure: error => {
|
|
309
|
-
if (error.code === _SBUError.default.CODE.ERR_PERMISSIONS_DENIED) {
|
|
310
|
-
alert({
|
|
311
|
-
title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
|
|
312
|
-
message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_CAMERA, STRINGS.LABELS.PERMISSION_APP_NAME),
|
|
313
|
-
buttons: [{
|
|
314
|
-
text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
|
|
315
|
-
onPress: () => _SBUUtils.default.openSettings()
|
|
316
|
-
}]
|
|
317
|
-
});
|
|
318
|
-
} else {
|
|
319
|
-
toast.show(STRINGS.TOAST.OPEN_CAMERA_ERROR, 'error');
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
if (mediaFile) {
|
|
324
|
-
sendFileMessage(mediaFile);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
if (input.gallery.enablePhoto || input.gallery.enableVideo) {
|
|
330
|
-
const mediaType = (() => {
|
|
331
|
-
switch (true) {
|
|
332
|
-
case input.gallery.enablePhoto && input.gallery.enableVideo:
|
|
333
|
-
return 'all';
|
|
334
|
-
case input.gallery.enablePhoto && !input.gallery.enableVideo:
|
|
335
|
-
return 'photo';
|
|
336
|
-
case !input.gallery.enablePhoto && input.gallery.enableVideo:
|
|
337
|
-
return 'video';
|
|
338
|
-
default:
|
|
339
|
-
return 'all';
|
|
340
|
-
}
|
|
341
|
-
})();
|
|
342
|
-
sheetItems.push({
|
|
343
|
-
title: STRINGS.LABELS.CHANNEL_INPUT_ATTACHMENT_PHOTO_LIBRARY,
|
|
344
|
-
icon: 'photo',
|
|
345
|
-
onPress: async () => {
|
|
346
|
-
const mediaFiles = await fileService.openMediaLibrary({
|
|
347
|
-
selectionLimit: 1,
|
|
348
|
-
mediaType,
|
|
349
|
-
onOpenFailure: error => {
|
|
350
|
-
if (error.code === _SBUError.default.CODE.ERR_PERMISSIONS_DENIED) {
|
|
351
|
-
alert({
|
|
352
|
-
title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
|
|
353
|
-
message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_DEVICE_STORAGE, STRINGS.LABELS.PERMISSION_APP_NAME),
|
|
354
|
-
buttons: [{
|
|
355
|
-
text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
|
|
356
|
-
onPress: () => _SBUUtils.default.openSettings()
|
|
357
|
-
}]
|
|
358
|
-
});
|
|
359
|
-
} else {
|
|
360
|
-
toast.show(STRINGS.TOAST.OPEN_PHOTO_LIBRARY_ERROR, 'error');
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
if (mediaFiles && mediaFiles[0]) {
|
|
365
|
-
const mediaFile = mediaFiles[0];
|
|
366
|
-
|
|
367
|
-
// Image compression
|
|
368
|
-
if ((0, _uikitUtils.isImage)(mediaFile.uri, mediaFile.type) && (0, _uikitUtils.shouldCompressImage)(mediaFile.type, sbOptions.chat.imageCompressionEnabled)) {
|
|
369
|
-
await _SBUUtils.default.safeRun(async () => {
|
|
370
|
-
const compressed = await mediaService.compressImage({
|
|
371
|
-
uri: mediaFile.uri,
|
|
372
|
-
maxWidth: imageCompressionConfig.width,
|
|
373
|
-
maxHeight: imageCompressionConfig.height,
|
|
374
|
-
compressionRate: imageCompressionConfig.compressionRate
|
|
375
|
-
});
|
|
376
|
-
if (compressed) {
|
|
377
|
-
mediaFile.uri = compressed.uri;
|
|
378
|
-
mediaFile.size = compressed.size;
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
sendFileMessage(mediaFile);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
if (input.enableDocument) {
|
|
388
|
-
sheetItems.push({
|
|
389
|
-
title: STRINGS.LABELS.CHANNEL_INPUT_ATTACHMENT_FILES,
|
|
390
|
-
icon: 'document',
|
|
391
|
-
onPress: async () => {
|
|
392
|
-
const documentFile = await fileService.openDocument({
|
|
393
|
-
onOpenFailure: () => toast.show(STRINGS.TOAST.OPEN_FILES_ERROR, 'error')
|
|
394
|
-
});
|
|
395
|
-
if (documentFile) {
|
|
396
|
-
// Image compression
|
|
397
|
-
if ((0, _uikitUtils.isImage)(documentFile.uri, documentFile.type) && (0, _uikitUtils.shouldCompressImage)(documentFile.type, sbOptions.chat.imageCompressionEnabled)) {
|
|
398
|
-
await _SBUUtils.default.safeRun(async () => {
|
|
399
|
-
const compressed = await mediaService.compressImage({
|
|
400
|
-
uri: documentFile.uri,
|
|
401
|
-
maxWidth: imageCompressionConfig.width,
|
|
402
|
-
maxHeight: imageCompressionConfig.height,
|
|
403
|
-
compressionRate: imageCompressionConfig.compressionRate
|
|
404
|
-
});
|
|
405
|
-
if (compressed) {
|
|
406
|
-
documentFile.uri = compressed.uri;
|
|
407
|
-
documentFile.size = compressed.size;
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
sendFileMessage(documentFile);
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
return sheetItems;
|
|
216
|
+
const playerGranted = await playerService.requestPermission();
|
|
217
|
+
if (!playerGranted) {
|
|
218
|
+
alert({
|
|
219
|
+
title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
|
|
220
|
+
message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_DEVICE_STORAGE, STRINGS.LABELS.PERMISSION_APP_NAME),
|
|
221
|
+
buttons: [{
|
|
222
|
+
text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
|
|
223
|
+
onPress: () => _SBUUtils.default.openSettings()
|
|
224
|
+
}]
|
|
225
|
+
});
|
|
226
|
+
_uikitUtils.Logger.error('Failed to request permission for player');
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
onPress();
|
|
230
|
+
};
|
|
231
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
232
|
+
onPress: onPressWithPermissionCheck,
|
|
233
|
+
disabled: disabled
|
|
234
|
+
}, /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.Icon, {
|
|
235
|
+
color: disabled ? colors.ui.input.default.disabled.highlight : colors.ui.input.default.active.highlight,
|
|
236
|
+
icon: 'audio-on',
|
|
237
|
+
size: 24,
|
|
238
|
+
containerStyle: styles.sendIcon
|
|
239
|
+
}));
|
|
240
|
+
};
|
|
241
|
+
const UserMessageSendButton = _ref4 => {
|
|
242
|
+
let {
|
|
243
|
+
visible,
|
|
244
|
+
disabled,
|
|
245
|
+
onPress
|
|
246
|
+
} = _ref4;
|
|
247
|
+
const {
|
|
248
|
+
colors
|
|
249
|
+
} = (0, _uikitReactNativeFoundation.useUIKitTheme)();
|
|
250
|
+
if (!visible) return null;
|
|
251
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
252
|
+
onPress: onPress,
|
|
253
|
+
disabled: disabled
|
|
254
|
+
}, /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.Icon, {
|
|
255
|
+
color: disabled ? colors.ui.input.default.disabled.highlight : colors.ui.input.default.active.highlight,
|
|
256
|
+
icon: 'send',
|
|
257
|
+
size: 24,
|
|
258
|
+
containerStyle: styles.sendIcon
|
|
259
|
+
}));
|
|
417
260
|
};
|
|
418
261
|
const styles = (0, _uikitReactNativeFoundation.createStyleSheet)({
|
|
419
262
|
sendInputContainer: {
|
|
@@ -432,17 +275,9 @@ const styles = (0, _uikitReactNativeFoundation.createStyleSheet)({
|
|
|
432
275
|
}),
|
|
433
276
|
borderRadius: 20
|
|
434
277
|
},
|
|
435
|
-
|
|
278
|
+
sendIcon: {
|
|
436
279
|
marginLeft: 4,
|
|
437
280
|
padding: 4
|
|
438
|
-
},
|
|
439
|
-
previewImage: {
|
|
440
|
-
width: 36,
|
|
441
|
-
height: 36,
|
|
442
|
-
borderRadius: 10,
|
|
443
|
-
marginTop: 2,
|
|
444
|
-
marginRight: 10,
|
|
445
|
-
overflow: 'hidden'
|
|
446
281
|
}
|
|
447
282
|
});
|
|
448
283
|
var _default = SendInput;
|