@sendbird/uikit-react-native 2.1.0 → 2.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/lib/commonjs/components/ChatFlatList.js +2 -1
- package/lib/commonjs/components/ChatFlatList.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 +25 -10
- package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.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 +99 -14
- 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 +118 -78
- package/lib/commonjs/containers/SendbirdUIKitContainer.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 +18 -6
- 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 +28 -11
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/index.js +120 -31
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/index.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +31 -12
- 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 +9 -14
- 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/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 +93 -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/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/localization/StringSet.type.js +17 -5
- package/lib/commonjs/localization/StringSet.type.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/common.js +19 -0
- package/lib/commonjs/utils/common.js.map +1 -0
- 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/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 +25 -10
- package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.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 +101 -17
- 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 +116 -80
- package/lib/module/containers/SendbirdUIKitContainer.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 +18 -6
- 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 +24 -13
- package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelInput/index.js +117 -33
- package/lib/module/domain/groupChannel/component/GroupChannelInput/index.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +32 -14
- 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 +10 -15
- 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/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 +75 -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/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/localization/StringSet.type.js +18 -6
- package/lib/module/localization/StringSet.type.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/common.js +7 -0
- package/lib/module/utils/common.js.map +1 -0
- 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 +12 -3
- package/lib/typescript/src/contexts/LocalizationCtx.d.ts +2 -2
- package/lib/typescript/src/contexts/PlatformServiceCtx.d.ts +1 -1
- package/lib/typescript/src/contexts/ReactionCtx.d.ts +18 -0
- package/lib/typescript/src/contexts/SendbirdChatCtx.d.ts +10 -2
- 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 +4 -0
- 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 +7 -2
- package/lib/typescript/src/libs/EmojiManager.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/localization/StringSet.type.d.ts +16 -2
- package/lib/typescript/src/platform/createMediaService.expo.d.ts +1 -1
- package/lib/typescript/src/platform/createMediaService.native.d.ts +1 -1
- package/lib/typescript/src/platform/dynamicModule.d.ts +1 -1
- package/lib/typescript/src/platform/types.d.ts +5 -5
- package/lib/typescript/src/types.d.ts +13 -4
- package/lib/typescript/src/utils/common.d.ts +1 -0
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +6 -6
- package/src/components/ChatFlatList.tsx +2 -1
- package/src/components/MessageRenderer/FileMessage/BaseFileMessage.tsx +17 -12
- package/src/components/MessageRenderer/FileMessage/ImageFileMessage.tsx +25 -18
- package/src/components/MessageRenderer/FileMessage/VideoFileMessage.tsx +20 -10
- package/src/components/MessageRenderer/UserMessage/BaseUserMessage.tsx +82 -14
- package/src/components/MessageRenderer/UserMessage/OpenGraphUserMessage.tsx +135 -61
- 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 +141 -83
- package/src/contexts/ReactionCtx.tsx +102 -0
- package/src/contexts/SendbirdChatCtx.tsx +24 -2
- 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 +48 -19
- package/src/domain/groupChannel/component/GroupChannelInput/index.tsx +137 -43
- package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +27 -10
- 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 +9 -12
- 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/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 +54 -0
- package/src/hooks/useMentionSuggestion.ts +106 -0
- package/src/hooks/useMentionTextInput.ts +139 -0
- package/src/index.ts +13 -2
- package/src/libs/EmojiManager.ts +80 -0
- package/src/libs/MentionConfig.ts +40 -0
- package/src/libs/MentionManager.tsx +240 -0
- package/src/localization/StringSet.type.ts +38 -8
- package/src/types.ts +12 -0
- package/src/utils/common.ts +8 -0
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ScrollView","useSafeAreaInsets","createStyleSheet","useUIKitTheme","NOOP","createGroupChannelSettingsModule","createGroupChannelSettingsFragment","initModule","GroupChannelSettingsModule","onPressHeaderLeft","channel","onPressMenuModeration","onPressMenuMembers","onPressMenuLeaveChannel","menuItemsCreator","colors","left","right","backgroundColor","background","paddingLeft","styles","viewContainer","paddingHorizontal","paddingRight"],"sources":["createGroupChannelSettingsFragment.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { NOOP } from '@sendbird/uikit-utils';\n\nimport createGroupChannelSettingsModule from '../domain/groupChannelSettings/module/createGroupChannelSettingsModule';\nimport type { GroupChannelSettingsFragment, GroupChannelSettingsModule } from '../domain/groupChannelSettings/types';\n\nconst createGroupChannelSettingsFragment = (\n initModule?: Partial<GroupChannelSettingsModule>,\n): GroupChannelSettingsFragment => {\n const GroupChannelSettingsModule = createGroupChannelSettingsModule(initModule);\n\n return ({\n onPressHeaderLeft = NOOP,\n channel,\n onPressMenuModeration,\n onPressMenuMembers,\n onPressMenuLeaveChannel,\n menuItemsCreator,\n }) => {\n const { colors } = useUIKitTheme();\n const { left, right } = useSafeAreaInsets();\n\n return (\n <GroupChannelSettingsModule.Provider channel={channel}>\n <GroupChannelSettingsModule.Header onPressHeaderLeft={onPressHeaderLeft} />\n <ScrollView\n style={{ backgroundColor: colors.background }}\n contentContainerStyle={{\n paddingLeft: left + styles.viewContainer.paddingHorizontal,\n paddingRight: right + styles.viewContainer.paddingHorizontal,\n }}\n >\n <GroupChannelSettingsModule.Info />\n <GroupChannelSettingsModule.Menu\n menuItemsCreator={menuItemsCreator}\n onPressMenuModeration={onPressMenuModeration}\n onPressMenuMembers={onPressMenuMembers}\n onPressMenuLeaveChannel={onPressMenuLeaveChannel}\n />\n </ScrollView>\n </GroupChannelSettingsModule.Provider>\n );\n };\n};\n\nconst styles = createStyleSheet({\n viewContainer: {\n paddingHorizontal: 16,\n },\n});\n\nexport default createGroupChannelSettingsFragment;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,iBAAT,QAAkC,gCAAlC;AAEA,SAASC,gBAAT,EAA2BC,aAA3B,QAAgD,yCAAhD;AACA,SAASC,IAAT,QAAqB,uBAArB;AAEA,OAAOC,gCAAP,MAA6C,wEAA7C;;AAGA,MAAMC,kCAAkC,GACtCC,UADyC,IAER;EACjC,MAAMC,0BAA0B,GAAGH,gCAAgC,CAACE,UAAD,CAAnE;EAEA,OAAO,
|
|
1
|
+
{"version":3,"names":["React","ScrollView","useSafeAreaInsets","createStyleSheet","useUIKitTheme","NOOP","createGroupChannelSettingsModule","createGroupChannelSettingsFragment","initModule","GroupChannelSettingsModule","onPressHeaderLeft","channel","onPressMenuModeration","onPressMenuMembers","onPressMenuLeaveChannel","onPressMenuNotification","menuItemsCreator","colors","left","right","backgroundColor","background","paddingLeft","styles","viewContainer","paddingHorizontal","paddingRight"],"sources":["createGroupChannelSettingsFragment.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { NOOP } from '@sendbird/uikit-utils';\n\nimport createGroupChannelSettingsModule from '../domain/groupChannelSettings/module/createGroupChannelSettingsModule';\nimport type { GroupChannelSettingsFragment, GroupChannelSettingsModule } from '../domain/groupChannelSettings/types';\n\nconst createGroupChannelSettingsFragment = (\n initModule?: Partial<GroupChannelSettingsModule>,\n): GroupChannelSettingsFragment => {\n const GroupChannelSettingsModule = createGroupChannelSettingsModule(initModule);\n\n return ({\n onPressHeaderLeft = NOOP,\n channel,\n onPressMenuModeration,\n onPressMenuMembers,\n onPressMenuLeaveChannel,\n onPressMenuNotification,\n menuItemsCreator,\n }) => {\n const { colors } = useUIKitTheme();\n const { left, right } = useSafeAreaInsets();\n\n return (\n <GroupChannelSettingsModule.Provider channel={channel}>\n <GroupChannelSettingsModule.Header onPressHeaderLeft={onPressHeaderLeft} />\n <ScrollView\n style={{ backgroundColor: colors.background }}\n contentContainerStyle={{\n paddingLeft: left + styles.viewContainer.paddingHorizontal,\n paddingRight: right + styles.viewContainer.paddingHorizontal,\n }}\n >\n <GroupChannelSettingsModule.Info />\n <GroupChannelSettingsModule.Menu\n menuItemsCreator={menuItemsCreator}\n onPressMenuModeration={onPressMenuModeration}\n onPressMenuMembers={onPressMenuMembers}\n onPressMenuLeaveChannel={onPressMenuLeaveChannel}\n onPressMenuNotification={onPressMenuNotification}\n />\n </ScrollView>\n </GroupChannelSettingsModule.Provider>\n );\n };\n};\n\nconst styles = createStyleSheet({\n viewContainer: {\n paddingHorizontal: 16,\n },\n});\n\nexport default createGroupChannelSettingsFragment;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,iBAAT,QAAkC,gCAAlC;AAEA,SAASC,gBAAT,EAA2BC,aAA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7 @@ const cacheRestrictCodes = [400300, 400301, 400302, 400310];
|
|
|
7
7
|
const useConnection = () => {
|
|
8
8
|
const {
|
|
9
9
|
sdk,
|
|
10
|
+
emojiManager,
|
|
10
11
|
setCurrentUser,
|
|
11
12
|
features
|
|
12
13
|
} = useSendbirdChat();
|
|
@@ -39,6 +40,7 @@ const useConnection = () => {
|
|
|
39
40
|
|
|
40
41
|
Logger.debug('[useConnection]', 'connected! (online)');
|
|
41
42
|
setCurrentUser(user);
|
|
43
|
+
sdk.getAllEmoji().then(emojiManager.init);
|
|
42
44
|
return user;
|
|
43
45
|
} catch (e) {
|
|
44
46
|
const error = e;
|
|
@@ -51,6 +53,7 @@ const useConnection = () => {
|
|
|
51
53
|
} else if (sdk.currentUser) {
|
|
52
54
|
Logger.debug('[useConnection]', 'connected! (offline)');
|
|
53
55
|
setCurrentUser(sdk.currentUser);
|
|
56
|
+
sdk.getAllEmoji().finally(emojiManager.init);
|
|
54
57
|
return sdk.currentUser;
|
|
55
58
|
}
|
|
56
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","Logger","useSendbirdChat","usePushTokenRegistration","cacheRestrictCodes","useConnection","sdk","setCurrentUser","features","registerPushTokenForCurrentUser","unregisterPushTokenForCurrentUser","connect","userId","opts","debug","user","accessToken","nickname","updateCurrentUserInfo","then","updatedUser","catch","e","warn","useUserIdForNicknameEnabled","autoPushTokenRegistrationEnabled","error","isCacheEnabled","some","code","message","clearCachedData","currentUser","disconnect","undefined","reconnect"],"sources":["useConnection.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nimport { Logger, SendbirdError, SendbirdUser } from '@sendbird/uikit-utils';\n\nimport { useSendbirdChat } from './useContext';\nimport usePushTokenRegistration from './usePushTokenRegistration';\n\ntype ConnectOptions = { nickname?: string; accessToken?: string };\nconst cacheRestrictCodes = [400300, 400301, 400302, 400310];\n\nconst useConnection = () => {\n const { sdk, setCurrentUser, features } = useSendbirdChat();\n const { registerPushTokenForCurrentUser, unregisterPushTokenForCurrentUser } = usePushTokenRegistration();\n\n const connect = useCallback(\n async (userId: string, opts?: ConnectOptions): Promise<SendbirdUser> => {\n try {\n Logger.debug('[useConnection]', 'connect start:', userId);\n let user = await sdk.connect(userId, opts?.accessToken);\n\n if (opts?.nickname) {\n Logger.debug('[useConnection]', 'nickname-sync start:', opts.nickname);\n await sdk\n .updateCurrentUserInfo({ nickname: opts.nickname })\n .then((updatedUser) => (user = updatedUser))\n .catch((e) => Logger.warn('[useConnection]', 'nickname-sync failure', e));\n } else if (features.useUserIdForNicknameEnabled) {\n await sdk.updateCurrentUserInfo({ nickname: userId }).then((updatedUser) => (user = updatedUser));\n }\n\n if (features.autoPushTokenRegistrationEnabled) {\n Logger.debug('[useConnection]', 'autoPushTokenRegistration enabled, register for current user');\n await registerPushTokenForCurrentUser().catch((e) => {\n Logger.warn('[useConnection]', 'autoPushToken Registration failure', e);\n });\n }\n\n Logger.debug('[useConnection]', 'connected! (online)');\n setCurrentUser(user);\n\n return user;\n } catch (e) {\n const error = e as unknown as SendbirdError;\n\n if (sdk.isCacheEnabled) {\n if (cacheRestrictCodes.some((code) => error.code === code)) {\n Logger.warn('[useConnection]', 'offline connect restricted', error.message, error.code);\n Logger.warn('[useConnection]', 'clear cached-data');\n await sdk.clearCachedData().catch((e) => Logger.warn('[useConnection]', 'clear cached-data failure', e));\n } else if (sdk.currentUser) {\n Logger.debug('[useConnection]', 'connected! (offline)');\n setCurrentUser(sdk.currentUser);\n return sdk.currentUser;\n }\n }\n\n Logger.warn('[useConnection]', 'connect failure', error.message, error.code);\n throw error;\n }\n },\n [sdk, registerPushTokenForCurrentUser, features.autoPushTokenRegistrationEnabled],\n );\n\n const disconnect = useCallback(async () => {\n Logger.debug('[useConnection]', 'disconnect start');\n\n if (features.autoPushTokenRegistrationEnabled) {\n Logger.debug('[useConnection]', 'autoPushTokenRegistration enabled, unregister for current user');\n await unregisterPushTokenForCurrentUser().catch((e) => {\n Logger.warn('[useConnection]', 'autoPushToken unregister failure', e);\n });\n }\n\n await sdk.disconnect().then(() => setCurrentUser(undefined));\n Logger.debug('[useConnection]', 'disconnected!');\n }, [sdk, unregisterPushTokenForCurrentUser, features.autoPushTokenRegistrationEnabled]);\n\n return { connect, disconnect, reconnect: () => sdk.reconnect() };\n};\n\nexport default useConnection;\n"],"mappings":"AAAA,SAASA,WAAT,QAA4B,OAA5B;AAEA,SAASC,MAAT,QAAoD,uBAApD;AAEA,SAASC,eAAT,QAAgC,cAAhC;AACA,OAAOC,wBAAP,MAAqC,4BAArC;AAGA,MAAMC,kBAAkB,GAAG,CAAC,MAAD,EAAS,MAAT,EAAiB,MAAjB,EAAyB,MAAzB,CAA3B;;AAEA,MAAMC,aAAa,GAAG,MAAM;EAC1B,MAAM;IAAEC,GAAF;IAAOC,
|
|
1
|
+
{"version":3,"names":["useCallback","Logger","useSendbirdChat","usePushTokenRegistration","cacheRestrictCodes","useConnection","sdk","emojiManager","setCurrentUser","features","registerPushTokenForCurrentUser","unregisterPushTokenForCurrentUser","connect","userId","opts","debug","user","accessToken","nickname","updateCurrentUserInfo","then","updatedUser","catch","e","warn","useUserIdForNicknameEnabled","autoPushTokenRegistrationEnabled","getAllEmoji","init","error","isCacheEnabled","some","code","message","clearCachedData","currentUser","finally","disconnect","undefined","reconnect"],"sources":["useConnection.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nimport { Logger, SendbirdError, SendbirdUser } from '@sendbird/uikit-utils';\n\nimport { useSendbirdChat } from './useContext';\nimport usePushTokenRegistration from './usePushTokenRegistration';\n\ntype ConnectOptions = { nickname?: string; accessToken?: string };\nconst cacheRestrictCodes = [400300, 400301, 400302, 400310];\n\nconst useConnection = () => {\n const { sdk, emojiManager, setCurrentUser, features } = useSendbirdChat();\n const { registerPushTokenForCurrentUser, unregisterPushTokenForCurrentUser } = usePushTokenRegistration();\n\n const connect = useCallback(\n async (userId: string, opts?: ConnectOptions): Promise<SendbirdUser> => {\n try {\n Logger.debug('[useConnection]', 'connect start:', userId);\n let user = await sdk.connect(userId, opts?.accessToken);\n\n if (opts?.nickname) {\n Logger.debug('[useConnection]', 'nickname-sync start:', opts.nickname);\n await sdk\n .updateCurrentUserInfo({ nickname: opts.nickname })\n .then((updatedUser) => (user = updatedUser))\n .catch((e) => Logger.warn('[useConnection]', 'nickname-sync failure', e));\n } else if (features.useUserIdForNicknameEnabled) {\n await sdk.updateCurrentUserInfo({ nickname: userId }).then((updatedUser) => (user = updatedUser));\n }\n\n if (features.autoPushTokenRegistrationEnabled) {\n Logger.debug('[useConnection]', 'autoPushTokenRegistration enabled, register for current user');\n await registerPushTokenForCurrentUser().catch((e) => {\n Logger.warn('[useConnection]', 'autoPushToken Registration failure', e);\n });\n }\n\n Logger.debug('[useConnection]', 'connected! (online)');\n setCurrentUser(user);\n sdk.getAllEmoji().then(emojiManager.init);\n\n return user;\n } catch (e) {\n const error = e as unknown as SendbirdError;\n\n if (sdk.isCacheEnabled) {\n if (cacheRestrictCodes.some((code) => error.code === code)) {\n Logger.warn('[useConnection]', 'offline connect restricted', error.message, error.code);\n Logger.warn('[useConnection]', 'clear cached-data');\n await sdk.clearCachedData().catch((e) => Logger.warn('[useConnection]', 'clear cached-data failure', e));\n } else if (sdk.currentUser) {\n Logger.debug('[useConnection]', 'connected! (offline)');\n setCurrentUser(sdk.currentUser);\n sdk.getAllEmoji().finally(emojiManager.init);\n return sdk.currentUser;\n }\n }\n\n Logger.warn('[useConnection]', 'connect failure', error.message, error.code);\n throw error;\n }\n },\n [sdk, registerPushTokenForCurrentUser, features.autoPushTokenRegistrationEnabled],\n );\n\n const disconnect = useCallback(async () => {\n Logger.debug('[useConnection]', 'disconnect start');\n\n if (features.autoPushTokenRegistrationEnabled) {\n Logger.debug('[useConnection]', 'autoPushTokenRegistration enabled, unregister for current user');\n await unregisterPushTokenForCurrentUser().catch((e) => {\n Logger.warn('[useConnection]', 'autoPushToken unregister failure', e);\n });\n }\n\n await sdk.disconnect().then(() => setCurrentUser(undefined));\n Logger.debug('[useConnection]', 'disconnected!');\n }, [sdk, unregisterPushTokenForCurrentUser, features.autoPushTokenRegistrationEnabled]);\n\n return { connect, disconnect, reconnect: () => sdk.reconnect() };\n};\n\nexport default useConnection;\n"],"mappings":"AAAA,SAASA,WAAT,QAA4B,OAA5B;AAEA,SAASC,MAAT,QAAoD,uBAApD;AAEA,SAASC,eAAT,QAAgC,cAAhC;AACA,OAAOC,wBAAP,MAAqC,4BAArC;AAGA,MAAMC,kBAAkB,GAAG,CAAC,MAAD,EAAS,MAAT,EAAiB,MAAjB,EAAyB,MAAzB,CAA3B;;AAEA,MAAMC,aAAa,GAAG,MAAM;EAC1B,MAAM;IAAEC,GAAF;IAAOC,YAAP;IAAqBC,cAArB;IAAqCC;EAArC,IAAkDP,eAAe,EAAvE;EACA,MAAM;IAAEQ,+BAAF;IAAmCC;EAAnC,IAAyER,wBAAwB,EAAvG;EAEA,MAAMS,OAAO,GAAGZ,WAAW,CACzB,OAAOa,MAAP,EAAuBC,IAAvB,KAAwE;IACtE,IAAI;MACFb,MAAM,CAACc,KAAP,CAAa,iBAAb,EAAgC,gBAAhC,EAAkDF,MAAlD;MACA,IAAIG,IAAI,GAAG,MAAMV,GAAG,CAACM,OAAJ,CAAYC,MAAZ,EAAoBC,IAApB,aAAoBA,IAApB,uBAAoBA,IAAI,CAAEG,WAA1B,CAAjB;;MAEA,IAAIH,IAAJ,aAAIA,IAAJ,eAAIA,IAAI,CAAEI,QAAV,EAAoB;QAClBjB,MAAM,CAACc,KAAP,CAAa,iBAAb,EAAgC,sBAAhC,EAAwDD,IAAI,CAACI,QAA7D;QACA,MAAMZ,GAAG,CACNa,qBADG,CACmB;UAAED,QAAQ,EAAEJ,IAAI,CAACI;QAAjB,CADnB,EAEHE,IAFG,CAEGC,WAAD,IAAkBL,IAAI,GAAGK,WAF3B,EAGHC,KAHG,CAGIC,CAAD,IAAOtB,MAAM,CAACuB,IAAP,CAAY,iBAAZ,EAA+B,uBAA/B,EAAwDD,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
|
import { useContext } from 'react';
|
|
2
2
|
import { LocalizationContext } from '../contexts/LocalizationCtx';
|
|
3
3
|
import { PlatformServiceContext } from '../contexts/PlatformServiceCtx';
|
|
4
|
+
import { ReactionContext } from '../contexts/ReactionCtx';
|
|
4
5
|
import { SendbirdChatContext } from '../contexts/SendbirdChatCtx';
|
|
5
6
|
import { UserProfileContext } from '../contexts/UserProfileCtx';
|
|
6
7
|
export const useLocalization = () => {
|
|
@@ -23,4 +24,9 @@ export const useUserProfile = () => {
|
|
|
23
24
|
if (!value) throw new Error('UserProfileContext is not provided');
|
|
24
25
|
return value;
|
|
25
26
|
};
|
|
27
|
+
export const useReaction = () => {
|
|
28
|
+
const value = useContext(ReactionContext);
|
|
29
|
+
if (!value) throw new Error('ReactionContext is not provided');
|
|
30
|
+
return value;
|
|
31
|
+
};
|
|
26
32
|
//# sourceMappingURL=useContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","LocalizationContext","PlatformServiceContext","SendbirdChatContext","UserProfileContext","useLocalization","value","Error","usePlatformService","useSendbirdChat","useUserProfile"],"sources":["useContext.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { LocalizationContext } from '../contexts/LocalizationCtx';\nimport { PlatformServiceContext } from '../contexts/PlatformServiceCtx';\nimport { SendbirdChatContext } from '../contexts/SendbirdChatCtx';\nimport { UserProfileContext } from '../contexts/UserProfileCtx';\n\nexport const useLocalization = () => {\n const value = useContext(LocalizationContext);\n if (!value) throw new Error('LocalizationContext is not provided');\n return value;\n};\n\nexport const usePlatformService = () => {\n const value = useContext(PlatformServiceContext);\n if (!value) throw new Error('PlatformServiceContext is not provided');\n return value;\n};\n\nexport const useSendbirdChat = () => {\n const value = useContext(SendbirdChatContext);\n if (!value) throw new Error('SendbirdChatContext is not provided');\n return value;\n};\n\nexport const useUserProfile = () => {\n const value = useContext(UserProfileContext);\n if (!value) throw new Error('UserProfileContext is not provided');\n return value;\n};\n"],"mappings":"AAAA,SAASA,UAAT,QAA2B,OAA3B;AAEA,SAASC,mBAAT,QAAoC,6BAApC;AACA,SAASC,sBAAT,QAAuC,gCAAvC;AACA,SAASC,mBAAT,QAAoC,6BAApC;AACA,SAASC,kBAAT,QAAmC,4BAAnC;AAEA,OAAO,MAAMC,eAAe,GAAG,MAAM;EACnC,MAAMC,KAAK,
|
|
1
|
+
{"version":3,"names":["useContext","LocalizationContext","PlatformServiceContext","ReactionContext","SendbirdChatContext","UserProfileContext","useLocalization","value","Error","usePlatformService","useSendbirdChat","useUserProfile","useReaction"],"sources":["useContext.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { LocalizationContext } from '../contexts/LocalizationCtx';\nimport { PlatformServiceContext } from '../contexts/PlatformServiceCtx';\nimport { ReactionContext } from '../contexts/ReactionCtx';\nimport { SendbirdChatContext } from '../contexts/SendbirdChatCtx';\nimport { UserProfileContext } from '../contexts/UserProfileCtx';\n\nexport const useLocalization = () => {\n const value = useContext(LocalizationContext);\n if (!value) throw new Error('LocalizationContext is not provided');\n return value;\n};\n\nexport const usePlatformService = () => {\n const value = useContext(PlatformServiceContext);\n if (!value) throw new Error('PlatformServiceContext is not provided');\n return value;\n};\n\nexport const useSendbirdChat = () => {\n const value = useContext(SendbirdChatContext);\n if (!value) throw new Error('SendbirdChatContext is not provided');\n return value;\n};\n\nexport const useUserProfile = () => {\n const value = useContext(UserProfileContext);\n if (!value) throw new Error('UserProfileContext is not provided');\n return value;\n};\n\nexport const useReaction = () => {\n const value = useContext(ReactionContext);\n if (!value) throw new Error('ReactionContext is not provided');\n return value;\n};\n"],"mappings":"AAAA,SAASA,UAAT,QAA2B,OAA3B;AAEA,SAASC,mBAAT,QAAoC,6BAApC;AACA,SAASC,sBAAT,QAAuC,gCAAvC;AACA,SAASC,eAAT,QAAgC,yBAAhC;AACA,SAASC,mBAAT,QAAoC,6BAApC;AACA,SAASC,kBAAT,QAAmC,4BAAnC;AAEA,OAAO,MAAMC,eAAe,GAAG,MAAM;EACnC,MAAMC,KAAK,GAAGP,UAAU,CAACC,mBAAD,CAAxB;EACA,IAAI,CAACM,KAAL,EAAY,MAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;EACZ,OAAOD,KAAP;AACD,CAJM;AAMP,OAAO,MAAME,kBAAkB,GAAG,MAAM;EACtC,MAAMF,KAAK,GAAGP,UAAU,CAACE,sBAAD,CAAxB;EACA,IAAI,CAACK,KAAL,EAAY,MAAM,IAAIC,KAAJ,CAAU,wCAAV,CAAN;EACZ,OAAOD,KAAP;AACD,CAJM;AAMP,OAAO,MAAMG,eAAe,GAAG,MAAM;EACnC,MAAMH,KAAK,GAAGP,UAAU,CAACI,mBAAD,CAAxB;EACA,IAAI,CAACG,KAAL,EAAY,MAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;EACZ,OAAOD,KAAP;AACD,CAJM;AAMP,OAAO,MAAMI,cAAc,GAAG,MAAM;EAClC,MAAMJ,KAAK,GAAGP,UAAU,CAACK,kBAAD,CAAxB;EACA,IAAI,CAACE,KAAL,EAAY,MAAM,IAAIC,KAAJ,CAAU,oCAAV,CAAN;EACZ,OAAOD,KAAP;AACD,CAJM;AAMP,OAAO,MAAMK,WAAW,GAAG,MAAM;EAC/B,MAAML,KAAK,GAAGP,UAAU,CAACG,eAAD,CAAxB;EACA,IAAI,CAACI,KAAL,EAAY,MAAM,IAAIC,KAAJ,CAAU,iCAAV,CAAN;EACZ,OAAOD,KAAP;AACD,CAJM"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { Keyboard, LayoutAnimation, Platform } from 'react-native';
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
import { NOOP } from '@sendbird/uikit-utils';
|
|
5
|
+
|
|
6
|
+
const configureNextLayoutAnimation = event => {
|
|
7
|
+
const config = LayoutAnimation.create(event.duration, event.easing);
|
|
8
|
+
LayoutAnimation.configureNext(config);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
showEvent,
|
|
13
|
+
hideEvent
|
|
14
|
+
} = Platform.select({
|
|
15
|
+
android: {
|
|
16
|
+
showEvent: 'keyboardDidShow',
|
|
17
|
+
hideEvent: 'keyboardDidHide'
|
|
18
|
+
},
|
|
19
|
+
default: {
|
|
20
|
+
showEvent: 'keyboardWillShow',
|
|
21
|
+
hideEvent: 'keyboardWillHide'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const useKeyboardStatus = () => {
|
|
26
|
+
const [keyboardStatus, setKeyboardStatus] = useState({
|
|
27
|
+
visible: false,
|
|
28
|
+
height: 0,
|
|
29
|
+
bottomSpace: 0
|
|
30
|
+
});
|
|
31
|
+
const {
|
|
32
|
+
bottom: bottomInset
|
|
33
|
+
} = useSafeAreaInsets();
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const subscriptions = [Keyboard.addListener(showEvent, event => {
|
|
36
|
+
const height = event.endCoordinates.height;
|
|
37
|
+
const bottomSpace = Platform.select({
|
|
38
|
+
ios: height - bottomInset,
|
|
39
|
+
default: 0
|
|
40
|
+
});
|
|
41
|
+
const nextLayoutAnimation = Platform.select({
|
|
42
|
+
ios: configureNextLayoutAnimation,
|
|
43
|
+
default: NOOP
|
|
44
|
+
});
|
|
45
|
+
nextLayoutAnimation(event);
|
|
46
|
+
setKeyboardStatus({
|
|
47
|
+
visible: true,
|
|
48
|
+
height,
|
|
49
|
+
bottomSpace
|
|
50
|
+
});
|
|
51
|
+
}), Keyboard.addListener(hideEvent, event => {
|
|
52
|
+
const height = 0;
|
|
53
|
+
const bottomSpace = Platform.select({
|
|
54
|
+
default: height
|
|
55
|
+
});
|
|
56
|
+
const nextLayoutAnimation = Platform.select({
|
|
57
|
+
ios: configureNextLayoutAnimation,
|
|
58
|
+
default: NOOP
|
|
59
|
+
});
|
|
60
|
+
nextLayoutAnimation(event);
|
|
61
|
+
setKeyboardStatus({
|
|
62
|
+
visible: false,
|
|
63
|
+
height,
|
|
64
|
+
bottomSpace
|
|
65
|
+
});
|
|
66
|
+
})];
|
|
67
|
+
return () => {
|
|
68
|
+
subscriptions.forEach(it => it.remove());
|
|
69
|
+
};
|
|
70
|
+
}, []);
|
|
71
|
+
return keyboardStatus;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default useKeyboardStatus;
|
|
75
|
+
//# sourceMappingURL=useKeyboardStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useState","Keyboard","LayoutAnimation","Platform","useSafeAreaInsets","NOOP","configureNextLayoutAnimation","event","config","create","duration","easing","configureNext","showEvent","hideEvent","select","android","default","useKeyboardStatus","keyboardStatus","setKeyboardStatus","visible","height","bottomSpace","bottom","bottomInset","subscriptions","addListener","endCoordinates","ios","nextLayoutAnimation","forEach","it","remove"],"sources":["useKeyboardStatus.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { Keyboard, KeyboardEvent, KeyboardEventName, LayoutAnimation, Platform } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { NOOP } from '@sendbird/uikit-utils';\n\ntype KeyboardEvents = {\n showEvent: KeyboardEventName;\n hideEvent: KeyboardEventName;\n};\n\nconst configureNextLayoutAnimation = (event: KeyboardEvent) => {\n const config = LayoutAnimation.create(event.duration, event.easing);\n LayoutAnimation.configureNext(config);\n};\n\nconst { showEvent, hideEvent } = Platform.select<KeyboardEvents>({\n android: { showEvent: 'keyboardDidShow', hideEvent: 'keyboardDidHide' },\n default: { showEvent: 'keyboardWillShow', hideEvent: 'keyboardWillHide' },\n});\n\nconst useKeyboardStatus = () => {\n const [keyboardStatus, setKeyboardStatus] = useState({ visible: false, height: 0, bottomSpace: 0 });\n const { bottom: bottomInset } = useSafeAreaInsets();\n\n useEffect(() => {\n const subscriptions = [\n Keyboard.addListener(showEvent, (event) => {\n const height = event.endCoordinates.height;\n const bottomSpace = Platform.select({ ios: height - bottomInset, default: 0 });\n const nextLayoutAnimation = Platform.select({ ios: configureNextLayoutAnimation, default: NOOP });\n\n nextLayoutAnimation(event);\n setKeyboardStatus({ visible: true, height, bottomSpace });\n }),\n\n Keyboard.addListener(hideEvent, (event) => {\n const height = 0;\n const bottomSpace = Platform.select({ default: height });\n const nextLayoutAnimation = Platform.select({ ios: configureNextLayoutAnimation, default: NOOP });\n\n nextLayoutAnimation(event);\n setKeyboardStatus({ visible: false, height, bottomSpace });\n }),\n ];\n return () => {\n subscriptions.forEach((it) => it.remove());\n };\n }, []);\n\n return keyboardStatus;\n};\n\nexport default useKeyboardStatus;\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,QAApB,QAAoC,OAApC;AACA,SAASC,QAAT,EAAqDC,eAArD,EAAsEC,QAAtE,QAAsF,cAAtF;AACA,SAASC,iBAAT,QAAkC,gCAAlC;AAEA,SAASC,IAAT,QAAqB,uBAArB;;AAOA,MAAMC,4BAA4B,GAAIC,KAAD,IAA0B;EAC7D,MAAMC,MAAM,GAAGN,eAAe,CAACO,MAAhB,CAAuBF,KAAK,CAACG,QAA7B,EAAuCH,KAAK,CAACI,MAA7C,CAAf;EACAT,eAAe,CAACU,aAAhB,CAA8BJ,MAA9B;AACD,CAHD;;AAKA,MAAM;EAAEK,SAAF;EAAaC;AAAb,IAA2BX,QAAQ,CAACY,MAAT,CAAgC;EAC/DC,OAAO,EAAE;IAAEH,SAAS,EAAE,iBAAb;IAAgCC,SAAS,EAAE;EAA3C,CADsD;EAE/DG,OAAO,EAAE;IAAEJ,SAAS,EAAE,kBAAb;IAAiCC,SAAS,EAAE;EAA5C;AAFsD,CAAhC,CAAjC;;AAKA,MAAMI,iBAAiB,GAAG,MAAM;EAC9B,MAAM,CAACC,cAAD,EAAiBC,iBAAjB,IAAsCpB,QAAQ,CAAC;IAAEqB,OAAO,EAAE,KAAX;IAAkBC,MAAM,EAAE,CAA1B;IAA6BC,WAAW,EAAE;EAA1C,CAAD,CAApD;EACA,MAAM;IAAE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,CAAT;EAyBA,OAAOd,cAAP;AACD,CA9BD;;AAgCA,eAAeD,iBAAf"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useAsyncEffect } from '@sendbird/uikit-utils';
|
|
3
|
+
import { useSendbirdChat } from '../hooks/useContext';
|
|
4
|
+
|
|
5
|
+
const useMentionSuggestion = params => {
|
|
6
|
+
const {
|
|
7
|
+
text,
|
|
8
|
+
selection,
|
|
9
|
+
channel,
|
|
10
|
+
mentionedUsers
|
|
11
|
+
} = params;
|
|
12
|
+
const [freshChannel, setFreshChannel] = useState(channel);
|
|
13
|
+
useAsyncEffect(async () => {
|
|
14
|
+
setFreshChannel(await channel.refresh());
|
|
15
|
+
}, [channel.url]);
|
|
16
|
+
const {
|
|
17
|
+
mentionManager,
|
|
18
|
+
currentUser
|
|
19
|
+
} = useSendbirdChat();
|
|
20
|
+
const [members, setMembers] = useState([]);
|
|
21
|
+
const timeoutRef = useRef();
|
|
22
|
+
const searchStringRangeRef = useRef({
|
|
23
|
+
start: 0,
|
|
24
|
+
end: 0
|
|
25
|
+
});
|
|
26
|
+
const searchLimitedRef = useRef(false);
|
|
27
|
+
|
|
28
|
+
const updateSearchStringRange = (selectionIndex, searchString) => {
|
|
29
|
+
searchStringRangeRef.current = mentionManager.getSearchStringRangeInText(selectionIndex, searchString);
|
|
30
|
+
return searchStringRangeRef.current;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const updateSearchLimited = (mentionCount, mentionLimit) => {
|
|
34
|
+
searchLimitedRef.current = mentionCount >= mentionLimit;
|
|
35
|
+
return searchLimitedRef.current;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const resetRefs = () => {
|
|
39
|
+
searchLimitedRef.current = false;
|
|
40
|
+
searchStringRangeRef.current = {
|
|
41
|
+
start: 0,
|
|
42
|
+
end: 0
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const fetchMembers = async () => {
|
|
47
|
+
resetRefs();
|
|
48
|
+
const selectionRanged = selection.start !== selection.end;
|
|
49
|
+
if (selectionRanged) return [];
|
|
50
|
+
const selectionContainsMentionedUser = mentionedUsers.some(it => mentionManager.rangeHelpers.overlaps(it.range, selection, 'underMore'));
|
|
51
|
+
if (selectionContainsMentionedUser) return [];
|
|
52
|
+
const {
|
|
53
|
+
isTriggered,
|
|
54
|
+
isValidSearchString,
|
|
55
|
+
searchString
|
|
56
|
+
} = mentionManager.getSearchString(text, selection.start);
|
|
57
|
+
if (!isTriggered() || !isValidSearchString()) return [];
|
|
58
|
+
const limited = updateSearchLimited(mentionedUsers.length, mentionManager.config.mentionLimit);
|
|
59
|
+
if (limited) return [];
|
|
60
|
+
updateSearchStringRange(selection.start, searchString);
|
|
61
|
+
|
|
62
|
+
if (freshChannel.isSuper) {
|
|
63
|
+
return freshChannel.createMemberListQuery({
|
|
64
|
+
nicknameStartsWithFilter: searchString,
|
|
65
|
+
limit: mentionManager.config.suggestionLimit + 1
|
|
66
|
+
}).next().then(members => members.filter(member => member.userId !== (currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId)));
|
|
67
|
+
} else {
|
|
68
|
+
return freshChannel.members.sort((a, b) => {
|
|
69
|
+
var _a$nickname;
|
|
70
|
+
|
|
71
|
+
return (_a$nickname = a.nickname) === null || _a$nickname === void 0 ? void 0 : _a$nickname.localeCompare(b.nickname);
|
|
72
|
+
}).filter(member => {
|
|
73
|
+
var _member$nickname;
|
|
74
|
+
|
|
75
|
+
return ((_member$nickname = member.nickname) === null || _member$nickname === void 0 ? void 0 : _member$nickname.toLowerCase().startsWith(searchString.toLowerCase())) && member.userId !== (currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId);
|
|
76
|
+
}).slice(0, mentionManager.config.suggestionLimit);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
timeoutRef.current = setTimeout(async () => {
|
|
82
|
+
fetchMembers().then(setMembers).catch(() => setMembers([])).finally(() => timeoutRef.current = undefined);
|
|
83
|
+
}, mentionManager.config.debounceMills);
|
|
84
|
+
return () => {
|
|
85
|
+
if (timeoutRef.current) {
|
|
86
|
+
clearTimeout(timeoutRef.current);
|
|
87
|
+
timeoutRef.current = undefined;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}, [text, selection]);
|
|
91
|
+
return {
|
|
92
|
+
members,
|
|
93
|
+
reset: useCallback(() => setMembers([]), []),
|
|
94
|
+
searchStringRange: searchStringRangeRef.current,
|
|
95
|
+
searchLimited: searchLimitedRef.current
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default useMentionSuggestion;
|
|
100
|
+
//# sourceMappingURL=useMentionSuggestion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useRef","useState","useAsyncEffect","useSendbirdChat","useMentionSuggestion","params","text","selection","channel","mentionedUsers","freshChannel","setFreshChannel","refresh","url","mentionManager","currentUser","members","setMembers","timeoutRef","searchStringRangeRef","start","end","searchLimitedRef","updateSearchStringRange","selectionIndex","searchString","current","getSearchStringRangeInText","updateSearchLimited","mentionCount","mentionLimit","resetRefs","fetchMembers","selectionRanged","selectionContainsMentionedUser","some","it","rangeHelpers","overlaps","range","isTriggered","isValidSearchString","getSearchString","limited","length","config","isSuper","createMemberListQuery","nicknameStartsWithFilter","limit","suggestionLimit","next","then","filter","member","userId","sort","a","b","nickname","localeCompare","toLowerCase","startsWith","slice","setTimeout","catch","finally","undefined","debounceMills","clearTimeout","reset","searchStringRange","searchLimited"],"sources":["useMentionSuggestion.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { SendbirdGroupChannel, SendbirdMember, SendbirdUser } from '@sendbird/uikit-utils';\nimport { useAsyncEffect } from '@sendbird/uikit-utils';\n\nimport { useSendbirdChat } from '../hooks/useContext';\nimport type { Range } from '../types';\n\nconst useMentionSuggestion = (params: {\n text: string;\n selection: Range;\n channel: SendbirdGroupChannel;\n mentionedUsers: { user: SendbirdUser; range: Range }[];\n}) => {\n const { text, selection, channel, mentionedUsers } = params;\n\n const [freshChannel, setFreshChannel] = useState(channel);\n\n useAsyncEffect(async () => {\n setFreshChannel(await channel.refresh());\n }, [channel.url]);\n\n const { mentionManager, currentUser } = useSendbirdChat();\n const [members, setMembers] = useState<SendbirdMember[]>([]);\n const timeoutRef = useRef<NodeJS.Timeout>();\n\n const searchStringRangeRef = useRef<Range>({ start: 0, end: 0 });\n const searchLimitedRef = useRef(false);\n\n const updateSearchStringRange = (selectionIndex: number, searchString: string) => {\n searchStringRangeRef.current = mentionManager.getSearchStringRangeInText(selectionIndex, searchString);\n return searchStringRangeRef.current;\n };\n const updateSearchLimited = (mentionCount: number, mentionLimit: number) => {\n searchLimitedRef.current = mentionCount >= mentionLimit;\n return searchLimitedRef.current;\n };\n const resetRefs = () => {\n searchLimitedRef.current = false;\n searchStringRangeRef.current = { start: 0, end: 0 };\n };\n\n const fetchMembers = async (): Promise<SendbirdMember[]> => {\n resetRefs();\n\n const selectionRanged = selection.start !== selection.end;\n if (selectionRanged) return [];\n\n const selectionContainsMentionedUser = mentionedUsers.some((it) =>\n mentionManager.rangeHelpers.overlaps(it.range, selection, 'underMore'),\n );\n if (selectionContainsMentionedUser) return [];\n\n const { isTriggered, isValidSearchString, searchString } = mentionManager.getSearchString(text, selection.start);\n if (!isTriggered() || !isValidSearchString()) return [];\n\n const limited = updateSearchLimited(mentionedUsers.length, mentionManager.config.mentionLimit);\n if (limited) return [];\n\n updateSearchStringRange(selection.start, searchString);\n\n if (freshChannel.isSuper) {\n return freshChannel\n .createMemberListQuery({\n nicknameStartsWithFilter: searchString,\n limit: mentionManager.config.suggestionLimit + 1,\n })\n .next()\n .then((members) => members.filter((member) => member.userId !== currentUser?.userId));\n } else {\n return freshChannel.members\n .sort((a, b) => a.nickname?.localeCompare(b.nickname))\n .filter(\n (member) =>\n member.nickname?.toLowerCase().startsWith(searchString.toLowerCase()) &&\n member.userId !== currentUser?.userId,\n )\n .slice(0, mentionManager.config.suggestionLimit);\n }\n };\n\n useEffect(() => {\n timeoutRef.current = setTimeout(async () => {\n fetchMembers()\n .then(setMembers)\n .catch(() => setMembers([]))\n .finally(() => (timeoutRef.current = undefined));\n }, mentionManager.config.debounceMills);\n\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n };\n }, [text, selection]);\n\n return {\n members,\n reset: useCallback(() => setMembers([]), []),\n searchStringRange: searchStringRangeRef.current,\n searchLimited: searchLimitedRef.current,\n };\n};\n\nexport default useMentionSuggestion;\n"],"mappings":"AAAA,SAASA,WAAT,EAAsBC,SAAtB,EAAiCC,MAAjC,EAAyCC,QAAzC,QAAyD,OAAzD;AAGA,SAASC,cAAT,QAA+B,uBAA/B;AAEA,SAASC,eAAT,QAAgC,qBAAhC;;AAGA,MAAMC,oBAAoB,GAAIC,MAAD,IAKvB;EACJ,MAAM;IAAEC,IAAF;IAAQC,SAAR;IAAmBC,OAAnB;IAA4BC;EAA5B,IAA+CJ,MAArD;EAEA,MAAM,CAACK,YAAD,EAAeC,eAAf,IAAkCV,QAAQ,CAACO,OAAD,CAAhD;EAEAN,cAAc,CAAC,YAAY;IACzBS,eAAe,CAAC,MAAMH,OAAO,CAACI,OAAR,EAAP,CAAf;EACD,CAFa,EAEX,CAACJ,OAAO,CAACK,GAAT,CAFW,CAAd;EAIA,MAAM;IAAEC,cAAF;IAAkBC;EAAlB,IAAkCZ,eAAe,EAAvD;EACA,MAAM,CAACa,OAAD,EAAUC,UAAV,IAAwBhB,QAAQ,CAAmB,EAAnB,CAAtC;EACA,MAAMiB,UAAU,GAAGlB,MAAM,EAAzB;EAEA,MAAMmB,oBAAoB,GAAGnB,MAAM,CAAQ;IAAEoB,KAAK,EAAE,CAAT;IAAYC,GAAG,EAAE;EAAjB,CAAR,CAAnC;EACA,MAAMC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AMhD,UAAU,CAAC,EAAD,CAFzB,EAGGiD,OAHH,CAGW,MAAOhD,UAAU,CAACQ,OAAX,GAAqByC,SAHvC;IAID,CAL8B,EAK5BrD,cAAc,CAAC+B,MAAf,CAAsBuB,aALM,CAA/B;IAOA,OAAO,MAAM;MACX,IAAIlD,UAAU,CAACQ,OAAf,EAAwB;QACtB2C,YAAY,CAACnD,UAAU,CAACQ,OAAZ,CAAZ;QACAR,UAAU,CAACQ,OAAX,GAAqByC,SAArB;MACD;IACF,CALD;EAMD,CAdQ,EAcN,CAAC7D,IAAD,EAAOC,SAAP,CAdM,CAAT;EAgBA,OAAO;IACLS,OADK;IAELsD,KAAK,EAAExE,WAAW,CAAC,MAAMmB,UAAU,CAAC,EAAD,CAAjB,EAAuB,EAAvB,CAFb;IAGLsD,iBAAiB,EAAEpD,oBAAoB,CAACO,OAHnC;IAIL8C,aAAa,EAAElD,gBAAgB,CAACI;EAJ3B,CAAP;AAMD,CA/FD;;AAiGA,eAAetB,oBAAf"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import { replace, useFreshCallback } from '@sendbird/uikit-utils';
|
|
4
|
+
import { useSendbirdChat } from './useContext';
|
|
5
|
+
|
|
6
|
+
const useMentionTextInput = params => {
|
|
7
|
+
const {
|
|
8
|
+
mentionManager
|
|
9
|
+
} = useSendbirdChat();
|
|
10
|
+
const mentionedUsersRef = useRef([]);
|
|
11
|
+
const textInputRef = useRef();
|
|
12
|
+
const [text, setText] = useState('');
|
|
13
|
+
const [selection, setSelection] = useState({
|
|
14
|
+
start: 0,
|
|
15
|
+
end: 0
|
|
16
|
+
}); // TODO: Refactor text edit logic more clearly
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (mentionManager.shouldUseMentionedMessageTemplate(params.messageToEdit)) {
|
|
20
|
+
const result = mentionManager.templateToTextAndMentionedUsers(params.messageToEdit.mentionedMessageTemplate, params.messageToEdit.mentionedUsers);
|
|
21
|
+
mentionedUsersRef.current = result.mentionedUsers;
|
|
22
|
+
setText(result.mentionedText);
|
|
23
|
+
} else {
|
|
24
|
+
var _params$messageToEdit;
|
|
25
|
+
|
|
26
|
+
mentionedUsersRef.current = [];
|
|
27
|
+
|
|
28
|
+
if ((_params$messageToEdit = params.messageToEdit) !== null && _params$messageToEdit !== void 0 && _params$messageToEdit.isUserMessage()) {
|
|
29
|
+
setText(params.messageToEdit.message);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}, [params.messageToEdit]);
|
|
33
|
+
const onChangeText = useFreshCallback((_nextText, addedMentionedUser) => {
|
|
34
|
+
const prevText = text;
|
|
35
|
+
let nextText = _nextText;
|
|
36
|
+
let offset = nextText.length - prevText.length; // Text clear
|
|
37
|
+
|
|
38
|
+
if (nextText === '') {
|
|
39
|
+
mentionedUsersRef.current = [];
|
|
40
|
+
} // Text add
|
|
41
|
+
else if (offset > 0) {
|
|
42
|
+
/** Add mentioned user **/
|
|
43
|
+
if (addedMentionedUser) mentionedUsersRef.current.push(addedMentionedUser);
|
|
44
|
+
/** Reconcile mentioned users range on the right side of the selection **/
|
|
45
|
+
|
|
46
|
+
mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(offset, selection.end, mentionedUsersRef.current);
|
|
47
|
+
} // Text remove
|
|
48
|
+
else if (offset < 0) {
|
|
49
|
+
// Ranged remove
|
|
50
|
+
if (selection.start !== selection.end) {
|
|
51
|
+
/** Filter mentioned users in selection range **/
|
|
52
|
+
const {
|
|
53
|
+
filtered,
|
|
54
|
+
lastSelection
|
|
55
|
+
} = mentionManager.removeMentionedUsersInSelection(selection, mentionedUsersRef.current);
|
|
56
|
+
/** Reconcile mentioned users range on the right side of the selection **/
|
|
57
|
+
|
|
58
|
+
mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(offset, Math.max(selection.end, lastSelection), filtered);
|
|
59
|
+
} // Single remove
|
|
60
|
+
else {
|
|
61
|
+
/** Find mentioned user who ranges in removed selection **/
|
|
62
|
+
const foundIndex = mentionedUsersRef.current.findIndex(it => mentionManager.rangeHelpers.overlaps(it.range, selection, 'underMore'));
|
|
63
|
+
/** If found, remove from the mentioned user list and remove remainder text **/
|
|
64
|
+
|
|
65
|
+
if (foundIndex > -1) {
|
|
66
|
+
const it = mentionedUsersRef.current[foundIndex];
|
|
67
|
+
const remainderLength = it.range.end - it.range.start + offset;
|
|
68
|
+
offset = -remainderLength + offset;
|
|
69
|
+
nextText = replace(nextText, it.range.start, it.range.start + remainderLength, '');
|
|
70
|
+
mentionedUsersRef.current.splice(foundIndex, 1);
|
|
71
|
+
}
|
|
72
|
+
/** Reconcile mentioned users range on the right side of the selection **/
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(offset, selection.end, mentionedUsersRef.current);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
setText(nextText);
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
textInputRef,
|
|
83
|
+
selection,
|
|
84
|
+
onSelectionChange: useFreshCallback(e => {
|
|
85
|
+
const nativeSelection = { ...e.nativeEvent.selection
|
|
86
|
+
}; // NOTE: To synchronize call onSelectionChange after onChangeText called on each platform.
|
|
87
|
+
|
|
88
|
+
setTimeout(() => {
|
|
89
|
+
const mentionedUser = mentionedUsersRef.current.find(it => mentionManager.rangeHelpers.overlaps(it.range, nativeSelection)); // Selection should be blocked if changed into mentioned area
|
|
90
|
+
|
|
91
|
+
if (mentionedUser) {
|
|
92
|
+
var _textInputRef$current;
|
|
93
|
+
|
|
94
|
+
const selectionBlock = {
|
|
95
|
+
start: mentionedUser.range.start,
|
|
96
|
+
end: mentionedUser.range.end
|
|
97
|
+
};
|
|
98
|
+
(_textInputRef$current = textInputRef.current) === null || _textInputRef$current === void 0 ? void 0 : _textInputRef$current.setNativeProps({
|
|
99
|
+
selection: selectionBlock
|
|
100
|
+
}); // BUG: setNativeProps called again when invoked onChangeText
|
|
101
|
+
// https://github.com/facebook/react-native/issues/33520
|
|
102
|
+
|
|
103
|
+
if (Platform.OS === 'android') {
|
|
104
|
+
setTimeout(() => {
|
|
105
|
+
var _textInputRef$current2;
|
|
106
|
+
|
|
107
|
+
(_textInputRef$current2 = textInputRef.current) === null || _textInputRef$current2 === void 0 ? void 0 : _textInputRef$current2.setNativeProps({
|
|
108
|
+
selection: {
|
|
109
|
+
start: 0
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}, 250);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
setSelection(selectionBlock);
|
|
116
|
+
} else {
|
|
117
|
+
setSelection(nativeSelection);
|
|
118
|
+
}
|
|
119
|
+
}, 10);
|
|
120
|
+
}),
|
|
121
|
+
text,
|
|
122
|
+
onChangeText,
|
|
123
|
+
mentionedUsers: mentionedUsersRef.current
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export default useMentionTextInput;
|
|
128
|
+
//# sourceMappingURL=useMentionTextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","Platform","replace","useFreshCallback","useSendbirdChat","useMentionTextInput","params","mentionManager","mentionedUsersRef","textInputRef","text","setText","selection","setSelection","start","end","shouldUseMentionedMessageTemplate","messageToEdit","result","templateToTextAndMentionedUsers","mentionedMessageTemplate","mentionedUsers","current","mentionedText","isUserMessage","message","onChangeText","_nextText","addedMentionedUser","prevText","nextText","offset","length","push","reconcileRangeOfMentionedUsers","filtered","lastSelection","removeMentionedUsersInSelection","Math","max","foundIndex","findIndex","it","rangeHelpers","overlaps","range","remainderLength","splice","onSelectionChange","e","nativeSelection","nativeEvent","setTimeout","mentionedUser","find","selectionBlock","setNativeProps","OS"],"sources":["useMentionTextInput.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport type { NativeSyntheticEvent, TextInput, TextInputSelectionChangeEventData } from 'react-native';\nimport { Platform } from 'react-native';\n\nimport { SendbirdFileMessage, SendbirdUserMessage, replace, useFreshCallback } from '@sendbird/uikit-utils';\n\nimport type { MentionedUser } from '../types';\nimport { useSendbirdChat } from './useContext';\n\nconst useMentionTextInput = (params: { messageToEdit?: SendbirdUserMessage | SendbirdFileMessage }) => {\n const { mentionManager } = useSendbirdChat();\n\n const mentionedUsersRef = useRef<MentionedUser[]>([]);\n const textInputRef = useRef<TextInput>();\n\n const [text, setText] = useState('');\n const [selection, setSelection] = useState({ start: 0, end: 0 });\n\n // TODO: Refactor text edit logic more clearly\n useEffect(() => {\n if (mentionManager.shouldUseMentionedMessageTemplate(params.messageToEdit)) {\n const result = mentionManager.templateToTextAndMentionedUsers(\n params.messageToEdit.mentionedMessageTemplate,\n params.messageToEdit.mentionedUsers,\n );\n\n mentionedUsersRef.current = result.mentionedUsers;\n setText(result.mentionedText);\n } else {\n mentionedUsersRef.current = [];\n if (params.messageToEdit?.isUserMessage()) {\n setText(params.messageToEdit.message);\n }\n }\n }, [params.messageToEdit]);\n\n const onChangeText = useFreshCallback((_nextText: string, addedMentionedUser?: MentionedUser) => {\n const prevText = text;\n let nextText = _nextText;\n let offset = nextText.length - prevText.length;\n\n // Text clear\n if (nextText === '') {\n mentionedUsersRef.current = [];\n }\n // Text add\n else if (offset > 0) {\n /** Add mentioned user **/\n if (addedMentionedUser) mentionedUsersRef.current.push(addedMentionedUser);\n\n /** Reconcile mentioned users range on the right side of the selection **/\n mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(\n offset,\n selection.end,\n mentionedUsersRef.current,\n );\n }\n // Text remove\n else if (offset < 0) {\n // Ranged remove\n if (selection.start !== selection.end) {\n /** Filter mentioned users in selection range **/\n const { filtered, lastSelection } = mentionManager.removeMentionedUsersInSelection(\n selection,\n mentionedUsersRef.current,\n );\n\n /** Reconcile mentioned users range on the right side of the selection **/\n mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(\n offset,\n Math.max(selection.end, lastSelection),\n filtered,\n );\n }\n // Single remove\n else {\n /** Find mentioned user who ranges in removed selection **/\n const foundIndex = mentionedUsersRef.current.findIndex((it) =>\n mentionManager.rangeHelpers.overlaps(it.range, selection, 'underMore'),\n );\n /** If found, remove from the mentioned user list and remove remainder text **/\n if (foundIndex > -1) {\n const it = mentionedUsersRef.current[foundIndex];\n const remainderLength = it.range.end - it.range.start + offset;\n\n offset = -remainderLength + offset;\n nextText = replace(nextText, it.range.start, it.range.start + remainderLength, '');\n\n mentionedUsersRef.current.splice(foundIndex, 1);\n }\n\n /** Reconcile mentioned users range on the right side of the selection **/\n mentionedUsersRef.current = mentionManager.reconcileRangeOfMentionedUsers(\n offset,\n selection.end,\n mentionedUsersRef.current,\n );\n }\n }\n\n setText(nextText);\n });\n\n return {\n textInputRef,\n selection,\n onSelectionChange: useFreshCallback((e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => {\n const nativeSelection = { ...e.nativeEvent.selection };\n\n // NOTE: To synchronize call onSelectionChange after onChangeText called on each platform.\n setTimeout(() => {\n const mentionedUser = mentionedUsersRef.current.find((it) =>\n mentionManager.rangeHelpers.overlaps(it.range, nativeSelection),\n );\n\n // Selection should be blocked if changed into mentioned area\n if (mentionedUser) {\n const selectionBlock = { start: mentionedUser.range.start, end: mentionedUser.range.end };\n textInputRef.current?.setNativeProps({ selection: selectionBlock });\n // BUG: setNativeProps called again when invoked onChangeText\n // https://github.com/facebook/react-native/issues/33520\n if (Platform.OS === 'android') {\n setTimeout(() => {\n textInputRef.current?.setNativeProps({ selection: { start: 0 } });\n }, 250);\n }\n setSelection(selectionBlock);\n } else {\n setSelection(nativeSelection);\n }\n }, 10);\n }),\n text,\n onChangeText,\n mentionedUsers: mentionedUsersRef.current,\n };\n};\n\nexport default useMentionTextInput;\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,MAApB,EAA4BC,QAA5B,QAA4C,OAA5C;AAEA,SAASC,QA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AAoB9B;UAA7D,CAAvB;UACA,yBAAAN,YAAY,CAACa,OAAb,gFAAsBkC,cAAtB,CAAqC;YAAE5C,SAAS,EAAE2C;UAAb,CAArC,EAFiB,CAGjB;UACA;;UACA,IAAItD,QAAQ,CAACwD,EAAT,KAAgB,SAApB,EAA+B;YAC7BL,UAAU,CAAC,MAAM;cAAA;;cACf,0BAAA3C,YAAY,CAACa,OAAb,kFAAsBkC,cAAtB,CAAqC;gBAAE5C,SAAS,EAAE;kBAAEE,KAAK,EAAE;gBAAT;cAAb,CAArC;YACD,CAFS,EAEP,GAFO,CAAV;UAGD;;UACDD,YAAY,CAAC0C,cAAD,CAAZ;QACD,CAXD,MAWO;UACL1C,YAAY,CAACqC,eAAD,CAAZ;QACD;MACF,CApBS,EAoBP,EApBO,CAAV;IAqBD,CAzBkC,CAH9B;IA6BLxC,IA7BK;IA8BLgB,YA9BK;IA+BLL,cAAc,EAAEb,iBAAiB,CAACc;EA/B7B,CAAP;AAiCD,CA/HD;;AAiIA,eAAejB,mBAAf"}
|
package/lib/module/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import { Logger } from '@sendbird/uikit-utils';
|
|
4
4
|
export { default as MessageRenderer } from './components/MessageRenderer';
|
|
5
|
+
export { ReactionAddons } from './components/ReactionAddons';
|
|
6
|
+
export { ReactionBottomSheets } from './components/ReactionBottomSheets';
|
|
5
7
|
export { default as ChannelCover } from './components/ChannelCover';
|
|
6
8
|
export { default as ChatFlatList } from './components/ChatFlatList';
|
|
7
9
|
export { default as FileViewer } from './components/FileViewer';
|
|
@@ -25,6 +27,7 @@ export { default as createGroupChannelOperatorsFragment } from './fragments/crea
|
|
|
25
27
|
export { default as createGroupChannelRegisterOperatorFragment } from './fragments/createGroupChannelRegisterOperatorFragment';
|
|
26
28
|
export { default as createGroupChannelMutedMembersFragment } from './fragments/createGroupChannelMutedMembersFragment';
|
|
27
29
|
export { default as createGroupChannelBannedUsersFragment } from './fragments/createGroupChannelBannedUsersFragment';
|
|
30
|
+
export { default as createGroupChannelNotificationsFragment } from './fragments/createGroupChannelNotificationsFragment';
|
|
28
31
|
/** Context **/
|
|
29
32
|
|
|
30
33
|
export { SendbirdChatContext, SendbirdChatProvider } from './contexts/SendbirdChatCtx';
|
|
@@ -35,7 +38,7 @@ export { LocalizationContext, LocalizationProvider } from './contexts/Localizati
|
|
|
35
38
|
|
|
36
39
|
export { default as useConnection } from './hooks/useConnection';
|
|
37
40
|
export { default as usePushTokenRegistration } from './hooks/usePushTokenRegistration';
|
|
38
|
-
export
|
|
41
|
+
export * from './hooks/useContext';
|
|
39
42
|
/** Localization **/
|
|
40
43
|
|
|
41
44
|
export { default as StringSetEn } from './localization/StringSet.en';
|
|
@@ -55,10 +58,12 @@ export { default as createExpoMediaService } from './platform/createMediaService
|
|
|
55
58
|
export * from './domain/groupChannel';
|
|
56
59
|
export * from './domain/groupChannelSettings';
|
|
57
60
|
export * from './domain/groupChannelList';
|
|
58
|
-
export * from './domain/
|
|
61
|
+
export * from './domain/groupChannelNotifications';
|
|
62
|
+
export { GroupChannelNotificationsProps, GroupChannelNotificationsContextsType, GroupChannelNotificationsFragment, GroupChannelNotificationsModule } from './domain/groupChannelNotifications/types';
|
|
59
63
|
export * from './domain/groupChannelUserList/types';
|
|
60
|
-
|
|
64
|
+
export * from './domain/userList';
|
|
61
65
|
|
|
66
|
+
/** UIKit **/
|
|
62
67
|
export { default as SendbirdUIKitContainer, SendbirdUIKit } from './containers/SendbirdUIKitContainer';
|
|
63
68
|
export { default as SBUError } from './libs/SBUError';
|
|
64
69
|
export * from './types';
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","Logger","default","MessageRenderer","ChannelCover","ChatFlatList","FileViewer","NewMessagesButton","ProviderLayout","ScrollToBottomButton","StatusComposition","TypedPlaceholder","UserActionBar","UserSelectableBar","createGroupChannelCreateFragment","createGroupChannelFragment","createGroupChannelSettingsFragment","createGroupChannelInviteFragment","createGroupChannelListFragment","createGroupChannelMembersFragment","createGroupChannelModerationFragment","createGroupChannelOperatorsFragment","createGroupChannelRegisterOperatorFragment","createGroupChannelMutedMembersFragment","createGroupChannelBannedUsersFragment","SendbirdChatContext","SendbirdChatProvider","PlatformServiceContext","PlatformServiceProvider","UserProfileContext","UserProfileProvider","LocalizationContext","LocalizationProvider","useConnection","usePushTokenRegistration","
|
|
1
|
+
{"version":3,"names":["Platform","Logger","default","MessageRenderer","ReactionAddons","ReactionBottomSheets","ChannelCover","ChatFlatList","FileViewer","NewMessagesButton","ProviderLayout","ScrollToBottomButton","StatusComposition","TypedPlaceholder","UserActionBar","UserSelectableBar","createGroupChannelCreateFragment","createGroupChannelFragment","createGroupChannelSettingsFragment","createGroupChannelInviteFragment","createGroupChannelListFragment","createGroupChannelMembersFragment","createGroupChannelModerationFragment","createGroupChannelOperatorsFragment","createGroupChannelRegisterOperatorFragment","createGroupChannelMutedMembersFragment","createGroupChannelBannedUsersFragment","createGroupChannelNotificationsFragment","SendbirdChatContext","SendbirdChatProvider","PlatformServiceContext","PlatformServiceProvider","UserProfileContext","UserProfileProvider","LocalizationContext","LocalizationProvider","useConnection","usePushTokenRegistration","StringSetEn","createBaseStringSet","createNativeFileService","createNativeClipboardService","createNativeNotificationService","createNativeMediaService","createExpoFileService","createExpoClipboardService","createExpoNotificationService","createExpoMediaService","GroupChannelNotificationsProps","GroupChannelNotificationsContextsType","GroupChannelNotificationsFragment","GroupChannelNotificationsModule","SendbirdUIKitContainer","SendbirdUIKit","SBUError","setLogLevel","__DEV__","setTitle","OS"],"sources":["index.ts"],"sourcesContent":["/** Components **/\nimport { Platform } from 'react-native';\n\nimport { Logger } from '@sendbird/uikit-utils';\n\nexport { default as MessageRenderer } from './components/MessageRenderer';\nexport { ReactionAddons } from './components/ReactionAddons';\nexport { ReactionBottomSheets } from './components/ReactionBottomSheets';\nexport { default as ChannelCover } from './components/ChannelCover';\nexport { default as ChatFlatList } from './components/ChatFlatList';\nexport { default as FileViewer } from './components/FileViewer';\nexport { default as NewMessagesButton } from './components/NewMessagesButton';\nexport { default as ProviderLayout } from './components/ProviderLayout';\nexport { default as ScrollToBottomButton } from './components/ScrollToBottomButton';\nexport { default as StatusComposition } from './components/StatusComposition';\nexport { default as TypedPlaceholder } from './components/TypedPlaceholder';\nexport { default as UserActionBar } from './components/UserActionBar';\nexport { default as UserSelectableBar } from './components/UserSelectableBar';\n\n/** Fragments **/\nexport { default as createGroupChannelCreateFragment } from './fragments/createGroupChannelCreateFragment';\nexport { default as createGroupChannelFragment } from './fragments/createGroupChannelFragment';\nexport { default as createGroupChannelSettingsFragment } from './fragments/createGroupChannelSettingsFragment';\nexport { default as createGroupChannelInviteFragment } from './fragments/createGroupChannelInviteFragment';\nexport { default as createGroupChannelListFragment } from './fragments/createGroupChannelListFragment';\nexport { default as createGroupChannelMembersFragment } from './fragments/createGroupChannelMembersFragment';\nexport { default as createGroupChannelModerationFragment } from './fragments/createGroupChannelModerationFragment';\nexport { default as createGroupChannelOperatorsFragment } from './fragments/createGroupChannelOperatorsFragment';\nexport { default as createGroupChannelRegisterOperatorFragment } from './fragments/createGroupChannelRegisterOperatorFragment';\nexport { default as createGroupChannelMutedMembersFragment } from './fragments/createGroupChannelMutedMembersFragment';\nexport { default as createGroupChannelBannedUsersFragment } from './fragments/createGroupChannelBannedUsersFragment';\nexport { default as createGroupChannelNotificationsFragment } from './fragments/createGroupChannelNotificationsFragment';\n\n/** Context **/\nexport { SendbirdChatContext, SendbirdChatProvider } from './contexts/SendbirdChatCtx';\nexport { PlatformServiceContext, PlatformServiceProvider } from './contexts/PlatformServiceCtx';\nexport { UserProfileContext, UserProfileProvider } from './contexts/UserProfileCtx';\nexport { LocalizationContext, LocalizationProvider } from './contexts/LocalizationCtx';\n\n/** Hooks **/\nexport { default as useConnection } from './hooks/useConnection';\nexport { default as usePushTokenRegistration } from './hooks/usePushTokenRegistration';\nexport * from './hooks/useContext';\n\n/** Localization **/\nexport { default as StringSetEn } from './localization/StringSet.en';\nexport { createBaseStringSet } from './localization/StringSet.type';\nexport type { StringSet } from './localization/StringSet.type';\n\n/** Platform API **/\nexport { default as createNativeFileService } from './platform/createFileService.native';\nexport { default as createNativeClipboardService } from './platform/createClipboardService.native';\nexport { default as createNativeNotificationService } from './platform/createNotificationService.native';\nexport { default as createNativeMediaService } from './platform/createMediaService.native';\nexport { default as createExpoFileService } from './platform/createFileService.expo';\nexport { default as createExpoClipboardService } from './platform/createClipboardService.expo';\nexport { default as createExpoNotificationService } from './platform/createNotificationService.expo';\nexport { default as createExpoMediaService } from './platform/createMediaService.expo';\n\nexport type {\n FileServiceInterface,\n ClipboardServiceInterface,\n FilePickerServiceInterface,\n FileSystemServiceInterface,\n SaveOptions,\n OpenDocumentOptions,\n OpenCameraOptions,\n OpenMediaLibraryOptions,\n OpenResultListener,\n DownloadedPath,\n Unsubscribe,\n FilePickerResponse,\n FileType,\n NotificationServiceInterface,\n} from './platform/types';\n\n/** Domain **/\nexport * from './domain/groupChannel';\nexport type {\n GroupChannelProps,\n GroupChannelModule,\n GroupChannelFragment,\n GroupChannelContextsType,\n} from './domain/groupChannel/types';\n\nexport * from './domain/groupChannelSettings';\nexport type {\n GroupChannelSettingsProps,\n GroupChannelSettingsModule,\n GroupChannelSettingsFragment,\n GroupChannelSettingsContextsType,\n} from './domain/groupChannelSettings/types';\n\nexport * from './domain/groupChannelList';\nexport type {\n GroupChannelType,\n GroupChannelListProps,\n GroupChannelListModule,\n GroupChannelListFragment,\n GroupChannelListContextsType,\n} from './domain/groupChannelList/types';\n\nexport * from './domain/groupChannelNotifications';\nexport {\n GroupChannelNotificationsProps,\n GroupChannelNotificationsContextsType,\n GroupChannelNotificationsFragment,\n GroupChannelNotificationsModule,\n} from './domain/groupChannelNotifications/types';\n\nexport * from './domain/groupChannelUserList/types';\nexport * from './domain/userList';\nexport type { UserListProps, UserListModule, UserListContextsType } from './domain/userList/types';\n\n/** UIKit **/\nexport { default as SendbirdUIKitContainer, SendbirdUIKit } from './containers/SendbirdUIKitContainer';\nexport type { SendbirdUIKitContainerProps } from './containers/SendbirdUIKitContainer';\nexport { default as SBUError } from './libs/SBUError';\n\nexport * from './types';\n\nLogger.setLogLevel(__DEV__ ? 'warn' : 'none');\nLogger.setTitle(`[UIKIT_${Platform.OS}]`);\n"],"mappings":"AAAA;AACA,SAASA,QAAT,QAAyB,cAAzB;AAEA,SAASC,MAAT,QAAuB,uBAAvB;AAEA,SAASC,OAAO,IAAIC,eAApB,QAA2C,8BAA3C;AACA,SAASC,cAAT,QAA+B,6BAA/B;AACA,SAASC,oBAAT,QAAqC,mCAArC;AACA,SAASH,OAAO,IAAII,YAApB,QAAwC,2BAAxC;AACA,SAASJ,OAAO,IAAIK,YAApB,QAAwC,2BAAxC;AACA,SAASL,OAAO,IAAIM,UAApB,QAAsC,yBAAtC;AACA,SAASN,OAAO,IAAIO,iBAApB,QAA6C,gCAA7C;AACA,SAASP,OAAO,IAAIQ,cAApB,QAA0C,6BAA1C;AACA,SAASR,OAAO,IAAIS,oBAApB,QAAgD,mCAAhD;AACA,SAAST,OAAO,IAAIU,iBAApB,QAA6C,gCAA7C;AACA,SAASV,OAAO,IAAIW,gBAApB,QAA4C,+BAA5C;AACA,SAASX,OAAO,IAAIY,aAApB,QAAyC,4BAAzC;AACA,SAASZ,OAAO,IAAIa,iBAApB,QAA6C,gCAA7C;AAEA;;AACA,SAASb,OAAO,IAAIc,gCAApB,QAA4D,8CAA5D;AACA,SAASd,OAAO,IAAIe,0BAApB,QAAsD,wCAAtD;AACA,SAASf,OAAO,IAAIgB,kCAApB,QAA8D,gDAA9D;AACA,SAAShB,OAAO,IAAIiB,gCAApB,QAA4D,8CAA5D;AACA,SAASjB,OAAO,IAAIkB,8BAApB,QAA0D,4CAA1D;AACA,SAASlB,OAAO,IAAImB,iCAApB,QAA6D,+CAA7D;AACA,SAASnB,OAAO,IAAIoB,oCAApB,QAAgE,kDAAhE;AAC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