@sendbird/uikit-react-native 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -42
- package/lib/commonjs/components/ChannelInput/MessageToReplyPreview.js +145 -0
- package/lib/commonjs/components/ChannelInput/MessageToReplyPreview.js.map +1 -0
- package/lib/commonjs/components/ChannelInput/SendInput.js +147 -312
- package/lib/commonjs/components/ChannelInput/SendInput.js.map +1 -1
- package/lib/commonjs/components/ChannelInput/VoiceMessageInput.js +238 -0
- package/lib/commonjs/components/ChannelInput/VoiceMessageInput.js.map +1 -0
- package/lib/commonjs/components/ChannelInput/index.js +5 -1
- package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
- package/lib/commonjs/components/ChannelMessageList/index.js +1 -1
- package/lib/commonjs/components/ChannelMessageList/index.js.map +1 -1
- package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js +24 -13
- package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js.map +1 -1
- package/lib/commonjs/components/GroupChannelMessageRenderer/index.js +100 -5
- package/lib/commonjs/components/GroupChannelMessageRenderer/index.js.map +1 -1
- package/lib/commonjs/components/MessageSearchResultItem.js +1 -0
- package/lib/commonjs/components/MessageSearchResultItem.js.map +1 -1
- package/lib/commonjs/components/OpenChannelMessageRenderer/index.js +1 -0
- package/lib/commonjs/components/OpenChannelMessageRenderer/index.js.map +1 -1
- package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +2 -2
- package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
- package/lib/commonjs/components/ReactionBottomSheets/index.js.map +1 -1
- package/lib/commonjs/components/StatusComposition.js.map +1 -1
- package/lib/commonjs/constants.js +5 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/containers/GroupChannelPreviewContainer.js +1 -0
- package/lib/commonjs/containers/GroupChannelPreviewContainer.js.map +1 -1
- package/lib/commonjs/containers/InternalErrorBoundaryContainer.js.map +1 -1
- package/lib/commonjs/containers/SendbirdUIKitContainer.js +72 -34
- package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -1
- package/lib/commonjs/contexts/PlatformServiceCtx.js +16 -12
- package/lib/commonjs/contexts/PlatformServiceCtx.js.map +1 -1
- package/lib/commonjs/contexts/ReactionCtx.js +3 -2
- package/lib/commonjs/contexts/ReactionCtx.js.map +1 -1
- package/lib/commonjs/contexts/SendbirdChatCtx.js +2 -0
- package/lib/commonjs/contexts/SendbirdChatCtx.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +27 -42
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js +109 -5
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
- package/lib/commonjs/domain/userList/types.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelFragment.js +30 -4
- package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/commonjs/fragments/createMessageSearchFragment.js +1 -1
- package/lib/commonjs/fragments/createMessageSearchFragment.js.map +1 -1
- package/lib/commonjs/hooks/useChannelInputItems.js +211 -0
- package/lib/commonjs/hooks/useChannelInputItems.js.map +1 -0
- package/lib/commonjs/hooks/useConnection.js +1 -1
- package/lib/commonjs/hooks/useConnection.js.map +1 -1
- package/lib/commonjs/hooks/useVoiceMessageInput.js +207 -0
- package/lib/commonjs/hooks/useVoiceMessageInput.js.map +1 -0
- package/lib/commonjs/index.js +32 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/libs/MentionManager.js.map +1 -1
- package/lib/commonjs/libs/SBUUtils.js +4 -0
- package/lib/commonjs/libs/SBUUtils.js.map +1 -1
- package/lib/commonjs/libs/VoiceMessageConfig.js +30 -0
- package/lib/commonjs/libs/VoiceMessageConfig.js.map +1 -0
- package/lib/commonjs/localization/StringSet.type.js.map +1 -1
- package/lib/commonjs/localization/createBaseStringSet.js +24 -9
- package/lib/commonjs/localization/createBaseStringSet.js.map +1 -1
- package/lib/commonjs/platform/createFileService.expo.js +10 -0
- package/lib/commonjs/platform/createFileService.expo.js.map +1 -1
- package/lib/commonjs/platform/createFileService.native.js +19 -0
- package/lib/commonjs/platform/createFileService.native.js.map +1 -1
- package/lib/commonjs/platform/createPlayerService.expo.js +137 -0
- package/lib/commonjs/platform/createPlayerService.expo.js.map +1 -0
- package/lib/commonjs/platform/createPlayerService.native.js +139 -0
- package/lib/commonjs/platform/createPlayerService.native.js.map +1 -0
- package/lib/commonjs/platform/createRecorderService.expo.js +158 -0
- package/lib/commonjs/platform/createRecorderService.expo.js.map +1 -0
- package/lib/commonjs/platform/createRecorderService.native.js +157 -0
- package/lib/commonjs/platform/createRecorderService.native.js.map +1 -0
- package/lib/commonjs/platform/types.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/components/ChannelInput/MessageToReplyPreview.js +137 -0
- package/lib/module/components/ChannelInput/MessageToReplyPreview.js.map +1 -0
- package/lib/module/components/ChannelInput/SendInput.js +149 -314
- package/lib/module/components/ChannelInput/SendInput.js.map +1 -1
- package/lib/module/components/ChannelInput/VoiceMessageInput.js +228 -0
- package/lib/module/components/ChannelInput/VoiceMessageInput.js.map +1 -0
- package/lib/module/components/ChannelInput/index.js +5 -1
- package/lib/module/components/ChannelInput/index.js.map +1 -1
- package/lib/module/components/ChannelMessageList/index.js +2 -2
- package/lib/module/components/ChannelMessageList/index.js.map +1 -1
- package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js +24 -13
- package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.js.map +1 -1
- package/lib/module/components/GroupChannelMessageRenderer/index.js +99 -6
- package/lib/module/components/GroupChannelMessageRenderer/index.js.map +1 -1
- package/lib/module/components/MessageSearchResultItem.js +2 -1
- package/lib/module/components/MessageSearchResultItem.js.map +1 -1
- package/lib/module/components/OpenChannelMessageRenderer/index.js +1 -0
- package/lib/module/components/OpenChannelMessageRenderer/index.js.map +1 -1
- package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +2 -2
- package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
- package/lib/module/components/ReactionBottomSheets/index.js.map +1 -1
- package/lib/module/components/StatusComposition.js.map +1 -1
- package/lib/module/constants.js +2 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/containers/GroupChannelPreviewContainer.js +2 -1
- package/lib/module/containers/GroupChannelPreviewContainer.js.map +1 -1
- package/lib/module/containers/InternalErrorBoundaryContainer.js.map +1 -1
- package/lib/module/containers/SendbirdUIKitContainer.js +74 -36
- package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -1
- package/lib/module/contexts/PlatformServiceCtx.js +14 -11
- package/lib/module/contexts/PlatformServiceCtx.js.map +1 -1
- package/lib/module/contexts/ReactionCtx.js +3 -2
- package/lib/module/contexts/ReactionCtx.js.map +1 -1
- package/lib/module/contexts/SendbirdChatCtx.js +2 -0
- package/lib/module/contexts/SendbirdChatCtx.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +28 -43
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/module/domain/groupChannel/module/moduleContext.js +111 -7
- package/lib/module/domain/groupChannel/module/moduleContext.js.map +1 -1
- package/lib/module/domain/groupChannel/types.js.map +1 -1
- package/lib/module/domain/userList/types.js.map +1 -1
- package/lib/module/fragments/createGroupChannelFragment.js +32 -6
- package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/module/fragments/createMessageSearchFragment.js +1 -1
- package/lib/module/fragments/createMessageSearchFragment.js.map +1 -1
- package/lib/module/hooks/useChannelInputItems.js +203 -0
- package/lib/module/hooks/useChannelInputItems.js.map +1 -0
- package/lib/module/hooks/useConnection.js +1 -1
- package/lib/module/hooks/useConnection.js.map +1 -1
- package/lib/module/hooks/useVoiceMessageInput.js +199 -0
- package/lib/module/hooks/useVoiceMessageInput.js.map +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/libs/MentionManager.js.map +1 -1
- package/lib/module/libs/SBUUtils.js +4 -0
- package/lib/module/libs/SBUUtils.js.map +1 -1
- package/lib/module/libs/VoiceMessageConfig.js +23 -0
- package/lib/module/libs/VoiceMessageConfig.js.map +1 -0
- package/lib/module/localization/StringSet.type.js.map +1 -1
- package/lib/module/localization/createBaseStringSet.js +25 -10
- package/lib/module/localization/createBaseStringSet.js.map +1 -1
- package/lib/module/platform/createFileService.expo.js +10 -0
- package/lib/module/platform/createFileService.expo.js.map +1 -1
- package/lib/module/platform/createFileService.native.js +19 -0
- package/lib/module/platform/createFileService.native.js.map +1 -1
- package/lib/module/platform/createPlayerService.expo.js +129 -0
- package/lib/module/platform/createPlayerService.expo.js.map +1 -0
- package/lib/module/platform/createPlayerService.native.js +132 -0
- package/lib/module/platform/createPlayerService.native.js.map +1 -0
- package/lib/module/platform/createRecorderService.expo.js +150 -0
- package/lib/module/platform/createRecorderService.expo.js.map +1 -0
- package/lib/module/platform/createRecorderService.native.js +149 -0
- package/lib/module/platform/createRecorderService.native.js.map +1 -0
- package/lib/module/platform/types.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/components/ChannelCover.d.ts +2 -1
- package/lib/typescript/src/components/ChannelInput/AttachmentsButton.d.ts +2 -1
- package/lib/typescript/src/components/ChannelInput/MessageToReplyPreview.d.ts +7 -0
- package/lib/typescript/src/components/ChannelInput/VoiceMessageInput.d.ts +11 -0
- package/lib/typescript/src/components/ChannelInput/index.d.ts +7 -3
- package/lib/typescript/src/components/ChannelMessageList/index.d.ts +1 -1
- package/lib/typescript/src/components/FileViewer.d.ts +2 -1
- package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.d.ts +2 -1
- package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageFocusAnimation.d.ts +1 -1
- package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.d.ts +1 -1
- package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.d.ts +4 -2
- package/lib/typescript/src/components/NewMessagesButton.d.ts +1 -1
- package/lib/typescript/src/components/OpenChannelMessageRenderer/OpenChannelMessageDateSeparator.d.ts +2 -1
- package/lib/typescript/src/components/ProviderLayout.d.ts +1 -1
- package/lib/typescript/src/components/ReactionAddons/BottomSheetReactionAddon.d.ts +2 -1
- package/lib/typescript/src/components/ReactionAddons/MessageReactionAddon.d.ts +2 -1
- package/lib/typescript/src/components/ReactionAddons/ReactionRoundedButton.d.ts +3 -2
- package/lib/typescript/src/components/ReactionAddons/index.d.ts +3 -2
- package/lib/typescript/src/components/ReactionBottomSheets/ReactionListBottomSheet.d.ts +2 -1
- package/lib/typescript/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.d.ts +2 -1
- package/lib/typescript/src/components/ReactionBottomSheets/index.d.ts +4 -4
- package/lib/typescript/src/components/ScrollToBottomButton.d.ts +1 -1
- package/lib/typescript/src/components/StatusComposition.d.ts +4 -4
- package/lib/typescript/src/components/TypedPlaceholder.d.ts +2 -1
- package/lib/typescript/src/components/UserActionBar.d.ts +2 -1
- package/lib/typescript/src/components/UserSelectableBar.d.ts +2 -1
- package/lib/typescript/src/constants.d.ts +2 -0
- package/lib/typescript/src/containers/GroupChannelPreviewContainer.d.ts +2 -1
- package/lib/typescript/src/containers/InternalErrorBoundaryContainer.d.ts +3 -3
- package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +19 -8
- package/lib/typescript/src/contexts/LocalizationCtx.d.ts +1 -1
- package/lib/typescript/src/contexts/PlatformServiceCtx.d.ts +8 -8
- package/lib/typescript/src/contexts/ReactionCtx.d.ts +5 -2
- package/lib/typescript/src/contexts/SendbirdChatCtx.d.ts +6 -3
- package/lib/typescript/src/contexts/UserProfileCtx.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelMessageList.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannel/types.d.ts +45 -0
- package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListList.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListTypeSelector.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelModeration/component/GroupChannelModerationHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelModeration/component/GroupChannelModerationMenu.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsView.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsList.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelOperators/component/GroupChannelOperatorsStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsInfo.d.ts +2 -1
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.d.ts +2 -1
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchHeader.d.ts +2 -1
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchList.d.ts +2 -1
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannel/component/OpenChannelHeader.d.ts +2 -2
- package/lib/typescript/src/domain/openChannel/component/OpenChannelInput.d.ts +1 -1
- package/lib/typescript/src/domain/openChannel/component/OpenChannelMessageList.d.ts +1 -1
- package/lib/typescript/src/domain/openChannel/component/OpenChannelStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/openChannel/component/OpenChannelStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersList.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelBannedUsers/component/OpenChannelBannedUsersStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateProfileInput.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelCreate/component/OpenChannelCreateStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelList/component/OpenChannelListHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelList/component/OpenChannelListList.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelList/component/OpenChannelListStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelList/component/OpenChannelListStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelModeration/component/OpenChannelModerationHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelModeration/component/OpenChannelModerationMenu.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsList.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelMutedParticipants/component/OpenChannelMutedParticipantsStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsList.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelOperators/component/OpenChannelOperatorsStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsHeader.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsInfo.d.ts +2 -1
- package/lib/typescript/src/domain/openChannelSettings/component/OpenChannelSettingsMenu.d.ts +2 -1
- package/lib/typescript/src/domain/userList/component/UserListHeader.d.ts +3 -3
- package/lib/typescript/src/domain/userList/component/UserListList.d.ts +1 -1
- package/lib/typescript/src/domain/userList/component/UserListStatusEmpty.d.ts +2 -1
- package/lib/typescript/src/domain/userList/component/UserListStatusLoading.d.ts +2 -1
- package/lib/typescript/src/domain/userList/types.d.ts +2 -2
- package/lib/typescript/src/hooks/useChannelInputItems.d.ts +10 -0
- package/lib/typescript/src/hooks/useVoiceMessageInput.d.ts +53 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/libs/MentionManager.d.ts +2 -1
- package/lib/typescript/src/libs/SBUUtils.d.ts +1 -0
- package/lib/typescript/src/libs/VoiceMessageConfig.d.ts +25 -0
- package/lib/typescript/src/localization/StringSet.type.d.ts +7 -0
- package/lib/typescript/src/platform/createPlayerService.expo.d.ts +7 -0
- package/lib/typescript/src/platform/createPlayerService.native.d.ts +9 -0
- package/lib/typescript/src/platform/createRecorderService.expo.d.ts +7 -0
- package/lib/typescript/src/platform/createRecorderService.native.d.ts +9 -0
- package/lib/typescript/src/platform/types.d.ts +100 -1
- package/lib/typescript/src/types.d.ts +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +9 -11
- package/src/components/ChannelInput/MessageToReplyPreview.tsx +133 -0
- package/src/components/ChannelInput/SendInput.tsx +129 -320
- package/src/components/ChannelInput/VoiceMessageInput.tsx +206 -0
- package/src/components/ChannelInput/index.tsx +12 -4
- package/src/components/ChannelMessageList/index.tsx +3 -1
- package/src/components/GroupChannelMessageRenderer/GroupChannelMessageParentMessage.tsx +24 -11
- package/src/components/GroupChannelMessageRenderer/index.tsx +80 -3
- package/src/components/MessageSearchResultItem.tsx +2 -1
- package/src/components/OpenChannelMessageRenderer/index.tsx +1 -0
- package/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.tsx +2 -2
- package/src/components/ReactionBottomSheets/index.tsx +3 -2
- package/src/components/StatusComposition.tsx +3 -3
- package/src/constants.ts +2 -0
- package/src/containers/GroupChannelPreviewContainer.tsx +2 -0
- package/src/containers/InternalErrorBoundaryContainer.tsx +1 -1
- package/src/containers/SendbirdUIKitContainer.tsx +103 -59
- package/src/contexts/PlatformServiceCtx.tsx +22 -20
- package/src/contexts/ReactionCtx.tsx +7 -5
- package/src/contexts/SendbirdChatCtx.tsx +10 -2
- package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +29 -43
- package/src/domain/groupChannel/module/moduleContext.tsx +119 -7
- package/src/domain/groupChannel/types.ts +41 -0
- package/src/domain/userList/types.ts +2 -2
- package/src/fragments/createGroupChannelFragment.tsx +32 -5
- package/src/fragments/createMessageSearchFragment.tsx +1 -1
- package/src/hooks/useChannelInputItems.ts +215 -0
- package/src/hooks/useConnection.ts +1 -1
- package/src/hooks/useVoiceMessageInput.ts +237 -0
- package/src/index.ts +4 -0
- package/src/libs/MentionManager.tsx +1 -1
- package/src/libs/SBUUtils.ts +5 -0
- package/src/libs/VoiceMessageConfig.ts +28 -0
- package/src/localization/StringSet.type.ts +8 -0
- package/src/localization/createBaseStringSet.ts +27 -11
- package/src/platform/createFileService.expo.ts +10 -0
- package/src/platform/createFileService.native.ts +19 -0
- package/src/platform/createPlayerService.expo.tsx +142 -0
- package/src/platform/createPlayerService.native.tsx +148 -0
- package/src/platform/createRecorderService.expo.tsx +160 -0
- package/src/platform/createRecorderService.native.tsx +170 -0
- package/src/platform/types.ts +114 -1
- package/src/types.ts +1 -1
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_chat","_groupChannel","_openChannel","_uikitReactNativeFoundation","_uikitTools","_uikitUtils","_LocalizationCtx","_PlatformServiceCtx","_ReactionCtx","_SendbirdChatCtx","_UserProfileCtx","_EmojiManager","_interopRequireDefault","_ImageCompressionConfig","_InternalLocalCacheStorage","_MentionConfig","_MentionManager","_StringSet","_dynamicModule","_version","_InternalErrorBoundaryContainer","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","NetInfo","SBUDynamicModule","SendbirdUIKit","freeze","VERSION","PLATFORM","Platform","OS","toLowerCase","DEFAULT","AUTO_PUSH_TOKEN_REGISTRATION","USE_USER_ID_FOR_NICKNAME","IMAGE_COMPRESSION","exports","SendbirdUIKitContainer","_ref","children","appId","chatOptions","uikitOptions","platformServices","localization","styles","errorBoundary","toast","userProfile","userMention","imageCompression","localCacheStorage","Error","defaultStringSet","stringSet","StringSetEn","isFirstMount","useIsFirstMount","unsubscribes","useRef","internalStorage","useState","InternalLocalCacheStorage","sdkInstance","setSdkInstance","sendbird","initializeSendbird","current","chatSDK","emojiManager","useMemo","EmojiManager","mentionManager","config","MentionConfig","mentionLimit","MENTION_LIMIT","suggestionLimit","SUGGESTION_LIMIT","debounceMills","DEBOUNCE_MILLS","delimiter","DELIMITER","trigger","TRIGGER","MentionManager","imageCompressionConfig","ImageCompressionConfig","compressionRate","COMPRESSION_RATE","width","height","useLayoutEffect","forEach","u","renderChildren","disabled","createElement","SafeAreaProvider","UIKitConfigProvider","storage","localConfigs","common","groupChannel","channel","channelList","groupChannelList","setting","groupChannelSettings","openChannel","SendbirdChatProvider","enableAutoPushTokenRegistration","enableUseUserIdForNickname","enableImageCompression","LocalizationProvider","PlatformServiceProvider","fileService","file","notificationService","notification","clipboardService","clipboard","mediaService","media","UIKitThemeProvider","theme","LightUIKitTheme","HeaderStyleProvider","HeaderComponent","Header","defaultTitleAlign","defaultHeaderTitleAlign","statusBarTranslucent","ToastProvider","dismissTimeout","UserProfileProvider","onCreateChannel","onBeforeCreateChannel","ReactionProvider","LocalizationContext","Consumer","value","STRINGS","DialogProvider","defaultLabels","alert","ok","DIALOG","ALERT_DEFAULT_OK","prompt","PROMPT_DEFAULT_OK","cancel","PROMPT_DEFAULT_CANCEL","placeholder","PROMPT_DEFAULT_PLACEHOLDER","options","localCacheEncryption","onInitialized","Sendbird","init","newInstance","modules","GroupChannelModule","OpenChannelModule","localCacheEnabled","Boolean","useAsyncStorageStore","platform","getDeviceOSPlatform","deviceOSInfo","version","String","Version","customData","platform_version","getReactNativeVersion","uikitExtension","product","SendbirdProduct","UIKIT_CHAT","SendbirdPlatform","REACT_NATIVE","addSendbirdExtensions","addExtension","addEventListener","_chatSDK$setOnlineLis","_chatSDK","_chatSDK$setOfflineLi","_chatSDK2","NOOP","listener","callback","callbackType","callCount","unsubscribe","state","online","isConnected","isInternetReachable","push","setOnlineListener","onOnline","setOfflineListener","onOffline","DeviceOsPlatform","ANDROID","IOS","WEB","WINDOWS","undefined","major","minor","patch","constants","reactNativeVersion","_default"],"sources":["SendbirdUIKitContainer.tsx"],"sourcesContent":["import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\nimport Sendbird, { DeviceOsPlatform, SendbirdPlatform, SendbirdProduct } from '@sendbird/chat';\nimport { GroupChannelModule } from '@sendbird/chat/groupChannel';\nimport { OpenChannelModule } from '@sendbird/chat/openChannel';\nimport type { HeaderStyleContextType, UIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport {\n DialogProvider,\n Header,\n HeaderStyleProvider,\n LightUIKitTheme,\n ToastProvider,\n UIKitThemeProvider,\n} from '@sendbird/uikit-react-native-foundation';\nimport { SBUConfig, UIKitConfigProvider } from '@sendbird/uikit-tools';\nimport type {\n PartialDeep,\n SendbirdChatSDK,\n SendbirdEncryption,\n SendbirdGroupChannel,\n SendbirdGroupChannelCreateParams,\n SendbirdMember,\n SendbirdUser,\n} from '@sendbird/uikit-utils';\nimport { NOOP, useIsFirstMount } from '@sendbird/uikit-utils';\n\nimport { LocalizationContext, LocalizationProvider } from '../contexts/LocalizationCtx';\nimport { PlatformServiceProvider } from '../contexts/PlatformServiceCtx';\nimport { ReactionProvider } from '../contexts/ReactionCtx';\nimport type { ChatRelatedFeaturesInUIKit } from '../contexts/SendbirdChatCtx';\nimport { SendbirdChatProvider } from '../contexts/SendbirdChatCtx';\nimport { UserProfileProvider } from '../contexts/UserProfileCtx';\nimport EmojiManager from '../libs/EmojiManager';\nimport type { ImageCompressionConfigInterface } from '../libs/ImageCompressionConfig';\nimport ImageCompressionConfig from '../libs/ImageCompressionConfig';\nimport InternalLocalCacheStorage from '../libs/InternalLocalCacheStorage';\nimport MentionConfig, { MentionConfigInterface } from '../libs/MentionConfig';\nimport MentionManager from '../libs/MentionManager';\nimport StringSetEn from '../localization/StringSet.en';\nimport type { StringSet } from '../localization/StringSet.type';\nimport SBUDynamicModule from '../platform/dynamicModule';\nimport type {\n ClipboardServiceInterface,\n FileServiceInterface,\n MediaServiceInterface,\n NotificationServiceInterface,\n} from '../platform/types';\nimport type { ErrorBoundaryProps, LocalCacheStorage } from '../types';\nimport VERSION from '../version';\nimport InternalErrorBoundaryContainer from './InternalErrorBoundaryContainer';\n\nconst NetInfo = SBUDynamicModule.get('@react-native-community/netinfo', 'warn');\ntype UnimplementedFeatures = 'enableVoiceMessage' | 'threadReplySelectType' | 'replyType';\nexport const SendbirdUIKit = Object.freeze({\n VERSION,\n PLATFORM: Platform.OS.toLowerCase(),\n DEFAULT: {\n AUTO_PUSH_TOKEN_REGISTRATION: true,\n USE_USER_ID_FOR_NICKNAME: false,\n IMAGE_COMPRESSION: true,\n },\n});\n\nexport type SendbirdUIKitContainerProps = React.PropsWithChildren<{\n appId: string;\n platformServices: {\n file: FileServiceInterface;\n notification: NotificationServiceInterface;\n clipboard: ClipboardServiceInterface;\n media: MediaServiceInterface;\n };\n chatOptions: {\n localCacheStorage: LocalCacheStorage;\n localCacheEncryption?: SendbirdEncryption;\n onInitialized?: (sdkInstance: SendbirdChatSDK) => SendbirdChatSDK;\n } & Partial<ChatRelatedFeaturesInUIKit>;\n uikitOptions?: PartialDeep<{\n common: SBUConfig['common'];\n groupChannel: Omit<SBUConfig['groupChannel']['channel'], UnimplementedFeatures> & {\n replyType: Extract<SBUConfig['groupChannel']['channel']['replyType'], 'none' | 'quote_reply'>;\n };\n groupChannelList: SBUConfig['groupChannel']['channelList'];\n groupChannelSettings: SBUConfig['groupChannel']['setting'];\n openChannel: SBUConfig['openChannel']['channel'];\n }>;\n localization?: {\n stringSet?: StringSet;\n };\n styles?: {\n theme?: UIKitTheme;\n statusBarTranslucent?: boolean;\n defaultHeaderTitleAlign?: 'left' | 'center';\n defaultHeaderHeight?: number;\n HeaderComponent?: HeaderStyleContextType['HeaderComponent'];\n };\n errorBoundary?: {\n disabled?: boolean;\n onError?: (props: ErrorBoundaryProps) => void;\n ErrorInfoComponent?: (props: ErrorBoundaryProps) => JSX.Element;\n };\n toast?: {\n dismissTimeout?: number;\n };\n userProfile?: {\n onCreateChannel: (channel: SendbirdGroupChannel) => void;\n onBeforeCreateChannel?: (\n channelParams: SendbirdGroupChannelCreateParams,\n users: SendbirdUser[] | SendbirdMember[],\n ) => SendbirdGroupChannelCreateParams | Promise<SendbirdGroupChannelCreateParams>;\n };\n userMention?: Pick<Partial<MentionConfigInterface>, 'mentionLimit' | 'suggestionLimit' | 'debounceMills'>;\n imageCompression?: Partial<ImageCompressionConfigInterface>;\n}>;\n\nconst SendbirdUIKitContainer = ({\n children,\n appId,\n chatOptions,\n uikitOptions,\n platformServices,\n localization,\n styles,\n errorBoundary,\n toast,\n userProfile,\n userMention,\n imageCompression,\n}: SendbirdUIKitContainerProps) => {\n if (!chatOptions.localCacheStorage) {\n throw new Error('SendbirdUIKitContainer: chatOptions.localCacheStorage is required');\n }\n\n const defaultStringSet = localization?.stringSet ?? StringSetEn;\n\n const isFirstMount = useIsFirstMount();\n const unsubscribes = useRef<Array<() => void>>([]);\n\n const [internalStorage] = useState(() => new InternalLocalCacheStorage(chatOptions.localCacheStorage));\n const [sdkInstance, setSdkInstance] = useState<SendbirdChatSDK>(() => {\n const sendbird = initializeSendbird(appId, { internalStorage, ...chatOptions });\n unsubscribes.current = sendbird.unsubscribes;\n return sendbird.chatSDK;\n });\n\n const emojiManager = useMemo(() => new EmojiManager(internalStorage), [internalStorage]);\n\n const mentionManager = useMemo(() => {\n const config = new MentionConfig({\n mentionLimit: userMention?.mentionLimit || MentionConfig.DEFAULT.MENTION_LIMIT,\n suggestionLimit: userMention?.suggestionLimit || MentionConfig.DEFAULT.SUGGESTION_LIMIT,\n debounceMills: userMention?.debounceMills ?? MentionConfig.DEFAULT.DEBOUNCE_MILLS,\n delimiter: MentionConfig.DEFAULT.DELIMITER,\n trigger: MentionConfig.DEFAULT.TRIGGER,\n });\n return new MentionManager(config);\n }, [userMention?.mentionLimit, userMention?.suggestionLimit, userMention?.debounceMills]);\n\n const imageCompressionConfig = useMemo(() => {\n return new ImageCompressionConfig({\n compressionRate: imageCompression?.compressionRate || ImageCompressionConfig.DEFAULT.COMPRESSION_RATE,\n width: imageCompression?.width,\n height: imageCompression?.height,\n });\n }, [imageCompression?.compressionRate, imageCompression?.width, imageCompression?.height]);\n\n useLayoutEffect(() => {\n if (!isFirstMount) {\n const sendbird = initializeSendbird(appId, { internalStorage, ...chatOptions });\n setSdkInstance(sendbird.chatSDK);\n unsubscribes.current = sendbird.unsubscribes;\n }\n\n return () => {\n unsubscribes.current.forEach((u) => {\n try {\n u();\n } catch {}\n });\n };\n }, [appId, internalStorage]);\n\n const renderChildren = () => {\n if (errorBoundary?.disabled) {\n return children;\n } else {\n return <InternalErrorBoundaryContainer {...errorBoundary}>{children}</InternalErrorBoundaryContainer>;\n }\n };\n\n return (\n <SafeAreaProvider>\n <UIKitConfigProvider\n storage={internalStorage}\n localConfigs={{\n common: uikitOptions?.common,\n groupChannel: {\n channel: uikitOptions?.groupChannel,\n channelList: uikitOptions?.groupChannelList,\n setting: uikitOptions?.groupChannelSettings,\n },\n openChannel: {\n channel: uikitOptions?.openChannel,\n },\n }}\n >\n <SendbirdChatProvider\n sdkInstance={sdkInstance}\n emojiManager={emojiManager}\n mentionManager={mentionManager}\n imageCompressionConfig={imageCompressionConfig}\n enableAutoPushTokenRegistration={\n chatOptions.enableAutoPushTokenRegistration ?? SendbirdUIKit.DEFAULT.AUTO_PUSH_TOKEN_REGISTRATION\n }\n enableUseUserIdForNickname={\n chatOptions.enableUseUserIdForNickname ?? SendbirdUIKit.DEFAULT.USE_USER_ID_FOR_NICKNAME\n }\n enableImageCompression={chatOptions.enableImageCompression ?? SendbirdUIKit.DEFAULT.IMAGE_COMPRESSION}\n >\n <LocalizationProvider stringSet={defaultStringSet}>\n <PlatformServiceProvider\n fileService={platformServices.file}\n notificationService={platformServices.notification}\n clipboardService={platformServices.clipboard}\n mediaService={platformServices.media}\n >\n <UIKitThemeProvider theme={styles?.theme ?? LightUIKitTheme}>\n <HeaderStyleProvider\n HeaderComponent={styles?.HeaderComponent ?? Header}\n defaultTitleAlign={styles?.defaultHeaderTitleAlign ?? 'left'}\n statusBarTranslucent={styles?.statusBarTranslucent ?? true}\n >\n <ToastProvider dismissTimeout={toast?.dismissTimeout}>\n <UserProfileProvider\n onCreateChannel={userProfile?.onCreateChannel}\n onBeforeCreateChannel={userProfile?.onBeforeCreateChannel}\n statusBarTranslucent={styles?.statusBarTranslucent ?? true}\n >\n <ReactionProvider>\n <LocalizationContext.Consumer>\n {(value) => {\n const STRINGS = value?.STRINGS || defaultStringSet;\n return (\n <DialogProvider\n defaultLabels={{\n alert: { ok: STRINGS.DIALOG.ALERT_DEFAULT_OK },\n prompt: {\n ok: STRINGS.DIALOG.PROMPT_DEFAULT_OK,\n cancel: STRINGS.DIALOG.PROMPT_DEFAULT_CANCEL,\n placeholder: STRINGS.DIALOG.PROMPT_DEFAULT_PLACEHOLDER,\n },\n }}\n >\n {renderChildren()}\n </DialogProvider>\n );\n }}\n </LocalizationContext.Consumer>\n </ReactionProvider>\n </UserProfileProvider>\n </ToastProvider>\n </HeaderStyleProvider>\n </UIKitThemeProvider>\n </PlatformServiceProvider>\n </LocalizationProvider>\n </SendbirdChatProvider>\n </UIKitConfigProvider>\n </SafeAreaProvider>\n );\n};\n\nconst initializeSendbird = (\n appId: string,\n options: {\n internalStorage?: InternalLocalCacheStorage;\n onInitialized?: (sdk: SendbirdChatSDK) => SendbirdChatSDK;\n localCacheEncryption?: SendbirdEncryption;\n },\n) => {\n let chatSDK: SendbirdChatSDK;\n const unsubscribes: Array<() => void> = [];\n const { internalStorage, localCacheEncryption, onInitialized } = options;\n\n chatSDK = Sendbird.init({\n appId,\n newInstance: true,\n modules: [new GroupChannelModule(), new OpenChannelModule()],\n localCacheEnabled: Boolean(internalStorage),\n useAsyncStorageStore: internalStorage as never,\n localCacheEncryption,\n });\n\n if (onInitialized) {\n chatSDK = onInitialized(chatSDK);\n }\n\n const platform = getDeviceOSPlatform();\n if (SendbirdUIKit.VERSION && platform) {\n const deviceOSInfo = { platform, version: String(Platform.Version) };\n const customData = { platform_version: getReactNativeVersion() };\n const uikitExtension = {\n product: SendbirdProduct.UIKIT_CHAT,\n version: SendbirdUIKit.VERSION,\n platform: SendbirdPlatform.REACT_NATIVE,\n };\n\n chatSDK.addSendbirdExtensions([uikitExtension], deviceOSInfo, customData);\n chatSDK.addExtension('sb_uikit', SendbirdUIKit.VERSION);\n }\n\n if (SendbirdUIKit.PLATFORM) {\n chatSDK.addExtension('device-os-platform', SendbirdUIKit.PLATFORM);\n }\n\n if (NetInfo?.addEventListener) {\n try {\n // NOTE: For removing buggy behavior of NetInfo.addEventListener\n // When you first add an event listener, it is assumed that the initialization of the internal event detector is done simultaneously.\n // In other words, when you call the first event listener two events are triggered immediately\n // - the one that is called when adding the event listener\n // - and the internal initialization event\n NetInfo.addEventListener(NOOP)();\n } catch {}\n\n const listener = (callback: () => void, callbackType: 'online' | 'offline') => {\n let callCount = 0;\n const unsubscribe = NetInfo.addEventListener((state) => {\n const online = Boolean(state.isConnected) || Boolean(state.isInternetReachable);\n\n // NOTE: When NetInfo.addEventListener is called\n // the event is immediately triggered regardless of whether the event actually occurred.\n // This is why it filters the first event.\n if (callCount === 0) {\n callCount++;\n return;\n }\n\n if (online && callbackType === 'online') callback();\n if (!online && callbackType === 'offline') callback();\n });\n unsubscribes.push(unsubscribe);\n return unsubscribe;\n };\n chatSDK.setOnlineListener?.((onOnline) => listener(onOnline, 'online'));\n chatSDK.setOfflineListener?.((onOffline) => listener(onOffline, 'offline'));\n }\n return { chatSDK, unsubscribes };\n};\n\nfunction getDeviceOSPlatform() {\n switch (Platform.OS) {\n case 'android':\n return DeviceOsPlatform.ANDROID;\n case 'ios':\n return DeviceOsPlatform.IOS;\n case 'web':\n return DeviceOsPlatform.WEB;\n case 'windows':\n return DeviceOsPlatform.WINDOWS;\n default:\n return undefined;\n }\n}\n\nfunction getReactNativeVersion() {\n const { major, minor, patch } = Platform.constants.reactNativeVersion;\n return `${major}.${minor}.${patch}`;\n}\n\nexport default SendbirdUIKitContainer;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAEA,IAAAM,2BAAA,GAAAN,OAAA;AAQA,IAAAO,WAAA,GAAAP,OAAA;AAUA,IAAAQ,WAAA,GAAAR,OAAA;AAEA,IAAAS,gBAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV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,CAAA,EAAG;EAC7B,QAAQ3I,qBAAQ,CAACC,EAAE;IACjB,KAAK,SAAS;MACZ,OAAO8K,sBAAgB,CAACC,OAAO;IACjC,KAAK,KAAK;MACR,OAAOD,sBAAgB,CAACE,GAAG;IAC7B,KAAK,KAAK;MACR,OAAOF,sBAAgB,CAACG,GAAG;IAC7B,KAAK,SAAS;MACZ,OAAOH,sBAAgB,CAACI,OAAO;IACjC;MACE,OAAOC,SAAS;EAAC;AAEvB;AAEA,SAASlC,qBAAqBA,CAAA,EAAG;EAC/B,MAAM;IAAEmC,KAAK;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGvL,qBAAQ,CAACwL,SAAS,CAACC,kBAAkB;EACrE,OAAQ,GAAEJ,KAAM,IAAGC,KAAM,IAAGC,KAAM,EAAC;AACrC;AAAC,IAAAG,QAAA,GAEclL,sBAAsB;AAAAD,OAAA,CAAAjC,OAAA,GAAAoN,QAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_chat","_groupChannel","_openChannel","_uikitReactNativeFoundation","_uikitTools","_uikitUtils","_LocalizationCtx","_PlatformServiceCtx","_ReactionCtx","_SendbirdChatCtx","_UserProfileCtx","_EmojiManager","_interopRequireDefault","_ImageCompressionConfig","_InternalLocalCacheStorage","_MentionConfig","_MentionManager","_VoiceMessageConfig","_StringSet","_dynamicModule","_version","_InternalErrorBoundaryContainer","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","NetInfo","SBUDynamicModule","SendbirdUIKit","freeze","VERSION","PLATFORM","Platform","OS","toLowerCase","DEFAULT","AUTO_PUSH_TOKEN_REGISTRATION","USE_USER_ID_FOR_NICKNAME","IMAGE_COMPRESSION","exports","chatOmitKeys","sanitizeChatOptions","chatOptions","opts","forEach","SendbirdUIKitContainer","props","children","appId","uikitOptions","platformServices","localization","styles","errorBoundary","toast","userProfile","reaction","localCacheStorage","Error","defaultStringSet","stringSet","StringSetEn","isFirstMount","useIsFirstMount","unsubscribes","useRef","internalStorage","useState","InternalLocalCacheStorage","sdkInstance","setSdkInstance","sendbird","initializeSendbird","current","chatSDK","imageCompressionConfig","voiceMessageConfig","mentionConfig","useConfigInstance","emojiManager","useMemo","EmojiManager","mentionManager","MentionManager","useLayoutEffect","u","renderChildren","disabled","createElement","SafeAreaProvider","UIKitConfigProvider","storage","localConfigs","common","groupChannel","channel","channelList","groupChannelList","setting","groupChannelSettings","openChannel","SendbirdChatProvider","enableAutoPushTokenRegistration","enableUseUserIdForNickname","enableImageCompression","LocalizationProvider","PlatformServiceProvider","fileService","file","notificationService","notification","clipboardService","clipboard","mediaService","media","playerService","player","recorderService","recorder","UIKitThemeProvider","theme","LightUIKitTheme","HeaderStyleProvider","HeaderComponent","Header","defaultTitleAlign","defaultHeaderTitleAlign","statusBarTranslucent","ToastProvider","dismissTimeout","UserProfileProvider","ReactionProvider","LocalizationContext","Consumer","value","STRINGS","DialogProvider","defaultLabels","alert","ok","DIALOG","ALERT_DEFAULT_OK","prompt","PROMPT_DEFAULT_OK","cancel","PROMPT_DEFAULT_CANCEL","placeholder","PROMPT_DEFAULT_PLACEHOLDER","options","onInitialized","chatInitParams","SendbirdChat","init","newInstance","modules","GroupChannelModule","OpenChannelModule","localCacheEnabled","useAsyncStorageStore","platform","getDeviceOSPlatform","deviceOSInfo","version","String","Version","customData","platform_version","getReactNativeVersion","uikitExtension","product","SendbirdProduct","UIKIT_CHAT","SendbirdPlatform","REACT_NATIVE","addSendbirdExtensions","addExtension","addEventListener","_chatSDK$setOnlineLis","_chatSDK","_chatSDK$setOfflineLi","_chatSDK2","NOOP","listener","callback","callbackType","callCount","unsubscribe","state","online","Boolean","isConnected","isInternetReachable","push","setOnlineListener","onOnline","setOfflineListener","onOffline","DeviceOsPlatform","ANDROID","IOS","WEB","WINDOWS","undefined","major","minor","patch","constants","reactNativeVersion","_ref","_voiceMessage$recorde3","_voiceMessage$recorde4","imageCompression","userMention","voiceMessage","MentionConfig","mentionLimit","MENTION_LIMIT","suggestionLimit","SUGGESTION_LIMIT","debounceMills","DEBOUNCE_MILLS","delimiter","DELIMITER","trigger","TRIGGER","ImageCompressionConfig","compressionRate","COMPRESSION_RATE","width","height","_voiceMessage$recorde","_voiceMessage$recorde2","VoiceMessageConfig","minDuration","RECORDER","MIN_DURATION","maxDuration","MAX_DURATION","_default"],"sources":["SendbirdUIKitContainer.tsx"],"sourcesContent":["import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\nimport SendbirdChat, { DeviceOsPlatform, SendbirdChatParams, SendbirdPlatform, SendbirdProduct } from '@sendbird/chat';\nimport { GroupChannelModule } from '@sendbird/chat/groupChannel';\nimport { OpenChannelModule } from '@sendbird/chat/openChannel';\nimport type { HeaderStyleContextType, UIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport {\n DialogProvider,\n Header,\n HeaderStyleProvider,\n LightUIKitTheme,\n ToastProvider,\n UIKitThemeProvider,\n} from '@sendbird/uikit-react-native-foundation';\nimport { SBUConfig, UIKitConfigProvider } from '@sendbird/uikit-tools';\nimport type {\n PartialDeep,\n SendbirdChatSDK,\n SendbirdGroupChannel,\n SendbirdGroupChannelCreateParams,\n SendbirdMember,\n SendbirdUser,\n} from '@sendbird/uikit-utils';\nimport { NOOP, useIsFirstMount } from '@sendbird/uikit-utils';\n\nimport { LocalizationContext, LocalizationProvider } from '../contexts/LocalizationCtx';\nimport { PlatformServiceProvider } from '../contexts/PlatformServiceCtx';\nimport { ReactionProvider } from '../contexts/ReactionCtx';\nimport type { ChatRelatedFeaturesInUIKit } from '../contexts/SendbirdChatCtx';\nimport { SendbirdChatProvider } from '../contexts/SendbirdChatCtx';\nimport { UserProfileProvider } from '../contexts/UserProfileCtx';\nimport EmojiManager from '../libs/EmojiManager';\nimport type { ImageCompressionConfigInterface } from '../libs/ImageCompressionConfig';\nimport ImageCompressionConfig from '../libs/ImageCompressionConfig';\nimport InternalLocalCacheStorage from '../libs/InternalLocalCacheStorage';\nimport MentionConfig, { MentionConfigInterface } from '../libs/MentionConfig';\nimport MentionManager from '../libs/MentionManager';\nimport VoiceMessageConfig, { VoiceMessageConfigInterface } from '../libs/VoiceMessageConfig';\nimport StringSetEn from '../localization/StringSet.en';\nimport type { StringSet } from '../localization/StringSet.type';\nimport SBUDynamicModule from '../platform/dynamicModule';\nimport type {\n ClipboardServiceInterface,\n FileServiceInterface,\n MediaServiceInterface,\n NotificationServiceInterface,\n PlayerServiceInterface,\n RecorderServiceInterface,\n} from '../platform/types';\nimport type { ErrorBoundaryProps, LocalCacheStorage } from '../types';\nimport VERSION from '../version';\nimport InternalErrorBoundaryContainer from './InternalErrorBoundaryContainer';\n\nconst NetInfo = SBUDynamicModule.get('@react-native-community/netinfo', 'warn');\nexport const SendbirdUIKit = Object.freeze({\n VERSION,\n PLATFORM: Platform.OS.toLowerCase(),\n DEFAULT: {\n AUTO_PUSH_TOKEN_REGISTRATION: true,\n USE_USER_ID_FOR_NICKNAME: false,\n IMAGE_COMPRESSION: true,\n },\n});\n\ntype UnimplementedFeatures = 'threadReplySelectType' | 'replyType';\nexport type ChatOmittedInitParams = Omit<\n SendbirdChatParams<[GroupChannelModule, OpenChannelModule]>,\n (typeof chatOmitKeys)[number]\n>;\n\nconst chatOmitKeys = [\n 'appId',\n 'newInstance',\n 'modules',\n 'debugMode',\n 'appVersion',\n 'localCacheEnabled',\n 'useAsyncStorageStore',\n] as const;\nfunction sanitizeChatOptions<T extends Record<string, unknown>>(chatOptions: T): T {\n const opts = { ...chatOptions };\n chatOmitKeys.forEach((key) => delete opts[key]);\n return opts;\n}\n\nexport type SendbirdUIKitContainerProps = React.PropsWithChildren<{\n appId: string;\n platformServices: {\n file: FileServiceInterface;\n notification: NotificationServiceInterface;\n clipboard: ClipboardServiceInterface;\n media: MediaServiceInterface;\n player: PlayerServiceInterface;\n recorder: RecorderServiceInterface;\n };\n chatOptions: {\n localCacheStorage: LocalCacheStorage;\n onInitialized?: (sdkInstance: SendbirdChatSDK) => SendbirdChatSDK;\n } & Partial<ChatOmittedInitParams> &\n Partial<ChatRelatedFeaturesInUIKit>;\n uikitOptions?: PartialDeep<{\n common: SBUConfig['common'];\n groupChannel: Omit<SBUConfig['groupChannel']['channel'], UnimplementedFeatures> & {\n replyType: Extract<SBUConfig['groupChannel']['channel']['replyType'], 'none' | 'quote_reply'>;\n };\n groupChannelList: SBUConfig['groupChannel']['channelList'];\n groupChannelSettings: SBUConfig['groupChannel']['setting'];\n openChannel: SBUConfig['openChannel']['channel'];\n }>;\n localization?: {\n stringSet?: StringSet;\n };\n styles?: {\n theme?: UIKitTheme;\n statusBarTranslucent?: boolean;\n defaultHeaderTitleAlign?: 'left' | 'center';\n defaultHeaderHeight?: number;\n HeaderComponent?: HeaderStyleContextType['HeaderComponent'];\n };\n errorBoundary?: {\n disabled?: boolean;\n onError?: (props: ErrorBoundaryProps) => void;\n ErrorInfoComponent?: (props: ErrorBoundaryProps) => React.ReactNode;\n };\n toast?: {\n dismissTimeout?: number;\n };\n userProfile?: {\n onCreateChannel: (channel: SendbirdGroupChannel) => void;\n onBeforeCreateChannel?: (\n channelParams: SendbirdGroupChannelCreateParams,\n users: SendbirdUser[] | SendbirdMember[],\n ) => SendbirdGroupChannelCreateParams | Promise<SendbirdGroupChannelCreateParams>;\n };\n reaction?: {\n onPressUserProfile?: (user: SendbirdUser | SendbirdMember) => void;\n };\n userMention?: Pick<Partial<MentionConfigInterface>, 'mentionLimit' | 'suggestionLimit' | 'debounceMills'>;\n imageCompression?: Partial<ImageCompressionConfigInterface>;\n voiceMessage?: PartialDeep<VoiceMessageConfigInterface>;\n}>;\n\nconst SendbirdUIKitContainer = (props: SendbirdUIKitContainerProps) => {\n const {\n children,\n appId,\n chatOptions,\n uikitOptions,\n platformServices,\n localization,\n styles,\n errorBoundary,\n toast,\n userProfile,\n reaction,\n } = props;\n\n if (!chatOptions.localCacheStorage) {\n throw new Error('SendbirdUIKitContainer: chatOptions.localCacheStorage is required');\n }\n\n const defaultStringSet = localization?.stringSet ?? StringSetEn;\n\n const isFirstMount = useIsFirstMount();\n const unsubscribes = useRef<Array<() => void>>([]);\n\n const [internalStorage] = useState(() => new InternalLocalCacheStorage(chatOptions.localCacheStorage));\n const [sdkInstance, setSdkInstance] = useState<SendbirdChatSDK>(() => {\n const sendbird = initializeSendbird(appId, { internalStorage, ...sanitizeChatOptions(chatOptions) });\n unsubscribes.current = sendbird.unsubscribes;\n return sendbird.chatSDK;\n });\n\n const { imageCompressionConfig, voiceMessageConfig, mentionConfig } = useConfigInstance(props);\n const emojiManager = useMemo(() => new EmojiManager(internalStorage), [internalStorage]);\n const mentionManager = useMemo(() => new MentionManager(mentionConfig), [mentionConfig]);\n\n useLayoutEffect(() => {\n if (!isFirstMount) {\n const sendbird = initializeSendbird(appId, { internalStorage, ...sanitizeChatOptions(chatOptions) });\n setSdkInstance(sendbird.chatSDK);\n unsubscribes.current = sendbird.unsubscribes;\n }\n\n return () => {\n unsubscribes.current.forEach((u) => {\n try {\n u();\n } catch {}\n });\n };\n }, [appId, internalStorage]);\n\n const renderChildren = () => {\n if (errorBoundary?.disabled) {\n return children;\n } else {\n return <InternalErrorBoundaryContainer {...errorBoundary}>{children}</InternalErrorBoundaryContainer>;\n }\n };\n\n return (\n <SafeAreaProvider>\n <UIKitConfigProvider\n storage={internalStorage}\n localConfigs={{\n common: uikitOptions?.common,\n groupChannel: {\n channel: uikitOptions?.groupChannel,\n channelList: uikitOptions?.groupChannelList,\n setting: uikitOptions?.groupChannelSettings,\n },\n openChannel: {\n channel: uikitOptions?.openChannel,\n },\n }}\n >\n <SendbirdChatProvider\n sdkInstance={sdkInstance}\n emojiManager={emojiManager}\n mentionManager={mentionManager}\n imageCompressionConfig={imageCompressionConfig}\n voiceMessageConfig={voiceMessageConfig}\n enableAutoPushTokenRegistration={\n chatOptions.enableAutoPushTokenRegistration ?? SendbirdUIKit.DEFAULT.AUTO_PUSH_TOKEN_REGISTRATION\n }\n enableUseUserIdForNickname={\n chatOptions.enableUseUserIdForNickname ?? SendbirdUIKit.DEFAULT.USE_USER_ID_FOR_NICKNAME\n }\n enableImageCompression={chatOptions.enableImageCompression ?? SendbirdUIKit.DEFAULT.IMAGE_COMPRESSION}\n >\n <LocalizationProvider stringSet={defaultStringSet}>\n <PlatformServiceProvider\n fileService={platformServices.file}\n notificationService={platformServices.notification}\n clipboardService={platformServices.clipboard}\n mediaService={platformServices.media}\n playerService={platformServices.player}\n recorderService={platformServices.recorder}\n voiceMessageConfig={voiceMessageConfig}\n >\n <UIKitThemeProvider theme={styles?.theme ?? LightUIKitTheme}>\n <HeaderStyleProvider\n HeaderComponent={styles?.HeaderComponent ?? Header}\n defaultTitleAlign={styles?.defaultHeaderTitleAlign ?? 'left'}\n statusBarTranslucent={styles?.statusBarTranslucent ?? true}\n >\n <ToastProvider dismissTimeout={toast?.dismissTimeout}>\n <UserProfileProvider {...userProfile} statusBarTranslucent={styles?.statusBarTranslucent ?? true}>\n <ReactionProvider {...reaction}>\n <LocalizationContext.Consumer>\n {(value) => {\n const STRINGS = value?.STRINGS || defaultStringSet;\n return (\n <DialogProvider\n defaultLabels={{\n alert: { ok: STRINGS.DIALOG.ALERT_DEFAULT_OK },\n prompt: {\n ok: STRINGS.DIALOG.PROMPT_DEFAULT_OK,\n cancel: STRINGS.DIALOG.PROMPT_DEFAULT_CANCEL,\n placeholder: STRINGS.DIALOG.PROMPT_DEFAULT_PLACEHOLDER,\n },\n }}\n >\n {renderChildren()}\n </DialogProvider>\n );\n }}\n </LocalizationContext.Consumer>\n </ReactionProvider>\n </UserProfileProvider>\n </ToastProvider>\n </HeaderStyleProvider>\n </UIKitThemeProvider>\n </PlatformServiceProvider>\n </LocalizationProvider>\n </SendbirdChatProvider>\n </UIKitConfigProvider>\n </SafeAreaProvider>\n );\n};\n\ninterface InitOptions extends ChatOmittedInitParams {\n internalStorage: InternalLocalCacheStorage;\n onInitialized?: (sdk: SendbirdChatSDK) => SendbirdChatSDK;\n}\nconst initializeSendbird = (appId: string, options: InitOptions) => {\n let chatSDK: SendbirdChatSDK;\n const unsubscribes: Array<() => void> = [];\n const { internalStorage, onInitialized, ...chatInitParams } = options;\n\n chatSDK = SendbirdChat.init({\n ...chatInitParams,\n appId,\n newInstance: true,\n modules: [new GroupChannelModule(), new OpenChannelModule()],\n localCacheEnabled: true,\n useAsyncStorageStore: internalStorage as never,\n });\n\n if (onInitialized) {\n chatSDK = onInitialized(chatSDK);\n }\n\n const platform = getDeviceOSPlatform();\n if (SendbirdUIKit.VERSION && platform) {\n const deviceOSInfo = { platform, version: String(Platform.Version) };\n const customData = { platform_version: getReactNativeVersion() };\n const uikitExtension = {\n product: SendbirdProduct.UIKIT_CHAT,\n version: SendbirdUIKit.VERSION,\n platform: SendbirdPlatform.REACT_NATIVE,\n };\n\n chatSDK.addSendbirdExtensions([uikitExtension], deviceOSInfo, customData);\n chatSDK.addExtension('sb_uikit', SendbirdUIKit.VERSION);\n }\n\n if (SendbirdUIKit.PLATFORM) {\n chatSDK.addExtension('device-os-platform', SendbirdUIKit.PLATFORM);\n }\n\n if (NetInfo?.addEventListener) {\n try {\n // NOTE: For removing buggy behavior of NetInfo.addEventListener\n // When you first add an event listener, it is assumed that the initialization of the internal event detector is done simultaneously.\n // In other words, when you call the first event listener two events are triggered immediately\n // - the one that is called when adding the event listener\n // - and the internal initialization event\n NetInfo.addEventListener(NOOP)();\n } catch {}\n\n const listener = (callback: () => void, callbackType: 'online' | 'offline') => {\n let callCount = 0;\n const unsubscribe = NetInfo.addEventListener((state) => {\n const online = Boolean(state.isConnected) || Boolean(state.isInternetReachable);\n\n // NOTE: When NetInfo.addEventListener is called\n // the event is immediately triggered regardless of whether the event actually occurred.\n // This is why it filters the first event.\n if (callCount === 0) {\n callCount++;\n return;\n }\n\n if (online && callbackType === 'online') callback();\n if (!online && callbackType === 'offline') callback();\n });\n unsubscribes.push(unsubscribe);\n return unsubscribe;\n };\n chatSDK.setOnlineListener?.((onOnline) => listener(onOnline, 'online'));\n chatSDK.setOfflineListener?.((onOffline) => listener(onOffline, 'offline'));\n }\n return { chatSDK, unsubscribes };\n};\n\nfunction getDeviceOSPlatform() {\n switch (Platform.OS) {\n case 'android':\n return DeviceOsPlatform.ANDROID;\n case 'ios':\n return DeviceOsPlatform.IOS;\n case 'web':\n return DeviceOsPlatform.WEB;\n case 'windows':\n return DeviceOsPlatform.WINDOWS;\n default:\n return undefined;\n }\n}\n\nfunction getReactNativeVersion() {\n const { major, minor, patch } = Platform.constants.reactNativeVersion;\n return `${major}.${minor}.${patch}`;\n}\n\nconst useConfigInstance = ({ imageCompression, userMention, voiceMessage }: SendbirdUIKitContainerProps) => {\n const mentionConfig = useMemo(() => {\n return new MentionConfig({\n mentionLimit: userMention?.mentionLimit || MentionConfig.DEFAULT.MENTION_LIMIT,\n suggestionLimit: userMention?.suggestionLimit || MentionConfig.DEFAULT.SUGGESTION_LIMIT,\n debounceMills: userMention?.debounceMills ?? MentionConfig.DEFAULT.DEBOUNCE_MILLS,\n delimiter: MentionConfig.DEFAULT.DELIMITER,\n trigger: MentionConfig.DEFAULT.TRIGGER,\n });\n }, [userMention?.mentionLimit, userMention?.suggestionLimit, userMention?.debounceMills]);\n\n const imageCompressionConfig = useMemo(() => {\n return new ImageCompressionConfig({\n compressionRate: imageCompression?.compressionRate || ImageCompressionConfig.DEFAULT.COMPRESSION_RATE,\n width: imageCompression?.width,\n height: imageCompression?.height,\n });\n }, [imageCompression?.compressionRate, imageCompression?.width, imageCompression?.height]);\n\n const voiceMessageConfig = useMemo(() => {\n return new VoiceMessageConfig({\n recorder: {\n minDuration: voiceMessage?.recorder?.minDuration ?? VoiceMessageConfig.DEFAULT.RECORDER.MIN_DURATION,\n maxDuration: voiceMessage?.recorder?.maxDuration ?? VoiceMessageConfig.DEFAULT.RECORDER.MAX_DURATION,\n },\n });\n }, [voiceMessage?.recorder?.minDuration, voiceMessage?.recorder?.maxDuration]);\n\n return {\n mentionConfig,\n imageCompressionConfig,\n voiceMessageConfig,\n };\n};\n\nexport default SendbirdUIKitContainer;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAEA,IAAAM,2BAAA,GAAAN,OAAA;AAQA,IAAAO,WAAA,GAAAP,OAAA;AASA,IAAAQ,WAAA,GAAAR,OAAA;AAEA,IAAAS,gBAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AAEA,IAAAY,gBAAA,GAAAZ,OAAA;AACA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAC,sBAAA,CAAAf,OAAA;AAEA,IAAAgB,uBAAA,GAAAD,sBAAA,CAAAf,OAAA;AACA,IAAAiB,0BAAA,GAAAF,sBAAA,CAAAf,OAAA;AACA,IAAAkB,cAAA,GAAAH,sBAAA,CAAAf,OAAA;AACA,IAAAmB,eAAA,GAAAJ,sBAAA,CAAAf,OAAA;AACA,IAAAoB,mBAAA,GAAAL,sBAAA,CAAAf,OAAA;AACA,IAAAqB,UAAA,GAAAN,sBAAA,CAAAf,OAAA;AAEA,IAAAsB,cAAA,GAAAP,sBAAA,CAAAf,OAAA;AAUA,IAAAuB,QAAA,GAAAR,sBAAA,CAAAf,OAAA;AACA,IAAAwB,+BAAA,GAAAT,sBAAA,CAAAf,OAAA;AAA8E,SAAAe,uBAAAU,GAAA,WAAAA,GAAA,IAAA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BAAAiB,qBAAA,GAAZjB,YAAY,CAAE/F,QAAQ,cAAAgH,qBAAA,uBAAtBA,qBAAA,CAAwBG,WAAW,KAAID,2BAAkB,CAACrM,OAAO,CAACuM,QAAQ,CAACC,YAAY;QACpGC,WAAW,EAAE,CAAAvB,YAAY,aAAZA,YAAY,wBAAAkB,sBAAA,GAAZlB,YAAY,CAAE/F,QAAQ,cAAAiH,sBAAA,uBAAtBA,sBAAA,CAAwBK,WAAW,KAAIJ,2BAAkB,CAACrM,OAAO,CAACuM,QAAQ,CAACG;MAC1F;IACF,CAAC,CAAC;EACJ,CAAC,EAAE,CAACxB,YAAY,aAAZA,YAAY,wBAAAJ,sBAAA,GAAZI,YAAY,CAAE/F,QAAQ,cAAA2F,sBAAA,uBAAtBA,sBAAA,CAAwBwB,WAAW,EAAEpB,YAAY,aAAZA,YAAY,wBAAAH,sBAAA,GAAZG,YAAY,CAAE/F,QAAQ,cAAA4F,sBAAA,uBAAtBA,sBAAA,CAAwB0B,WAAW,CAAC,CAAC;EAE9E,OAAO;IACL/J,aAAa;IACbF,sBAAsB;IACtBC;EACF,CAAC;AACH,CAAC;AAAC,IAAAkK,QAAA,GAEajM,sBAAsB;AAAAN,OAAA,CAAA1C,OAAA,GAAAiP,QAAA"}
|
|
@@ -4,25 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.PlatformServiceProvider = exports.PlatformServiceContext = void 0;
|
|
7
|
-
var _react =
|
|
8
|
-
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _uikitUtils = require("@sendbird/uikit-utils");
|
|
9
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
9
11
|
const PlatformServiceContext = /*#__PURE__*/_react.default.createContext(null);
|
|
10
12
|
exports.PlatformServiceContext = PlatformServiceContext;
|
|
11
13
|
const PlatformServiceProvider = _ref => {
|
|
12
14
|
let {
|
|
13
15
|
children,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
notificationService,
|
|
17
|
-
mediaService
|
|
16
|
+
voiceMessageConfig,
|
|
17
|
+
...services
|
|
18
18
|
} = _ref;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
(0, _react.useEffect)(() => {
|
|
20
|
+
services.recorderService.options.minDuration = voiceMessageConfig.recorder.minDuration;
|
|
21
|
+
services.recorderService.options.maxDuration = voiceMessageConfig.recorder.maxDuration;
|
|
22
|
+
}, [voiceMessageConfig]);
|
|
23
|
+
(0, _uikitUtils.useAppState)('change', state => {
|
|
24
|
+
if (state !== 'active') {
|
|
25
|
+
Promise.allSettled([services.playerService.reset(), services.recorderService.reset()]);
|
|
25
26
|
}
|
|
27
|
+
});
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement(PlatformServiceContext.Provider, {
|
|
29
|
+
value: services
|
|
26
30
|
}, children);
|
|
27
31
|
};
|
|
28
32
|
exports.PlatformServiceProvider = PlatformServiceProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_uikitUtils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","PlatformServiceContext","React","createContext","exports","PlatformServiceProvider","_ref","children","voiceMessageConfig","services","useEffect","recorderService","options","minDuration","recorder","maxDuration","useAppState","state","Promise","allSettled","playerService","reset","createElement","Provider","value"],"sources":["PlatformServiceCtx.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\nimport { useAppState } from '@sendbird/uikit-utils';\n\nimport VoiceMessageConfig from '../libs/VoiceMessageConfig';\nimport type {\n ClipboardServiceInterface,\n FileServiceInterface,\n MediaServiceInterface,\n NotificationServiceInterface,\n PlayerServiceInterface,\n RecorderServiceInterface,\n} from '../platform/types';\n\nexport type PlatformServiceContextType = {\n fileService: FileServiceInterface;\n clipboardService: ClipboardServiceInterface;\n notificationService: NotificationServiceInterface;\n mediaService: MediaServiceInterface;\n recorderService: RecorderServiceInterface;\n playerService: PlayerServiceInterface;\n};\ntype Props = React.PropsWithChildren<PlatformServiceContextType & { voiceMessageConfig: VoiceMessageConfig }>;\n\nexport const PlatformServiceContext = React.createContext<PlatformServiceContextType | null>(null);\nexport const PlatformServiceProvider = ({ children, voiceMessageConfig, ...services }: Props) => {\n useEffect(() => {\n services.recorderService.options.minDuration = voiceMessageConfig.recorder.minDuration;\n services.recorderService.options.maxDuration = voiceMessageConfig.recorder.maxDuration;\n }, [voiceMessageConfig]);\n\n useAppState('change', (state) => {\n if (state !== 'active') {\n Promise.allSettled([services.playerService.reset(), services.recorderService.reset()]);\n }\n });\n\n return <PlatformServiceContext.Provider value={services}>{children}</PlatformServiceContext.Provider>;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,u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AH,sBAAA,GAAAA,sBAAA;AAC5F,MAAMI,uBAAuB,GAAGC,IAAA,IAA0D;EAAA,IAAzD;IAAEC,QAAQ;IAAEC,kBAAkB;IAAE,GAAGC;EAAgB,CAAC,GAAAH,IAAA;EAC1F,IAAAI,gBAAS,EAAC,MAAM;IACdD,QAAQ,CAACE,eAAe,CAACC,OAAO,CAACC,WAAW,GAAGL,kBAAkB,CAACM,QAAQ,CAACD,WAAW;IACtFJ,QAAQ,CAACE,eAAe,CAACC,OAAO,CAACG,WAAW,GAAGP,kBAAkB,CAACM,QAAQ,CAACC,WAAW;EACxF,CAAC,EAAE,CAACP,kBAAkB,CAAC,CAAC;EAExB,IAAAQ,uBAAW,EAAC,QAAQ,EAAGC,KAAK,IAAK;IAC/B,IAAIA,KAAK,KAAK,QAAQ,EAAE;MACtBC,OAAO,CAACC,UAAU,CAAC,CAACV,QAAQ,CAACW,aAAa,CAACC,KAAK,EAAE,EAAEZ,QAAQ,CAACE,eAAe,CAACU,KAAK,EAAE,CAAC,CAAC;IACxF;EACF,CAAC,CAAC;EAEF,oBAAO9C,MAAA,CAAAW,OAAA,CAAAoC,aAAA,CAACrB,sBAAsB,CAACsB,QAAQ;IAACC,KAAK,EAAEf;EAAS,GAAEF,QAAQ,CAAmC;AACvG,CAAC;AAACH,OAAA,CAAAC,uBAAA,GAAAA,uBAAA"}
|
|
@@ -17,7 +17,8 @@ const ReactionContext = /*#__PURE__*/_react.default.createContext(null);
|
|
|
17
17
|
exports.ReactionContext = ReactionContext;
|
|
18
18
|
const ReactionProvider = _ref => {
|
|
19
19
|
let {
|
|
20
|
-
children
|
|
20
|
+
children,
|
|
21
|
+
onPressUserProfile
|
|
21
22
|
} = _ref;
|
|
22
23
|
const chatCtx = (0, _react.useContext)(_SendbirdChatCtx.SendbirdChatContext);
|
|
23
24
|
const localizationCtx = (0, _react.useContext)(_LocalizationCtx.LocalizationContext);
|
|
@@ -72,7 +73,7 @@ const ReactionProvider = _ref => {
|
|
|
72
73
|
chatCtx,
|
|
73
74
|
reactionCtx,
|
|
74
75
|
localizationCtx,
|
|
75
|
-
userProfileCtx,
|
|
76
|
+
onPressUserProfile: onPressUserProfile ?? userProfileCtx.show,
|
|
76
77
|
onDismiss: () => {
|
|
77
78
|
var _closeResolver$curren;
|
|
78
79
|
setState({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_uikitUtils","_ReactionBottomSheets","_LocalizationCtx","_SendbirdChatCtx","_UserProfileCtx","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","ReactionContext","React","createContext","exports","ReactionProvider","_ref","children","chatCtx","useContext","SendbirdChatContext","localizationCtx","LocalizationContext","userProfileCtx","UserProfileContext","Error","state","setState","useReducer","prev","next","reactionListVisible","setReactionListVisible","useState","reactionUserListVisible","setReactionUserListVisible","reactionUserListFocusIndex","setReactionUserListFocusIndex","closeResolver","useRef","NOOP","openReactionList","useCallback","params","openReactionUserList","_ref2","channel","message","focusIndex","updateReactionFocusedItem","createOnCloseWithResolver","callback","Promise","resolve","current","reactionCtx","sheetProps","onDismiss","_closeResolver$curren","createElement","Provider","value","ReactionBottomSheets","UserList","visible","onClose","ReactionList"],"sources":["ReactionCtx.tsx"],"sourcesContent":["import React, { useCallback, useContext, useReducer, useRef, useState } from 'react';\n\nimport type { SendbirdBaseChannel, SendbirdBaseMessage } from '@sendbird/uikit-utils';\nimport { NOOP } from '@sendbird/uikit-utils';\n\nimport { ReactionBottomSheets } from '../components/ReactionBottomSheets';\nimport { LocalizationContext } from '../contexts/LocalizationCtx';\nimport { SendbirdChatContext } from '../contexts/SendbirdChatCtx';\nimport { UserProfileContext } from '../contexts/UserProfileCtx';\n\ntype State = {\n message?: SendbirdBaseMessage;\n channel?: SendbirdBaseChannel;\n};\nexport type ReactionContextType = {\n openReactionList(param: Required<State>): void;\n openReactionUserList(param: Required<State> & { focusIndex?: number }): void;\n updateReactionFocusedItem(param?: State): void;\n focusIndex: number;\n} & State;\n\ntype Props = React.PropsWithChildren<{}>;\n\nexport const ReactionContext = React.createContext<ReactionContextType | null>(null);\nexport const ReactionProvider = ({ children }: Props) => {\n const chatCtx = useContext(SendbirdChatContext);\n const localizationCtx = useContext(LocalizationContext);\n const userProfileCtx = useContext(UserProfileContext);\n if (!chatCtx) throw new Error('SendbirdChatContext is not provided');\n if (!localizationCtx) throw new Error('LocalizationContext is not provided');\n if (!userProfileCtx) throw new Error('UserProfileContext is not provided');\n\n const [state, setState] = useReducer((prev: State, next: State) => ({ ...prev, ...next }), {});\n const [reactionListVisible, setReactionListVisible] = useState(false);\n const [reactionUserListVisible, setReactionUserListVisible] = useState(false);\n const [reactionUserListFocusIndex, setReactionUserListFocusIndex] = useState(0);\n\n const closeResolver = useRef<() => void>(NOOP);\n\n const openReactionList: ReactionContextType['openReactionList'] = useCallback((params) => {\n setState(params);\n setReactionListVisible(true);\n }, []);\n\n const openReactionUserList: ReactionContextType['openReactionUserList'] = useCallback(\n ({ channel, message, focusIndex = 0 }) => {\n setState({ channel, message });\n setReactionUserListFocusIndex(focusIndex);\n setReactionUserListVisible(true);\n },\n [],\n );\n\n const updateReactionFocusedItem: ReactionContextType['updateReactionFocusedItem'] = useCallback((params) => {\n if (params) setState(params);\n else setState({});\n }, []);\n\n const createOnCloseWithResolver = (callback: () => void) => {\n return () => {\n return new Promise<void>((resolve) => {\n closeResolver.current = resolve;\n callback();\n });\n };\n };\n\n const reactionCtx = {\n ...state,\n openReactionList,\n openReactionUserList,\n updateReactionFocusedItem,\n focusIndex: reactionUserListFocusIndex,\n };\n\n const sheetProps = {\n chatCtx,\n reactionCtx,\n localizationCtx,\n userProfileCtx,\n onDismiss: () => {\n setState({});\n closeResolver.current?.();\n },\n };\n\n return (\n <ReactionContext.Provider value={reactionCtx}>\n {children}\n <ReactionBottomSheets.UserList\n {...sheetProps}\n visible={reactionUserListVisible}\n onClose={createOnCloseWithResolver(() => setReactionUserListVisible(false))}\n />\n <ReactionBottomSheets.ReactionList\n {...sheetProps}\n visible={reactionListVisible}\n onClose={createOnCloseWithResolver(() => setReactionListVisible(false))}\n />\n </ReactionContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAAgE,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAAA,SAAAW,SAAA,IAAAA,QAAA,GAAAT,MAAA,CAAAU,MAAA,GAAAV,MAAA,CAAAU,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAV,GAAA,IAAAa,MAAA,QAAAhB,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAU,MAAA,EAAAb,GAAA,KAAAS,MAAA,CAAAT,GAAA,IAAAa,MAAA,CAAAb,GAAA,gBAAAS,MAAA,YAAAH,QAAA,CAAAQ,KAAA,OAAAH,SAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_uikitUtils","_ReactionBottomSheets","_LocalizationCtx","_SendbirdChatCtx","_UserProfileCtx","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","ReactionContext","React","createContext","exports","ReactionProvider","_ref","children","onPressUserProfile","chatCtx","useContext","SendbirdChatContext","localizationCtx","LocalizationContext","userProfileCtx","UserProfileContext","Error","state","setState","useReducer","prev","next","reactionListVisible","setReactionListVisible","useState","reactionUserListVisible","setReactionUserListVisible","reactionUserListFocusIndex","setReactionUserListFocusIndex","closeResolver","useRef","NOOP","openReactionList","useCallback","params","openReactionUserList","_ref2","channel","message","focusIndex","updateReactionFocusedItem","createOnCloseWithResolver","callback","Promise","resolve","current","reactionCtx","sheetProps","show","onDismiss","_closeResolver$curren","createElement","Provider","value","ReactionBottomSheets","UserList","visible","onClose","ReactionList"],"sources":["ReactionCtx.tsx"],"sourcesContent":["import React, { useCallback, useContext, useReducer, useRef, useState } from 'react';\n\nimport type { SendbirdBaseChannel, SendbirdBaseMessage } from '@sendbird/uikit-utils';\nimport { NOOP } from '@sendbird/uikit-utils';\n\nimport { ReactionBottomSheetProps, ReactionBottomSheets } from '../components/ReactionBottomSheets';\nimport { LocalizationContext } from '../contexts/LocalizationCtx';\nimport { SendbirdChatContext } from '../contexts/SendbirdChatCtx';\nimport { UserProfileContext } from '../contexts/UserProfileCtx';\n\ntype State = {\n message?: SendbirdBaseMessage;\n channel?: SendbirdBaseChannel;\n};\nexport type ReactionContextType = {\n openReactionList(param: Required<State>): void;\n openReactionUserList(param: Required<State> & { focusIndex?: number }): void;\n updateReactionFocusedItem(param?: State): void;\n focusIndex: number;\n} & State;\n\ntype Props = React.PropsWithChildren<{\n onPressUserProfile?: ReactionBottomSheetProps['onPressUserProfile'];\n}>;\n\nexport const ReactionContext = React.createContext<ReactionContextType | null>(null);\nexport const ReactionProvider = ({ children, onPressUserProfile }: Props) => {\n const chatCtx = useContext(SendbirdChatContext);\n const localizationCtx = useContext(LocalizationContext);\n const userProfileCtx = useContext(UserProfileContext);\n if (!chatCtx) throw new Error('SendbirdChatContext is not provided');\n if (!localizationCtx) throw new Error('LocalizationContext is not provided');\n if (!userProfileCtx) throw new Error('UserProfileContext is not provided');\n\n const [state, setState] = useReducer((prev: State, next: State) => ({ ...prev, ...next }), {});\n const [reactionListVisible, setReactionListVisible] = useState(false);\n const [reactionUserListVisible, setReactionUserListVisible] = useState(false);\n const [reactionUserListFocusIndex, setReactionUserListFocusIndex] = useState(0);\n\n const closeResolver = useRef<() => void>(NOOP);\n\n const openReactionList: ReactionContextType['openReactionList'] = useCallback((params) => {\n setState(params);\n setReactionListVisible(true);\n }, []);\n\n const openReactionUserList: ReactionContextType['openReactionUserList'] = useCallback(\n ({ channel, message, focusIndex = 0 }) => {\n setState({ channel, message });\n setReactionUserListFocusIndex(focusIndex);\n setReactionUserListVisible(true);\n },\n [],\n );\n\n const updateReactionFocusedItem: ReactionContextType['updateReactionFocusedItem'] = useCallback((params) => {\n if (params) setState(params);\n else setState({});\n }, []);\n\n const createOnCloseWithResolver = (callback: () => void) => {\n return () => {\n return new Promise<void>((resolve) => {\n closeResolver.current = resolve;\n callback();\n });\n };\n };\n\n const reactionCtx = {\n ...state,\n openReactionList,\n openReactionUserList,\n updateReactionFocusedItem,\n focusIndex: reactionUserListFocusIndex,\n };\n\n const sheetProps: Omit<ReactionBottomSheetProps, 'visible' | 'onClose'> = {\n chatCtx,\n reactionCtx,\n localizationCtx,\n onPressUserProfile: onPressUserProfile ?? userProfileCtx.show,\n onDismiss: () => {\n setState({});\n closeResolver.current?.();\n },\n };\n\n return (\n <ReactionContext.Provider value={reactionCtx}>\n {children}\n <ReactionBottomSheets.UserList\n {...sheetProps}\n visible={reactionUserListVisible}\n onClose={createOnCloseWithResolver(() => setReactionUserListVisible(false))}\n />\n <ReactionBottomSheets.ReactionList\n {...sheetProps}\n visible={reactionListVisible}\n onClose={createOnCloseWithResolver(() => setReactionListVisible(false))}\n />\n </ReactionContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAAgE,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA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AAA,IAAAC,qBAAA;MACfhC,QAAQ,CAAC,CAAC,CAAC,CAAC;MACZ,CAAAgC,qBAAA,GAAArB,aAAa,CAACgB,OAAO,cAAAK,qBAAA,uBAArBA,qBAAA,CAAA7D,IAAA,CAAAwC,aAAa,CAAY;IAC3B;EACF,CAAC;EAED,oBACEnE,MAAA,CAAAe,OAAA,CAAA0E,aAAA,CAAClD,eAAe,CAACmD,QAAQ;IAACC,KAAK,EAAEP;EAAY,GAC1CvC,QAAQ,eACT7C,MAAA,CAAAe,OAAA,CAAA0E,aAAA,CAACrF,qBAAA,CAAAwF,oBAAoB,CAACC,QAAQ,EAAA/D,QAAA,KACxBuD,UAAU;IACdS,OAAO,EAAE/B,uBAAwB;IACjCgC,OAAO,EAAEhB,yBAAyB,CAAC,MAAMf,0BAA0B,CAAC,KAAK,CAAC;EAAE,GAC5E,eACFhE,MAAA,CAAAe,OAAA,CAAA0E,aAAA,CAACrF,qBAAA,CAAAwF,oBAAoB,CAACI,YAAY,EAAAlE,QAAA,KAC5BuD,UAAU;IACdS,OAAO,EAAElC,mBAAoB;IAC7BmC,OAAO,EAAEhB,yBAAyB,CAAC,MAAMlB,sBAAsB,CAAC,KAAK,CAAC;EAAE,GACxE,CACuB;AAE/B,CAAC;AAACnB,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
|
|
@@ -19,6 +19,7 @@ const SendbirdChatProvider = _ref => {
|
|
|
19
19
|
emojiManager,
|
|
20
20
|
mentionManager,
|
|
21
21
|
imageCompressionConfig,
|
|
22
|
+
voiceMessageConfig,
|
|
22
23
|
enableAutoPushTokenRegistration,
|
|
23
24
|
enableUseUserIdForNickname,
|
|
24
25
|
enableImageCompression
|
|
@@ -74,6 +75,7 @@ const SendbirdChatProvider = _ref => {
|
|
|
74
75
|
emojiManager,
|
|
75
76
|
mentionManager,
|
|
76
77
|
imageCompressionConfig,
|
|
78
|
+
voiceMessageConfig,
|
|
77
79
|
currentUser,
|
|
78
80
|
setCurrentUser,
|
|
79
81
|
updateCurrentUserInfo,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_uikitChatHooks","_uikitTools","_uikitUtils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SendbirdChatContext","React","createContext","exports","SendbirdChatProvider","_ref","children","sdkInstance","emojiManager","mentionManager","imageCompressionConfig","enableAutoPushTokenRegistration","enableUseUserIdForNickname","enableImageCompression","currentUser","_setCurrentUser","useState","forceUpdate","useForceUpdate","appFeatures","useAppFeatures","configs","configsWithAppAttr","useUIKitConfig","setCurrentUser","useCallback","user","updateCurrentUserInfo","nickname","profile","Error","params","profileUrl","profileImage","markAsDeliveredWithChannel","channel","deliveryReceiptEnabled","confirmAndMarkAsDelivered","useAppState","status","connectionState","setForegroundState","setBackgroundState","useEffect","disconnect","then","undefined","value","sdk","sbOptions","appInfo","uikit","uikitWithAppInfo","chat","autoPushTokenRegistrationEnabled","useUserIdForNicknameEnabled","imageCompressionEnabled","createElement","Provider"],"sources":["SendbirdChatCtx.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\n\nimport { useAppFeatures } from '@sendbird/uikit-chat-hooks';\nimport { SBUConfig, useUIKitConfig } from '@sendbird/uikit-tools';\nimport type {\n SendbirdChatSDK,\n SendbirdGroupChannel,\n SendbirdUser,\n SendbirdUserUpdateParams,\n} from '@sendbird/uikit-utils';\nimport { confirmAndMarkAsDelivered, useAppState, useForceUpdate } from '@sendbird/uikit-utils';\n\nimport type EmojiManager from '../libs/EmojiManager';\nimport type ImageCompressionConfig from '../libs/ImageCompressionConfig';\nimport type MentionManager from '../libs/MentionManager';\nimport type { FileType } from '../platform/types';\n\nexport interface ChatRelatedFeaturesInUIKit {\n enableAutoPushTokenRegistration: boolean;\n enableUseUserIdForNickname: boolean;\n enableImageCompression: boolean;\n}\n\ninterface Props extends ChatRelatedFeaturesInUIKit, React.PropsWithChildren {\n sdkInstance: SendbirdChatSDK;\n emojiManager: EmojiManager;\n mentionManager: MentionManager;\n imageCompressionConfig: ImageCompressionConfig;\n}\n\nexport type SendbirdChatContextType = {\n sdk: SendbirdChatSDK;\n emojiManager: EmojiManager;\n mentionManager: MentionManager;\n imageCompressionConfig: ImageCompressionConfig;\n currentUser?: SendbirdUser;\n setCurrentUser: React.Dispatch<React.SetStateAction<SendbirdUser | undefined>>;\n\n // helper functions\n updateCurrentUserInfo: (nickname?: string, profile?: string | FileType) => Promise<SendbirdUser>;\n markAsDeliveredWithChannel: (channel: SendbirdGroupChannel) => void;\n\n sbOptions: {\n // UIKit options\n uikit: SBUConfig;\n uikitWithAppInfo: {\n groupChannel: {\n channel: {\n enableReactions: boolean;\n enableOgtag: boolean;\n };\n setting: {\n enableMessageSearch: boolean;\n };\n };\n openChannel: {\n channel: {\n enableOgtag: boolean;\n };\n };\n };\n\n // Chat related options in UIKit\n chat: {\n imageCompressionEnabled: boolean;\n useUserIdForNicknameEnabled: boolean;\n autoPushTokenRegistrationEnabled: boolean; // RN only\n };\n\n // Sendbird application options\n appInfo: {\n deliveryReceiptEnabled: boolean;\n broadcastChannelEnabled: boolean;\n superGroupChannelEnabled: boolean;\n reactionEnabled: boolean;\n };\n };\n};\n\nexport const SendbirdChatContext = React.createContext<SendbirdChatContextType | null>(null);\nexport const SendbirdChatProvider = ({\n children,\n sdkInstance,\n emojiManager,\n mentionManager,\n imageCompressionConfig,\n enableAutoPushTokenRegistration,\n enableUseUserIdForNickname,\n enableImageCompression,\n}: Props) => {\n const [currentUser, _setCurrentUser] = useState<SendbirdUser>();\n const forceUpdate = useForceUpdate();\n const appFeatures = useAppFeatures(sdkInstance);\n const { configs, configsWithAppAttr } = useUIKitConfig();\n\n const setCurrentUser: SendbirdChatContextType['setCurrentUser'] = useCallback((user) => {\n // NOTE: Sendbird SDK handle User object is always same object, so force update after setCurrentUser\n _setCurrentUser(user);\n forceUpdate();\n }, []);\n\n const updateCurrentUserInfo: SendbirdChatContextType['updateCurrentUserInfo'] = useCallback(\n async (nickname, profile) => {\n let user = currentUser;\n\n if (!user) throw new Error('Current user is not defined, please connect using `useConnection()` hook first');\n\n const params: SendbirdUserUpdateParams = {};\n\n if (!nickname) {\n params.nickname = user.nickname;\n } else {\n params.nickname = nickname;\n }\n\n if (!profile) {\n params.profileUrl = user.profileUrl;\n } else if (typeof profile === 'string') {\n params.profileUrl = profile;\n } else if (typeof profile === 'object') {\n params.profileImage = profile;\n } else {\n throw new Error(`Cannot update profile, not supported profile type(${typeof profile})`);\n }\n\n user = await sdkInstance.updateCurrentUserInfo(params);\n\n setCurrentUser(user);\n return user;\n },\n [sdkInstance, currentUser, setCurrentUser],\n );\n\n const markAsDeliveredWithChannel: SendbirdChatContextType['markAsDeliveredWithChannel'] = useCallback(\n (channel: SendbirdGroupChannel) => {\n if (appFeatures.deliveryReceiptEnabled) confirmAndMarkAsDelivered([channel]);\n },\n [sdkInstance, appFeatures.deliveryReceiptEnabled],\n );\n\n useAppState('change', (status) => {\n // 'active' | 'background' | 'inactive' | 'unknown' | 'extension';\n if (status === 'active') sdkInstance.connectionState === 'CLOSED' && sdkInstance.setForegroundState();\n else if (status === 'background') sdkInstance.connectionState === 'OPEN' && sdkInstance.setBackgroundState();\n });\n\n useEffect(() => {\n return () => {\n sdkInstance.disconnect().then(() => _setCurrentUser(undefined));\n };\n }, [sdkInstance]);\n\n const value: SendbirdChatContextType = {\n sdk: sdkInstance,\n emojiManager,\n mentionManager,\n imageCompressionConfig,\n currentUser,\n setCurrentUser,\n\n updateCurrentUserInfo,\n markAsDeliveredWithChannel,\n\n // TODO: Options should be moved to the common area at the higher level to be passed to the context of each product.\n // For example, common -> chat context, common -> calls context\n sbOptions: {\n appInfo: appFeatures,\n uikit: configs,\n uikitWithAppInfo: configsWithAppAttr(sdkInstance),\n chat: {\n autoPushTokenRegistrationEnabled: enableAutoPushTokenRegistration,\n useUserIdForNicknameEnabled: enableUseUserIdForNickname,\n imageCompressionEnabled: enableImageCompression,\n },\n },\n };\n\n return <SendbirdChatContext.Provider value={value}>{children}</SendbirdChatContext.Provider>;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,WAAA,GAAAH,OAAA;AAA+F,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAA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EAAE,CAACvC,WAAW,CAAC,CAAC;EAEjB,MAAMwC,KAA8B,GAAG;IACrCC,GAAG,EAAEzC,WAAW;IAChBC,YAAY;IACZC,cAAc;IACdC,sBAAsB;IACtBI,WAAW;IACXU,cAAc;IAEdG,qBAAqB;IACrBO,0BAA0B;IAE1B;IACA;IACAe,SAAS,EAAE;MACTC,OAAO,EAAE/B,WAAW;MACpBgC,KAAK,EAAE9B,OAAO;MACd+B,gBAAgB,EAAE9B,kBAAkB,CAACf,WAAW,CAAC;MACjD8C,IAAI,EAAE;QACJC,gCAAgC,EAAE3C,+BAA+B;QACjE4C,2BAA2B,EAAE3C,0BAA0B;QACvD4C,uBAAuB,EAAE3C;MAC3B;IACF;EACF,CAAC;EAED,oBAAOzC,MAAA,CAAAa,OAAA,CAAAwE,aAAA,CAACzD,mBAAmB,CAAC0D,QAAQ;IAACX,KAAK,EAAEA;EAAM,GAAEzC,QAAQ,CAAgC;AAC9F,CAAC;AAACH,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_uikitChatHooks","_uikitTools","_uikitUtils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SendbirdChatContext","React","createContext","exports","SendbirdChatProvider","_ref","children","sdkInstance","emojiManager","mentionManager","imageCompressionConfig","voiceMessageConfig","enableAutoPushTokenRegistration","enableUseUserIdForNickname","enableImageCompression","currentUser","_setCurrentUser","useState","forceUpdate","useForceUpdate","appFeatures","useAppFeatures","configs","configsWithAppAttr","useUIKitConfig","setCurrentUser","useCallback","user","updateCurrentUserInfo","nickname","profile","Error","params","profileUrl","profileImage","markAsDeliveredWithChannel","channel","deliveryReceiptEnabled","confirmAndMarkAsDelivered","useAppState","status","connectionState","setForegroundState","setBackgroundState","useEffect","disconnect","then","undefined","value","sdk","sbOptions","appInfo","uikit","uikitWithAppInfo","chat","autoPushTokenRegistrationEnabled","useUserIdForNicknameEnabled","imageCompressionEnabled","createElement","Provider"],"sources":["SendbirdChatCtx.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\n\nimport { useAppFeatures } from '@sendbird/uikit-chat-hooks';\nimport { SBUConfig, useUIKitConfig } from '@sendbird/uikit-tools';\nimport type {\n SendbirdChatSDK,\n SendbirdGroupChannel,\n SendbirdUser,\n SendbirdUserUpdateParams,\n} from '@sendbird/uikit-utils';\nimport { confirmAndMarkAsDelivered, useAppState, useForceUpdate } from '@sendbird/uikit-utils';\n\nimport type EmojiManager from '../libs/EmojiManager';\nimport type ImageCompressionConfig from '../libs/ImageCompressionConfig';\nimport type MentionManager from '../libs/MentionManager';\nimport type VoiceMessageConfig from '../libs/VoiceMessageConfig';\nimport type { FileType } from '../platform/types';\n\nexport interface ChatRelatedFeaturesInUIKit {\n enableAutoPushTokenRegistration: boolean;\n enableUseUserIdForNickname: boolean;\n enableImageCompression: boolean;\n}\n\ninterface Props extends ChatRelatedFeaturesInUIKit, React.PropsWithChildren {\n sdkInstance: SendbirdChatSDK;\n\n emojiManager: EmojiManager;\n mentionManager: MentionManager;\n imageCompressionConfig: ImageCompressionConfig;\n voiceMessageConfig: VoiceMessageConfig;\n}\n\nexport type SendbirdChatContextType = {\n sdk: SendbirdChatSDK;\n currentUser?: SendbirdUser;\n setCurrentUser: React.Dispatch<React.SetStateAction<SendbirdUser | undefined>>;\n\n // feature related instances\n emojiManager: EmojiManager;\n mentionManager: MentionManager;\n imageCompressionConfig: ImageCompressionConfig;\n voiceMessageConfig: VoiceMessageConfig;\n\n // helper functions\n updateCurrentUserInfo: (nickname?: string, profile?: string | FileType) => Promise<SendbirdUser>;\n markAsDeliveredWithChannel: (channel: SendbirdGroupChannel) => void;\n\n sbOptions: {\n // UIKit options\n uikit: SBUConfig;\n uikitWithAppInfo: {\n groupChannel: {\n channel: {\n enableReactions: boolean;\n enableOgtag: boolean;\n };\n setting: {\n enableMessageSearch: boolean;\n };\n };\n openChannel: {\n channel: {\n enableOgtag: boolean;\n };\n };\n };\n\n // Chat related options in UIKit\n chat: {\n imageCompressionEnabled: boolean;\n useUserIdForNicknameEnabled: boolean;\n autoPushTokenRegistrationEnabled: boolean; // RN only\n };\n\n // Sendbird application options\n appInfo: {\n deliveryReceiptEnabled: boolean;\n broadcastChannelEnabled: boolean;\n superGroupChannelEnabled: boolean;\n reactionEnabled: boolean;\n };\n };\n};\n\nexport const SendbirdChatContext = React.createContext<SendbirdChatContextType | null>(null);\nexport const SendbirdChatProvider = ({\n children,\n sdkInstance,\n emojiManager,\n mentionManager,\n imageCompressionConfig,\n voiceMessageConfig,\n enableAutoPushTokenRegistration,\n enableUseUserIdForNickname,\n enableImageCompression,\n}: Props) => {\n const [currentUser, _setCurrentUser] = useState<SendbirdUser>();\n const forceUpdate = useForceUpdate();\n const appFeatures = useAppFeatures(sdkInstance);\n const { configs, configsWithAppAttr } = useUIKitConfig();\n\n const setCurrentUser: SendbirdChatContextType['setCurrentUser'] = useCallback((user) => {\n // NOTE: Sendbird SDK handle User object is always same object, so force update after setCurrentUser\n _setCurrentUser(user);\n forceUpdate();\n }, []);\n\n const updateCurrentUserInfo: SendbirdChatContextType['updateCurrentUserInfo'] = useCallback(\n async (nickname, profile) => {\n let user = currentUser;\n\n if (!user) throw new Error('Current user is not defined, please connect using `useConnection()` hook first');\n\n const params: SendbirdUserUpdateParams = {};\n\n if (!nickname) {\n params.nickname = user.nickname;\n } else {\n params.nickname = nickname;\n }\n\n if (!profile) {\n params.profileUrl = user.profileUrl;\n } else if (typeof profile === 'string') {\n params.profileUrl = profile;\n } else if (typeof profile === 'object') {\n params.profileImage = profile;\n } else {\n throw new Error(`Cannot update profile, not supported profile type(${typeof profile})`);\n }\n\n user = await sdkInstance.updateCurrentUserInfo(params);\n\n setCurrentUser(user);\n return user;\n },\n [sdkInstance, currentUser, setCurrentUser],\n );\n\n const markAsDeliveredWithChannel: SendbirdChatContextType['markAsDeliveredWithChannel'] = useCallback(\n (channel: SendbirdGroupChannel) => {\n if (appFeatures.deliveryReceiptEnabled) confirmAndMarkAsDelivered([channel]);\n },\n [sdkInstance, appFeatures.deliveryReceiptEnabled],\n );\n\n useAppState('change', (status) => {\n // 'active' | 'background' | 'inactive' | 'unknown' | 'extension';\n if (status === 'active') sdkInstance.connectionState === 'CLOSED' && sdkInstance.setForegroundState();\n else if (status === 'background') sdkInstance.connectionState === 'OPEN' && sdkInstance.setBackgroundState();\n });\n\n useEffect(() => {\n return () => {\n sdkInstance.disconnect().then(() => _setCurrentUser(undefined));\n };\n }, [sdkInstance]);\n\n const value: SendbirdChatContextType = {\n sdk: sdkInstance,\n emojiManager,\n mentionManager,\n imageCompressionConfig,\n voiceMessageConfig,\n currentUser,\n setCurrentUser,\n\n updateCurrentUserInfo,\n markAsDeliveredWithChannel,\n\n // TODO: Options should be moved to the common area at the higher level to be passed to the context of each product.\n // For example, common -> chat context, common -> calls context\n sbOptions: {\n appInfo: appFeatures,\n uikit: configs,\n uikitWithAppInfo: configsWithAppAttr(sdkInstance),\n chat: {\n autoPushTokenRegistrationEnabled: enableAutoPushTokenRegistration,\n useUserIdForNicknameEnabled: enableUseUserIdForNickname,\n imageCompressionEnabled: enableImageCompression,\n },\n },\n };\n\n return <SendbirdChatContext.Provider value={value}>{children}</SendbirdChatContext.Provider>;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,WAAA,GAAAH,OAAA;AAA+F,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAA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;EAED,oBAAO1C,MAAA,CAAAa,OAAA,CAAAyE,aAAA,CAAC1D,mBAAmB,CAAC2D,QAAQ;IAACX,KAAK,EAAEA;EAAM,GAAE1C,QAAQ,CAAgC;AAC9F,CAAC;AAACH,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
|
|
@@ -31,39 +31,14 @@ const GroupChannelMessageList = props => {
|
|
|
31
31
|
const {
|
|
32
32
|
subscribe
|
|
33
33
|
} = (0, _react.useContext)(_moduleContext.GroupChannelContexts.PubSub);
|
|
34
|
+
const {
|
|
35
|
+
flatListRef,
|
|
36
|
+
lazyScrollToBottom,
|
|
37
|
+
lazyScrollToIndex
|
|
38
|
+
} = (0, _react.useContext)(_moduleContext.GroupChannelContexts.MessageList);
|
|
34
39
|
const id = (0, _uikitUtils.useUniqHandlerId)('GroupChannelMessageList');
|
|
35
|
-
const ref = (0, _react.useRef)(null);
|
|
36
40
|
const isFirstMount = (0, _uikitUtils.useIsFirstMount)();
|
|
37
|
-
|
|
38
|
-
// FIXME: Workaround, should run after data has been applied to UI.
|
|
39
|
-
const lazyScrollToBottom = function () {
|
|
40
|
-
let animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
41
|
-
let timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
42
|
-
setTimeout(() => {
|
|
43
|
-
var _ref$current;
|
|
44
|
-
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.scrollToOffset({
|
|
45
|
-
offset: 0,
|
|
46
|
-
animated
|
|
47
|
-
});
|
|
48
|
-
}, timeout);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// FIXME: Workaround, should run after data has been applied to UI.
|
|
52
|
-
const lazyScrollToIndex = function () {
|
|
53
|
-
let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
54
|
-
let animated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
55
|
-
let timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
56
|
-
setTimeout(() => {
|
|
57
|
-
var _ref$current2;
|
|
58
|
-
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.scrollToIndex({
|
|
59
|
-
index,
|
|
60
|
-
animated,
|
|
61
|
-
viewPosition: 0.5
|
|
62
|
-
});
|
|
63
|
-
}, timeout);
|
|
64
|
-
};
|
|
65
|
-
const scrollToMessage = (0, _uikitUtils.useFreshCallback)(function (createdAt) {
|
|
66
|
-
let focusAnimated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
41
|
+
const scrollToMessageWithCreatedAt = (0, _uikitUtils.useFreshCallback)((createdAt, focusAnimated, timeout) => {
|
|
67
42
|
const foundMessageIndex = props.messages.findIndex(it => it.createdAt === createdAt);
|
|
68
43
|
const isIncludedInList = foundMessageIndex > -1;
|
|
69
44
|
if (isIncludedInList) {
|
|
@@ -72,7 +47,11 @@ const GroupChannelMessageList = props => {
|
|
|
72
47
|
startingPoint: createdAt
|
|
73
48
|
}), _constants.MESSAGE_FOCUS_ANIMATION_DELAY);
|
|
74
49
|
}
|
|
75
|
-
lazyScrollToIndex(
|
|
50
|
+
lazyScrollToIndex({
|
|
51
|
+
index: foundMessageIndex,
|
|
52
|
+
animated: true,
|
|
53
|
+
timeout
|
|
54
|
+
});
|
|
76
55
|
} else {
|
|
77
56
|
if (props.channel.messageOffsetTimestamp <= createdAt) {
|
|
78
57
|
if (focusAnimated) props.onUpdateSearchItem({
|
|
@@ -92,10 +71,14 @@ const GroupChannelMessageList = props => {
|
|
|
92
71
|
props.onScrolledAwayFromBottom(false);
|
|
93
72
|
props.onResetMessageList(() => {
|
|
94
73
|
props.onScrolledAwayFromBottom(false);
|
|
95
|
-
lazyScrollToBottom(
|
|
74
|
+
lazyScrollToBottom({
|
|
75
|
+
animated
|
|
76
|
+
});
|
|
96
77
|
});
|
|
97
78
|
} else {
|
|
98
|
-
lazyScrollToBottom(
|
|
79
|
+
lazyScrollToBottom({
|
|
80
|
+
animated
|
|
81
|
+
});
|
|
99
82
|
}
|
|
100
83
|
});
|
|
101
84
|
(0, _uikitChatHooks.useChannelHandler)(sdk, id, {
|
|
@@ -105,7 +88,10 @@ const GroupChannelMessageList = props => {
|
|
|
105
88
|
const isRecentMessage = recentMessage && recentMessage.messageId === event.messageId;
|
|
106
89
|
const scrollReachedBottomAndCanScroll = !props.scrolledAwayFromBottom && !props.hasNext();
|
|
107
90
|
if (isRecentMessage && scrollReachedBottomAndCanScroll) {
|
|
108
|
-
lazyScrollToBottom(
|
|
91
|
+
lazyScrollToBottom({
|
|
92
|
+
animated: true,
|
|
93
|
+
timeout: 250
|
|
94
|
+
});
|
|
109
95
|
}
|
|
110
96
|
}
|
|
111
97
|
});
|
|
@@ -131,21 +117,20 @@ const GroupChannelMessageList = props => {
|
|
|
131
117
|
}
|
|
132
118
|
});
|
|
133
119
|
}, [props.scrolledAwayFromBottom]);
|
|
134
|
-
|
|
135
|
-
// Only trigger once when message list mount with initial props.searchItem
|
|
136
|
-
// - Search screen + searchItem > mount message list
|
|
137
|
-
// - Reset message list + searchItem > re-mount message list
|
|
138
120
|
(0, _react.useEffect)(() => {
|
|
121
|
+
// Only trigger once when message list mount with initial props.searchItem
|
|
122
|
+
// - Search screen + searchItem > mount message list
|
|
123
|
+
// - Reset message list + searchItem > re-mount message list
|
|
139
124
|
if (isFirstMount && props.searchItem) {
|
|
140
|
-
|
|
125
|
+
scrollToMessageWithCreatedAt(props.searchItem.startingPoint, false, _constants.MESSAGE_SEARCH_SAFE_SCROLL_DELAY);
|
|
141
126
|
}
|
|
142
127
|
}, [isFirstMount]);
|
|
143
128
|
const onPressParentMessage = (0, _uikitUtils.useFreshCallback)(message => {
|
|
144
|
-
const canScrollToParent =
|
|
129
|
+
const canScrollToParent = scrollToMessageWithCreatedAt(message.createdAt, true, 0);
|
|
145
130
|
if (!canScrollToParent) toast.show(STRINGS.TOAST.FIND_PARENT_MSG_ERROR, 'error');
|
|
146
131
|
});
|
|
147
132
|
return /*#__PURE__*/_react.default.createElement(_ChannelMessageList.default, _extends({}, props, {
|
|
148
|
-
ref:
|
|
133
|
+
ref: flatListRef,
|
|
149
134
|
onReplyMessage: setMessageToReply,
|
|
150
135
|
onEditMessage: setMessageToEdit,
|
|
151
136
|
onPressParentMessage: onPressParentMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_uikitChatHooks","_uikitReactNativeFoundation","_uikitUtils","_ChannelMessageList","_interopRequireDefault","_constants","_useContext","_moduleContext","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","GroupChannelMessageList","props","toast","useToast","STRINGS","useLocalization","sdk","useSendbirdChat","setMessageToEdit","setMessageToReply","useContext","GroupChannelContexts","Fragment","subscribe","PubSub","id","useUniqHandlerId","ref","useRef","isFirstMount","useIsFirstMount","lazyScrollToBottom","animated","undefined","timeout","setTimeout","_ref$current","current","scrollToOffset","offset","lazyScrollToIndex","index","_ref$current2","scrollToIndex","viewPosition","scrollToMessage","useFreshCallback","createdAt","focusAnimated","foundMessageIndex","messages","findIndex","it","isIncludedInList","onUpdateSearchItem","startingPoint","MESSAGE_FOCUS_ANIMATION_DELAY","MESSAGE_SEARCH_SAFE_SCROLL_DELAY","channel","messageOffsetTimestamp","onResetMessageListWithStartingPoint","scrollToBottom","hasNext","onScrolledAwayFromBottom","onResetMessageList","useChannelHandler","onReactionUpdated","event","isDifferentChannel","recentMessage","isRecentMessage","messageId","scrollReachedBottomAndCanScroll","scrolledAwayFromBottom","useEffect","_ref","type","searchItem","onPressParentMessage","message","canScrollToParent","show","TOAST","FIND_PARENT_MSG_ERROR","createElement","onReplyMessage","onEditMessage","onPressNewMessagesButton","onPressScrollToBottomButton","_default","React","memo","exports"],"sources":["GroupChannelMessageList.tsx"],"sourcesContent":["import React, { useContext, useEffect, useRef } from 'react';\nimport type { FlatList } from 'react-native';\n\nimport { useChannelHandler } from '@sendbird/uikit-chat-hooks';\nimport { useToast } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\nimport { isDifferentChannel, useFreshCallback, useIsFirstMount, useUniqHandlerId } from '@sendbird/uikit-utils';\n\nimport ChannelMessageList from '../../../components/ChannelMessageList';\nimport { MESSAGE_FOCUS_ANIMATION_DELAY, MESSAGE_SEARCH_SAFE_SCROLL_DELAY } from '../../../constants';\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport { GroupChannelContexts } from '../module/moduleContext';\nimport type { GroupChannelProps } from '../types';\n\nconst GroupChannelMessageList = (props: GroupChannelProps['MessageList']) => {\n const toast = useToast();\n const { STRINGS } = useLocalization();\n const { sdk } = useSendbirdChat();\n const { setMessageToEdit, setMessageToReply } = useContext(GroupChannelContexts.Fragment);\n const { subscribe } = useContext(GroupChannelContexts.PubSub);\n\n const id = useUniqHandlerId('GroupChannelMessageList');\n const ref = useRef<FlatList<SendbirdMessage>>(null);\n const isFirstMount = useIsFirstMount();\n\n // FIXME: Workaround, should run after data has been applied to UI.\n const lazyScrollToBottom = (animated = false, timeout = 0) => {\n setTimeout(() => {\n ref.current?.scrollToOffset({ offset: 0, animated });\n }, timeout);\n };\n\n // FIXME: Workaround, should run after data has been applied to UI.\n const lazyScrollToIndex = (index = 0, animated = false, timeout = 0) => {\n setTimeout(() => {\n ref.current?.scrollToIndex({ index, animated, viewPosition: 0.5 });\n }, timeout);\n };\n\n const scrollToMessage = useFreshCallback((createdAt: number, focusAnimated = false): boolean => {\n const foundMessageIndex = props.messages.findIndex((it) => it.createdAt === createdAt);\n const isIncludedInList = foundMessageIndex > -1;\n\n if (isIncludedInList) {\n if (focusAnimated) {\n setTimeout(() => props.onUpdateSearchItem({ startingPoint: createdAt }), MESSAGE_FOCUS_ANIMATION_DELAY);\n }\n lazyScrollToIndex(foundMessageIndex, true, isFirstMount ? MESSAGE_SEARCH_SAFE_SCROLL_DELAY : 0);\n } else {\n if (props.channel.messageOffsetTimestamp <= createdAt) {\n if (focusAnimated) props.onUpdateSearchItem({ startingPoint: createdAt });\n props.onResetMessageListWithStartingPoint(createdAt);\n } else {\n return false;\n }\n }\n\n return true;\n });\n\n const scrollToBottom = useFreshCallback((animated = false) => {\n if (props.hasNext()) {\n props.onUpdateSearchItem(undefined);\n props.onScrolledAwayFromBottom(false);\n\n props.onResetMessageList(() => {\n props.onScrolledAwayFromBottom(false);\n lazyScrollToBottom(animated);\n });\n } else {\n lazyScrollToBottom(animated);\n }\n });\n\n useChannelHandler(sdk, id, {\n onReactionUpdated(channel, event) {\n if (isDifferentChannel(channel, props.channel)) return;\n const recentMessage = props.messages[0];\n const isRecentMessage = recentMessage && recentMessage.messageId === event.messageId;\n const scrollReachedBottomAndCanScroll = !props.scrolledAwayFromBottom && !props.hasNext();\n if (isRecentMessage && scrollReachedBottomAndCanScroll) {\n lazyScrollToBottom(true, 250);\n }\n },\n });\n\n useEffect(() => {\n return subscribe(({ type }) => {\n switch (type) {\n case 'MESSAGES_RECEIVED': {\n if (!props.scrolledAwayFromBottom) {\n scrollToBottom(true);\n }\n break;\n }\n case 'MESSAGE_SENT_SUCCESS':\n case 'MESSAGE_SENT_PENDING': {\n scrollToBottom(false);\n break;\n }\n }\n });\n }, [props.scrolledAwayFromBottom]);\n\n // Only trigger once when message list mount with initial props.searchItem\n // - Search screen + searchItem > mount message list\n // - Reset message list + searchItem > re-mount message list\n useEffect(() => {\n if (isFirstMount && props.searchItem) {\n scrollToMessage(props.searchItem.startingPoint);\n }\n }, [isFirstMount]);\n\n const onPressParentMessage = useFreshCallback((message: SendbirdMessage) => {\n const canScrollToParent = scrollToMessage(message.createdAt, true);\n if (!canScrollToParent) toast.show(STRINGS.TOAST.FIND_PARENT_MSG_ERROR, 'error');\n });\n\n return (\n <ChannelMessageList\n {...props}\n ref={ref}\n onReplyMessage={setMessageToReply}\n onEditMessage={setMessageToEdit}\n onPressParentMessage={onPressParentMessage}\n onPressNewMessagesButton={scrollToBottom}\n onPressScrollToBottomButton={scrollToBottom}\n />\n );\n};\n\nexport default React.memo(GroupChannelMessageList);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,mBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AAA+D,SAAAK,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAd,wBAAAU,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAA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C;EACJ,CAAC,EAAE,CAAClD,KAAK,CAAC8D,sBAAsB,CAAC,CAAC;;EAElC;EACA;EACA;EACA,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAI7C,YAAY,IAAIlB,KAAK,CAACkE,UAAU,EAAE;MACpChC,eAAe,CAAClC,KAAK,CAACkE,UAAU,CAACtB,aAAa,CAAC;IACjD;EACF,CAAC,EAAE,CAAC1B,YAAY,CAAC,CAAC;EAElB,MAAMiD,oBAAoB,GAAG,IAAAhC,4BAAgB,EAAEiC,OAAwB,IAAK;IAC1E,MAAMC,iBAAiB,GAAGnC,eAAe,CAACkC,OAAO,CAAChC,SAAS,EAAE,IAAI,CAAC;IAClE,IAAI,CAACiC,iBAAiB,EAAEpE,KAAK,CAACqE,IAAI,CAACnE,OAAO,CAACoE,KAAK,CAACC,qBAAqB,EAAE,OAAO,CAAC;EAClF,CAAC,CAAC;EAEF,oBACEnH,MAAA,CAAAa,OAAA,CAAAuG,aAAA,CAAC9G,mBAAA,CAAAO,OAAkB,EAAAoB,QAAA,KACbU,KAAK;IACTgB,GAAG,EAAEA,GAAI;IACT0D,cAAc,EAAElE,iBAAkB;IAClCmE,aAAa,EAAEpE,gBAAiB;IAChC4D,oBAAoB,EAAEA,oBAAqB;IAC3CS,wBAAwB,EAAE1B,cAAe;IACzC2B,2BAA2B,EAAE3B;EAAe,GAC5C;AAEN,CAAC;AAAC,IAAA4B,QAAA,gBAEaC,cAAK,CAACC,IAAI,CAACjF,uBAAuB,CAAC;AAAAkF,OAAA,CAAA/G,OAAA,GAAA4G,QAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_uikitChatHooks","_uikitReactNativeFoundation","_uikitUtils","_ChannelMessageList","_interopRequireDefault","_constants","_useContext","_moduleContext","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","GroupChannelMessageList","props","toast","useToast","STRINGS","useLocalization","sdk","useSendbirdChat","setMessageToEdit","setMessageToReply","useContext","GroupChannelContexts","Fragment","subscribe","PubSub","flatListRef","lazyScrollToBottom","lazyScrollToIndex","MessageList","id","useUniqHandlerId","isFirstMount","useIsFirstMount","scrollToMessageWithCreatedAt","useFreshCallback","createdAt","focusAnimated","timeout","foundMessageIndex","messages","findIndex","it","isIncludedInList","setTimeout","onUpdateSearchItem","startingPoint","MESSAGE_FOCUS_ANIMATION_DELAY","index","animated","channel","messageOffsetTimestamp","onResetMessageListWithStartingPoint","scrollToBottom","undefined","hasNext","onScrolledAwayFromBottom","onResetMessageList","useChannelHandler","onReactionUpdated","event","isDifferentChannel","recentMessage","isRecentMessage","messageId","scrollReachedBottomAndCanScroll","scrolledAwayFromBottom","useEffect","_ref","type","searchItem","MESSAGE_SEARCH_SAFE_SCROLL_DELAY","onPressParentMessage","message","canScrollToParent","show","TOAST","FIND_PARENT_MSG_ERROR","createElement","ref","onReplyMessage","onEditMessage","onPressNewMessagesButton","onPressScrollToBottomButton","_default","React","memo","exports"],"sources":["GroupChannelMessageList.tsx"],"sourcesContent":["import React, { useContext, useEffect } from 'react';\n\nimport { useChannelHandler } from '@sendbird/uikit-chat-hooks';\nimport { useToast } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\nimport { isDifferentChannel, useFreshCallback, useIsFirstMount, useUniqHandlerId } from '@sendbird/uikit-utils';\n\nimport ChannelMessageList from '../../../components/ChannelMessageList';\nimport { MESSAGE_FOCUS_ANIMATION_DELAY, MESSAGE_SEARCH_SAFE_SCROLL_DELAY } from '../../../constants';\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport { GroupChannelContexts } from '../module/moduleContext';\nimport type { GroupChannelProps } from '../types';\n\nconst GroupChannelMessageList = (props: GroupChannelProps['MessageList']) => {\n const toast = useToast();\n const { STRINGS } = useLocalization();\n const { sdk } = useSendbirdChat();\n const { setMessageToEdit, setMessageToReply } = useContext(GroupChannelContexts.Fragment);\n const { subscribe } = useContext(GroupChannelContexts.PubSub);\n const { flatListRef, lazyScrollToBottom, lazyScrollToIndex } = useContext(GroupChannelContexts.MessageList);\n\n const id = useUniqHandlerId('GroupChannelMessageList');\n const isFirstMount = useIsFirstMount();\n\n const scrollToMessageWithCreatedAt = useFreshCallback(\n (createdAt: number, focusAnimated: boolean, timeout: number): boolean => {\n const foundMessageIndex = props.messages.findIndex((it) => it.createdAt === createdAt);\n const isIncludedInList = foundMessageIndex > -1;\n\n if (isIncludedInList) {\n if (focusAnimated) {\n setTimeout(() => props.onUpdateSearchItem({ startingPoint: createdAt }), MESSAGE_FOCUS_ANIMATION_DELAY);\n }\n lazyScrollToIndex({ index: foundMessageIndex, animated: true, timeout });\n } else {\n if (props.channel.messageOffsetTimestamp <= createdAt) {\n if (focusAnimated) props.onUpdateSearchItem({ startingPoint: createdAt });\n props.onResetMessageListWithStartingPoint(createdAt);\n } else {\n return false;\n }\n }\n return true;\n },\n );\n\n const scrollToBottom = useFreshCallback((animated = false) => {\n if (props.hasNext()) {\n props.onUpdateSearchItem(undefined);\n props.onScrolledAwayFromBottom(false);\n\n props.onResetMessageList(() => {\n props.onScrolledAwayFromBottom(false);\n lazyScrollToBottom({ animated });\n });\n } else {\n lazyScrollToBottom({ animated });\n }\n });\n\n useChannelHandler(sdk, id, {\n onReactionUpdated(channel, event) {\n if (isDifferentChannel(channel, props.channel)) return;\n const recentMessage = props.messages[0];\n const isRecentMessage = recentMessage && recentMessage.messageId === event.messageId;\n const scrollReachedBottomAndCanScroll = !props.scrolledAwayFromBottom && !props.hasNext();\n if (isRecentMessage && scrollReachedBottomAndCanScroll) {\n lazyScrollToBottom({ animated: true, timeout: 250 });\n }\n },\n });\n\n useEffect(() => {\n return subscribe(({ type }) => {\n switch (type) {\n case 'MESSAGES_RECEIVED': {\n if (!props.scrolledAwayFromBottom) {\n scrollToBottom(true);\n }\n break;\n }\n case 'MESSAGE_SENT_SUCCESS':\n case 'MESSAGE_SENT_PENDING': {\n scrollToBottom(false);\n break;\n }\n }\n });\n }, [props.scrolledAwayFromBottom]);\n\n useEffect(() => {\n // Only trigger once when message list mount with initial props.searchItem\n // - Search screen + searchItem > mount message list\n // - Reset message list + searchItem > re-mount message list\n if (isFirstMount && props.searchItem) {\n scrollToMessageWithCreatedAt(props.searchItem.startingPoint, false, MESSAGE_SEARCH_SAFE_SCROLL_DELAY);\n }\n }, [isFirstMount]);\n\n const onPressParentMessage = useFreshCallback((message: SendbirdMessage) => {\n const canScrollToParent = scrollToMessageWithCreatedAt(message.createdAt, true, 0);\n if (!canScrollToParent) toast.show(STRINGS.TOAST.FIND_PARENT_MSG_ERROR, 'error');\n });\n\n return (\n <ChannelMessageList\n {...props}\n ref={flatListRef}\n onReplyMessage={setMessageToReply}\n onEditMessage={setMessageToEdit}\n onPressParentMessage={onPressParentMessage}\n onPressNewMessagesButton={scrollToBottom}\n onPressScrollToBottomButton={scrollToBottom}\n />\n );\n};\n\nexport default React.memo(GroupChannelMessageList);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,mBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AAA+D,SAAAK,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YA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