@sendbird/uikit-react-native 3.1.2 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -42
- package/lib/commonjs/components/ChannelInput/EditInput.js +2 -11
- package/lib/commonjs/components/ChannelInput/EditInput.js.map +1 -1
- 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 +149 -323
- 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 +34 -3
- package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
- package/lib/commonjs/components/ChannelMessageList/index.js +148 -116
- 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 +134 -6
- 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/GroupChannelHeader.js +14 -4
- package/lib/commonjs/domain/groupChannel/component/GroupChannelHeader.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +28 -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 +34 -7
- 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 +36 -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 +7 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/promise.js +138 -0
- package/lib/commonjs/utils/promise.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/components/ChannelInput/EditInput.js +3 -12
- package/lib/module/components/ChannelInput/EditInput.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 +152 -326
- 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 +36 -5
- package/lib/module/components/ChannelInput/index.js.map +1 -1
- package/lib/module/components/ChannelMessageList/index.js +149 -117
- 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 +132 -7
- 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/GroupChannelHeader.js +15 -5
- package/lib/module/domain/groupChannel/component/GroupChannelHeader.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +29 -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 +36 -9
- 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 +8 -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 +5 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/promise.js +132 -0
- package/lib/module/utils/promise.js.map +1 -0
- 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 +9 -3
- package/lib/typescript/src/components/ChannelMessageList/index.d.ts +4 -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/GroupChannelMessageRenderer/index.d.ts +3 -0
- 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/OpenChannelMessageRenderer/index.d.ts +2 -0
- 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 +48 -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 +5 -1
- package/lib/typescript/src/utils/promise.d.ts +7 -0
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +10 -12
- package/src/components/ChannelInput/EditInput.tsx +3 -15
- package/src/components/ChannelInput/MessageToReplyPreview.tsx +133 -0
- package/src/components/ChannelInput/SendInput.tsx +131 -329
- package/src/components/ChannelInput/VoiceMessageInput.tsx +206 -0
- package/src/components/ChannelInput/index.tsx +37 -6
- package/src/components/ChannelMessageList/index.tsx +145 -113
- package/src/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.tsx +24 -11
- package/src/components/GroupChannelMessageRenderer/index.tsx +113 -4
- 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/GroupChannelHeader.tsx +14 -3
- package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +30 -43
- package/src/domain/groupChannel/module/moduleContext.tsx +119 -7
- package/src/domain/groupChannel/types.ts +45 -0
- package/src/domain/userList/types.ts +2 -2
- package/src/fragments/createGroupChannelFragment.tsx +43 -8
- 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 +9 -1
- 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 +6 -1
- package/src/utils/promise.ts +139 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","TouchableOpacity","View","Icon","ImageWithPlaceholder","Text","VideoThumbnail","createStyleSheet","useUIKitTheme","getFileIconFromMessageType","getMessageType","getThumbnailUriFromFileMessage","useLocalization","usePlatformService","MessageToReplyPreview","_ref","messageToReply","setMessageToReply","colors","select","palette","mediaService","STRINGS","getFileIconAsImage","url","createElement","source","uri","style","styles","previewImage","getFileIconAsVideoThumbnail","iconSize","fetchThumbnailFromVideoSource","getVideoThumbnail","timeMills","getFileIconAsSymbol","icon","size","color","onBackground02","containerStyle","fileIcon","backgroundColor","light","background100","dark","background500","getFileIcon","isFileMessage","messageType","messageToReplyContainer","borderColor","onBackground04","flex","flexDirection","numberOfLines","fontSize","fontWeight","marginBottom","LABELS","CHANNEL_INPUT_REPLY_PREVIEW_TITLE","sender","onBackground03","CHANNEL_INPUT_REPLY_PREVIEW_BODY","onPress","undefined","onBackground01","closeIcon","width","height","borderRadius","marginTop","marginRight","overflow","paddingLeft","paddingRight","paddingTop","paddingBottom","alignItems","borderTopWidth","marginLeft","padding"],"sources":["MessageToReplyPreview.tsx"],"sourcesContent":["import React from 'react';\nimport { TouchableOpacity, View } from 'react-native';\n\nimport {\n Icon,\n ImageWithPlaceholder,\n Text,\n VideoThumbnail,\n createStyleSheet,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport {\n FileIcon,\n SendbirdBaseMessage,\n SendbirdFileMessage,\n SendbirdUserMessage,\n getFileIconFromMessageType,\n getMessageType,\n getThumbnailUriFromFileMessage,\n} from '@sendbird/uikit-utils';\n\nimport { useLocalization, usePlatformService } from '../../hooks/useContext';\n\nexport type MessageToReplyPreviewProps = {\n messageToReply?: SendbirdFileMessage | SendbirdUserMessage;\n setMessageToReply?: (message?: undefined | SendbirdFileMessage | SendbirdUserMessage) => void;\n};\n\nexport const MessageToReplyPreview = ({ messageToReply, setMessageToReply }: MessageToReplyPreviewProps) => {\n const { colors, select, palette } = useUIKitTheme();\n const { mediaService } = usePlatformService();\n const { STRINGS } = useLocalization();\n\n const getFileIconAsImage = (url: string) => {\n return <ImageWithPlaceholder source={{ uri: url }} style={styles.previewImage} />;\n };\n\n const getFileIconAsVideoThumbnail = (url: string) => {\n return (\n <VideoThumbnail\n style={styles.previewImage}\n iconSize={0}\n source={url}\n fetchThumbnailFromVideoSource={(uri) => mediaService.getVideoThumbnail({ url: uri, timeMills: 1000 })}\n />\n );\n };\n\n const getFileIconAsSymbol = (icon: FileIcon) => {\n return (\n <Icon\n icon={icon}\n size={20}\n color={colors.onBackground02}\n containerStyle={[\n styles.fileIcon,\n {\n backgroundColor: select({ light: palette.background100, dark: palette.background500 }),\n },\n ]}\n />\n );\n };\n\n const getFileIcon = (messageToReply: SendbirdBaseMessage) => {\n if (messageToReply?.isFileMessage()) {\n const messageType = getMessageType(messageToReply);\n switch (messageType) {\n case 'file.image':\n return getFileIconAsImage(getThumbnailUriFromFileMessage(messageToReply));\n case 'file.video':\n return getFileIconAsVideoThumbnail(getThumbnailUriFromFileMessage(messageToReply));\n case 'file.voice':\n return null;\n default:\n return getFileIconAsSymbol(getFileIconFromMessageType(messageType));\n }\n }\n return null;\n };\n\n if (!messageToReply) return null;\n\n return (\n <View style={[styles.messageToReplyContainer, { borderColor: colors.onBackground04 }]}>\n <View style={{ flex: 1, flexDirection: 'row' }}>\n {getFileIcon(messageToReply)}\n <View style={{ flex: 1, flexDirection: 'column' }}>\n <Text numberOfLines={1} style={{ fontSize: 13, fontWeight: '900', marginBottom: 4 }}>\n {STRINGS.LABELS.CHANNEL_INPUT_REPLY_PREVIEW_TITLE(messageToReply.sender)}\n </Text>\n <Text numberOfLines={1} style={{ fontSize: 13, color: colors.onBackground03 }}>\n {STRINGS.LABELS.CHANNEL_INPUT_REPLY_PREVIEW_BODY(messageToReply)}\n </Text>\n </View>\n </View>\n <TouchableOpacity onPress={() => setMessageToReply?.(undefined)}>\n <Icon icon={'close'} size={24} color={colors.onBackground01} containerStyle={styles.closeIcon} />\n </TouchableOpacity>\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n previewImage: {\n width: 36,\n height: 36,\n borderRadius: 10,\n marginTop: 2,\n marginRight: 10,\n overflow: 'hidden',\n },\n messageToReplyContainer: {\n flexDirection: 'row',\n paddingLeft: 18,\n paddingRight: 16,\n paddingTop: 10,\n paddingBottom: 8,\n alignItems: 'center',\n borderTopWidth: 1,\n },\n fileIcon: {\n width: 36,\n height: 36,\n borderRadius: 10,\n marginRight: 10,\n marginTop: 2,\n },\n closeIcon: {\n marginLeft: 4,\n padding: 4,\n },\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAErD,SACEC,IAAI,EACJC,oBAAoB,EACpBC,IAAI,EACJC,cAAc,EACdC,gBAAgB,EAChBC,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AE;EACb,CAAC;EACDJ,SAAS,EAAE;IACTa,UAAU,EAAE,CAAC;IACbC,OAAO,EAAE;EACX;AACF,CAAC,CAAC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { MentionType } from '@sendbird/chat/message';
|
|
4
|
-
import { Icon,
|
|
5
|
-
import { Logger,
|
|
2
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
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
|
+
style,
|
|
13
|
+
VoiceMessageInput,
|
|
14
|
+
MessageToReplyPreview,
|
|
11
15
|
AttachmentsButton,
|
|
12
16
|
onPressSendUserMessage,
|
|
13
17
|
onPressSendFileMessage,
|
|
@@ -22,15 +26,14 @@ const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
|
|
|
22
26
|
messageToReply,
|
|
23
27
|
setMessageToReply
|
|
24
28
|
} = _ref;
|
|
29
|
+
const {
|
|
30
|
+
playerService,
|
|
31
|
+
recorderService
|
|
32
|
+
} = usePlatformService();
|
|
25
33
|
const {
|
|
26
34
|
mentionManager,
|
|
27
35
|
sbOptions
|
|
28
36
|
} = useSendbirdChat();
|
|
29
|
-
const {
|
|
30
|
-
select,
|
|
31
|
-
colors,
|
|
32
|
-
palette
|
|
33
|
-
} = useUIKitTheme();
|
|
34
37
|
const {
|
|
35
38
|
STRINGS
|
|
36
39
|
} = useLocalization();
|
|
@@ -39,8 +42,11 @@ const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
|
|
|
39
42
|
} = useBottomSheet();
|
|
40
43
|
const toast = useToast();
|
|
41
44
|
const {
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
onClose,
|
|
46
|
+
onDismiss,
|
|
47
|
+
visible: voiceMessageInputVisible,
|
|
48
|
+
setVisible: setVoiceMessageInputVisible
|
|
49
|
+
} = useDeferredModalState();
|
|
44
50
|
const messageReplyParams = useIIFE(() => {
|
|
45
51
|
const {
|
|
46
52
|
groupChannel
|
|
@@ -82,10 +88,30 @@ const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
|
|
|
82
88
|
}).catch(onFailureToSend);
|
|
83
89
|
setMessageToReply === null || setMessageToReply === void 0 ? void 0 : setMessageToReply();
|
|
84
90
|
};
|
|
91
|
+
const sendVoiceMessage = (file, durationMills) => {
|
|
92
|
+
if (inputMuted) {
|
|
93
|
+
toast.show(STRINGS.TOAST.USER_MUTED_ERROR, 'error');
|
|
94
|
+
Logger.error(STRINGS.TOAST.USER_MUTED_ERROR);
|
|
95
|
+
} else if (inputFrozen) {
|
|
96
|
+
toast.show(STRINGS.TOAST.CHANNEL_FROZEN_ERROR, 'error');
|
|
97
|
+
Logger.error(STRINGS.TOAST.CHANNEL_FROZEN_ERROR);
|
|
98
|
+
} else {
|
|
99
|
+
onPressSendFileMessage({
|
|
100
|
+
file,
|
|
101
|
+
metaArrays: [new MessageMetaArray({
|
|
102
|
+
key: VOICE_MESSAGE_META_ARRAY_DURATION_KEY,
|
|
103
|
+
value: [String(durationMills)]
|
|
104
|
+
}), new MessageMetaArray({
|
|
105
|
+
key: VOICE_MESSAGE_META_ARRAY_MESSAGE_TYPE_KEY,
|
|
106
|
+
value: [`voice/${recorderService.options.extension}`]
|
|
107
|
+
})],
|
|
108
|
+
...messageReplyParams
|
|
109
|
+
}).catch(onFailureToSend);
|
|
110
|
+
}
|
|
111
|
+
onChangeText('');
|
|
112
|
+
setMessageToReply === null || setMessageToReply === void 0 ? void 0 : setMessageToReply();
|
|
113
|
+
};
|
|
85
114
|
const sheetItems = useChannelInputItems(channel, sendFileMessage);
|
|
86
|
-
const onPressAttachment = () => openSheet({
|
|
87
|
-
sheetItems
|
|
88
|
-
});
|
|
89
115
|
const getPlaceholder = () => {
|
|
90
116
|
if (inputMuted) return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_MUTED;
|
|
91
117
|
if (inputFrozen) return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_DISABLED;
|
|
@@ -93,102 +119,17 @@ const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
|
|
|
93
119
|
if (messageToReply) return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_REPLY;
|
|
94
120
|
return STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_ACTIVE;
|
|
95
121
|
};
|
|
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, {
|
|
122
|
+
const voiceMessageEnabled = channel.isGroupChannel() && sbOptions.uikit.groupChannel.channel.enableVoiceMessage;
|
|
123
|
+
const sendButtonVisible = Boolean(text.trim());
|
|
124
|
+
return /*#__PURE__*/React.createElement(View, null, MessageToReplyPreview && /*#__PURE__*/React.createElement(MessageToReplyPreview, {
|
|
125
|
+
messageToReply: messageToReply,
|
|
126
|
+
setMessageToReply: setMessageToReply
|
|
127
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
189
128
|
style: styles.sendInputContainer
|
|
190
129
|
}, AttachmentsButton && /*#__PURE__*/React.createElement(AttachmentsButton, {
|
|
191
|
-
onPress:
|
|
130
|
+
onPress: () => openSheet({
|
|
131
|
+
sheetItems
|
|
132
|
+
}),
|
|
192
133
|
disabled: inputDisabled
|
|
193
134
|
}), /*#__PURE__*/React.createElement(TextInput, {
|
|
194
135
|
ref: ref,
|
|
@@ -197,214 +138,117 @@ const SendInput = /*#__PURE__*/forwardRef(function SendInput(_ref, ref) {
|
|
|
197
138
|
onSelectionChange: onSelectionChange,
|
|
198
139
|
editable: !inputDisabled,
|
|
199
140
|
onChangeText: onChangeText,
|
|
200
|
-
style:
|
|
141
|
+
style: style,
|
|
201
142
|
placeholder: getPlaceholder()
|
|
202
|
-
}, mentionManager.textToMentionedComponents(text, mentionedUsers, sbOptions.uikit.groupChannel.channel.enableMention)),
|
|
203
|
-
|
|
204
|
-
disabled: inputDisabled
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
143
|
+
}, mentionManager.textToMentionedComponents(text, mentionedUsers, sbOptions.uikit.groupChannel.channel.enableMention)), voiceMessageEnabled && /*#__PURE__*/React.createElement(VoiceMessageButton, {
|
|
144
|
+
visible: !sendButtonVisible,
|
|
145
|
+
disabled: inputDisabled,
|
|
146
|
+
onPress: () => setVoiceMessageInputVisible(true)
|
|
147
|
+
}), /*#__PURE__*/React.createElement(UserMessageSendButton, {
|
|
148
|
+
visible: sendButtonVisible,
|
|
149
|
+
disabled: inputDisabled,
|
|
150
|
+
onPress: sendUserMessage
|
|
151
|
+
}), voiceMessageEnabled && VoiceMessageInput && /*#__PURE__*/React.createElement(Modal, {
|
|
152
|
+
disableBackgroundClose: true,
|
|
153
|
+
onClose: onClose,
|
|
154
|
+
onDismiss: () => {
|
|
155
|
+
onDismiss();
|
|
156
|
+
Promise.allSettled([playerService.reset(), recorderService.reset()]);
|
|
157
|
+
},
|
|
158
|
+
backgroundStyle: {
|
|
159
|
+
justifyContent: 'flex-end'
|
|
160
|
+
},
|
|
161
|
+
visible: voiceMessageInputVisible,
|
|
162
|
+
type: 'slide-no-gesture'
|
|
163
|
+
}, /*#__PURE__*/React.createElement(VoiceMessageInput, {
|
|
164
|
+
onClose: onClose,
|
|
165
|
+
onSend: _ref2 => {
|
|
166
|
+
let {
|
|
167
|
+
file,
|
|
168
|
+
duration
|
|
169
|
+
} = _ref2;
|
|
170
|
+
return sendVoiceMessage(file, duration);
|
|
171
|
+
}
|
|
210
172
|
}))));
|
|
211
173
|
});
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
174
|
+
const VoiceMessageButton = _ref3 => {
|
|
175
|
+
let {
|
|
176
|
+
visible,
|
|
177
|
+
disabled,
|
|
178
|
+
onPress
|
|
179
|
+
} = _ref3;
|
|
217
180
|
const {
|
|
218
181
|
STRINGS
|
|
219
182
|
} = useLocalization();
|
|
220
|
-
const {
|
|
221
|
-
fileService,
|
|
222
|
-
mediaService
|
|
223
|
-
} = usePlatformService();
|
|
224
183
|
const {
|
|
225
184
|
alert
|
|
226
185
|
} = useAlert();
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
186
|
+
const {
|
|
187
|
+
playerService,
|
|
188
|
+
recorderService
|
|
189
|
+
} = usePlatformService();
|
|
190
|
+
const {
|
|
191
|
+
colors
|
|
192
|
+
} = useUIKitTheme();
|
|
193
|
+
if (!visible) return null;
|
|
194
|
+
const onPressWithPermissionCheck = async () => {
|
|
195
|
+
const recorderGranted = await recorderService.requestPermission();
|
|
196
|
+
if (!recorderGranted) {
|
|
197
|
+
alert({
|
|
198
|
+
title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
|
|
199
|
+
message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_MICROPHONE, STRINGS.LABELS.PERMISSION_APP_NAME),
|
|
200
|
+
buttons: [{
|
|
201
|
+
text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
|
|
202
|
+
onPress: () => SBUUtils.openSettings()
|
|
203
|
+
}]
|
|
204
|
+
});
|
|
205
|
+
Logger.error('Failed to request permission for recorder');
|
|
206
|
+
return;
|
|
247
207
|
}
|
|
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;
|
|
208
|
+
const playerGranted = await playerService.requestPermission();
|
|
209
|
+
if (!playerGranted) {
|
|
210
|
+
alert({
|
|
211
|
+
title: STRINGS.DIALOG.ALERT_PERMISSIONS_TITLE,
|
|
212
|
+
message: STRINGS.DIALOG.ALERT_PERMISSIONS_MESSAGE(STRINGS.LABELS.PERMISSION_DEVICE_STORAGE, STRINGS.LABELS.PERMISSION_APP_NAME),
|
|
213
|
+
buttons: [{
|
|
214
|
+
text: STRINGS.DIALOG.ALERT_PERMISSIONS_OK,
|
|
215
|
+
onPress: () => SBUUtils.openSettings()
|
|
216
|
+
}]
|
|
217
|
+
});
|
|
218
|
+
Logger.error('Failed to request permission for player');
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
onPress();
|
|
222
|
+
};
|
|
223
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
224
|
+
onPress: onPressWithPermissionCheck,
|
|
225
|
+
disabled: disabled
|
|
226
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
227
|
+
color: disabled ? colors.ui.input.default.disabled.highlight : colors.ui.input.default.active.highlight,
|
|
228
|
+
icon: 'audio-on',
|
|
229
|
+
size: 24,
|
|
230
|
+
containerStyle: styles.sendIcon
|
|
231
|
+
}));
|
|
232
|
+
};
|
|
233
|
+
const UserMessageSendButton = _ref4 => {
|
|
234
|
+
let {
|
|
235
|
+
visible,
|
|
236
|
+
disabled,
|
|
237
|
+
onPress
|
|
238
|
+
} = _ref4;
|
|
239
|
+
const {
|
|
240
|
+
colors
|
|
241
|
+
} = useUIKitTheme();
|
|
242
|
+
if (!visible) return null;
|
|
243
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
244
|
+
onPress: onPress,
|
|
245
|
+
disabled: disabled
|
|
246
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
247
|
+
color: disabled ? colors.ui.input.default.disabled.highlight : colors.ui.input.default.active.highlight,
|
|
248
|
+
icon: 'send',
|
|
249
|
+
size: 24,
|
|
250
|
+
containerStyle: styles.sendIcon
|
|
251
|
+
}));
|
|
408
252
|
};
|
|
409
253
|
const styles = createStyleSheet({
|
|
410
254
|
sendInputContainer: {
|
|
@@ -413,27 +257,9 @@ const styles = createStyleSheet({
|
|
|
413
257
|
alignItems: 'center',
|
|
414
258
|
flexDirection: 'row'
|
|
415
259
|
},
|
|
416
|
-
|
|
417
|
-
flex: 1,
|
|
418
|
-
marginRight: 4,
|
|
419
|
-
minHeight: 36,
|
|
420
|
-
maxHeight: 36 * Platform.select({
|
|
421
|
-
ios: 2.5,
|
|
422
|
-
default: 2
|
|
423
|
-
}),
|
|
424
|
-
borderRadius: 20
|
|
425
|
-
},
|
|
426
|
-
iconSend: {
|
|
260
|
+
sendIcon: {
|
|
427
261
|
marginLeft: 4,
|
|
428
262
|
padding: 4
|
|
429
|
-
},
|
|
430
|
-
previewImage: {
|
|
431
|
-
width: 36,
|
|
432
|
-
height: 36,
|
|
433
|
-
borderRadius: 10,
|
|
434
|
-
marginTop: 2,
|
|
435
|
-
marginRight: 10,
|
|
436
|
-
overflow: 'hidden'
|
|
437
263
|
}
|
|
438
264
|
});
|
|
439
265
|
export default SendInput;
|