@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,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _uikitUtils = require("@sendbird/uikit-utils");
|
|
9
|
+
var _VoiceMessageConfig = _interopRequireDefault(require("../libs/VoiceMessageConfig"));
|
|
10
|
+
var _nativePermissionGranted = _interopRequireDefault(require("../utils/nativePermissionGranted"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
14
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
|
+
const createNativeRecorderService = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
audioRecorderModule,
|
|
18
|
+
permissionModule
|
|
19
|
+
} = _ref;
|
|
20
|
+
const module = new audioRecorderModule.default();
|
|
21
|
+
class VoiceRecorder {
|
|
22
|
+
constructor() {
|
|
23
|
+
_defineProperty(this, "uri", undefined);
|
|
24
|
+
_defineProperty(this, "state", 'idle');
|
|
25
|
+
_defineProperty(this, "options", {
|
|
26
|
+
minDuration: _VoiceMessageConfig.default.DEFAULT.RECORDER.MIN_DURATION,
|
|
27
|
+
maxDuration: _VoiceMessageConfig.default.DEFAULT.RECORDER.MAX_DURATION,
|
|
28
|
+
extension: _VoiceMessageConfig.default.DEFAULT.RECORDER.EXTENSION
|
|
29
|
+
});
|
|
30
|
+
// NOTE: In Android, even when startRecorder() is awaited, if stop() is executed immediately afterward, an error occurs
|
|
31
|
+
_defineProperty(this, "_recordStartedAt", 0);
|
|
32
|
+
_defineProperty(this, "_getRecorderStopSafeBuffer", () => {
|
|
33
|
+
const minWaitingTime = 500;
|
|
34
|
+
const elapsedTime = Date.now() - this._recordStartedAt;
|
|
35
|
+
if (elapsedTime > minWaitingTime) return 0;else return minWaitingTime - elapsedTime;
|
|
36
|
+
});
|
|
37
|
+
_defineProperty(this, "recordingSubscribers", new Set());
|
|
38
|
+
_defineProperty(this, "stateSubscribers", new Set());
|
|
39
|
+
_defineProperty(this, "audioSettings", {
|
|
40
|
+
sampleRate: _VoiceMessageConfig.default.DEFAULT.RECORDER.SAMPLE_RATE,
|
|
41
|
+
bitRate: _VoiceMessageConfig.default.DEFAULT.RECORDER.BIT_RATE,
|
|
42
|
+
audioChannels: _VoiceMessageConfig.default.DEFAULT.RECORDER.CHANNELS
|
|
43
|
+
// encoding: mpeg4_aac
|
|
44
|
+
});
|
|
45
|
+
_defineProperty(this, "audioOptions", _reactNative.Platform.select({
|
|
46
|
+
android: {
|
|
47
|
+
AudioEncodingBitRateAndroid: this.audioSettings.bitRate,
|
|
48
|
+
AudioChannelsAndroid: this.audioSettings.audioChannels,
|
|
49
|
+
AudioSamplingRateAndroid: this.audioSettings.sampleRate,
|
|
50
|
+
AudioEncoderAndroid: audioRecorderModule.AudioEncoderAndroidType.AAC,
|
|
51
|
+
OutputFormatAndroid: audioRecorderModule.OutputFormatAndroidType.MPEG_4,
|
|
52
|
+
AudioSourceAndroid: audioRecorderModule.AudioSourceAndroidType.VOICE_RECOGNITION
|
|
53
|
+
},
|
|
54
|
+
ios: {
|
|
55
|
+
AVEncoderBitRateKeyIOS: this.audioSettings.bitRate,
|
|
56
|
+
AVNumberOfChannelsKeyIOS: this.audioSettings.audioChannels,
|
|
57
|
+
AVSampleRateKeyIOS: this.audioSettings.sampleRate,
|
|
58
|
+
AVFormatIDKeyIOS: audioRecorderModule.AVEncodingOption.mp4,
|
|
59
|
+
// same with aac
|
|
60
|
+
AVEncoderAudioQualityKeyIOS: audioRecorderModule.AVEncoderAudioQualityIOSType.high
|
|
61
|
+
},
|
|
62
|
+
default: {}
|
|
63
|
+
}));
|
|
64
|
+
_defineProperty(this, "setState", state => {
|
|
65
|
+
this.state = state;
|
|
66
|
+
this.stateSubscribers.forEach(callback => {
|
|
67
|
+
callback(state);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
_defineProperty(this, "requestPermission", async () => {
|
|
71
|
+
const permission = _reactNative.Platform.select({
|
|
72
|
+
android: [permissionModule.PERMISSIONS.ANDROID.RECORD_AUDIO],
|
|
73
|
+
ios: [permissionModule.PERMISSIONS.IOS.MICROPHONE],
|
|
74
|
+
windows: [permissionModule.PERMISSIONS.WINDOWS.MICROPHONE],
|
|
75
|
+
default: undefined
|
|
76
|
+
});
|
|
77
|
+
if (_reactNative.Platform.OS === 'android' && _reactNative.Platform.Version <= 28) {
|
|
78
|
+
permission === null || permission === void 0 ? void 0 : permission.push(permissionModule.PERMISSIONS.ANDROID.WRITE_EXTERNAL_STORAGE);
|
|
79
|
+
}
|
|
80
|
+
if (permission) {
|
|
81
|
+
const status = await permissionModule.checkMultiple(permission);
|
|
82
|
+
if ((0, _nativePermissionGranted.default)(status)) {
|
|
83
|
+
return true;
|
|
84
|
+
} else {
|
|
85
|
+
const status = await permissionModule.requestMultiple(permission);
|
|
86
|
+
return (0, _nativePermissionGranted.default)(status);
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
_defineProperty(this, "addRecordingListener", callback => {
|
|
93
|
+
this.recordingSubscribers.add(callback);
|
|
94
|
+
return () => {
|
|
95
|
+
this.recordingSubscribers.delete(callback);
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
_defineProperty(this, "addStateListener", callback => {
|
|
99
|
+
this.stateSubscribers.add(callback);
|
|
100
|
+
return () => {
|
|
101
|
+
this.stateSubscribers.delete(callback);
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
_defineProperty(this, "record", async uri => {
|
|
105
|
+
if ((0, _uikitUtils.matchesOneOf)(this.state, ['idle', 'completed'])) {
|
|
106
|
+
try {
|
|
107
|
+
this.setState('preparing');
|
|
108
|
+
await module.startRecorder(uri, {
|
|
109
|
+
...this.audioOptions
|
|
110
|
+
});
|
|
111
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
112
|
+
this._recordStartedAt = Date.now();
|
|
113
|
+
}
|
|
114
|
+
this.uri = uri;
|
|
115
|
+
this.setState('recording');
|
|
116
|
+
} catch (e) {
|
|
117
|
+
this.setState('idle');
|
|
118
|
+
throw e;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
_defineProperty(this, "stop", async () => {
|
|
123
|
+
if ((0, _uikitUtils.matchesOneOf)(this.state, ['recording'])) {
|
|
124
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
125
|
+
const buffer = this._getRecorderStopSafeBuffer();
|
|
126
|
+
if (buffer > 0) await (0, _uikitUtils.sleep)(buffer);
|
|
127
|
+
}
|
|
128
|
+
await module.stopRecorder();
|
|
129
|
+
this.setState('completed');
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
_defineProperty(this, "reset", async () => {
|
|
133
|
+
await this.stop();
|
|
134
|
+
this.uri = undefined;
|
|
135
|
+
this.recordingSubscribers.clear();
|
|
136
|
+
this.setState('idle');
|
|
137
|
+
});
|
|
138
|
+
module.setSubscriptionDuration(0.1);
|
|
139
|
+
module.addRecordBackListener(data => {
|
|
140
|
+
const completed = data.currentPosition >= this.options.maxDuration;
|
|
141
|
+
if (completed) this.stop();
|
|
142
|
+
if (this.state === 'recording') {
|
|
143
|
+
this.recordingSubscribers.forEach(callback => {
|
|
144
|
+
callback({
|
|
145
|
+
currentTime: data.currentPosition,
|
|
146
|
+
completed
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return new VoiceRecorder();
|
|
154
|
+
};
|
|
155
|
+
var _default = createNativeRecorderService;
|
|
156
|
+
exports.default = _default;
|
|
157
|
+
//# sourceMappingURL=createRecorderService.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_uikitUtils","_VoiceMessageConfig","_interopRequireDefault","_nativePermissionGranted","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","createNativeRecorderService","_ref","audioRecorderModule","permissionModule","module","VoiceRecorder","constructor","minDuration","VoiceMessageConfig","DEFAULT","RECORDER","MIN_DURATION","maxDuration","MAX_DURATION","extension","EXTENSION","minWaitingTime","elapsedTime","Date","now","_recordStartedAt","Set","sampleRate","SAMPLE_RATE","bitRate","BIT_RATE","audioChannels","CHANNELS","Platform","select","android","AudioEncodingBitRateAndroid","audioSettings","AudioChannelsAndroid","AudioSamplingRateAndroid","AudioEncoderAndroid","AudioEncoderAndroidType","AAC","OutputFormatAndroid","OutputFormatAndroidType","MPEG_4","AudioSourceAndroid","AudioSourceAndroidType","VOICE_RECOGNITION","ios","AVEncoderBitRateKeyIOS","AVNumberOfChannelsKeyIOS","AVSampleRateKeyIOS","AVFormatIDKeyIOS","AVEncodingOption","mp4","AVEncoderAudioQualityKeyIOS","AVEncoderAudioQualityIOSType","high","state","stateSubscribers","forEach","callback","permission","PERMISSIONS","ANDROID","RECORD_AUDIO","IOS","MICROPHONE","windows","WINDOWS","OS","Version","push","WRITE_EXTERNAL_STORAGE","status","checkMultiple","nativePermissionGranted","requestMultiple","recordingSubscribers","add","delete","uri","matchesOneOf","setState","startRecorder","audioOptions","e","buffer","_getRecorderStopSafeBuffer","sleep","stopRecorder","stop","clear","setSubscriptionDuration","addRecordBackListener","data","completed","currentPosition","options","currentTime","_default","exports"],"sources":["createRecorderService.native.tsx"],"sourcesContent":["import { Platform } from 'react-native';\nimport * as RNAudioRecorder from 'react-native-audio-recorder-player';\nimport * as Permissions from 'react-native-permissions';\nimport { Permission } from 'react-native-permissions/src/types';\n\nimport { matchesOneOf, sleep } from '@sendbird/uikit-utils';\n\nimport VoiceMessageConfig from '../libs/VoiceMessageConfig';\nimport nativePermissionGranted from '../utils/nativePermissionGranted';\nimport type { RecorderServiceInterface, Unsubscribe } from './types';\n\ntype RecordingListener = Parameters<RecorderServiceInterface['addRecordingListener']>[number];\ntype StateListener = Parameters<RecorderServiceInterface['addStateListener']>[number];\ntype Modules = {\n audioRecorderModule: typeof RNAudioRecorder;\n permissionModule: typeof Permissions;\n};\nconst createNativeRecorderService = ({ audioRecorderModule, permissionModule }: Modules): RecorderServiceInterface => {\n const module = new audioRecorderModule.default();\n\n class VoiceRecorder implements RecorderServiceInterface {\n public uri: RecorderServiceInterface['uri'] = undefined;\n public state: RecorderServiceInterface['state'] = 'idle';\n public options: RecorderServiceInterface['options'] = {\n minDuration: VoiceMessageConfig.DEFAULT.RECORDER.MIN_DURATION,\n maxDuration: VoiceMessageConfig.DEFAULT.RECORDER.MAX_DURATION,\n extension: VoiceMessageConfig.DEFAULT.RECORDER.EXTENSION,\n };\n\n // NOTE: In Android, even when startRecorder() is awaited, if stop() is executed immediately afterward, an error occurs\n private _recordStartedAt = 0;\n private _getRecorderStopSafeBuffer = () => {\n const minWaitingTime = 500;\n const elapsedTime = Date.now() - this._recordStartedAt;\n if (elapsedTime > minWaitingTime) return 0;\n else return minWaitingTime - elapsedTime;\n };\n\n private readonly recordingSubscribers = new Set<RecordingListener>();\n private readonly stateSubscribers = new Set<StateListener>();\n private readonly audioSettings = {\n sampleRate: VoiceMessageConfig.DEFAULT.RECORDER.SAMPLE_RATE,\n bitRate: VoiceMessageConfig.DEFAULT.RECORDER.BIT_RATE,\n audioChannels: VoiceMessageConfig.DEFAULT.RECORDER.CHANNELS,\n // encoding: mpeg4_aac\n };\n private readonly audioOptions = Platform.select({\n android: {\n AudioEncodingBitRateAndroid: this.audioSettings.bitRate,\n AudioChannelsAndroid: this.audioSettings.audioChannels,\n AudioSamplingRateAndroid: this.audioSettings.sampleRate,\n AudioEncoderAndroid: audioRecorderModule.AudioEncoderAndroidType.AAC,\n OutputFormatAndroid: audioRecorderModule.OutputFormatAndroidType.MPEG_4,\n AudioSourceAndroid: audioRecorderModule.AudioSourceAndroidType.VOICE_RECOGNITION,\n },\n ios: {\n AVEncoderBitRateKeyIOS: this.audioSettings.bitRate,\n AVNumberOfChannelsKeyIOS: this.audioSettings.audioChannels,\n AVSampleRateKeyIOS: this.audioSettings.sampleRate,\n AVFormatIDKeyIOS: audioRecorderModule.AVEncodingOption.mp4, // same with aac\n AVEncoderAudioQualityKeyIOS: audioRecorderModule.AVEncoderAudioQualityIOSType.high,\n },\n default: {},\n });\n\n constructor() {\n module.setSubscriptionDuration(0.1);\n module.addRecordBackListener((data) => {\n const completed = data.currentPosition >= this.options.maxDuration;\n\n if (completed) this.stop();\n if (this.state === 'recording') {\n this.recordingSubscribers.forEach((callback) => {\n callback({ currentTime: data.currentPosition, completed });\n });\n }\n });\n }\n\n private setState = (state: RecorderServiceInterface['state']) => {\n this.state = state;\n this.stateSubscribers.forEach((callback) => {\n callback(state);\n });\n };\n\n public requestPermission = async (): Promise<boolean> => {\n const permission: Permission[] | undefined = Platform.select({\n android: [permissionModule.PERMISSIONS.ANDROID.RECORD_AUDIO],\n ios: [permissionModule.PERMISSIONS.IOS.MICROPHONE],\n windows: [permissionModule.PERMISSIONS.WINDOWS.MICROPHONE],\n default: undefined,\n });\n\n if (Platform.OS === 'android' && Platform.Version <= 28) {\n permission?.push(permissionModule.PERMISSIONS.ANDROID.WRITE_EXTERNAL_STORAGE);\n }\n\n if (permission) {\n const status = await permissionModule.checkMultiple(permission);\n if (nativePermissionGranted(status)) {\n return true;\n } else {\n const status = await permissionModule.requestMultiple(permission);\n return nativePermissionGranted(status);\n }\n } else {\n return true;\n }\n };\n\n public addRecordingListener = (callback: RecordingListener): Unsubscribe => {\n this.recordingSubscribers.add(callback);\n return () => {\n this.recordingSubscribers.delete(callback);\n };\n };\n\n public addStateListener = (callback: StateListener): Unsubscribe => {\n this.stateSubscribers.add(callback);\n return () => {\n this.stateSubscribers.delete(callback);\n };\n };\n\n public record = async (uri: string): Promise<void> => {\n if (matchesOneOf(this.state, ['idle', 'completed'])) {\n try {\n this.setState('preparing');\n await module.startRecorder(uri, {\n ...this.audioOptions,\n });\n\n if (Platform.OS === 'android') {\n this._recordStartedAt = Date.now();\n }\n\n this.uri = uri;\n this.setState('recording');\n } catch (e) {\n this.setState('idle');\n throw e;\n }\n }\n };\n\n public stop = async (): Promise<void> => {\n if (matchesOneOf(this.state, ['recording'])) {\n if (Platform.OS === 'android') {\n const buffer = this._getRecorderStopSafeBuffer();\n if (buffer > 0) await sleep(buffer);\n }\n\n await module.stopRecorder();\n this.setState('completed');\n }\n };\n\n public reset = async (): Promise<void> => {\n await this.stop();\n this.uri = undefined;\n this.recordingSubscribers.clear();\n this.setState('idle');\n };\n }\n\n return new VoiceRecorder();\n};\n\nexport default createNativeRecorderService;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,mBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,wBAAA,GAAAD,sBAAA,CAAAH,OAAA;AAAuE,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,S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,CAACL,IAAI,EAAE;QAC1B,IAAI,IAAI,CAACjC,KAAK,KAAK,WAAW,EAAE;UAC9B,IAAI,CAACoB,oBAAoB,CAAClB,OAAO,CAAEC,QAAQ,IAAK;YAC9CA,QAAQ,CAAC;cAAEsC,WAAW,EAAEJ,IAAI,CAACE,eAAe;cAAED;YAAU,CAAC,CAAC;UAC5D,CAAC,CAAC;QACJ;MACF,CAAC,CAAC;IACJ;EAuFF;EAEA,OAAO,IAAIvF,aAAa,EAAE;AAC5B,CAAC;AAAC,IAAA2F,QAAA,GAEahG,2BAA2B;AAAAiG,OAAA,CAAAxH,OAAA,GAAAuH,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type SBUError from '../libs/SBUError';\n\nexport type Unsubscribe = () => void | undefined;\nexport type DownloadedPath = string;\nexport type FilePickerResponse = FileType | null;\n\n/**\n * We are following the file format of react-native FormData\n * @see https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Network/FormData.js#L37-L41\n * */\nexport type FileType = { name: string; uri: string; size: number; type: string };\n\n// ---------- NotificationService ---------- //\nexport interface NotificationServiceInterface {\n hasPushPermission(): Promise<boolean>;\n requestPushPermission(): Promise<boolean>;\n\n getAPNSToken(): Promise<string | null>;\n getFCMToken(): Promise<string | null>;\n onTokenRefresh(handler: (token: string) => void): Unsubscribe;\n}\n\n// ---------- ClipboardService ---------- //\nexport interface ClipboardServiceInterface {\n setString(text: string): void;\n getString(): Promise<string>;\n}\n\n// ---------- FileService ---------- //\nexport interface FileServiceInterface extends FilePickerServiceInterface, FileSystemServiceInterface {}\n\nexport interface OpenResultListener {\n onOpenFailure?: (error: SBUError, originError?: unknown) => void;\n}\nexport interface OpenMediaLibraryOptions extends OpenResultListener {\n selectionLimit?: number;\n mediaType?: 'photo' | 'video' | 'all';\n}\nexport interface OpenCameraOptions extends OpenResultListener {\n cameraType?: 'front' | 'back';\n mediaType?: 'photo' | 'video' | 'all';\n}\nexport type OpenDocumentOptions = OpenResultListener;\nexport interface SaveOptions {\n fileUrl: string;\n fileName: string;\n fileType?: string | null;\n}\n\nexport interface FilePickerServiceInterface {\n openMediaLibrary(options?: OpenMediaLibraryOptions): Promise<null | FilePickerResponse[]>;\n openCamera(options?: OpenCameraOptions): Promise<FilePickerResponse>;\n openDocument(options?: OpenDocumentOptions): Promise<FilePickerResponse>;\n}\n\nexport interface FileSystemServiceInterface {\n // NOTE: On iOS, You can access the downloaded files by providing options below to info.plist\n // - Supports opening documents in place\n // - Application supports iTunes file sharing\n save(options?: SaveOptions): Promise<DownloadedPath | null>;\n}\n\n// ---------- MediaService ---------- //\nexport type VideoProps = {\n source: { uri: string } | number;\n resizeMode?: 'cover' | 'contain' | 'stretch';\n onLoad?: () => void;\n};\n\nexport type GetVideoThumbnailOptions = {\n url: string;\n timeMills?: number;\n quality?: number;\n};\nexport type GetVideoThumbnailResult = Promise<{ path: string } | null>;\n\nexport type CompressImageOptions = {\n /**\n * A uri of image file to compress\n * */\n uri: string;\n\n /**\n * A resize width, apply only to downscale\n * */\n maxWidth?: number;\n\n /**\n * A resize height, apply only to downscale\n * */\n maxHeight?: number;\n\n /**\n * A value in range 0.0 - 1.0 specifying compression level of the result image.\n * 1 means highest quality and 0 the lowest quality.\n * */\n compressionRate?: number;\n};\nexport type CompressImageResult = Promise<{ uri: string; size: number } | null>;\n\nexport interface MediaServiceInterface {\n VideoComponent<Props = {}>(props: VideoProps & Props):
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport type SBUError from '../libs/SBUError';\n\nexport type Unsubscribe = () => void | undefined;\nexport type DownloadedPath = string;\nexport type FilePickerResponse = FileType | null;\n\n/**\n * We are following the file format of react-native FormData\n * @see https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Network/FormData.js#L37-L41\n * */\nexport type FileType = { name: string; uri: string; size: number; type: string };\n\n// ---------- NotificationService ---------- //\nexport interface NotificationServiceInterface {\n hasPushPermission(): Promise<boolean>;\n requestPushPermission(): Promise<boolean>;\n\n getAPNSToken(): Promise<string | null>;\n getFCMToken(): Promise<string | null>;\n onTokenRefresh(handler: (token: string) => void): Unsubscribe;\n}\n\n// ---------- ClipboardService ---------- //\nexport interface ClipboardServiceInterface {\n setString(text: string): void;\n getString(): Promise<string>;\n}\n\n// ---------- FileService ---------- //\nexport interface FileServiceInterface extends FilePickerServiceInterface, FileSystemServiceInterface {}\n\nexport interface OpenResultListener {\n onOpenFailure?: (error: SBUError, originError?: unknown) => void;\n}\nexport interface OpenMediaLibraryOptions extends OpenResultListener {\n selectionLimit?: number;\n mediaType?: 'photo' | 'video' | 'all';\n}\nexport interface OpenCameraOptions extends OpenResultListener {\n cameraType?: 'front' | 'back';\n mediaType?: 'photo' | 'video' | 'all';\n}\nexport type OpenDocumentOptions = OpenResultListener;\nexport interface SaveOptions {\n fileUrl: string;\n fileName: string;\n fileType?: string | null;\n}\n\nexport interface FilePickerServiceInterface {\n openMediaLibrary(options?: OpenMediaLibraryOptions): Promise<null | FilePickerResponse[]>;\n openCamera(options?: OpenCameraOptions): Promise<FilePickerResponse>;\n openDocument(options?: OpenDocumentOptions): Promise<FilePickerResponse>;\n}\n\nexport interface FileSystemServiceInterface {\n // NOTE: On iOS, You can access the downloaded files by providing options below to info.plist\n // - Supports opening documents in place\n // - Application supports iTunes file sharing\n save(options?: SaveOptions): Promise<DownloadedPath | null>;\n createRecordFilePath(customExtension?: string): { recordFilePath: string; uri: string };\n}\n\n// ---------- MediaService ---------- //\nexport type VideoProps = {\n source: { uri: string } | number;\n resizeMode?: 'cover' | 'contain' | 'stretch';\n onLoad?: () => void;\n};\n\nexport type GetVideoThumbnailOptions = {\n url: string;\n timeMills?: number;\n quality?: number;\n};\nexport type GetVideoThumbnailResult = Promise<{ path: string } | null>;\n\nexport type CompressImageOptions = {\n /**\n * A uri of image file to compress\n * */\n uri: string;\n\n /**\n * A resize width, apply only to downscale\n * */\n maxWidth?: number;\n\n /**\n * A resize height, apply only to downscale\n * */\n maxHeight?: number;\n\n /**\n * A value in range 0.0 - 1.0 specifying compression level of the result image.\n * 1 means highest quality and 0 the lowest quality.\n * */\n compressionRate?: number;\n};\nexport type CompressImageResult = Promise<{ uri: string; size: number } | null>;\n\nexport interface MediaServiceInterface {\n VideoComponent<Props = {}>(props: VideoProps & Props): ReactNode;\n getVideoThumbnail(options: GetVideoThumbnailOptions): GetVideoThumbnailResult;\n compressImage(options: CompressImageOptions): CompressImageResult;\n}\n\n// ---------- PlayerService ---------- //\nexport interface PlayerServiceInterface {\n uri?: string;\n state: 'idle' | 'preparing' | 'playing' | 'paused' | 'stopped';\n\n /**\n * Check and request permission for the player.\n * */\n requestPermission(): Promise<boolean>;\n\n /**\n * Add a playback listener.\n * */\n addPlaybackListener(\n callback: (params: { currentTime: number; duration: number; stopped: boolean }) => void,\n ): Unsubscribe;\n\n /**\n * Add a state listener.\n * */\n addStateListener(callback: (state: PlayerServiceInterface['state']) => void): Unsubscribe;\n\n /**\n * State transition:\n * [idle, stopped] to [playing] - start from the beginning\n * [paused] to [playing] - resume\n * */\n play(uri: string): Promise<void>;\n\n /**\n * State transition:\n * [playing] to [paused]\n * */\n pause(): Promise<void>;\n\n /**\n * State transition:\n * [preparing, playing, paused] to [stop]\n * */\n stop(): Promise<void>;\n\n /**\n * State transition:\n * [*] to [idle]\n * */\n reset(): Promise<void>;\n\n /**\n * Seek time, only available when the state is [playing, paused].\n * */\n seek(time: number): Promise<void>;\n}\n\n// ---------- RecorderService ---------- //\nexport interface RecorderOptions {\n /**\n * Minimum recording duration (milliseconds).\n * */\n minDuration: number;\n\n /**\n * Maximum recording duration (milliseconds).\n * */\n maxDuration: number;\n\n /**\n * File extension for recorded audio file\n * */\n extension: string;\n}\n\nexport interface RecorderServiceInterface {\n uri?: string;\n options: RecorderOptions;\n state: 'idle' | 'preparing' | 'recording' | 'completed';\n\n /**\n * Check and request permission for the recorder.\n * */\n requestPermission(): Promise<boolean>;\n\n /**\n * Add recording listener.\n * */\n addRecordingListener(callback: (params: { currentTime: number; completed: boolean }) => void): Unsubscribe;\n\n /**\n * Add state listener.\n * */\n addStateListener(callback: (state: RecorderServiceInterface['state']) => void): Unsubscribe;\n\n /**\n * State transition:\n * [idle, completed] to [recording]\n * */\n record(uri?: string): Promise<void>;\n\n /**\n * State transition:\n * [recording] to [completed]\n * */\n stop(): Promise<void>;\n\n /**\n * State transition:\n * [*] to [idle]\n * */\n reset(): Promise<void>;\n}\n"],"mappings":""}
|
package/lib/commonjs/types.js
CHANGED
|
@@ -3,4 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.TypingIndicatorType = void 0;
|
|
7
|
+
let TypingIndicatorType = /*#__PURE__*/function (TypingIndicatorType) {
|
|
8
|
+
TypingIndicatorType["Text"] = "text";
|
|
9
|
+
TypingIndicatorType["Bubble"] = "bubble";
|
|
10
|
+
return TypingIndicatorType;
|
|
11
|
+
}({});
|
|
12
|
+
exports.TypingIndicatorType = TypingIndicatorType;
|
|
6
13
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ErrorInfo, ReactNode } from 'react';\n\nimport type { SendbirdUser } from '@sendbird/uikit-utils';\n\nexport type KeyValuePairGet = [string, string | null];\nexport type KeyValuePairSet = [string, string];\nexport interface LocalCacheStorage {\n getAllKeys(): Promise<readonly string[] | string[]>;\n getItem(key: string): Promise<string | null>;\n setItem(key: string, value: string): Promise<void>;\n removeItem(key: string): Promise<void>;\n\n multiSet?(keyValuePairs: Array<KeyValuePairSet>): Promise<void>;\n multiGet?(keys: string[]): Promise<readonly KeyValuePairGet[] | KeyValuePairGet[]>;\n multiRemove?(keys: string[]): Promise<void>;\n}\n\nexport type ErrorBoundaryProps = { error: Error; errorInfo: ErrorInfo; reset: () => void };\n\nexport type CommonComponent<P = {}> = (props: P & { children?: ReactNode }) => null |
|
|
1
|
+
{"version":3,"names":["TypingIndicatorType","exports"],"sources":["types.ts"],"sourcesContent":["import type { ErrorInfo, ReactNode } from 'react';\n\nimport type { SendbirdUser } from '@sendbird/uikit-utils';\n\nexport type KeyValuePairGet = [string, string | null];\nexport type KeyValuePairSet = [string, string];\nexport interface LocalCacheStorage {\n getAllKeys(): Promise<readonly string[] | string[]>;\n getItem(key: string): Promise<string | null>;\n setItem(key: string, value: string): Promise<void>;\n removeItem(key: string): Promise<void>;\n\n multiSet?(keyValuePairs: Array<KeyValuePairSet>): Promise<void>;\n multiGet?(keys: string[]): Promise<readonly KeyValuePairGet[] | KeyValuePairGet[]>;\n multiRemove?(keys: string[]): Promise<void>;\n}\n\nexport type ErrorBoundaryProps = { error: Error; errorInfo: ErrorInfo; reset: () => void };\n\nexport type CommonComponent<P = {}> = (props: P & { children?: ReactNode }) => null | ReactNode;\n\nexport type MentionedUser = {\n range: Range;\n user: SendbirdUser;\n};\n\nexport type Range = {\n start: number;\n end: number;\n};\n\nexport enum TypingIndicatorType {\n Text = 'text',\n Bubble = 'bubble',\n}\n"],"mappings":";;;;;;IA+BYA,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAAAC,OAAA,CAAAD,mBAAA,GAAAA,mBAAA"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PromisePolyfill = void 0;
|
|
7
|
+
require("react-native");
|
|
8
|
+
/**
|
|
9
|
+
* This file contains subcomponents with separate copyright notices and license terms.
|
|
10
|
+
* Your use of the source code for these subcomponents is subject to the terms and conditions of the following licenses.
|
|
11
|
+
*
|
|
12
|
+
* MIT License: https://github.com/then/promise
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) 2014 Forbes Lindesay
|
|
15
|
+
*
|
|
16
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
18
|
+
* in the Software without restriction, including without limitation the rights
|
|
19
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
20
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
21
|
+
* furnished to do so, subject to the following conditions:
|
|
22
|
+
*
|
|
23
|
+
* The above copyright notice and this permission notice shall be included in
|
|
24
|
+
* all copies or substantial portions of the Software.
|
|
25
|
+
*
|
|
26
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
30
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
31
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
32
|
+
* THE SOFTWARE.
|
|
33
|
+
*
|
|
34
|
+
* Original code: https://github.com/then/promise/blob/master/src/es6-extensions.js
|
|
35
|
+
* */
|
|
36
|
+
let iterableToArray = function (iterable) {
|
|
37
|
+
if (typeof Array.from === 'function') {
|
|
38
|
+
// ES2015+, iterables exist
|
|
39
|
+
iterableToArray = Array.from;
|
|
40
|
+
return Array.from(iterable);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ES5, only arrays and array-likes exist
|
|
44
|
+
iterableToArray = function (x) {
|
|
45
|
+
return Array.prototype.slice.call(x);
|
|
46
|
+
};
|
|
47
|
+
return Array.prototype.slice.call(iterable);
|
|
48
|
+
};
|
|
49
|
+
function onSettledFulfill(value) {
|
|
50
|
+
return {
|
|
51
|
+
status: 'fulfilled',
|
|
52
|
+
value: value
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function onSettledReject(reason) {
|
|
56
|
+
return {
|
|
57
|
+
status: 'rejected',
|
|
58
|
+
reason: reason
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function mapAllSettled(item) {
|
|
62
|
+
if (item && (typeof item === 'object' || typeof item === 'function')) {
|
|
63
|
+
if (item instanceof Promise && item.then === Promise.prototype.then) {
|
|
64
|
+
return item.then(onSettledFulfill, onSettledReject);
|
|
65
|
+
}
|
|
66
|
+
// @ts-expect-error
|
|
67
|
+
const then = item.then;
|
|
68
|
+
if (typeof then === 'function') {
|
|
69
|
+
return new Promise(then.bind(item)).then(onSettledFulfill, onSettledReject);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// @ts-expect-error
|
|
74
|
+
return onSettledFulfill(item);
|
|
75
|
+
}
|
|
76
|
+
function getAggregateError(errors) {
|
|
77
|
+
if (typeof AggregateError === 'function') {
|
|
78
|
+
return new AggregateError(errors, 'All promises were rejected');
|
|
79
|
+
}
|
|
80
|
+
const error = new Error('All promises were rejected');
|
|
81
|
+
error.name = 'AggregateError';
|
|
82
|
+
error.errors = errors;
|
|
83
|
+
return error;
|
|
84
|
+
}
|
|
85
|
+
const PromisePolyfill = {
|
|
86
|
+
allSettled(values) {
|
|
87
|
+
return Promise.all(iterableToArray(values).map(mapAllSettled));
|
|
88
|
+
},
|
|
89
|
+
race(values) {
|
|
90
|
+
return new Promise(function (resolve, reject) {
|
|
91
|
+
iterableToArray(values).forEach(function (value) {
|
|
92
|
+
Promise.resolve(value).then(resolve, reject);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
any(values) {
|
|
97
|
+
return new Promise(function (resolve, reject) {
|
|
98
|
+
const promises = iterableToArray(values);
|
|
99
|
+
let hasResolved = false;
|
|
100
|
+
const rejectionReasons = [];
|
|
101
|
+
function resolveOnce(value) {
|
|
102
|
+
if (!hasResolved) {
|
|
103
|
+
hasResolved = true;
|
|
104
|
+
resolve(value);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function rejectionCheck(reason) {
|
|
108
|
+
rejectionReasons.push(reason);
|
|
109
|
+
if (rejectionReasons.length === promises.length) {
|
|
110
|
+
reject(getAggregateError(rejectionReasons));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (promises.length === 0) {
|
|
114
|
+
reject(getAggregateError(rejectionReasons));
|
|
115
|
+
} else {
|
|
116
|
+
promises.forEach(function (value) {
|
|
117
|
+
Promise.resolve(value).then(resolveOnce, rejectionCheck);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
apply() {
|
|
123
|
+
// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Utilities/PolyfillFunctions.js
|
|
124
|
+
if (typeof global !== 'undefined' && 'Promise' in global) {
|
|
125
|
+
if (!global.Promise.allSettled) {
|
|
126
|
+
global.Promise.allSettled = this.allSettled;
|
|
127
|
+
}
|
|
128
|
+
if (!global.Promise.any) {
|
|
129
|
+
global.Promise.any = this.any;
|
|
130
|
+
}
|
|
131
|
+
if (!global.Promise.race) {
|
|
132
|
+
global.Promise.race = this.race;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
exports.PromisePolyfill = PromisePolyfill;
|
|
138
|
+
//# sourceMappingURL=promise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["require","iterableToArray","iterable","Array","from","x","prototype","slice","call","onSettledFulfill","value","status","onSettledReject","reason","mapAllSettled","item","Promise","then","bind","getAggregateError","errors","AggregateError","error","Error","name","PromisePolyfill","allSettled","values","all","map","race","resolve","reject","forEach","any","promises","hasResolved","rejectionReasons","resolveOnce","rejectionCheck","push","length","apply","global","exports"],"sources":["promise.ts"],"sourcesContent":["import 'react-native';\n\n/**\n * This file contains subcomponents with separate copyright notices and license terms.\n * Your use of the source code for these subcomponents is subject to the terms and conditions of the following licenses.\n *\n * MIT License: https://github.com/then/promise\n *\n * Copyright (c) 2014 Forbes Lindesay\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Original code: https://github.com/then/promise/blob/master/src/es6-extensions.js\n * */\nlet iterableToArray = function <T>(iterable: Iterable<T | PromiseLike<T>>): (T | PromiseLike<T>)[] {\n if (typeof Array.from === 'function') {\n // ES2015+, iterables exist\n iterableToArray = Array.from;\n return Array.from(iterable);\n }\n\n // ES5, only arrays and array-likes exist\n iterableToArray = function (x) {\n return Array.prototype.slice.call(x);\n };\n return Array.prototype.slice.call(iterable);\n};\n\nfunction onSettledFulfill<T>(value: T) {\n return { status: 'fulfilled', value: value } as const;\n}\n\nfunction onSettledReject<T>(reason: T) {\n return { status: 'rejected', reason: reason } as const;\n}\n\nfunction mapAllSettled<T>(item: T | PromiseLike<T>): PromiseLike<PromiseSettledResult<T>> | PromiseSettledResult<T> {\n if (item && (typeof item === 'object' || typeof item === 'function')) {\n if (item instanceof Promise && item.then === Promise.prototype.then) {\n return item.then(onSettledFulfill, onSettledReject);\n }\n // @ts-expect-error\n const then = item.then;\n if (typeof then === 'function') {\n return new Promise<T>(then.bind(item)).then(onSettledFulfill, onSettledReject);\n }\n }\n\n // @ts-expect-error\n return onSettledFulfill(item);\n}\n\nfunction getAggregateError(errors: unknown[]) {\n if (typeof AggregateError === 'function') {\n return new AggregateError(errors, 'All promises were rejected');\n }\n\n const error = new Error('All promises were rejected') as Error & { errors: unknown[] };\n\n error.name = 'AggregateError';\n error.errors = errors;\n\n return error;\n}\n\nexport const PromisePolyfill = {\n allSettled<T extends readonly unknown[] | []>(values: T) {\n return Promise.all(iterableToArray(values).map(mapAllSettled)) as Promise<{\n -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>;\n }>;\n },\n race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>> {\n return new Promise(function (resolve, reject) {\n iterableToArray(values).forEach(function (value) {\n Promise.resolve(value).then(resolve, reject);\n });\n });\n },\n any<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>> {\n return new Promise<Awaited<T>>(function (resolve, reject) {\n const promises = iterableToArray(values);\n let hasResolved = false;\n const rejectionReasons: unknown[] = [];\n\n function resolveOnce(value: Awaited<T>) {\n if (!hasResolved) {\n hasResolved = true;\n resolve(value);\n }\n }\n\n function rejectionCheck(reason: unknown) {\n rejectionReasons.push(reason);\n\n if (rejectionReasons.length === promises.length) {\n reject(getAggregateError(rejectionReasons));\n }\n }\n\n if (promises.length === 0) {\n reject(getAggregateError(rejectionReasons));\n } else {\n promises.forEach(function (value) {\n Promise.resolve(value).then(resolveOnce, rejectionCheck);\n });\n }\n });\n },\n apply() {\n // https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Utilities/PolyfillFunctions.js\n if (typeof global !== 'undefined' && 'Promise' in global) {\n if (!global.Promise.allSettled) {\n global.Promise.allSettled = this.allSettled;\n }\n if (!global.Promise.any) {\n global.Promise.any = this.any;\n }\n if (!global.Promise.race) {\n global.Promise.race = this.race;\n }\n }\n },\n};\n"],"mappings":";;;;;;AAAAA,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,eAAe,GAAG,SAAAA,CAAaC,QAAsC,EAA0B;EACjG,IAAI,OAAOC,KAAK,CAACC,IAAI,KAAK,UAAU,EAAE;IACpC;IACAH,eAAe,GAAGE,KAAK,CAACC,IAAI;IAC5B,OAAOD,KAAK,CAACC,IAAI,CAACF,QAAQ,CAAC;EAC7B;;EAEA;EACAD,eAAe,GAAG,SAAAA,CAAUI,CAAC,EAAE;IAC7B,OAAOF,KAAK,CAACG,SAAS,CAACC,KAAK,CAACC,IAAI,CAACH,CAAC,CAAC;EACtC,CAAC;EACD,OAAOF,KAAK,CAACG,SAAS,CAACC,KAAK,CAACC,IAAI,CAACN,QAAQ,CAAC;AAC7C,CAAC;AAED,SAASO,gBAAgBA,CAAIC,KAAQ,EAAE;EACrC,OAAO;IAAEC,MAAM,EAAE,WAAW;IAAED,KAAK,EAAEA;EAAM,CAAC;AAC9C;AAEA,SAASE,eAAeA,CAAIC,MAAS,EAAE;EACrC,OAAO;IAAEF,MAAM,EAAE,UAAU;IAAEE,MAAM,EAAEA;EAAO,CAAC;AAC/C;AAEA,SAASC,aAAaA,CAAIC,IAAwB,EAAkE;EAClH,IAAIA,IAAI,KAAK,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,CAAC,EAAE;IACpE,IAAIA,IAAI,YAAYC,OAAO,IAAID,IAAI,CAACE,IAAI,KAAKD,OAAO,CAACV,SAAS,CAACW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AO,CAACc,IAAI,EAAE;QACxBa,MAAM,CAAC3B,OAAO,CAACc,IAAI,GAAG,IAAI,CAACA,IAAI;MACjC;IACF;EACF;AACF,CAAC;AAACc,OAAA,CAAAnB,eAAA,GAAAA,eAAA"}
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VERSION","_default","exports","default"],"sources":["version.ts"],"sourcesContent":["const VERSION = '3.
|
|
1
|
+
{"version":3,"names":["VERSION","_default","exports","default"],"sources":["version.ts"],"sourcesContent":["const VERSION = '3.3.0';\nexport default VERSION;\n"],"mappings":";;;;;;AAAA,MAAMA,OAAO,GAAG,OAAO;AAAC,IAAAC,QAAA,GACTD,OAAO;AAAAE,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { View } from 'react-native';
|
|
3
3
|
import { MentionType } from '@sendbird/chat/message';
|
|
4
4
|
import { Button, TextInput, createStyleSheet, useToast } from '@sendbird/uikit-react-native-foundation';
|
|
5
5
|
import { useLocalization, useSendbirdChat } from '../../hooks/useContext';
|
|
6
6
|
const EditInput = /*#__PURE__*/forwardRef(function EditInput(_ref, ref) {
|
|
7
7
|
let {
|
|
8
|
+
style,
|
|
8
9
|
text,
|
|
9
10
|
onChangeText,
|
|
10
11
|
messageToEdit,
|
|
@@ -54,7 +55,7 @@ const EditInput = /*#__PURE__*/forwardRef(function EditInput(_ref, ref) {
|
|
|
54
55
|
editable: !inputDisabled,
|
|
55
56
|
autoFocus: autoFocus,
|
|
56
57
|
onChangeText: onChangeText,
|
|
57
|
-
style:
|
|
58
|
+
style: style,
|
|
58
59
|
placeholder: STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_ACTIVE,
|
|
59
60
|
onSelectionChange: onSelectionChange
|
|
60
61
|
}, mentionManager.textToMentionedComponents(text, mentionedUsers, sbOptions.uikit.groupChannel.channel.enableMention))), /*#__PURE__*/React.createElement(View, {
|
|
@@ -79,16 +80,6 @@ const styles = createStyleSheet({
|
|
|
79
80
|
flexDirection: 'column',
|
|
80
81
|
alignItems: 'center'
|
|
81
82
|
},
|
|
82
|
-
input: {
|
|
83
|
-
flex: 1,
|
|
84
|
-
marginRight: 4,
|
|
85
|
-
minHeight: 36,
|
|
86
|
-
maxHeight: 36 * Platform.select({
|
|
87
|
-
ios: 2.5,
|
|
88
|
-
default: 2
|
|
89
|
-
}),
|
|
90
|
-
borderRadius: 20
|
|
91
|
-
},
|
|
92
83
|
inputWrapper: {
|
|
93
84
|
flexDirection: 'row'
|
|
94
85
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","View","MentionType","Button","TextInput","createStyleSheet","useToast","useLocalization","useSendbirdChat","EditInput","_ref","ref","style","text","onChangeText","messageToEdit","setMessageToEdit","onPressUpdateUserMessage","onSelectionChange","autoFocus","mentionedUsers","inputDisabled","mentionManager","sbOptions","STRINGS","toast","onPressCancel","onPressSave","isUserMessage","mentionType","USERS","mentionedUserIds","map","it","user","userId","mentionedMessageTemplate","textToMentionedMessageTemplate","uikit","groupChannel","channel","enableMention","message","catch","onFailureToUpdate","show","TOAST","UPDATE_MSG_ERROR","createElement","styles","editInputContainer","inputWrapper","multiline","disableFullscreenUI","editable","placeholder","LABELS","CHANNEL_INPUT_PLACEHOLDER_ACTIVE","textToMentionedComponents","marginTop","flexDirection","variant","onPress","CHANNEL_INPUT_EDIT_CANCEL","space","CHANNEL_INPUT_EDIT_OK","paddingVertical","paddingHorizontal","alignItems","flex"],"sources":["EditInput.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { NativeSyntheticEvent, TextInput as RNTextInput, TextInputSelectionChangeEventData, View } from 'react-native';\n\nimport { MentionType } from '@sendbird/chat/message';\nimport { Button, TextInput, createStyleSheet, useToast } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdFileMessage, SendbirdUserMessage } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../hooks/useContext';\nimport type { MentionedUser } from '../../types';\nimport type { ChannelInputProps } from './index';\n\ninterface EditInputProps extends ChannelInputProps {\n text: string;\n onChangeText: (val: string) => void;\n messageToEdit: SendbirdUserMessage | SendbirdFileMessage;\n setMessageToEdit: (msg?: SendbirdUserMessage | SendbirdFileMessage) => void;\n onSelectionChange: (e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void;\n autoFocus: boolean;\n mentionedUsers: MentionedUser[];\n}\n\nconst EditInput = forwardRef<RNTextInput, EditInputProps>(function EditInput(\n {\n style,\n text,\n onChangeText,\n messageToEdit,\n setMessageToEdit,\n onPressUpdateUserMessage,\n onSelectionChange,\n autoFocus,\n mentionedUsers,\n inputDisabled,\n },\n ref,\n) {\n const { mentionManager, sbOptions } = useSendbirdChat();\n const { STRINGS } = useLocalization();\n const toast = useToast();\n\n const onPressCancel = () => {\n setMessageToEdit();\n onChangeText('');\n };\n\n const onPressSave = () => {\n if (messageToEdit.isUserMessage()) {\n const mentionType = MentionType.USERS;\n const mentionedUserIds = mentionedUsers.map((it) => it.user.userId);\n const mentionedMessageTemplate = mentionManager.textToMentionedMessageTemplate(\n text,\n mentionedUsers,\n sbOptions.uikit.groupChannel.channel.enableMention,\n );\n\n onPressUpdateUserMessage(messageToEdit, {\n message: text,\n mentionType,\n mentionedUserIds,\n mentionedMessageTemplate,\n }).catch(onFailureToUpdate);\n }\n setMessageToEdit();\n onChangeText('');\n };\n\n const onFailureToUpdate = () => toast.show(STRINGS.TOAST.UPDATE_MSG_ERROR, 'error');\n\n return (\n <View style={styles.editInputContainer}>\n <View style={styles.inputWrapper}>\n <TextInput\n ref={ref}\n multiline\n disableFullscreenUI\n editable={!inputDisabled}\n autoFocus={autoFocus}\n onChangeText={onChangeText}\n style={style}\n placeholder={STRINGS.LABELS.CHANNEL_INPUT_PLACEHOLDER_ACTIVE}\n onSelectionChange={onSelectionChange}\n >\n {mentionManager.textToMentionedComponents(\n text,\n mentionedUsers,\n sbOptions.uikit.groupChannel.channel.enableMention,\n )}\n </TextInput>\n </View>\n <View style={{ marginTop: 8, flexDirection: 'row' }}>\n <Button variant={'text'} onPress={onPressCancel}>\n {STRINGS.LABELS.CHANNEL_INPUT_EDIT_CANCEL}\n </Button>\n <View style={styles.space} />\n <Button variant={'contained'} onPress={onPressSave}>\n {STRINGS.LABELS.CHANNEL_INPUT_EDIT_OK}\n </Button>\n </View>\n </View>\n );\n});\n\nconst styles = createStyleSheet({\n editInputContainer: {\n paddingVertical: 10,\n paddingHorizontal: 16,\n flexDirection: 'column',\n alignItems: 'center',\n },\n inputWrapper: {\n flexDirection: 'row',\n },\n space: {\n flex: 1,\n },\n});\n\nexport default EditInput;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAA4FC,IAAI,QAAQ,cAAc;AAEtH,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,MAAM,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,QAAQ,QAAQ,yCAAyC;AAGvG,SAASC,eAAe,EAAEC,eAAe,QAAQ,wBAAwB;AAczE,MAAMC,SAAS,gBAAGT,UAAU,CAA8B,SAASS,SAASA,CAAAC,IAAA,EAa1EC,GAAG,EACH;EAAA,IAbA;IACEC,KAAK;IACLC,IAAI;IACJC,YAAY;IACZC,aAAa;IACbC,gBAAgB;IAChBC,wBAAwB;IACxBC,iBAAiB;IACjBC,SAAS;IACTC,cAAc;IACdC;EACF,CAAC,GAAAX,IAAA;EAGD,MAAM;IAAEY,cAAc;IAAEC;EAAU,CAAC,GAAGf,eAAe,EAAE;EACvD,MAAM;IAAEgB;EAAQ,CAAC,GAAGjB,eAAe,EAAE;EACrC,MAAMkB,KAAK,GAAGnB,QAAQ,EAAE;EAExB,MAAMoB,aAAa,GAAGA,CAAA,KAAM;IAC1BV,gBAAgB,EA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EAAkB,GAEpCI,cAAc,CAACoC,yBAAyB,CACvC7C,IAAI,EACJO,cAAc,EACdG,SAAS,CAACe,KAAK,CAACC,YAAY,CAACC,OAAO,CAACC,aAAa,CACnD,CACS,CACP,eACP1C,KAAA,CAAAiD,aAAA,CAAC/C,IAAI;IAACW,KAAK,EAAE;MAAE+C,SAAS,EAAE,CAAC;MAAEC,aAAa,EAAE;IAAM;EAAE,gBAClD7D,KAAA,CAAAiD,aAAA,CAAC7C,MAAM;IAAC0D,OAAO,EAAE,MAAO;IAACC,OAAO,EAAEpC;EAAc,GAC7CF,OAAO,CAACgC,MAAM,CAACO,yBAAyB,CAClC,eACThE,KAAA,CAAAiD,aAAA,CAAC/C,IAAI;IAACW,KAAK,EAAEqC,MAAM,CAACe;EAAM,EAAG,eAC7BjE,KAAA,CAAAiD,aAAA,CAAC7C,MAAM;IAAC0D,OAAO,EAAE,WAAY;IAACC,OAAO,EAAEnC;EAAY,GAChDH,OAAO,CAACgC,MAAM,CAACS,qBAAqB,CAC9B,CACJ,CACF;AAEX,CAAC,CAAC;AAEF,MAAMhB,MAAM,GAAG5C,gBAAgB,CAAC;EAC9B6C,kBAAkB,EAAE;IAClBgB,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrBP,aAAa,EAAE,QAAQ;IACvBQ,UAAU,EAAE;EACd,CAAC;EACDjB,YAAY,EAAE;IACZS,aAAa,EAAE;EACjB,CAAC;EACDI,KAAK,EAAE;IACLK,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,eAAe5D,SAAS"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import { Icon, ImageWithPlaceholder, Text, VideoThumbnail, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
4
|
+
import { getFileIconFromMessageType, getMessageType, getThumbnailUriFromFileMessage } from '@sendbird/uikit-utils';
|
|
5
|
+
import { useLocalization, usePlatformService } from '../../hooks/useContext';
|
|
6
|
+
export const MessageToReplyPreview = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
messageToReply,
|
|
9
|
+
setMessageToReply
|
|
10
|
+
} = _ref;
|
|
11
|
+
const {
|
|
12
|
+
colors,
|
|
13
|
+
select,
|
|
14
|
+
palette
|
|
15
|
+
} = useUIKitTheme();
|
|
16
|
+
const {
|
|
17
|
+
mediaService
|
|
18
|
+
} = usePlatformService();
|
|
19
|
+
const {
|
|
20
|
+
STRINGS
|
|
21
|
+
} = useLocalization();
|
|
22
|
+
const getFileIconAsImage = url => {
|
|
23
|
+
return /*#__PURE__*/React.createElement(ImageWithPlaceholder, {
|
|
24
|
+
source: {
|
|
25
|
+
uri: url
|
|
26
|
+
},
|
|
27
|
+
style: styles.previewImage
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const getFileIconAsVideoThumbnail = url => {
|
|
31
|
+
return /*#__PURE__*/React.createElement(VideoThumbnail, {
|
|
32
|
+
style: styles.previewImage,
|
|
33
|
+
iconSize: 0,
|
|
34
|
+
source: url,
|
|
35
|
+
fetchThumbnailFromVideoSource: uri => mediaService.getVideoThumbnail({
|
|
36
|
+
url: uri,
|
|
37
|
+
timeMills: 1000
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const getFileIconAsSymbol = icon => {
|
|
42
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
43
|
+
icon: icon,
|
|
44
|
+
size: 20,
|
|
45
|
+
color: colors.onBackground02,
|
|
46
|
+
containerStyle: [styles.fileIcon, {
|
|
47
|
+
backgroundColor: select({
|
|
48
|
+
light: palette.background100,
|
|
49
|
+
dark: palette.background500
|
|
50
|
+
})
|
|
51
|
+
}]
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
const getFileIcon = messageToReply => {
|
|
55
|
+
if (messageToReply !== null && messageToReply !== void 0 && messageToReply.isFileMessage()) {
|
|
56
|
+
const messageType = getMessageType(messageToReply);
|
|
57
|
+
switch (messageType) {
|
|
58
|
+
case 'file.image':
|
|
59
|
+
return getFileIconAsImage(getThumbnailUriFromFileMessage(messageToReply));
|
|
60
|
+
case 'file.video':
|
|
61
|
+
return getFileIconAsVideoThumbnail(getThumbnailUriFromFileMessage(messageToReply));
|
|
62
|
+
case 'file.voice':
|
|
63
|
+
return null;
|
|
64
|
+
default:
|
|
65
|
+
return getFileIconAsSymbol(getFileIconFromMessageType(messageType));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
};
|
|
70
|
+
if (!messageToReply) return null;
|
|
71
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
72
|
+
style: [styles.messageToReplyContainer, {
|
|
73
|
+
borderColor: colors.onBackground04
|
|
74
|
+
}]
|
|
75
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
76
|
+
style: {
|
|
77
|
+
flex: 1,
|
|
78
|
+
flexDirection: 'row'
|
|
79
|
+
}
|
|
80
|
+
}, getFileIcon(messageToReply), /*#__PURE__*/React.createElement(View, {
|
|
81
|
+
style: {
|
|
82
|
+
flex: 1,
|
|
83
|
+
flexDirection: 'column'
|
|
84
|
+
}
|
|
85
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
86
|
+
numberOfLines: 1,
|
|
87
|
+
style: {
|
|
88
|
+
fontSize: 13,
|
|
89
|
+
fontWeight: '900',
|
|
90
|
+
marginBottom: 4
|
|
91
|
+
}
|
|
92
|
+
}, STRINGS.LABELS.CHANNEL_INPUT_REPLY_PREVIEW_TITLE(messageToReply.sender)), /*#__PURE__*/React.createElement(Text, {
|
|
93
|
+
numberOfLines: 1,
|
|
94
|
+
style: {
|
|
95
|
+
fontSize: 13,
|
|
96
|
+
color: colors.onBackground03
|
|
97
|
+
}
|
|
98
|
+
}, STRINGS.LABELS.CHANNEL_INPUT_REPLY_PREVIEW_BODY(messageToReply)))), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
99
|
+
onPress: () => setMessageToReply === null || setMessageToReply === void 0 ? void 0 : setMessageToReply(undefined)
|
|
100
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
101
|
+
icon: 'close',
|
|
102
|
+
size: 24,
|
|
103
|
+
color: colors.onBackground01,
|
|
104
|
+
containerStyle: styles.closeIcon
|
|
105
|
+
})));
|
|
106
|
+
};
|
|
107
|
+
const styles = createStyleSheet({
|
|
108
|
+
previewImage: {
|
|
109
|
+
width: 36,
|
|
110
|
+
height: 36,
|
|
111
|
+
borderRadius: 10,
|
|
112
|
+
marginTop: 2,
|
|
113
|
+
marginRight: 10,
|
|
114
|
+
overflow: 'hidden'
|
|
115
|
+
},
|
|
116
|
+
messageToReplyContainer: {
|
|
117
|
+
flexDirection: 'row',
|
|
118
|
+
paddingLeft: 18,
|
|
119
|
+
paddingRight: 16,
|
|
120
|
+
paddingTop: 10,
|
|
121
|
+
paddingBottom: 8,
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
borderTopWidth: 1
|
|
124
|
+
},
|
|
125
|
+
fileIcon: {
|
|
126
|
+
width: 36,
|
|
127
|
+
height: 36,
|
|
128
|
+
borderRadius: 10,
|
|
129
|
+
marginRight: 10,
|
|
130
|
+
marginTop: 2
|
|
131
|
+
},
|
|
132
|
+
closeIcon: {
|
|
133
|
+
marginLeft: 4,
|
|
134
|
+
padding: 4
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
//# sourceMappingURL=MessageToReplyPreview.js.map
|