@sendbird/uikit-react-native 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -17
- package/lib/commonjs/components/ChatFlatList.js +2 -1
- package/lib/commonjs/components/ChatFlatList.js.map +1 -1
- package/lib/commonjs/components/FileViewer.js +2 -5
- package/lib/commonjs/components/FileViewer.js.map +1 -1
- package/lib/commonjs/components/MessageRenderer/FileMessage/BaseFileMessage.js +11 -6
- package/lib/commonjs/components/MessageRenderer/FileMessage/BaseFileMessage.js.map +1 -1
- package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js +12 -2
- package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +1 -1
- package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js +26 -11
- package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -1
- package/lib/commonjs/components/MessageRenderer/FileMessage/index.js +1 -6
- package/lib/commonjs/components/MessageRenderer/FileMessage/index.js.map +1 -1
- package/lib/commonjs/components/MessageRenderer/UserMessage/BaseUserMessage.js +86 -10
- package/lib/commonjs/components/MessageRenderer/UserMessage/BaseUserMessage.js.map +1 -1
- package/lib/commonjs/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js +102 -15
- package/lib/commonjs/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js.map +1 -1
- package/lib/commonjs/components/MessageRenderer/UserMessage/index.js.map +1 -1
- package/lib/commonjs/components/MessageRenderer/index.js +22 -3
- package/lib/commonjs/components/MessageRenderer/index.js.map +1 -1
- package/lib/commonjs/components/ReactionAddons/BottomSheetReactionAddon.js +150 -0
- package/lib/commonjs/components/ReactionAddons/BottomSheetReactionAddon.js.map +1 -0
- package/lib/commonjs/components/ReactionAddons/MessageReactionAddon.js +135 -0
- package/lib/commonjs/components/ReactionAddons/MessageReactionAddon.js.map +1 -0
- package/lib/commonjs/components/ReactionAddons/ReactionRoundedButton.js +87 -0
- package/lib/commonjs/components/ReactionAddons/ReactionRoundedButton.js.map +1 -0
- package/lib/commonjs/components/ReactionAddons/index.js +19 -0
- package/lib/commonjs/components/ReactionAddons/index.js.map +1 -0
- package/lib/commonjs/components/ReactionBottomSheets/ReactionListBottomSheet.js +150 -0
- package/lib/commonjs/components/ReactionBottomSheets/ReactionListBottomSheet.js.map +1 -0
- package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +276 -0
- package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -0
- package/lib/commonjs/components/ReactionBottomSheets/index.js +19 -0
- package/lib/commonjs/components/ReactionBottomSheets/index.js.map +1 -0
- package/lib/commonjs/constants.js +3 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/containers/GroupChannelPreviewContainer.js +4 -1
- package/lib/commonjs/containers/GroupChannelPreviewContainer.js.map +1 -1
- package/lib/commonjs/containers/SendbirdUIKitContainer.js +130 -79
- package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -1
- package/lib/commonjs/contexts/PlatformServiceCtx.js.map +1 -1
- package/lib/commonjs/contexts/ReactionCtx.js +107 -0
- package/lib/commonjs/contexts/ReactionCtx.js.map +1 -0
- package/lib/commonjs/contexts/SendbirdChatCtx.js +26 -18
- package/lib/commonjs/contexts/SendbirdChatCtx.js.map +1 -1
- package/lib/commonjs/contexts/UserProfileCtx.js +9 -0
- package/lib/commonjs/contexts/UserProfileCtx.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/EditInput.js +33 -37
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/EditInput.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js +95 -23
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/index.js +121 -31
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/index.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +34 -13
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelSuggestedMentionList.js +210 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelSuggestedMentionList.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/index.js +8 -0
- package/lib/commonjs/domain/groupChannel/index.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/module/createGroupChannelModule.js +4 -0
- package/lib/commonjs/domain/groupChannel/module/createGroupChannelModule.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js +4 -4
- 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/groupChannelBannedUsers/component/GroupChannelBannedUsersList.js +3 -2
- package/lib/commonjs/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.js.map +1 -1
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListList.js +2 -1
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListList.js.map +1 -1
- package/lib/commonjs/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.js +2 -1
- package/lib/commonjs/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.js.map +1 -1
- package/lib/commonjs/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.js +39 -0
- package/lib/commonjs/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.js.map +1 -0
- package/lib/commonjs/domain/groupChannelNotifications/component/GroupChannelNotificationsView.js +140 -0
- package/lib/commonjs/domain/groupChannelNotifications/component/GroupChannelNotificationsView.js.map +1 -0
- package/lib/commonjs/domain/groupChannelNotifications/index.js +46 -0
- package/lib/commonjs/domain/groupChannelNotifications/index.js.map +1 -0
- package/lib/commonjs/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.js +33 -0
- package/lib/commonjs/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.js.map +1 -0
- package/lib/commonjs/domain/groupChannelNotifications/module/moduleContext.js +45 -0
- package/lib/commonjs/domain/groupChannelNotifications/module/moduleContext.js.map +1 -0
- package/lib/commonjs/domain/groupChannelNotifications/types.js +6 -0
- package/lib/commonjs/domain/groupChannelNotifications/types.js.map +1 -0
- package/lib/commonjs/domain/groupChannelOperators/component/GroupChannelOperatorsList.js +2 -1
- package/lib/commonjs/domain/groupChannelOperators/component/GroupChannelOperatorsList.js.map +1 -1
- package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +49 -6
- package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -1
- package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js +11 -16
- package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
- package/lib/commonjs/domain/groupChannelSettings/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelUserList/types.js.map +1 -1
- package/lib/commonjs/domain/userList/component/UserListList.js +4 -1
- package/lib/commonjs/domain/userList/component/UserListList.js.map +1 -1
- package/lib/commonjs/domain/userList/module/createUserListModule.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelCreateFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelFragment.js +11 -4
- package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelInviteFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelListFragment.js +4 -14
- package/lib/commonjs/fragments/createGroupChannelListFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelNotificationsFragment.js +34 -0
- package/lib/commonjs/fragments/createGroupChannelNotificationsFragment.js.map +1 -0
- package/lib/commonjs/fragments/createGroupChannelSettingsFragment.js +3 -1
- package/lib/commonjs/fragments/createGroupChannelSettingsFragment.js.map +1 -1
- package/lib/commonjs/hooks/useConnection.js +3 -0
- package/lib/commonjs/hooks/useConnection.js.map +1 -1
- package/lib/commonjs/hooks/useContext.js +11 -1
- package/lib/commonjs/hooks/useContext.js.map +1 -1
- package/lib/commonjs/hooks/useKeyboardStatus.js +97 -0
- package/lib/commonjs/hooks/useKeyboardStatus.js.map +1 -0
- package/lib/commonjs/hooks/useMentionSuggestion.js +110 -0
- package/lib/commonjs/hooks/useMentionSuggestion.js.map +1 -0
- package/lib/commonjs/hooks/useMentionTextInput.js +139 -0
- package/lib/commonjs/hooks/useMentionTextInput.js.map +1 -0
- package/lib/commonjs/index.js +95 -40
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/libs/EmojiManager.js +100 -0
- package/lib/commonjs/libs/EmojiManager.js.map +1 -0
- package/lib/commonjs/libs/ImageCompressionConfig.js +38 -0
- package/lib/commonjs/libs/ImageCompressionConfig.js.map +1 -0
- package/lib/commonjs/libs/MentionConfig.js +47 -0
- package/lib/commonjs/libs/MentionConfig.js.map +1 -0
- package/lib/commonjs/libs/MentionManager.js +235 -0
- package/lib/commonjs/libs/MentionManager.js.map +1 -0
- package/lib/commonjs/libs/SBUUtils.js +27 -0
- package/lib/commonjs/libs/SBUUtils.js.map +1 -1
- package/lib/commonjs/localization/StringSet.type.js +20 -5
- package/lib/commonjs/localization/StringSet.type.js.map +1 -1
- package/lib/commonjs/platform/createMediaService.expo.js +35 -1
- package/lib/commonjs/platform/createMediaService.expo.js.map +1 -1
- package/lib/commonjs/platform/createMediaService.native.js +41 -6
- package/lib/commonjs/platform/createMediaService.native.js.map +1 -1
- package/lib/commonjs/platform/dynamicModule.js +9 -57
- package/lib/commonjs/platform/dynamicModule.js.map +1 -1
- 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/ChatFlatList.js +3 -2
- package/lib/module/components/ChatFlatList.js.map +1 -1
- package/lib/module/components/FileViewer.js +2 -5
- package/lib/module/components/FileViewer.js.map +1 -1
- package/lib/module/components/MessageRenderer/FileMessage/BaseFileMessage.js +11 -6
- package/lib/module/components/MessageRenderer/FileMessage/BaseFileMessage.js.map +1 -1
- package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js +12 -2
- package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +1 -1
- package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js +26 -11
- package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -1
- package/lib/module/components/MessageRenderer/FileMessage/index.js +1 -5
- package/lib/module/components/MessageRenderer/FileMessage/index.js.map +1 -1
- package/lib/module/components/MessageRenderer/UserMessage/BaseUserMessage.js +86 -12
- package/lib/module/components/MessageRenderer/UserMessage/BaseUserMessage.js.map +1 -1
- package/lib/module/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js +103 -19
- package/lib/module/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js.map +1 -1
- package/lib/module/components/MessageRenderer/UserMessage/index.js.map +1 -1
- package/lib/module/components/MessageRenderer/index.js +21 -4
- package/lib/module/components/MessageRenderer/index.js.map +1 -1
- package/lib/module/components/ReactionAddons/BottomSheetReactionAddon.js +132 -0
- package/lib/module/components/ReactionAddons/BottomSheetReactionAddon.js.map +1 -0
- package/lib/module/components/ReactionAddons/MessageReactionAddon.js +118 -0
- package/lib/module/components/ReactionAddons/MessageReactionAddon.js.map +1 -0
- package/lib/module/components/ReactionAddons/ReactionRoundedButton.js +74 -0
- package/lib/module/components/ReactionAddons/ReactionRoundedButton.js.map +1 -0
- package/lib/module/components/ReactionAddons/index.js +7 -0
- package/lib/module/components/ReactionAddons/index.js.map +1 -0
- package/lib/module/components/ReactionBottomSheets/ReactionListBottomSheet.js +135 -0
- package/lib/module/components/ReactionBottomSheets/ReactionListBottomSheet.js.map +1 -0
- package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +259 -0
- package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -0
- package/lib/module/components/ReactionBottomSheets/index.js +7 -0
- package/lib/module/components/ReactionBottomSheets/index.js.map +1 -0
- package/lib/module/constants.js +1 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/containers/GroupChannelPreviewContainer.js +4 -1
- package/lib/module/containers/GroupChannelPreviewContainer.js.map +1 -1
- package/lib/module/containers/SendbirdUIKitContainer.js +127 -81
- package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -1
- package/lib/module/contexts/PlatformServiceCtx.js.map +1 -1
- package/lib/module/contexts/ReactionCtx.js +85 -0
- package/lib/module/contexts/ReactionCtx.js.map +1 -0
- package/lib/module/contexts/SendbirdChatCtx.js +28 -18
- package/lib/module/contexts/SendbirdChatCtx.js.map +1 -1
- package/lib/module/contexts/UserProfileCtx.js +7 -0
- package/lib/module/contexts/UserProfileCtx.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelInput/EditInput.js +34 -39
- package/lib/module/domain/groupChannel/component/GroupChannelInput/EditInput.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js +92 -26
- package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelInput/index.js +118 -33
- package/lib/module/domain/groupChannel/component/GroupChannelInput/index.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +35 -16
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelSuggestedMentionList.js +188 -0
- package/lib/module/domain/groupChannel/component/GroupChannelSuggestedMentionList.js.map +1 -0
- package/lib/module/domain/groupChannel/index.js +1 -0
- package/lib/module/domain/groupChannel/index.js.map +1 -1
- package/lib/module/domain/groupChannel/module/createGroupChannelModule.js +3 -0
- package/lib/module/domain/groupChannel/module/createGroupChannelModule.js.map +1 -1
- package/lib/module/domain/groupChannel/module/moduleContext.js +4 -4
- 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/groupChannelBannedUsers/component/GroupChannelBannedUsersList.js +4 -3
- package/lib/module/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.js.map +1 -1
- package/lib/module/domain/groupChannelList/component/GroupChannelListList.js +3 -2
- package/lib/module/domain/groupChannelList/component/GroupChannelListList.js.map +1 -1
- package/lib/module/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.js +3 -2
- package/lib/module/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.js.map +1 -1
- package/lib/module/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.js +25 -0
- package/lib/module/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.js.map +1 -0
- package/lib/module/domain/groupChannelNotifications/component/GroupChannelNotificationsView.js +122 -0
- package/lib/module/domain/groupChannelNotifications/component/GroupChannelNotificationsView.js.map +1 -0
- package/lib/module/domain/groupChannelNotifications/index.js +5 -0
- package/lib/module/domain/groupChannelNotifications/index.js.map +1 -0
- package/lib/module/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.js +21 -0
- package/lib/module/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.js.map +1 -0
- package/lib/module/domain/groupChannelNotifications/module/moduleContext.js +25 -0
- package/lib/module/domain/groupChannelNotifications/module/moduleContext.js.map +1 -0
- package/lib/module/domain/groupChannelNotifications/types.js +2 -0
- package/lib/module/domain/groupChannelNotifications/types.js.map +1 -0
- package/lib/module/domain/groupChannelOperators/component/GroupChannelOperatorsList.js +3 -2
- package/lib/module/domain/groupChannelOperators/component/GroupChannelOperatorsList.js.map +1 -1
- package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +46 -6
- package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -1
- package/lib/module/domain/groupChannelSettings/module/moduleContext.js +12 -17
- package/lib/module/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
- package/lib/module/domain/groupChannelSettings/types.js.map +1 -1
- package/lib/module/domain/groupChannelUserList/types.js.map +1 -1
- package/lib/module/domain/userList/component/UserListList.js +3 -1
- package/lib/module/domain/userList/component/UserListList.js.map +1 -1
- package/lib/module/domain/userList/module/createUserListModule.js.map +1 -1
- package/lib/module/fragments/createGroupChannelCreateFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelFragment.js +11 -4
- package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelInviteFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelListFragment.js +5 -9
- package/lib/module/fragments/createGroupChannelListFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelNotificationsFragment.js +22 -0
- package/lib/module/fragments/createGroupChannelNotificationsFragment.js.map +1 -0
- package/lib/module/fragments/createGroupChannelSettingsFragment.js +3 -1
- package/lib/module/fragments/createGroupChannelSettingsFragment.js.map +1 -1
- package/lib/module/hooks/useConnection.js +3 -0
- package/lib/module/hooks/useConnection.js.map +1 -1
- package/lib/module/hooks/useContext.js +6 -0
- package/lib/module/hooks/useContext.js.map +1 -1
- package/lib/module/hooks/useKeyboardStatus.js +78 -0
- package/lib/module/hooks/useKeyboardStatus.js.map +1 -0
- package/lib/module/hooks/useMentionSuggestion.js +100 -0
- package/lib/module/hooks/useMentionSuggestion.js.map +1 -0
- package/lib/module/hooks/useMentionTextInput.js +128 -0
- package/lib/module/hooks/useMentionTextInput.js.map +1 -0
- package/lib/module/index.js +8 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/libs/EmojiManager.js +90 -0
- package/lib/module/libs/EmojiManager.js.map +1 -0
- package/lib/module/libs/ImageCompressionConfig.js +30 -0
- package/lib/module/libs/ImageCompressionConfig.js.map +1 -0
- package/lib/module/libs/MentionConfig.js +39 -0
- package/lib/module/libs/MentionConfig.js.map +1 -0
- package/lib/module/libs/MentionManager.js +223 -0
- package/lib/module/libs/MentionManager.js.map +1 -0
- package/lib/module/libs/SBUUtils.js +26 -1
- package/lib/module/libs/SBUUtils.js.map +1 -1
- package/lib/module/localization/StringSet.type.js +21 -6
- package/lib/module/localization/StringSet.type.js.map +1 -1
- package/lib/module/platform/createMediaService.expo.js +33 -1
- package/lib/module/platform/createMediaService.expo.js.map +1 -1
- package/lib/module/platform/createMediaService.native.js +38 -5
- package/lib/module/platform/createMediaService.native.js.map +1 -1
- package/lib/module/platform/dynamicModule.js +10 -56
- package/lib/module/platform/dynamicModule.js.map +1 -1
- 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/__template__/types.d.ts +3 -3
- package/lib/typescript/src/components/ChannelCover.d.ts +1 -1
- package/lib/typescript/src/components/ChatFlatList.d.ts +1 -1
- package/lib/typescript/src/components/FileViewer.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/AdminMessage/index.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/FileMessage/BaseFileMessage.d.ts +2 -2
- package/lib/typescript/src/components/MessageRenderer/FileMessage/ImageFileMessage.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/FileMessage/VideoFileMessage.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/FileMessage/index.d.ts +11 -2
- package/lib/typescript/src/components/MessageRenderer/MessageDateSeparator.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/MessageIncomingAvatar.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/MessageIncomingSenderName.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/MessageOutgoingStatus.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/MessageTime.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/UnknownMessage/index.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/UserMessage/BaseUserMessage.d.ts +1 -1
- package/lib/typescript/src/components/MessageRenderer/UserMessage/OpenGraphUserMessage.d.ts +2 -2
- package/lib/typescript/src/components/MessageRenderer/UserMessage/index.d.ts +4 -1
- package/lib/typescript/src/components/MessageRenderer/index.d.ts +4 -3
- package/lib/typescript/src/components/NewMessagesButton.d.ts +1 -1
- package/lib/typescript/src/components/ReactionAddons/BottomSheetReactionAddon.d.ts +8 -0
- package/lib/typescript/src/components/ReactionAddons/MessageReactionAddon.d.ts +6 -0
- package/lib/typescript/src/components/ReactionAddons/ReactionRoundedButton.d.ts +14 -0
- package/lib/typescript/src/components/ReactionAddons/index.d.ts +11 -0
- package/lib/typescript/src/components/ReactionBottomSheets/ReactionListBottomSheet.d.ts +3 -0
- package/lib/typescript/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.d.ts +3 -0
- package/lib/typescript/src/components/ReactionBottomSheets/index.d.ts +20 -0
- package/lib/typescript/src/components/ScrollToBottomButton.d.ts +1 -1
- package/lib/typescript/src/components/StatusComposition.d.ts +1 -1
- package/lib/typescript/src/components/TypedPlaceholder.d.ts +1 -1
- package/lib/typescript/src/components/UserActionBar.d.ts +1 -1
- package/lib/typescript/src/components/UserSelectableBar.d.ts +1 -1
- package/lib/typescript/src/constants.d.ts +1 -0
- package/lib/typescript/src/containers/GroupChannelPreviewContainer.d.ts +1 -1
- package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +20 -8
- package/lib/typescript/src/contexts/LocalizationCtx.d.ts +2 -2
- package/lib/typescript/src/contexts/PlatformServiceCtx.d.ts +9 -3
- package/lib/typescript/src/contexts/ReactionCtx.d.ts +18 -0
- package/lib/typescript/src/contexts/SendbirdChatCtx.d.ts +16 -3
- package/lib/typescript/src/contexts/UserProfileCtx.d.ts +4 -4
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput/EditInput.d.ts +35 -7
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput/SendInput.d.ts +32 -5
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput/index.d.ts +19 -2
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannel/index.d.ts +1 -0
- package/lib/typescript/src/domain/groupChannel/module/createGroupChannelModule.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/types.d.ts +24 -7
- package/lib/typescript/src/domain/groupChannelBannedUsers/types.d.ts +3 -3
- package/lib/typescript/src/domain/groupChannelList/types.d.ts +2 -2
- package/lib/typescript/src/domain/groupChannelModeration/types.d.ts +3 -3
- package/lib/typescript/src/domain/groupChannelMutedMembers/types.d.ts +3 -3
- package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelNotifications/component/GroupChannelNotificationsView.d.ts +2 -0
- package/lib/typescript/src/domain/groupChannelNotifications/index.d.ts +4 -0
- package/lib/typescript/src/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelNotifications/module/moduleContext.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelNotifications/types.d.ts +33 -0
- package/lib/typescript/src/domain/groupChannelOperators/types.d.ts +3 -3
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannelSettings/types.d.ts +3 -1
- package/lib/typescript/src/domain/groupChannelUserList/types.d.ts +6 -6
- package/lib/typescript/src/domain/userList/component/UserListList.d.ts +2 -1
- package/lib/typescript/src/domain/userList/module/createUserListModule.d.ts +2 -1
- package/lib/typescript/src/fragments/createGroupChannelCreateFragment.d.ts +1 -1
- package/lib/typescript/src/fragments/createGroupChannelInviteFragment.d.ts +1 -1
- package/lib/typescript/src/fragments/createGroupChannelNotificationsFragment.d.ts +3 -0
- package/lib/typescript/src/hooks/useConnection.d.ts +1 -1
- package/lib/typescript/src/hooks/useContext.d.ts +3 -26
- package/lib/typescript/src/hooks/useKeyboardStatus.d.ts +6 -0
- package/lib/typescript/src/hooks/useMentionSuggestion.d.ts +17 -0
- package/lib/typescript/src/hooks/useMentionTextInput.d.ts +18 -0
- package/lib/typescript/src/index.d.ts +8 -3
- package/lib/typescript/src/libs/EmojiManager.d.ts +16 -0
- package/lib/typescript/src/libs/ImageCompressionConfig.d.ts +16 -0
- package/lib/typescript/src/libs/MentionConfig.d.ts +24 -0
- package/lib/typescript/src/libs/MentionManager.d.ts +61 -0
- package/lib/typescript/src/libs/SBUUtils.d.ts +6 -0
- package/lib/typescript/src/localization/StringSet.type.d.ts +19 -2
- package/lib/typescript/src/platform/createMediaService.expo.d.ts +6 -2
- package/lib/typescript/src/platform/createMediaService.native.d.ts +8 -6
- package/lib/typescript/src/platform/dynamicModule.d.ts +8 -13
- package/lib/typescript/src/platform/types.d.ts +33 -8
- package/lib/typescript/src/types.d.ts +13 -4
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +16 -6
- package/src/components/ChatFlatList.tsx +2 -1
- package/src/components/FileViewer.tsx +2 -5
- package/src/components/MessageRenderer/FileMessage/BaseFileMessage.tsx +17 -12
- package/src/components/MessageRenderer/FileMessage/ImageFileMessage.tsx +30 -18
- package/src/components/MessageRenderer/FileMessage/VideoFileMessage.tsx +21 -11
- package/src/components/MessageRenderer/FileMessage/index.tsx +1 -4
- package/src/components/MessageRenderer/UserMessage/BaseUserMessage.tsx +82 -14
- package/src/components/MessageRenderer/UserMessage/OpenGraphUserMessage.tsx +136 -62
- package/src/components/MessageRenderer/UserMessage/index.tsx +8 -1
- package/src/components/MessageRenderer/index.tsx +39 -7
- package/src/components/ReactionAddons/BottomSheetReactionAddon.tsx +106 -0
- package/src/components/ReactionAddons/MessageReactionAddon.tsx +123 -0
- package/src/components/ReactionAddons/ReactionRoundedButton.tsx +71 -0
- package/src/components/ReactionAddons/index.tsx +7 -0
- package/src/components/ReactionBottomSheets/ReactionListBottomSheet.tsx +113 -0
- package/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.tsx +249 -0
- package/src/components/ReactionBottomSheets/index.tsx +24 -0
- package/src/constants.ts +2 -0
- package/src/containers/GroupChannelPreviewContainer.tsx +3 -1
- package/src/containers/SendbirdUIKitContainer.tsx +165 -88
- package/src/contexts/PlatformServiceCtx.tsx +9 -2
- package/src/contexts/ReactionCtx.tsx +102 -0
- package/src/contexts/SendbirdChatCtx.tsx +46 -21
- package/src/contexts/UserProfileCtx.tsx +9 -0
- package/src/domain/groupChannel/component/GroupChannelInput/EditInput.tsx +56 -30
- package/src/domain/groupChannel/component/GroupChannelInput/SendInput.tsx +129 -32
- package/src/domain/groupChannel/component/GroupChannelInput/index.tsx +138 -43
- package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +30 -12
- package/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.tsx +173 -0
- package/src/domain/groupChannel/index.ts +1 -0
- package/src/domain/groupChannel/module/createGroupChannelModule.tsx +12 -1
- package/src/domain/groupChannel/module/moduleContext.tsx +4 -4
- package/src/domain/groupChannel/types.ts +28 -5
- package/src/domain/groupChannelBannedUsers/component/GroupChannelBannedUsersList.tsx +3 -2
- package/src/domain/groupChannelList/component/GroupChannelListList.tsx +2 -1
- package/src/domain/groupChannelMutedMembers/component/GroupChannelMutedMembersList.tsx +2 -1
- package/src/domain/groupChannelNotifications/component/GroupChannelNotificationsHeader.tsx +14 -0
- package/src/domain/groupChannelNotifications/component/GroupChannelNotificationsView.tsx +128 -0
- package/src/domain/groupChannelNotifications/index.ts +4 -0
- package/src/domain/groupChannelNotifications/module/createGroupChannelNotificationsModule.tsx +15 -0
- package/src/domain/groupChannelNotifications/module/moduleContext.tsx +31 -0
- package/src/domain/groupChannelNotifications/types.ts +38 -0
- package/src/domain/groupChannelOperators/component/GroupChannelOperatorsList.tsx +2 -1
- package/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.tsx +42 -3
- package/src/domain/groupChannelSettings/module/moduleContext.tsx +17 -14
- package/src/domain/groupChannelSettings/types.ts +2 -0
- package/src/domain/groupChannelUserList/types.ts +7 -2
- package/src/domain/userList/component/UserListList.tsx +5 -1
- package/src/domain/userList/module/createUserListModule.tsx +3 -1
- package/src/fragments/createGroupChannelCreateFragment.tsx +8 -2
- package/src/fragments/createGroupChannelFragment.tsx +19 -6
- package/src/fragments/createGroupChannelInviteFragment.tsx +2 -2
- package/src/fragments/createGroupChannelListFragment.tsx +5 -9
- package/src/fragments/createGroupChannelNotificationsFragment.tsx +27 -0
- package/src/fragments/createGroupChannelSettingsFragment.tsx +2 -0
- package/src/hooks/useConnection.ts +3 -1
- package/src/hooks/useContext.ts +7 -0
- package/src/hooks/useKeyboardStatus.ts +59 -0
- package/src/hooks/useMentionSuggestion.ts +106 -0
- package/src/hooks/useMentionTextInput.ts +139 -0
- package/src/index.ts +14 -2
- package/src/libs/EmojiManager.ts +80 -0
- package/src/libs/ImageCompressionConfig.ts +31 -0
- package/src/libs/MentionConfig.ts +40 -0
- package/src/libs/MentionManager.tsx +240 -0
- package/src/libs/SBUUtils.ts +28 -1
- package/src/localization/StringSet.type.ts +45 -8
- package/src/platform/createMediaService.expo.tsx +24 -1
- package/src/platform/createMediaService.native.tsx +31 -9
- package/src/platform/dynamicModule.ts +17 -59
- package/src/platform/types.ts +29 -7
- package/src/types.ts +12 -0
- package/src/version.ts +1 -1
|
@@ -9,11 +9,11 @@ import type {
|
|
|
9
9
|
SendbirdUser,
|
|
10
10
|
} from '@sendbird/uikit-utils';
|
|
11
11
|
import {
|
|
12
|
-
|
|
12
|
+
getDateSeparatorFormat,
|
|
13
13
|
getGroupChannelLastMessage,
|
|
14
14
|
getGroupChannelPreviewTime,
|
|
15
15
|
getGroupChannelTitle,
|
|
16
|
-
|
|
16
|
+
getMessageTimeFormat,
|
|
17
17
|
} from '@sendbird/uikit-utils';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -44,6 +44,9 @@ export interface StringSet {
|
|
|
44
44
|
INPUT_EDIT_OK: string;
|
|
45
45
|
INPUT_EDIT_CANCEL: string;
|
|
46
46
|
|
|
47
|
+
/** GroupChannel > Suggested mention list */
|
|
48
|
+
MENTION_LIMITED: (mentionLimit: number) => string;
|
|
49
|
+
|
|
47
50
|
/** GroupChannel > Dialog > Message */
|
|
48
51
|
DIALOG_MESSAGE_COPY: string;
|
|
49
52
|
DIALOG_MESSAGE_EDIT: string;
|
|
@@ -69,9 +72,12 @@ export interface StringSet {
|
|
|
69
72
|
|
|
70
73
|
/** GroupChannelSettings > Menu */
|
|
71
74
|
MENU_MODERATION: string;
|
|
72
|
-
MENU_NOTIFICATION: string;
|
|
73
75
|
MENU_MEMBERS: string;
|
|
74
76
|
MENU_LEAVE_CHANNEL: string;
|
|
77
|
+
MENU_NOTIFICATION: string;
|
|
78
|
+
MENU_NOTIFICATION_LABEL_ON: string;
|
|
79
|
+
MENU_NOTIFICATION_LABEL_OFF: string;
|
|
80
|
+
MENU_NOTIFICATION_LABEL_MENTION_ONLY: string;
|
|
75
81
|
|
|
76
82
|
/** GroupChannelSettings > Dialog */
|
|
77
83
|
DIALOG_CHANGE_NAME: string;
|
|
@@ -84,6 +90,16 @@ export interface StringSet {
|
|
|
84
90
|
DIALOG_CHANGE_IMAGE_MENU_CAMERA: string;
|
|
85
91
|
DIALOG_CHANGE_IMAGE_MENU_PHOTO_LIBRARY: string;
|
|
86
92
|
};
|
|
93
|
+
GROUP_CHANNEL_NOTIFICATIONS: {
|
|
94
|
+
/** GroupChannelNotifications > Header */
|
|
95
|
+
HEADER_TITLE: string;
|
|
96
|
+
|
|
97
|
+
/** GroupChannelNotifications > Menu */
|
|
98
|
+
MENU_NOTIFICATIONS: string;
|
|
99
|
+
MENU_NOTIFICATIONS_DESC: string;
|
|
100
|
+
MENU_NOTIFICATIONS_OPTION_ALL: string;
|
|
101
|
+
MENU_NOTIFICATIONS_OPTION_MENTION_ONLY: string;
|
|
102
|
+
};
|
|
87
103
|
GROUP_CHANNEL_MODERATION: {
|
|
88
104
|
/** GroupChannelModeration > Header */
|
|
89
105
|
HEADER_TITLE: string;
|
|
@@ -153,6 +169,10 @@ export interface StringSet {
|
|
|
153
169
|
};
|
|
154
170
|
// UI
|
|
155
171
|
LABELS: {
|
|
172
|
+
PERMISSION_APP_NAME: string;
|
|
173
|
+
PERMISSION_CAMERA: string;
|
|
174
|
+
PERMISSION_DEVICE_STORAGE: string;
|
|
175
|
+
|
|
156
176
|
USER_NO_NAME: string;
|
|
157
177
|
CHANNEL_NO_MEMBERS: string;
|
|
158
178
|
TYPING_INDICATOR_TYPINGS: (users: SendbirdUser[]) => string | undefined;
|
|
@@ -237,10 +257,10 @@ export const createBaseStringSet = ({ dateLocale, overrides }: StringSetCreateOp
|
|
|
237
257
|
HEADER_TITLE: (currentUserId, channel) =>
|
|
238
258
|
getGroupChannelTitle(currentUserId, channel, USER_NO_NAME, CHANNEL_NO_MEMBERS),
|
|
239
259
|
LIST_BANNER_FROZEN: 'Channel is frozen',
|
|
240
|
-
LIST_DATE_SEPARATOR: (date, locale) =>
|
|
260
|
+
LIST_DATE_SEPARATOR: (date, locale) => getDateSeparatorFormat(date, locale ?? dateLocale),
|
|
241
261
|
LIST_BUTTON_NEW_MSG: (newMessages) => `${newMessages.length} new messages`,
|
|
242
262
|
|
|
243
|
-
MESSAGE_BUBBLE_TIME: (message, locale) =>
|
|
263
|
+
MESSAGE_BUBBLE_TIME: (message, locale) => getMessageTimeFormat(new Date(message.createdAt), locale ?? dateLocale),
|
|
244
264
|
MESSAGE_BUBBLE_FILE_TITLE: (message) => message.name,
|
|
245
265
|
MESSAGE_BUBBLE_EDITED_POSTFIX: ' (edited)',
|
|
246
266
|
MESSAGE_BUBBLE_UNKNOWN_TITLE: () => '(Unknown message type)',
|
|
@@ -252,6 +272,8 @@ export const createBaseStringSet = ({ dateLocale, overrides }: StringSetCreateOp
|
|
|
252
272
|
INPUT_EDIT_OK: 'Save',
|
|
253
273
|
INPUT_EDIT_CANCEL: 'Cancel',
|
|
254
274
|
|
|
275
|
+
MENTION_LIMITED: (mentionLimit) => `You can have up to ${mentionLimit} mentions per message.`,
|
|
276
|
+
|
|
255
277
|
DIALOG_MESSAGE_COPY: 'Copy',
|
|
256
278
|
DIALOG_MESSAGE_EDIT: 'Edit',
|
|
257
279
|
DIALOG_MESSAGE_SAVE: 'Save',
|
|
@@ -271,9 +293,12 @@ export const createBaseStringSet = ({ dateLocale, overrides }: StringSetCreateOp
|
|
|
271
293
|
HEADER_TITLE: 'Channel information',
|
|
272
294
|
HEADER_RIGHT: 'Edit',
|
|
273
295
|
MENU_MODERATION: 'Moderation',
|
|
274
|
-
MENU_NOTIFICATION: 'Notifications',
|
|
275
296
|
MENU_MEMBERS: 'Members',
|
|
276
297
|
MENU_LEAVE_CHANNEL: 'Leave channel',
|
|
298
|
+
MENU_NOTIFICATION: 'Notifications',
|
|
299
|
+
MENU_NOTIFICATION_LABEL_ON: 'On',
|
|
300
|
+
MENU_NOTIFICATION_LABEL_OFF: 'Off',
|
|
301
|
+
MENU_NOTIFICATION_LABEL_MENTION_ONLY: 'Mentions only',
|
|
277
302
|
DIALOG_CHANGE_NAME: 'Change channel name',
|
|
278
303
|
DIALOG_CHANGE_NAME_PROMPT_TITLE: 'Change channel name',
|
|
279
304
|
DIALOG_CHANGE_NAME_PROMPT_PLACEHOLDER: 'Enter name',
|
|
@@ -285,6 +310,15 @@ export const createBaseStringSet = ({ dateLocale, overrides }: StringSetCreateOp
|
|
|
285
310
|
DIALOG_CHANGE_IMAGE_MENU_PHOTO_LIBRARY: 'Choose photo',
|
|
286
311
|
...overrides?.GROUP_CHANNEL_SETTINGS,
|
|
287
312
|
},
|
|
313
|
+
GROUP_CHANNEL_NOTIFICATIONS: {
|
|
314
|
+
HEADER_TITLE: 'Notifications',
|
|
315
|
+
MENU_NOTIFICATIONS: 'Notifications',
|
|
316
|
+
MENU_NOTIFICATIONS_DESC:
|
|
317
|
+
'Turn on push notifications if you wish to be notified when messages are delivered to this channel.',
|
|
318
|
+
MENU_NOTIFICATIONS_OPTION_ALL: 'All new messages',
|
|
319
|
+
MENU_NOTIFICATIONS_OPTION_MENTION_ONLY: 'Mentions only',
|
|
320
|
+
...overrides?.GROUP_CHANNEL_NOTIFICATIONS,
|
|
321
|
+
},
|
|
288
322
|
GROUP_CHANNEL_MODERATION: {
|
|
289
323
|
HEADER_TITLE: 'Moderation',
|
|
290
324
|
MENU_OPERATORS: 'Operators',
|
|
@@ -361,6 +395,9 @@ export const createBaseStringSet = ({ dateLocale, overrides }: StringSetCreateOp
|
|
|
361
395
|
...overrides?.GROUP_CHANNEL_INVITE,
|
|
362
396
|
},
|
|
363
397
|
LABELS: {
|
|
398
|
+
PERMISSION_APP_NAME: 'Application',
|
|
399
|
+
PERMISSION_CAMERA: 'camera',
|
|
400
|
+
PERMISSION_DEVICE_STORAGE: 'device storage',
|
|
364
401
|
USER_NO_NAME,
|
|
365
402
|
CHANNEL_NO_MEMBERS,
|
|
366
403
|
TYPING_INDICATOR_TYPINGS: (users, NO_NAME = USER_NO_NAME) => {
|
|
@@ -382,7 +419,7 @@ export const createBaseStringSet = ({ dateLocale, overrides }: StringSetCreateOp
|
|
|
382
419
|
},
|
|
383
420
|
FILE_VIEWER: {
|
|
384
421
|
TITLE: (message) => message.sender?.nickname || USER_NO_NAME,
|
|
385
|
-
SUBTITLE: (message) =>
|
|
422
|
+
SUBTITLE: (message) => getMessageTimeFormat(new Date(message.createdAt), dateLocale),
|
|
386
423
|
},
|
|
387
424
|
PLACEHOLDER: {
|
|
388
425
|
NO_BANNED_USERS: 'No banned users',
|
|
@@ -402,7 +439,7 @@ export const createBaseStringSet = ({ dateLocale, overrides }: StringSetCreateOp
|
|
|
402
439
|
ALERT_DEFAULT_OK: 'OK',
|
|
403
440
|
ALERT_PERMISSIONS_TITLE: 'Allow access?',
|
|
404
441
|
ALERT_PERMISSIONS_MESSAGE: (permission, appName = 'Application') => {
|
|
405
|
-
return `${appName} need permission to access your ${permission}
|
|
442
|
+
return `${appName} need permission to access your ${permission}.`;
|
|
406
443
|
},
|
|
407
444
|
ALERT_PERMISSIONS_OK: 'Go to settings',
|
|
408
445
|
PROMPT_DEFAULT_OK: 'Submit',
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import type * as ExpoAV from 'expo-av';
|
|
2
|
+
import type * as ExpoFS from 'expo-file-system';
|
|
3
|
+
import type * as ExpoImageManipulator from 'expo-image-manipulator';
|
|
2
4
|
import type * as ExpoVideoThumbnail from 'expo-video-thumbnails';
|
|
3
5
|
import React from 'react';
|
|
4
6
|
|
|
7
|
+
import { getDownscaleSize } from '@sendbird/uikit-utils';
|
|
8
|
+
|
|
9
|
+
import SBUUtils from '../libs/SBUUtils';
|
|
5
10
|
import type { MediaServiceInterface } from './types';
|
|
6
11
|
|
|
7
12
|
type Modules = {
|
|
8
13
|
avModule: typeof ExpoAV;
|
|
9
14
|
thumbnailModule: typeof ExpoVideoThumbnail;
|
|
15
|
+
imageManipulator: typeof ExpoImageManipulator;
|
|
16
|
+
fsModule: typeof ExpoFS;
|
|
10
17
|
};
|
|
11
18
|
|
|
12
|
-
const createExpoMediaService = ({
|
|
19
|
+
const createExpoMediaService = ({
|
|
20
|
+
avModule,
|
|
21
|
+
thumbnailModule,
|
|
22
|
+
imageManipulator,
|
|
23
|
+
fsModule,
|
|
24
|
+
}: Modules): MediaServiceInterface => {
|
|
13
25
|
return {
|
|
14
26
|
VideoComponent({ source, resizeMode, onLoad, ...props }) {
|
|
15
27
|
// FIXME: type error https://github.com/expo/expo/issues/17101
|
|
@@ -24,6 +36,17 @@ const createExpoMediaService = ({ avModule, thumbnailModule }: Modules): MediaSe
|
|
|
24
36
|
return null;
|
|
25
37
|
}
|
|
26
38
|
},
|
|
39
|
+
async compressImage({ maxWidth, maxHeight, compressionRate = 1, uri }) {
|
|
40
|
+
const originSize = await SBUUtils.getImageSize(uri);
|
|
41
|
+
const resizingSize = getDownscaleSize(originSize, { width: maxWidth, height: maxHeight });
|
|
42
|
+
|
|
43
|
+
const { uri: compressedURI } = await imageManipulator.manipulateAsync(uri, [{ resize: resizingSize }], {
|
|
44
|
+
compress: Math.min(Math.max(0, compressionRate), 1),
|
|
45
|
+
});
|
|
46
|
+
const { size = 0 } = await fsModule.getInfoAsync(uri);
|
|
47
|
+
|
|
48
|
+
return { uri: compressedURI, size };
|
|
49
|
+
},
|
|
27
50
|
};
|
|
28
51
|
};
|
|
29
52
|
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
+
import type * as RNImageResizer from '@bam.tech/react-native-image-resizer';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import type * as
|
|
3
|
-
import type
|
|
3
|
+
import type * as RNCreateThumbnail from 'react-native-create-thumbnail';
|
|
4
|
+
import type RNVideo from 'react-native-video';
|
|
4
5
|
|
|
6
|
+
import { getDownscaleSize, getFileExtension, hash } from '@sendbird/uikit-utils';
|
|
7
|
+
|
|
8
|
+
import SBUUtils from '../libs/SBUUtils';
|
|
5
9
|
import type { MediaServiceInterface } from './types';
|
|
6
10
|
|
|
7
11
|
type Modules = {
|
|
8
|
-
VideoComponent: typeof
|
|
9
|
-
thumbnailModule: typeof
|
|
12
|
+
VideoComponent: typeof RNVideo;
|
|
13
|
+
thumbnailModule: typeof RNCreateThumbnail;
|
|
14
|
+
imageResizerModule: typeof RNImageResizer;
|
|
10
15
|
};
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
const createNativeMediaService = ({
|
|
18
|
+
VideoComponent,
|
|
19
|
+
thumbnailModule,
|
|
20
|
+
imageResizerModule,
|
|
21
|
+
}: Modules): MediaServiceInterface => {
|
|
17
22
|
return {
|
|
18
23
|
VideoComponent({ source, resizeMode, onLoad, ...props }) {
|
|
19
24
|
return <VideoComponent {...props} source={source} resizeMode={resizeMode} onLoad={onLoad} controls />;
|
|
@@ -31,6 +36,23 @@ const createNativeMediaService = ({ VideoComponent, thumbnailModule }: Modules):
|
|
|
31
36
|
return null;
|
|
32
37
|
}
|
|
33
38
|
},
|
|
39
|
+
async compressImage({ uri, maxWidth, maxHeight, compressionRate = 1 }) {
|
|
40
|
+
const originSize = await SBUUtils.getImageSize(uri);
|
|
41
|
+
const { width, height } = getDownscaleSize(originSize, { width: maxWidth, height: maxHeight });
|
|
42
|
+
const extension = (() => {
|
|
43
|
+
return { 'png': 'PNG', 'jpeg': 'JPEG', 'jpg': 'JPEG' }[getFileExtension(uri)] ?? 'JPEG';
|
|
44
|
+
})() as 'PNG' | 'JPEG';
|
|
45
|
+
|
|
46
|
+
const { size: resizedSize, uri: compressedURI } = await imageResizerModule.default.createResizedImage(
|
|
47
|
+
uri,
|
|
48
|
+
width,
|
|
49
|
+
height,
|
|
50
|
+
extension,
|
|
51
|
+
Math.min(Math.max(0, compressionRate), 1) * 100,
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return { uri: compressedURI, size: resizedSize };
|
|
55
|
+
},
|
|
34
56
|
};
|
|
35
57
|
};
|
|
36
58
|
|
|
@@ -1,43 +1,28 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import type
|
|
3
|
-
import { NativeModules } from 'react-native';
|
|
4
|
-
import type RNFastImage from 'react-native-fast-image';
|
|
5
|
-
import type RNFileAccess from 'react-native-file-access';
|
|
2
|
+
import type * as RNCNetInfo from '@react-native-community/netinfo';
|
|
3
|
+
import { NativeModules, UIManager } from 'react-native';
|
|
6
4
|
|
|
7
5
|
import { Logger } from '@sendbird/uikit-utils';
|
|
8
6
|
|
|
9
|
-
export interface DynamicModules {
|
|
10
|
-
'react-native-file-access': typeof RNFileAccess;
|
|
11
|
-
'react-native-fast-image': typeof RNFastImage;
|
|
12
|
-
'@react-native-community/netinfo': typeof RNNetInfo;
|
|
13
|
-
}
|
|
14
7
|
export type SBUNativeModule = keyof DynamicModules;
|
|
15
8
|
|
|
16
9
|
interface SBUDynamicModuleInfo {
|
|
17
10
|
packageName: SBUNativeModule;
|
|
18
|
-
|
|
19
|
-
moduleName: string;
|
|
11
|
+
nativeModuleNamespace: string;
|
|
20
12
|
getPackage: <T>(logLevel: 'error' | 'warn' | 'none') => T;
|
|
21
13
|
url: string;
|
|
14
|
+
isComponent?: boolean;
|
|
22
15
|
}
|
|
23
16
|
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (minMinor < currMinor) return true;
|
|
31
|
-
if (minMinor === currMinor) {
|
|
32
|
-
return minPatch <= currPatch;
|
|
17
|
+
function checkLink(dmi: SBUDynamicModuleInfo, logLevel: 'error' | 'warn' | 'none') {
|
|
18
|
+
const nativeModule = (() => {
|
|
19
|
+
if (dmi.isComponent) {
|
|
20
|
+
return UIManager.getViewManagerConfig(dmi.nativeModuleNamespace);
|
|
21
|
+
} else {
|
|
22
|
+
return NativeModules[dmi.nativeModuleNamespace];
|
|
33
23
|
}
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
24
|
+
})();
|
|
38
25
|
|
|
39
|
-
function checkLink(dmi: SBUDynamicModuleInfo, logLevel: 'error' | 'warn' | 'none') {
|
|
40
|
-
const nativeModule = NativeModules[dmi.moduleName];
|
|
41
26
|
if (!nativeModule) {
|
|
42
27
|
const message = `[UIKit] Cannot use native module, you should install and link ${dmi.packageName} (${dmi.url})`;
|
|
43
28
|
if (logLevel === 'error') console.error(message);
|
|
@@ -45,41 +30,14 @@ function checkLink(dmi: SBUDynamicModuleInfo, logLevel: 'error' | 'warn' | 'none
|
|
|
45
30
|
}
|
|
46
31
|
}
|
|
47
32
|
|
|
48
|
-
|
|
49
|
-
'react-native-
|
|
50
|
-
|
|
51
|
-
packageName: 'react-native-file-access',
|
|
52
|
-
moduleName: 'RNFileAccess',
|
|
53
|
-
url: 'https://github.com/alpha0010/react-native-file-access',
|
|
54
|
-
getPackage(logLevel) {
|
|
55
|
-
checkLink(this, logLevel);
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
return require('react-native-file-access');
|
|
59
|
-
} catch (e) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
'react-native-fast-image': {
|
|
65
|
-
minVersion: '8.5.11',
|
|
66
|
-
packageName: 'react-native-fast-image',
|
|
67
|
-
moduleName: 'FastImageView',
|
|
68
|
-
url: 'https://github.com/DylanVann/react-native-fast-image',
|
|
69
|
-
getPackage(logLevel) {
|
|
70
|
-
checkLink(this, logLevel);
|
|
33
|
+
export interface DynamicModules {
|
|
34
|
+
'@react-native-community/netinfo': typeof RNCNetInfo;
|
|
35
|
+
}
|
|
71
36
|
|
|
72
|
-
|
|
73
|
-
return require('react-native-fast-image');
|
|
74
|
-
} catch (e) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
},
|
|
37
|
+
const SBUDynamicModuleRegistry: Record<SBUNativeModule, SBUDynamicModuleInfo> = {
|
|
79
38
|
'@react-native-community/netinfo': {
|
|
80
|
-
minVersion: '9.3.0',
|
|
81
39
|
packageName: '@react-native-community/netinfo',
|
|
82
|
-
|
|
40
|
+
nativeModuleNamespace: 'RNCNetInfo',
|
|
83
41
|
url: 'https://github.com/react-native-netinfo/react-native-netinfo',
|
|
84
42
|
getPackage(logLevel) {
|
|
85
43
|
checkLink(this, logLevel);
|
|
@@ -95,7 +53,7 @@ const SBUDynamicModuleRegistry: Record<SBUNativeModule, SBUDynamicModuleInfo> =
|
|
|
95
53
|
|
|
96
54
|
const SBUDynamicModule = {
|
|
97
55
|
register(mdi: SBUDynamicModuleInfo) {
|
|
98
|
-
SBUDynamicModuleRegistry[mdi.
|
|
56
|
+
SBUDynamicModuleRegistry[mdi.nativeModuleNamespace as SBUNativeModule] = mdi;
|
|
99
57
|
},
|
|
100
58
|
getInfo(name: SBUNativeModule) {
|
|
101
59
|
return SBUDynamicModuleRegistry[name] ?? null;
|
package/src/platform/types.ts
CHANGED
|
@@ -66,13 +66,35 @@ interface GetVideoThumbnailOptions {
|
|
|
66
66
|
timeMills?: number;
|
|
67
67
|
quality?: number;
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
interface CompressImageOptions {
|
|
71
|
+
/**
|
|
72
|
+
* A uri of image file to compress
|
|
73
|
+
* */
|
|
74
|
+
uri: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A resize width, apply only to downscale
|
|
78
|
+
* */
|
|
79
|
+
maxWidth?: number;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A resize height, apply only to downscale
|
|
83
|
+
* */
|
|
84
|
+
maxHeight?: number;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* A value in range 0.0 - 1.0 specifying compression level of the result image.
|
|
88
|
+
* 1 means highest quality and 0 the lowest quality.
|
|
89
|
+
* */
|
|
90
|
+
compressionRate?: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type GetVideoThumbnailResult = Promise<{ path: string } | null>;
|
|
94
|
+
type CompressImageResult = Promise<{ uri: string; size: number } | null>;
|
|
95
|
+
|
|
69
96
|
export interface MediaServiceInterface {
|
|
70
97
|
VideoComponent<Props = {}>(props: VideoProps & Props): JSX.Element;
|
|
71
|
-
getVideoThumbnail(options: GetVideoThumbnailOptions):
|
|
72
|
-
|
|
73
|
-
// path: string;
|
|
74
|
-
// compressionRate: number;
|
|
75
|
-
// resizingWidth: number;
|
|
76
|
-
// resizingHeight: number;
|
|
77
|
-
// }): Promise<{ path: string }>;
|
|
98
|
+
getVideoThumbnail(options: GetVideoThumbnailOptions): GetVideoThumbnailResult;
|
|
99
|
+
compressImage(options: CompressImageOptions): CompressImageResult;
|
|
78
100
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ErrorInfo, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
+
import type { SendbirdUser } from '@sendbird/uikit-utils';
|
|
4
|
+
|
|
3
5
|
export type KeyValuePairGet = [string, string | null];
|
|
4
6
|
export type KeyValuePairSet = [string, string];
|
|
5
7
|
export interface LocalCacheStorage {
|
|
@@ -16,3 +18,13 @@ export interface LocalCacheStorage {
|
|
|
16
18
|
export type ErrorBoundaryProps = { error: Error; errorInfo: ErrorInfo; reset: () => void };
|
|
17
19
|
|
|
18
20
|
export type CommonComponent<P = {}> = (props: P & { children?: ReactNode }) => null | JSX.Element; //ReactNode;
|
|
21
|
+
|
|
22
|
+
export type MentionedUser = {
|
|
23
|
+
range: Range;
|
|
24
|
+
user: SendbirdUser;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type Range = {
|
|
28
|
+
start: number;
|
|
29
|
+
end: number;
|
|
30
|
+
};
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const VERSION = '2.
|
|
1
|
+
const VERSION = '2.3.0';
|
|
2
2
|
export default VERSION;
|