@sendbird/uikit-react-native 1.0.1 → 1.0.2
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/InternalErrorBoundary.js +84 -0
- package/lib/commonjs/InternalErrorBoundary.js.map +1 -0
- package/lib/commonjs/InternalLocalCacheStorage.js +59 -0
- package/lib/commonjs/InternalLocalCacheStorage.js.map +1 -0
- package/lib/commonjs/SendbirdUIKitContainer.js +166 -0
- package/lib/commonjs/SendbirdUIKitContainer.js.map +1 -0
- package/lib/commonjs/components/ChannelCover.js +59 -0
- package/lib/commonjs/components/ChannelCover.js.map +1 -0
- package/lib/commonjs/components/ChatFlatList.js +118 -0
- package/lib/commonjs/components/ChatFlatList.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/AdminMessage/index.js +52 -0
- package/lib/commonjs/components/MessageRenderer/AdminMessage/index.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/BaseFileMessage.js +76 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/BaseFileMessage.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js +61 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/index.js +31 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/index.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/MessageContainer.js +33 -0
- package/lib/commonjs/components/MessageRenderer/MessageContainer.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/MessageDateSeparator.js +58 -0
- package/lib/commonjs/components/MessageRenderer/MessageDateSeparator.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/MessageIncomingAvatar.js +42 -0
- package/lib/commonjs/components/MessageRenderer/MessageIncomingAvatar.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/MessageIncomingSenderName.js +48 -0
- package/lib/commonjs/components/MessageRenderer/MessageIncomingSenderName.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/MessageOutgoingStatus.js +134 -0
- package/lib/commonjs/components/MessageRenderer/MessageOutgoingStatus.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/MessageTime.js +41 -0
- package/lib/commonjs/components/MessageRenderer/MessageTime.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/UnknownMessage/index.js +53 -0
- package/lib/commonjs/components/MessageRenderer/UnknownMessage/index.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/UserMessage/BaseUserMessage.js +54 -0
- package/lib/commonjs/components/MessageRenderer/UserMessage/BaseUserMessage.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js +131 -0
- package/lib/commonjs/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/UserMessage/index.js +31 -0
- package/lib/commonjs/components/MessageRenderer/UserMessage/index.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/index.js +189 -0
- package/lib/commonjs/components/MessageRenderer/index.js.map +1 -0
- package/lib/commonjs/components/NewMessagesButton.js +73 -0
- package/lib/commonjs/components/NewMessagesButton.js.map +1 -0
- package/lib/commonjs/components/ProviderLayout.js +37 -0
- package/lib/commonjs/components/ProviderLayout.js.map +1 -0
- package/lib/commonjs/components/ScrollToBottomButton.js +66 -0
- package/lib/commonjs/components/ScrollToBottomButton.js.map +1 -0
- package/lib/commonjs/components/StatusComposition.js +27 -0
- package/lib/commonjs/components/StatusComposition.js.map +1 -0
- package/lib/commonjs/components/TypedPlaceholder.js +80 -0
- package/lib/commonjs/components/TypedPlaceholder.js.map +1 -0
- package/lib/commonjs/components/UserActionBar.js +96 -0
- package/lib/commonjs/components/UserActionBar.js.map +1 -0
- package/lib/commonjs/components/UserSelectableBar.js +78 -0
- package/lib/commonjs/components/UserSelectableBar.js.map +1 -0
- package/lib/commonjs/constants.js +9 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/contexts/Localization.js +29 -0
- package/lib/commonjs/contexts/Localization.js.map +1 -0
- package/lib/commonjs/contexts/PlatformService.js +33 -0
- package/lib/commonjs/contexts/PlatformService.js.map +1 -0
- package/lib/commonjs/contexts/SendbirdChat.js +87 -0
- package/lib/commonjs/contexts/SendbirdChat.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelHeader.js +88 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelHeader.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/EditInput.js +118 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/EditInput.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js +148 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/index.js +115 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/index.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +343 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelStatusEmpty.js +34 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelStatusEmpty.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelStatusLoading.js +34 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelStatusLoading.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/index.js +70 -0
- package/lib/commonjs/domain/groupChannel/index.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/module/createGroupChannelModule.js +45 -0
- package/lib/commonjs/domain/groupChannel/module/createGroupChannelModule.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js +79 -0
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js.map +1 -0
- package/lib/commonjs/domain/groupChannel/types.js +6 -0
- package/lib/commonjs/domain/groupChannel/types.js.map +1 -0
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListHeader.js +35 -0
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListHeader.js.map +1 -0
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListList.js +96 -0
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListList.js.map +1 -0
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListStatusEmpty.js +34 -0
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListStatusEmpty.js.map +1 -0
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListStatusLoading.js +34 -0
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListStatusLoading.js.map +1 -0
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListTypeSelector.js +141 -0
- package/lib/commonjs/domain/groupChannelList/component/GroupChannelListTypeSelector.js.map +1 -0
- package/lib/commonjs/domain/groupChannelList/index.js +70 -0
- package/lib/commonjs/domain/groupChannelList/index.js.map +1 -0
- package/lib/commonjs/domain/groupChannelList/module/createGroupChannelListModule.js +45 -0
- package/lib/commonjs/domain/groupChannelList/module/createGroupChannelListModule.js.map +1 -0
- package/lib/commonjs/domain/groupChannelList/module/moduleContext.js +61 -0
- package/lib/commonjs/domain/groupChannelList/module/moduleContext.js.map +1 -0
- package/lib/commonjs/domain/groupChannelList/types.js +6 -0
- package/lib/commonjs/domain/groupChannelList/types.js.map +1 -0
- package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsHeader.js +49 -0
- package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsHeader.js.map +1 -0
- package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsInfo.js +77 -0
- package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsInfo.js.map +1 -0
- package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +94 -0
- package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -0
- package/lib/commonjs/domain/groupChannelSettings/index.js +54 -0
- package/lib/commonjs/domain/groupChannelSettings/index.js.map +1 -0
- package/lib/commonjs/domain/groupChannelSettings/module/createGroupChannelSettingsModule.js +37 -0
- package/lib/commonjs/domain/groupChannelSettings/module/createGroupChannelSettingsModule.js.map +1 -0
- package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js +150 -0
- package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js.map +1 -0
- package/lib/commonjs/domain/groupChannelSettings/types.js +6 -0
- package/lib/commonjs/domain/groupChannelSettings/types.js.map +1 -0
- package/lib/commonjs/domain/groupChannelUserList/types.js +6 -0
- package/lib/commonjs/domain/groupChannelUserList/types.js.map +1 -0
- package/lib/commonjs/domain/userList/component/UserListHeader.js +56 -0
- package/lib/commonjs/domain/userList/component/UserListHeader.js.map +1 -0
- package/lib/commonjs/domain/userList/component/UserListList.js +57 -0
- package/lib/commonjs/domain/userList/component/UserListList.js.map +1 -0
- package/lib/commonjs/domain/userList/component/UserListStatusEmpty.js +34 -0
- package/lib/commonjs/domain/userList/component/UserListStatusEmpty.js.map +1 -0
- package/lib/commonjs/domain/userList/component/UserListStatusError.js +38 -0
- package/lib/commonjs/domain/userList/component/UserListStatusError.js.map +1 -0
- package/lib/commonjs/domain/userList/component/UserListStatusLoading.js +34 -0
- package/lib/commonjs/domain/userList/component/UserListStatusLoading.js.map +1 -0
- package/lib/commonjs/domain/userList/index.js +70 -0
- package/lib/commonjs/domain/userList/index.js.map +1 -0
- package/lib/commonjs/domain/userList/module/createUserListModule.js +45 -0
- package/lib/commonjs/domain/userList/module/createUserListModule.js.map +1 -0
- package/lib/commonjs/domain/userList/module/moduleContext.js +54 -0
- package/lib/commonjs/domain/userList/module/moduleContext.js.map +1 -0
- package/lib/commonjs/domain/userList/types.js +6 -0
- package/lib/commonjs/domain/userList/types.js.map +1 -0
- package/lib/commonjs/fragments/createGroupChannelCreateFragment.js +145 -0
- package/lib/commonjs/fragments/createGroupChannelCreateFragment.js.map +1 -0
- package/lib/commonjs/fragments/createGroupChannelFragment.js +154 -0
- package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -0
- package/lib/commonjs/fragments/createGroupChannelInviteFragment.js +139 -0
- package/lib/commonjs/fragments/createGroupChannelInviteFragment.js.map +1 -0
- package/lib/commonjs/fragments/createGroupChannelListFragment.js +141 -0
- package/lib/commonjs/fragments/createGroupChannelListFragment.js.map +1 -0
- package/lib/commonjs/fragments/createGroupChannelMembersFragment.js +134 -0
- package/lib/commonjs/fragments/createGroupChannelMembersFragment.js.map +1 -0
- package/lib/commonjs/fragments/createGroupChannelSettingsFragment.js +66 -0
- package/lib/commonjs/fragments/createGroupChannelSettingsFragment.js.map +1 -0
- package/lib/commonjs/hooks/useConnection.js +102 -0
- package/lib/commonjs/hooks/useConnection.js.map +1 -0
- package/lib/commonjs/hooks/useContext.js +39 -0
- package/lib/commonjs/hooks/useContext.js.map +1 -0
- package/lib/commonjs/hooks/usePushTokenRegistration.js +83 -0
- package/lib/commonjs/hooks/usePushTokenRegistration.js.map +1 -0
- package/lib/commonjs/index.js +449 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/localization/StringSet.en.js +19 -0
- package/lib/commonjs/localization/StringSet.en.js.map +1 -0
- package/lib/commonjs/localization/StringSet.type.js +178 -0
- package/lib/commonjs/localization/StringSet.type.js.map +1 -0
- package/lib/commonjs/platform/createClipboardService.expo.js +23 -0
- package/lib/commonjs/platform/createClipboardService.expo.js.map +1 -0
- package/lib/commonjs/platform/createClipboardService.native.js +23 -0
- package/lib/commonjs/platform/createClipboardService.native.js.map +1 -0
- package/lib/commonjs/platform/createFileService.expo.js +175 -0
- package/lib/commonjs/platform/createFileService.expo.js.map +1 -0
- package/lib/commonjs/platform/createFileService.native.js +253 -0
- package/lib/commonjs/platform/createFileService.native.js.map +1 -0
- package/lib/commonjs/platform/createNotificationService.expo.js +50 -0
- package/lib/commonjs/platform/createNotificationService.expo.js.map +1 -0
- package/lib/commonjs/platform/createNotificationService.native.js +65 -0
- package/lib/commonjs/platform/createNotificationService.native.js.map +1 -0
- package/lib/commonjs/platform/dynamicModule.js +114 -0
- package/lib/commonjs/platform/dynamicModule.js.map +1 -0
- package/lib/commonjs/platform/types.js +2 -0
- package/lib/commonjs/platform/types.js.map +1 -0
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils/expoPermissionGranted.js +32 -0
- package/lib/commonjs/utils/expoPermissionGranted.js.map +1 -0
- package/lib/commonjs/utils/fileTypeGuard.js +26 -0
- package/lib/commonjs/utils/fileTypeGuard.js.map +1 -0
- package/lib/commonjs/utils/nativePermissionGranted.js +23 -0
- package/lib/commonjs/utils/nativePermissionGranted.js.map +1 -0
- package/lib/commonjs/version.js +10 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/InternalErrorBoundary.js +72 -0
- package/lib/module/InternalErrorBoundary.js.map +1 -0
- package/lib/module/InternalLocalCacheStorage.js +50 -0
- package/lib/module/InternalLocalCacheStorage.js.map +1 -0
- package/lib/module/SendbirdUIKitContainer.js +136 -0
- package/lib/module/SendbirdUIKitContainer.js.map +1 -0
- package/lib/module/components/ChannelCover.js +46 -0
- package/lib/module/components/ChannelCover.js.map +1 -0
- package/lib/module/components/ChatFlatList.js +102 -0
- package/lib/module/components/ChatFlatList.js.map +1 -0
- package/lib/module/components/MessageRenderer/AdminMessage/index.js +40 -0
- package/lib/module/components/MessageRenderer/AdminMessage/index.js.map +1 -0
- package/lib/module/components/MessageRenderer/FileMessage/BaseFileMessage.js +62 -0
- package/lib/module/components/MessageRenderer/FileMessage/BaseFileMessage.js.map +1 -0
- package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js +47 -0
- package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +1 -0
- package/lib/module/components/MessageRenderer/FileMessage/index.js +17 -0
- package/lib/module/components/MessageRenderer/FileMessage/index.js.map +1 -0
- package/lib/module/components/MessageRenderer/MessageContainer.js +21 -0
- package/lib/module/components/MessageRenderer/MessageContainer.js.map +1 -0
- package/lib/module/components/MessageRenderer/MessageDateSeparator.js +44 -0
- package/lib/module/components/MessageRenderer/MessageDateSeparator.js.map +1 -0
- package/lib/module/components/MessageRenderer/MessageIncomingAvatar.js +30 -0
- package/lib/module/components/MessageRenderer/MessageIncomingAvatar.js.map +1 -0
- package/lib/module/components/MessageRenderer/MessageIncomingSenderName.js +35 -0
- package/lib/module/components/MessageRenderer/MessageIncomingSenderName.js.map +1 -0
- package/lib/module/components/MessageRenderer/MessageOutgoingStatus.js +116 -0
- package/lib/module/components/MessageRenderer/MessageOutgoingStatus.js.map +1 -0
- package/lib/module/components/MessageRenderer/MessageTime.js +28 -0
- package/lib/module/components/MessageRenderer/MessageTime.js.map +1 -0
- package/lib/module/components/MessageRenderer/UnknownMessage/index.js +40 -0
- package/lib/module/components/MessageRenderer/UnknownMessage/index.js.map +1 -0
- package/lib/module/components/MessageRenderer/UserMessage/BaseUserMessage.js +41 -0
- package/lib/module/components/MessageRenderer/UserMessage/BaseUserMessage.js.map +1 -0
- package/lib/module/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js +115 -0
- package/lib/module/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js.map +1 -0
- package/lib/module/components/MessageRenderer/UserMessage/index.js +18 -0
- package/lib/module/components/MessageRenderer/UserMessage/index.js.map +1 -0
- package/lib/module/components/MessageRenderer/index.js +163 -0
- package/lib/module/components/MessageRenderer/index.js.map +1 -0
- package/lib/module/components/NewMessagesButton.js +58 -0
- package/lib/module/components/NewMessagesButton.js.map +1 -0
- package/lib/module/components/ProviderLayout.js +25 -0
- package/lib/module/components/ProviderLayout.js.map +1 -0
- package/lib/module/components/ScrollToBottomButton.js +52 -0
- package/lib/module/components/ScrollToBottomButton.js.map +1 -0
- package/lib/module/components/StatusComposition.js +17 -0
- package/lib/module/components/StatusComposition.js.map +1 -0
- package/lib/module/components/TypedPlaceholder.js +68 -0
- package/lib/module/components/TypedPlaceholder.js.map +1 -0
- package/lib/module/components/UserActionBar.js +81 -0
- package/lib/module/components/UserActionBar.js.map +1 -0
- package/lib/module/components/UserSelectableBar.js +63 -0
- package/lib/module/components/UserSelectableBar.js.map +1 -0
- package/lib/module/constants.js +2 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/contexts/Localization.js +14 -0
- package/lib/module/contexts/Localization.js.map +1 -0
- package/lib/module/contexts/PlatformService.js +18 -0
- package/lib/module/contexts/PlatformService.js.map +1 -0
- package/lib/module/contexts/SendbirdChat.js +66 -0
- package/lib/module/contexts/SendbirdChat.js.map +1 -0
- package/lib/module/domain/groupChannel/component/GroupChannelHeader.js +69 -0
- package/lib/module/domain/groupChannel/component/GroupChannelHeader.js.map +1 -0
- package/lib/module/domain/groupChannel/component/GroupChannelInput/EditInput.js +102 -0
- package/lib/module/domain/groupChannel/component/GroupChannelInput/EditInput.js.map +1 -0
- package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js +134 -0
- package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -0
- package/lib/module/domain/groupChannel/component/GroupChannelInput/index.js +92 -0
- package/lib/module/domain/groupChannel/component/GroupChannelInput/index.js.map +1 -0
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +317 -0
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -0
- package/lib/module/domain/groupChannel/component/GroupChannelStatusEmpty.js +21 -0
- package/lib/module/domain/groupChannel/component/GroupChannelStatusEmpty.js.map +1 -0
- package/lib/module/domain/groupChannel/component/GroupChannelStatusLoading.js +21 -0
- package/lib/module/domain/groupChannel/component/GroupChannelStatusLoading.js.map +1 -0
- package/lib/module/domain/groupChannel/index.js +8 -0
- package/lib/module/domain/groupChannel/index.js.map +1 -0
- package/lib/module/domain/groupChannel/module/createGroupChannelModule.js +30 -0
- package/lib/module/domain/groupChannel/module/createGroupChannelModule.js.map +1 -0
- package/lib/module/domain/groupChannel/module/moduleContext.js +57 -0
- package/lib/module/domain/groupChannel/module/moduleContext.js.map +1 -0
- package/lib/module/domain/groupChannel/types.js +2 -0
- package/lib/module/domain/groupChannel/types.js.map +1 -0
- package/lib/module/domain/groupChannelList/component/GroupChannelListHeader.js +21 -0
- package/lib/module/domain/groupChannelList/component/GroupChannelListHeader.js.map +1 -0
- package/lib/module/domain/groupChannelList/component/GroupChannelListList.js +79 -0
- package/lib/module/domain/groupChannelList/component/GroupChannelListList.js.map +1 -0
- package/lib/module/domain/groupChannelList/component/GroupChannelListStatusEmpty.js +21 -0
- package/lib/module/domain/groupChannelList/component/GroupChannelListStatusEmpty.js.map +1 -0
- package/lib/module/domain/groupChannelList/component/GroupChannelListStatusLoading.js +21 -0
- package/lib/module/domain/groupChannelList/component/GroupChannelListStatusLoading.js.map +1 -0
- package/lib/module/domain/groupChannelList/component/GroupChannelListTypeSelector.js +124 -0
- package/lib/module/domain/groupChannelList/component/GroupChannelListTypeSelector.js.map +1 -0
- package/lib/module/domain/groupChannelList/index.js +8 -0
- package/lib/module/domain/groupChannelList/index.js.map +1 -0
- package/lib/module/domain/groupChannelList/module/createGroupChannelListModule.js +30 -0
- package/lib/module/domain/groupChannelList/module/createGroupChannelListModule.js.map +1 -0
- package/lib/module/domain/groupChannelList/module/moduleContext.js +40 -0
- package/lib/module/domain/groupChannelList/module/moduleContext.js.map +1 -0
- package/lib/module/domain/groupChannelList/types.js +2 -0
- package/lib/module/domain/groupChannelList/types.js.map +1 -0
- package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsHeader.js +35 -0
- package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsHeader.js.map +1 -0
- package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsInfo.js +56 -0
- package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsInfo.js.map +1 -0
- package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +78 -0
- package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -0
- package/lib/module/domain/groupChannelSettings/index.js +6 -0
- package/lib/module/domain/groupChannelSettings/index.js.map +1 -0
- package/lib/module/domain/groupChannelSettings/module/createGroupChannelSettingsModule.js +24 -0
- package/lib/module/domain/groupChannelSettings/module/createGroupChannelSettingsModule.js.map +1 -0
- package/lib/module/domain/groupChannelSettings/module/moduleContext.js +127 -0
- package/lib/module/domain/groupChannelSettings/module/moduleContext.js.map +1 -0
- package/lib/module/domain/groupChannelSettings/types.js +2 -0
- package/lib/module/domain/groupChannelSettings/types.js.map +1 -0
- package/lib/module/domain/groupChannelUserList/types.js +2 -0
- package/lib/module/domain/groupChannelUserList/types.js.map +1 -0
- package/lib/module/domain/userList/component/UserListHeader.js +42 -0
- package/lib/module/domain/userList/component/UserListHeader.js.map +1 -0
- package/lib/module/domain/userList/component/UserListList.js +42 -0
- package/lib/module/domain/userList/component/UserListList.js.map +1 -0
- package/lib/module/domain/userList/component/UserListStatusEmpty.js +21 -0
- package/lib/module/domain/userList/component/UserListStatusEmpty.js.map +1 -0
- package/lib/module/domain/userList/component/UserListStatusError.js +25 -0
- package/lib/module/domain/userList/component/UserListStatusError.js.map +1 -0
- package/lib/module/domain/userList/component/UserListStatusLoading.js +21 -0
- package/lib/module/domain/userList/component/UserListStatusLoading.js.map +1 -0
- package/lib/module/domain/userList/index.js +8 -0
- package/lib/module/domain/userList/index.js.map +1 -0
- package/lib/module/domain/userList/module/createUserListModule.js +30 -0
- package/lib/module/domain/userList/module/createUserListModule.js.map +1 -0
- package/lib/module/domain/userList/module/moduleContext.js +34 -0
- package/lib/module/domain/userList/module/moduleContext.js.map +1 -0
- package/lib/module/domain/userList/types.js +2 -0
- package/lib/module/domain/userList/types.js.map +1 -0
- package/lib/module/fragments/createGroupChannelCreateFragment.js +124 -0
- package/lib/module/fragments/createGroupChannelCreateFragment.js.map +1 -0
- package/lib/module/fragments/createGroupChannelFragment.js +132 -0
- package/lib/module/fragments/createGroupChannelFragment.js.map +1 -0
- package/lib/module/fragments/createGroupChannelInviteFragment.js +118 -0
- package/lib/module/fragments/createGroupChannelInviteFragment.js.map +1 -0
- package/lib/module/fragments/createGroupChannelListFragment.js +115 -0
- package/lib/module/fragments/createGroupChannelListFragment.js.map +1 -0
- package/lib/module/fragments/createGroupChannelMembersFragment.js +114 -0
- package/lib/module/fragments/createGroupChannelMembersFragment.js.map +1 -0
- package/lib/module/fragments/createGroupChannelSettingsFragment.js +51 -0
- package/lib/module/fragments/createGroupChannelSettingsFragment.js.map +1 -0
- package/lib/module/hooks/useConnection.js +79 -0
- package/lib/module/hooks/useConnection.js.map +1 -0
- package/lib/module/hooks/useContext.js +20 -0
- package/lib/module/hooks/useContext.js.map +1 -0
- package/lib/module/hooks/usePushTokenRegistration.js +69 -0
- package/lib/module/hooks/usePushTokenRegistration.js.map +1 -0
- package/lib/module/index.js +57 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/localization/StringSet.en.js +7 -0
- package/lib/module/localization/StringSet.en.js.map +1 -0
- package/lib/module/localization/StringSet.type.js +173 -0
- package/lib/module/localization/StringSet.type.js.map +1 -0
- package/lib/module/platform/createClipboardService.expo.js +15 -0
- package/lib/module/platform/createClipboardService.expo.js.map +1 -0
- package/lib/module/platform/createClipboardService.native.js +15 -0
- package/lib/module/platform/createClipboardService.native.js.map +1 -0
- package/lib/module/platform/createFileService.expo.js +163 -0
- package/lib/module/platform/createFileService.expo.js.map +1 -0
- package/lib/module/platform/createFileService.native.js +237 -0
- package/lib/module/platform/createFileService.native.js.map +1 -0
- package/lib/module/platform/createNotificationService.expo.js +42 -0
- package/lib/module/platform/createNotificationService.expo.js.map +1 -0
- package/lib/module/platform/createNotificationService.native.js +57 -0
- package/lib/module/platform/createNotificationService.native.js.map +1 -0
- package/lib/module/platform/dynamicModule.js +103 -0
- package/lib/module/platform/dynamicModule.js.map +1 -0
- package/lib/module/platform/types.js +2 -0
- package/lib/module/platform/types.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils/expoPermissionGranted.js +24 -0
- package/lib/module/utils/expoPermissionGranted.js.map +1 -0
- package/lib/module/utils/fileTypeGuard.js +18 -0
- package/lib/module/utils/fileTypeGuard.js.map +1 -0
- package/lib/module/utils/nativePermissionGranted.js +15 -0
- package/lib/module/utils/nativePermissionGranted.js.map +1 -0
- package/lib/module/version.js +3 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/__template__/component/__domain__Header.d.ts +3 -0
- package/lib/typescript/__template__/component/__domain__StatusEmpty.d.ts +2 -0
- package/lib/typescript/__template__/component/__domain__StatusLoading.d.ts +2 -0
- package/lib/typescript/__template__/component/__domain__View.d.ts +3 -0
- package/lib/typescript/__template__/create__domain__Fragment.d.ts +2 -0
- package/lib/typescript/__template__/index.d.ts +6 -0
- package/lib/typescript/__template__/module/create__domain__Module.d.ts +3 -0
- package/lib/typescript/__template__/module/moduleContext.d.ts +3 -0
- package/lib/typescript/__template__/types.d.ts +31 -0
- package/lib/typescript/src/InternalErrorBoundary.d.ts +19 -0
- package/lib/typescript/src/InternalLocalCacheStorage.d.ts +12 -0
- package/lib/typescript/src/SendbirdUIKitContainer.d.ts +41 -0
- package/lib/typescript/src/components/ChannelCover.d.ts +9 -0
- package/lib/typescript/src/components/ChatFlatList.d.ts +14 -0
- package/lib/typescript/src/components/MessageRenderer/AdminMessage/index.d.ts +5 -0
- package/lib/typescript/src/components/MessageRenderer/FileMessage/BaseFileMessage.d.ts +6 -0
- package/lib/typescript/src/components/MessageRenderer/FileMessage/ImageFileMessage.d.ts +3 -0
- package/lib/typescript/src/components/MessageRenderer/FileMessage/index.d.ts +6 -0
- package/lib/typescript/src/components/MessageRenderer/MessageContainer.d.ts +3 -0
- package/lib/typescript/src/components/MessageRenderer/MessageDateSeparator.d.ts +7 -0
- package/lib/typescript/src/components/MessageRenderer/MessageIncomingAvatar.d.ts +7 -0
- package/lib/typescript/src/components/MessageRenderer/MessageIncomingSenderName.d.ts +7 -0
- package/lib/typescript/src/components/MessageRenderer/MessageOutgoingStatus.d.ts +8 -0
- package/lib/typescript/src/components/MessageRenderer/MessageTime.d.ts +9 -0
- package/lib/typescript/src/components/MessageRenderer/UnknownMessage/index.d.ts +4 -0
- package/lib/typescript/src/components/MessageRenderer/UserMessage/BaseUserMessage.d.ts +3 -0
- package/lib/typescript/src/components/MessageRenderer/UserMessage/OpenGraphUserMessage.d.ts +7 -0
- package/lib/typescript/src/components/MessageRenderer/UserMessage/index.d.ts +6 -0
- package/lib/typescript/src/components/MessageRenderer/index.d.ts +23 -0
- package/lib/typescript/src/components/NewMessagesButton.d.ts +9 -0
- package/lib/typescript/src/components/ProviderLayout.d.ts +3 -0
- package/lib/typescript/src/components/ScrollToBottomButton.d.ts +7 -0
- package/lib/typescript/src/components/StatusComposition.d.ts +10 -0
- package/lib/typescript/src/components/TypedPlaceholder.d.ts +6 -0
- package/lib/typescript/src/components/UserActionBar.d.ts +11 -0
- package/lib/typescript/src/components/UserSelectableBar.d.ts +9 -0
- package/lib/typescript/src/constants.d.ts +1 -0
- package/lib/typescript/src/contexts/Localization.d.ts +11 -0
- package/lib/typescript/src/contexts/PlatformService.d.ts +10 -0
- package/lib/typescript/src/contexts/SendbirdChat.d.ts +24 -0
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelHeader.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput/EditInput.d.ts +10 -0
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput/SendInput.d.ts +8 -0
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput/index.d.ts +9 -0
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelMessageList.d.ts +36 -0
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelStatusEmpty.d.ts +2 -0
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelStatusLoading.d.ts +2 -0
- package/lib/typescript/src/domain/groupChannel/index.d.ts +7 -0
- package/lib/typescript/src/domain/groupChannel/module/createGroupChannelModule.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannel/module/moduleContext.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannel/types.d.ts +102 -0
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListHeader.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListList.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListStatusEmpty.d.ts +2 -0
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListStatusLoading.d.ts +2 -0
- package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListTypeSelector.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelList/index.d.ts +7 -0
- package/lib/typescript/src/domain/groupChannelList/module/createGroupChannelListModule.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelList/module/moduleContext.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelList/types.d.ts +81 -0
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsHeader.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsInfo.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelSettings/index.d.ts +5 -0
- package/lib/typescript/src/domain/groupChannelSettings/module/createGroupChannelSettingsModule.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelSettings/module/moduleContext.d.ts +3 -0
- package/lib/typescript/src/domain/groupChannelSettings/types.d.ts +45 -0
- package/lib/typescript/src/domain/groupChannelUserList/types.d.ts +42 -0
- package/lib/typescript/src/domain/userList/component/UserListHeader.d.ts +10 -0
- package/lib/typescript/src/domain/userList/component/UserListList.d.ts +11 -0
- package/lib/typescript/src/domain/userList/component/UserListStatusEmpty.d.ts +2 -0
- package/lib/typescript/src/domain/userList/component/UserListStatusError.d.ts +3 -0
- package/lib/typescript/src/domain/userList/component/UserListStatusLoading.d.ts +2 -0
- package/lib/typescript/src/domain/userList/index.d.ts +7 -0
- package/lib/typescript/src/domain/userList/module/createUserListModule.d.ts +3 -0
- package/lib/typescript/src/domain/userList/module/moduleContext.d.ts +3 -0
- package/lib/typescript/src/domain/userList/types.d.ts +58 -0
- package/lib/typescript/src/fragments/createGroupChannelCreateFragment.d.ts +4 -0
- package/lib/typescript/src/fragments/createGroupChannelFragment.d.ts +3 -0
- package/lib/typescript/src/fragments/createGroupChannelInviteFragment.d.ts +4 -0
- package/lib/typescript/src/fragments/createGroupChannelListFragment.d.ts +3 -0
- package/lib/typescript/src/fragments/createGroupChannelMembersFragment.d.ts +5 -0
- package/lib/typescript/src/fragments/createGroupChannelSettingsFragment.d.ts +3 -0
- package/lib/typescript/src/hooks/useConnection.d.ts +11 -0
- package/lib/typescript/src/hooks/useContext.d.ts +24 -0
- package/lib/typescript/src/hooks/usePushTokenRegistration.d.ts +5 -0
- package/lib/typescript/src/index.d.ts +50 -0
- package/lib/typescript/src/localization/StringSet.en.d.ts +2 -0
- package/lib/typescript/src/localization/StringSet.type.d.ts +157 -0
- package/lib/typescript/src/platform/createClipboardService.expo.d.ts +4 -0
- package/lib/typescript/src/platform/createClipboardService.native.d.ts +4 -0
- package/lib/typescript/src/platform/createFileService.expo.d.ts +12 -0
- package/lib/typescript/src/platform/createFileService.native.d.ts +14 -0
- package/lib/typescript/src/platform/createNotificationService.expo.d.ts +4 -0
- package/lib/typescript/src/platform/createNotificationService.native.d.ts +8 -0
- package/lib/typescript/src/platform/dynamicModule.d.ts +23 -0
- package/lib/typescript/src/platform/types.d.ts +47 -0
- package/lib/typescript/src/types.d.ts +20 -0
- package/lib/typescript/src/utils/expoPermissionGranted.d.ts +13 -0
- package/lib/typescript/src/utils/fileTypeGuard.d.ts +4 -0
- package/lib/typescript/src/utils/nativePermissionGranted.d.ts +3 -0
- package/lib/typescript/src/version.d.ts +2 -0
- package/package.json +5 -5
- package/src/version.ts +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Avatar } from '@sendbird/uikit-react-native-foundation';
|
|
5
|
+
import { getMembersExcludeMe, isDefaultCoverImage } from '@sendbird/uikit-utils';
|
|
6
|
+
import { useSendbirdChat } from '../hooks/useContext';
|
|
7
|
+
|
|
8
|
+
const ChannelCover = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
channel,
|
|
11
|
+
...avatarProps
|
|
12
|
+
} = _ref;
|
|
13
|
+
const {
|
|
14
|
+
currentUser
|
|
15
|
+
} = useSendbirdChat(); // channel cover
|
|
16
|
+
|
|
17
|
+
if (!isDefaultCoverImage(channel.coverUrl) || !currentUser) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(Avatar, _extends({
|
|
19
|
+
uri: channel.coverUrl
|
|
20
|
+
}, avatarProps));
|
|
21
|
+
} // no members, use anonymous profile
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
if (channel.memberCount <= 1) {
|
|
25
|
+
return /*#__PURE__*/React.createElement(Avatar, avatarProps);
|
|
26
|
+
} // 1:1, use member profile
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
if (channel.memberCount === 2) {
|
|
30
|
+
var _channel$members$filt, _channel$members$filt2;
|
|
31
|
+
|
|
32
|
+
const otherUserProfile = (_channel$members$filt = channel.members.filter(m => m.userId !== currentUser.userId)) === null || _channel$members$filt === void 0 ? void 0 : (_channel$members$filt2 = _channel$members$filt[0]) === null || _channel$members$filt2 === void 0 ? void 0 : _channel$members$filt2.profileUrl;
|
|
33
|
+
return /*#__PURE__*/React.createElement(Avatar, _extends({
|
|
34
|
+
uri: otherUserProfile
|
|
35
|
+
}, avatarProps));
|
|
36
|
+
} // group, use members profile
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
return /*#__PURE__*/React.createElement(Avatar.Group, avatarProps, getMembersExcludeMe(channel, currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId).map(m => /*#__PURE__*/React.createElement(Avatar, {
|
|
40
|
+
key: m.userId,
|
|
41
|
+
uri: m.profileUrl
|
|
42
|
+
})));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default ChannelCover;
|
|
46
|
+
//# sourceMappingURL=ChannelCover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Avatar","getMembersExcludeMe","isDefaultCoverImage","useSendbirdChat","ChannelCover","channel","avatarProps","currentUser","coverUrl","memberCount","otherUserProfile","members","filter","m","userId","profileUrl","map"],"sources":["ChannelCover.tsx"],"sourcesContent":["import React from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Avatar } from '@sendbird/uikit-react-native-foundation';\nimport { SendbirdGroupChannel, getMembersExcludeMe, isDefaultCoverImage } from '@sendbird/uikit-utils';\n\nimport { useSendbirdChat } from '../hooks/useContext';\n\ntype Props = {\n channel: SendbirdGroupChannel;\n size?: number;\n containerStyle?: StyleProp<ViewStyle>;\n};\n\nconst ChannelCover = ({ channel, ...avatarProps }: Props) => {\n const { currentUser } = useSendbirdChat();\n\n // channel cover\n if (!isDefaultCoverImage(channel.coverUrl) || !currentUser) {\n return <Avatar uri={channel.coverUrl} {...avatarProps} />;\n }\n\n // no members, use anonymous profile\n if (channel.memberCount <= 1) {\n return <Avatar {...avatarProps} />;\n }\n\n // 1:1, use member profile\n if (channel.memberCount === 2) {\n const otherUserProfile = channel.members.filter((m) => m.userId !== currentUser.userId)?.[0]?.profileUrl;\n return <Avatar uri={otherUserProfile} {...avatarProps} />;\n }\n\n // group, use members profile\n return (\n <Avatar.Group {...avatarProps}>\n {getMembersExcludeMe(channel, currentUser?.userId).map((m) => (\n <Avatar key={m.userId} uri={m.profileUrl} />\n ))}\n </Avatar.Group>\n );\n};\n\nexport default ChannelCover;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,MAAT,QAAuB,yCAAvB;AACA,SAA+BC,mBAA/B,EAAoDC,mBAApD,QAA+E,uBAA/E;AAEA,SAASC,eAAT,QAAgC,qBAAhC;;AAQA,MAAMC,YAAY,GAAG,QAAwC;EAAA,IAAvC;IAAEC,OAAF;IAAW,GAAGC;EAAd,CAAuC;EAC3D,MAAM;IAAEC;EAAF,IAAkBJ,eAAe,EAAvC,CAD2D,CAG3D;;EACA,IAAI,CAACD,mBAAmB,CAACG,OAAO,CAACG,QAAT,CAApB,IAA0C,CAACD,WAA/C,EAA4D;IAC1D,oBAAO,oBAAC,MAAD;MAAQ,GAAG,EAAEF,OAAO,CAACG;IAArB,GAAmCF,WAAnC,EAAP;EACD,CAN0D,CAQ3D;;;EACA,IAAID,OAAO,CAACI,WAAR,IAAuB,CAA3B,EAA8B;IAC5B,oBAAO,oBAAC,MAAD,EAAYH,WAAZ,CAAP;EACD,CAX0D,CAa3D;;;EACA,IAAID,OAAO,CAACI,WAAR,KAAwB,CAA5B,EAA+B;IAAA;;IAC7B,MAAMC,gBAAgB,4BAAGL,OAAO,CAACM,OAAR,CAAgBC,MAAhB,CAAwBC,CAAD,IAAOA,CAAC,CAACC,MAAF,KAAaP,WAAW,CAACO,MAAvD,CAAH,oFAAG,sBAAiE,CAAjE,CAAH,2DAAG,uBAAqEC,UAA9F;IACA,oBAAO,oBAAC,MAAD;MAAQ,GAAG,EAAEL;IAAb,GAAmCJ,WAAnC,EAAP;EACD,CAjB0D,CAmB3D;;;EACA,oBACE,oBAAC,MAAD,CAAQ,KAAR,EAAkBA,WAAlB,EACGL,mBAAmB,CAACI,OAAD,EAAUE,WAAV,aAAUA,WAAV,uBAAUA,WAAW,CAAEO,MAAvB,CAAnB,CAAkDE,GAAlD,CAAuDH,CAAD,iBACrD,oBAAC,MAAD;IAAQ,GAAG,EAAEA,CAAC,CAACC,MAAf;IAAuB,GAAG,EAAED,CAAC,CAACE;EAA9B,EADD,CADH,CADF;AAOD,CA3BD;;AA6BA,eAAeX,YAAf"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
|
|
4
|
+
import { FlatList, Platform } from 'react-native';
|
|
5
|
+
import { useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
6
|
+
import { isMyMessage } from '@sendbird/uikit-utils';
|
|
7
|
+
let ANDROID_BUG_ALERT_SHOWED = Platform.OS !== 'android';
|
|
8
|
+
const BOTTOM_DETECT_THRESHOLD = 25; // const AUTO_SCROLL_TO_TOP_THRESHOLD = 15;
|
|
9
|
+
|
|
10
|
+
function hasReachedToBottom(yPos) {
|
|
11
|
+
let thresholdPx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
12
|
+
return thresholdPx >= yPos;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// FIXME: Inverted FlatList performance issue on Android {@link https://github.com/facebook/react-native/issues/30034}
|
|
16
|
+
const ChatFlatList = /*#__PURE__*/forwardRef(function CustomFlatList(_ref, ref) {
|
|
17
|
+
var _props$data;
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
onTopReached,
|
|
21
|
+
nextMessages,
|
|
22
|
+
onBottomReached,
|
|
23
|
+
onLeaveScrollBottom,
|
|
24
|
+
onScroll,
|
|
25
|
+
currentUserId,
|
|
26
|
+
...props
|
|
27
|
+
} = _ref;
|
|
28
|
+
const {
|
|
29
|
+
select
|
|
30
|
+
} = useUIKitTheme();
|
|
31
|
+
const scrollRef = useRef(null);
|
|
32
|
+
const yPos = useRef(0);
|
|
33
|
+
useImperativeHandle(ref, () => ({
|
|
34
|
+
scrollToBottom: function () {
|
|
35
|
+
var _scrollRef$current;
|
|
36
|
+
|
|
37
|
+
let animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
38
|
+
return (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.scrollToOffset({
|
|
39
|
+
animated,
|
|
40
|
+
offset: 0
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}), []);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
const latestMessage = nextMessages[nextMessages.length - 1];
|
|
46
|
+
if (!latestMessage) return;
|
|
47
|
+
|
|
48
|
+
if (hasReachedToBottom(yPos.current)) {
|
|
49
|
+
onBottomReached();
|
|
50
|
+
} else if (isMyMessage(latestMessage, currentUserId)) {
|
|
51
|
+
var _scrollRef$current2;
|
|
52
|
+
|
|
53
|
+
(_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.scrollToOffset({
|
|
54
|
+
animated: false,
|
|
55
|
+
offset: 0
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}, [onBottomReached, nextMessages, currentUserId]);
|
|
59
|
+
|
|
60
|
+
const _onScroll = useCallback(event => {
|
|
61
|
+
const {
|
|
62
|
+
contentOffset
|
|
63
|
+
} = event.nativeEvent;
|
|
64
|
+
|
|
65
|
+
if (BOTTOM_DETECT_THRESHOLD < yPos.current && contentOffset.y <= BOTTOM_DETECT_THRESHOLD) {
|
|
66
|
+
onLeaveScrollBottom(false);
|
|
67
|
+
} else if (BOTTOM_DETECT_THRESHOLD < contentOffset.y && yPos.current <= BOTTOM_DETECT_THRESHOLD) {
|
|
68
|
+
onLeaveScrollBottom(true);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
yPos.current = contentOffset.y;
|
|
72
|
+
onScroll === null || onScroll === void 0 ? void 0 : onScroll(event);
|
|
73
|
+
if (hasReachedToBottom(yPos.current)) onBottomReached();
|
|
74
|
+
}, [onScroll, onBottomReached]);
|
|
75
|
+
|
|
76
|
+
if (__DEV__ && !ANDROID_BUG_ALERT_SHOWED) {
|
|
77
|
+
ANDROID_BUG_ALERT_SHOWED = true; // eslint-disable-next-line no-console
|
|
78
|
+
|
|
79
|
+
console.warn('UIKit Warning: Inverted FlatList has a performance issue on Android, Maybe this is a bug please refer link\nhttps://github.com/facebook/react-native/issues/30034');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return /*#__PURE__*/React.createElement(FlatList, _extends({}, props, {
|
|
83
|
+
// FIXME: inverted list of ListEmptyComponent is reversed {@link https://github.com/facebook/react-native/issues/21196#issuecomment-836937743}
|
|
84
|
+
inverted: Boolean((_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length) // FIXME: maintainVisibleContentPosition is not working on Android {@link https://github.com/facebook/react-native/issues/25239}
|
|
85
|
+
// maintainVisibleContentPosition={{ minIndexForVisible: 1, autoscrollToTopThreshold: AUTO_SCROLL_TO_TOP_THRESHOLD }}
|
|
86
|
+
,
|
|
87
|
+
ref: scrollRef,
|
|
88
|
+
bounces: false,
|
|
89
|
+
keyboardShouldPersistTaps: 'handled',
|
|
90
|
+
indicatorStyle: select({
|
|
91
|
+
light: 'black',
|
|
92
|
+
dark: 'white'
|
|
93
|
+
}),
|
|
94
|
+
removeClippedSubviews: true,
|
|
95
|
+
onEndReachedThreshold: 0.5,
|
|
96
|
+
onEndReached: onTopReached,
|
|
97
|
+
scrollEventThrottle: 16,
|
|
98
|
+
onScroll: _onScroll
|
|
99
|
+
}));
|
|
100
|
+
});
|
|
101
|
+
export default ChatFlatList;
|
|
102
|
+
//# sourceMappingURL=ChatFlatList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useCallback","useEffect","useImperativeHandle","useRef","FlatList","Platform","useUIKitTheme","isMyMessage","ANDROID_BUG_ALERT_SHOWED","OS","BOTTOM_DETECT_THRESHOLD","hasReachedToBottom","yPos","thresholdPx","ChatFlatList","CustomFlatList","ref","onTopReached","nextMessages","onBottomReached","onLeaveScrollBottom","onScroll","currentUserId","props","select","scrollRef","scrollToBottom","animated","current","scrollToOffset","offset","latestMessage","length","_onScroll","event","contentOffset","nativeEvent","y","__DEV__","console","warn","Boolean","data","light","dark"],"sources":["ChatFlatList.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';\nimport { FlatList, FlatListProps, Platform } from 'react-native';\n\nimport { useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { SendbirdMessage, isMyMessage } from '@sendbird/uikit-utils';\n\nlet ANDROID_BUG_ALERT_SHOWED = Platform.OS !== 'android';\nconst BOTTOM_DETECT_THRESHOLD = 25;\n// const AUTO_SCROLL_TO_TOP_THRESHOLD = 15;\n\nfunction hasReachedToBottom(yPos: number, thresholdPx = 0) {\n return thresholdPx >= yPos;\n}\n\nexport type ChatFlatListRef = { scrollToBottom: (animated?: boolean) => void };\ntype Props = Omit<FlatListProps<SendbirdMessage>, 'onEndReached'> & {\n currentUserId?: string;\n onBottomReached: () => void;\n onTopReached: () => void;\n nextMessages: SendbirdMessage[];\n onLeaveScrollBottom: (value: boolean) => void;\n};\n// FIXME: Inverted FlatList performance issue on Android {@link https://github.com/facebook/react-native/issues/30034}\nconst ChatFlatList = forwardRef<ChatFlatListRef, Props>(function CustomFlatList(\n { onTopReached, nextMessages, onBottomReached, onLeaveScrollBottom, onScroll, currentUserId, ...props },\n ref,\n) {\n const { select } = useUIKitTheme();\n const scrollRef = useRef<FlatList<SendbirdMessage>>(null);\n const yPos = useRef(0);\n\n useImperativeHandle(\n ref,\n () => ({\n scrollToBottom: (animated = true) => scrollRef.current?.scrollToOffset({ animated, offset: 0 }),\n }),\n [],\n );\n\n useEffect(() => {\n const latestMessage = nextMessages[nextMessages.length - 1];\n if (!latestMessage) return;\n\n if (hasReachedToBottom(yPos.current)) {\n onBottomReached();\n } else if (isMyMessage(latestMessage, currentUserId)) {\n scrollRef.current?.scrollToOffset({ animated: false, offset: 0 });\n }\n }, [onBottomReached, nextMessages, currentUserId]);\n\n const _onScroll = useCallback<NonNullable<Props['onScroll']>>(\n (event) => {\n const { contentOffset } = event.nativeEvent;\n if (BOTTOM_DETECT_THRESHOLD < yPos.current && contentOffset.y <= BOTTOM_DETECT_THRESHOLD) {\n onLeaveScrollBottom(false);\n } else if (BOTTOM_DETECT_THRESHOLD < contentOffset.y && yPos.current <= BOTTOM_DETECT_THRESHOLD) {\n onLeaveScrollBottom(true);\n }\n\n yPos.current = contentOffset.y;\n\n onScroll?.(event);\n if (hasReachedToBottom(yPos.current)) onBottomReached();\n },\n [onScroll, onBottomReached],\n );\n\n if (__DEV__ && !ANDROID_BUG_ALERT_SHOWED) {\n ANDROID_BUG_ALERT_SHOWED = true;\n // eslint-disable-next-line no-console\n console.warn(\n 'UIKit Warning: Inverted FlatList has a performance issue on Android, Maybe this is a bug please refer link\\nhttps://github.com/facebook/react-native/issues/30034',\n );\n }\n\n return (\n <FlatList\n {...props}\n // FIXME: inverted list of ListEmptyComponent is reversed {@link https://github.com/facebook/react-native/issues/21196#issuecomment-836937743}\n inverted={Boolean(props.data?.length)}\n // FIXME: maintainVisibleContentPosition is not working on Android {@link https://github.com/facebook/react-native/issues/25239}\n // maintainVisibleContentPosition={{ minIndexForVisible: 1, autoscrollToTopThreshold: AUTO_SCROLL_TO_TOP_THRESHOLD }}\n ref={scrollRef}\n bounces={false}\n keyboardShouldPersistTaps={'handled'}\n indicatorStyle={select({ light: 'black', dark: 'white' })}\n removeClippedSubviews\n onEndReachedThreshold={0.5}\n onEndReached={onTopReached}\n scrollEventThrottle={16}\n onScroll={_onScroll}\n />\n );\n});\n\nexport default ChatFlatList;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,UAAhB,EAA4BC,WAA5B,EAAyCC,SAAzC,EAAoDC,mBAApD,EAAyEC,MAAzE,QAAuF,OAAvF;AACA,SAASC,QAAT,EAAkCC,QAAlC,QAAkD,cAAlD;AAEA,SAASC,aAAT,QAA8B,yCAA9B;AACA,SAA0BC,WAA1B,QAA6C,uBAA7C;AAEA,IAAIC,wBAAwB,GAAGH,QAAQ,CAACI,EAAT,KAAgB,SAA/C;AACA,MAAMC,uBAAuB,GAAG,EAAhC,C,CACA;;AAEA,SAASC,kBAAT,CAA4BC,IAA5B,EAA2D;EAAA,IAAjBC,WAAiB,uEAAH,CAAG;EACzD,OAAOA,WAAW,IAAID,IAAtB;AACD;;AAUD;AACA,MAAME,YAAY,gBAAGf,UAAU,CAAyB,SAASgB,cAAT,OAEtDC,GAFsD,EAGtD;EAAA;;EAAA,IAFA;IAAEC,YAAF;IAAgBC,YAAhB;IAA8BC,eAA9B;IAA+CC,mBAA/C;IAAoEC,QAApE;IAA8EC,aAA9E;IAA6F,GAAGC;EAAhG,CAEA;EACA,MAAM;IAAEC;EAAF,IAAalB,aAAa,EAAhC;EACA,MAAMmB,SAAS,GAAGtB,MAAM,CAA4B,IAA5B,CAAxB;EACA,MAAMS,IAAI,GAAGT,MAAM,CAAC,CAAD,CAAnB;EAEAD,mBAAmB,CACjBc,GADiB,EAEjB,OAAO;IACLU,cAAc,EAAE;MAAA;;MAAA,IAACC,QAAD,uEAAY,IAAZ;MAAA,6BAAqBF,SAAS,CAACG,OAA/B,uDAAqB,mBAAmBC,cAAnB,CAAkC;QAAEF,QAAF;QAAYG,MAAM,EAAE;MAApB,CAAlC,CAArB;IAAA;EADX,CAAP,CAFiB,EAKjB,EALiB,CAAnB;EAQA7B,SAAS,CAAC,MAAM;IACd,MAAM8B,aAAa,GAAGb,YAAY,CAACA,YAAY,CAACc,MAAb,GAAsB,CAAvB,CAAlC;IACA,IAAI,CAACD,aAAL,EAAoB;;IAEpB,IAAIpB,kBAAkB,CAACC,IAAI,CAACgB,OAAN,CAAtB,EAAsC;MACpCT,eAAe;IAChB,CAFD,MAEO,IAAIZ,WAAW,CAACwB,aAAD,EAAgBT,aAAhB,CAAf,EAA+C;MAAA;;MACpD,uBAAAG,SAAS,CAACG,OAAV,4EAAmBC,cAAnB,CAAkC;QAAEF,QAAQ,EAAE,KAAZ;QAAmBG,MAAM,EAAE;MAA3B,CAAlC;IACD;EACF,CATQ,EASN,CAACX,eAAD,EAAkBD,YAAlB,EAAgCI,aAAhC,CATM,CAAT;;EAWA,MAAMW,SAAS,GAAGjC,WAAW,CAC1BkC,KAAD,IAAW;IACT,MAAM;MAAEC;IAAF,IAAoBD,KAAK,CAACE,WAAhC;;IACA,IAAI1B,uBAAuB,GAAGE,IAAI,CAACgB,OAA/B,IAA0CO,aAAa,CAACE,CAAd,IAAmB3B,uBAAjE,EAA0F;MACxFU,mBAAmB,CAAC,KAAD,CAAnB;IACD,CAFD,MAEO,IAAIV,uBAAuB,GAAGyB,aAAa,CAACE,CAAxC,IAA6CzB,IAAI,CAACgB,OAAL,IAAgBlB,uBAAjE,EAA0F;MAC/FU,mBAAmB,CAAC,IAAD,CAAnB;IACD;;IAEDR,IAAI,CAACgB,OAAL,GAAeO,aAAa,CAACE,CAA7B;IAEAhB,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAGa,KAAH,CAAR;IACA,IAAIvB,kBAAkB,CAACC,IAAI,CAACgB,OAAN,CAAtB,EAAsCT,eAAe;EACtD,CAb0B,EAc3B,CAACE,QAAD,EAAWF,eAAX,CAd2B,CAA7B;;EAiBA,IAAImB,OAAO,IAAI,CAAC9B,wBAAhB,EAA0C;IACxCA,wBAAwB,GAAG,IAA3B,CADwC,CAExC;;IACA+B,OAAO,CAACC,IAAR,CACE,mKADF;EAGD;;EAED,oBACE,oBAAC,QAAD,eACMjB,KADN;IAEE;IACA,QAAQ,EAAEkB,OAAO,gBAAClB,KAAK,CAACmB,IAAP,gDAAC,YAAYV,MAAb,CAHnB,CAIE;IACA;IALF;IAME,GAAG,EAAEP,SANP;IAOE,OAAO,EAAE,KAPX;IAQE,yBAAyB,EAAE,SAR7B;IASE,cAAc,EAAED,MAAM,CAAC;MAAEmB,KAAK,EAAE,OAAT;MAAkBC,IAAI,EAAE;IAAxB,CAAD,CATxB;IAUE,qBAAqB,MAVvB;IAWE,qBAAqB,EAAE,GAXzB;IAYE,YAAY,EAAE3B,YAZhB;IAaE,mBAAmB,EAAE,EAbvB;IAcE,QAAQ,EAAEgB;EAdZ,GADF;AAkBD,CAtE8B,CAA/B;AAwEA,eAAenB,YAAf"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
4
|
+
|
|
5
|
+
const AdminMessage = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
message,
|
|
8
|
+
nextMessage
|
|
9
|
+
} = _ref;
|
|
10
|
+
const {
|
|
11
|
+
colors
|
|
12
|
+
} = useUIKitTheme();
|
|
13
|
+
const isNextAdmin = nextMessage === null || nextMessage === void 0 ? void 0 : nextMessage.isAdminMessage();
|
|
14
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
15
|
+
style: StyleSheet.flatten([styles.container, isNextAdmin ? styles.nextAdminType : styles.next])
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
17
|
+
caption2: true,
|
|
18
|
+
color: colors.onBackground02,
|
|
19
|
+
style: styles.text
|
|
20
|
+
}, message.message));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const styles = createStyleSheet({
|
|
24
|
+
container: {
|
|
25
|
+
width: 300,
|
|
26
|
+
alignSelf: 'center',
|
|
27
|
+
alignItems: 'center'
|
|
28
|
+
},
|
|
29
|
+
nextAdminType: {
|
|
30
|
+
marginBottom: 8
|
|
31
|
+
},
|
|
32
|
+
next: {
|
|
33
|
+
marginBottom: 16
|
|
34
|
+
},
|
|
35
|
+
text: {
|
|
36
|
+
textAlign: 'center'
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export default AdminMessage;
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","Text","createStyleSheet","useUIKitTheme","AdminMessage","message","nextMessage","colors","isNextAdmin","isAdminMessage","flatten","styles","container","nextAdminType","next","onBackground02","text","width","alignSelf","alignItems","marginBottom","textAlign"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdAdminMessage } from '@sendbird/uikit-utils';\n\nimport type { MessageRendererInterface } from '../index';\n\nexport type AdminMessageProps = MessageRendererInterface<SendbirdAdminMessage>;\nconst AdminMessage = ({ message, nextMessage }: AdminMessageProps) => {\n const { colors } = useUIKitTheme();\n\n const isNextAdmin = nextMessage?.isAdminMessage();\n return (\n <View style={StyleSheet.flatten([styles.container, isNextAdmin ? styles.nextAdminType : styles.next])}>\n <Text caption2 color={colors.onBackground02} style={styles.text}>\n {message.message}\n </Text>\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n width: 300,\n alignSelf: 'center',\n alignItems: 'center',\n },\n nextAdminType: {\n marginBottom: 8,\n },\n next: {\n marginBottom: 16,\n },\n text: {\n textAlign: 'center',\n },\n});\n\nexport default AdminMessage;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,UAAT,EAAqBC,IAArB,QAAiC,cAAjC;AAEA,SAASC,IAAT,EAAeC,gBAAf,EAAiCC,aAAjC,QAAsD,yCAAtD;;AAMA,MAAMC,YAAY,GAAG,QAAiD;EAAA,IAAhD;IAAEC,OAAF;IAAWC;EAAX,CAAgD;EACpE,MAAM;IAAEC;EAAF,IAAaJ,aAAa,EAAhC;EAEA,MAAMK,WAAW,GAAGF,WAAH,aAAGA,WAAH,uBAAGA,WAAW,CAAEG,cAAb,EAApB;EACA,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEV,UAAU,CAACW,OAAX,CAAmB,CAACC,MAAM,CAACC,SAAR,EAAmBJ,WAAW,GAAGG,MAAM,CAACE,aAAV,GAA0BF,MAAM,CAACG,IAA/D,CAAnB;EAAb,gBACE,oBAAC,IAAD;IAAM,QAAQ,MAAd;IAAe,KAAK,EAAEP,MAAM,CAACQ,cAA7B;IAA6C,KAAK,EAAEJ,MAAM,CAACK;EAA3D,GACGX,OAAO,CAACA,OADX,CADF,CADF;AAOD,CAXD;;AAaA,MAAMM,MAAM,GAAGT,gBAAgB,CAAC;EAC9BU,SAAS,EAAE;IACTK,KAAK,EAAE,GADE;IAETC,SAAS,EAAE,QAFF;IAGTC,UAAU,EAAE;EAHH,CADmB;EAM9BN,aAAa,EAAE;IACbO,YAAY,EAAE;EADD,CANe;EAS9BN,IAAI,EAAE;IACJM,YAAY,EAAE;EADV,CATwB;EAY9BJ,IAAI,EAAE;IACJK,SAAS,EAAE;EADP;AAZwB,CAAD,CAA/B;AAiBA,eAAejB,YAAf"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { Icon, Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
4
|
+
import { useLocalization } from '../../../hooks/useContext';
|
|
5
|
+
const iconMapper = {
|
|
6
|
+
audio: 'file-audio',
|
|
7
|
+
image: 'photo',
|
|
8
|
+
video: 'play',
|
|
9
|
+
file: 'file-document'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const BaseFileMessage = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
message,
|
|
15
|
+
variant,
|
|
16
|
+
pressed,
|
|
17
|
+
type
|
|
18
|
+
} = _ref;
|
|
19
|
+
const {
|
|
20
|
+
STRINGS
|
|
21
|
+
} = useLocalization();
|
|
22
|
+
const {
|
|
23
|
+
colors
|
|
24
|
+
} = useUIKitTheme();
|
|
25
|
+
const color = colors.ui.message[variant][pressed ? 'pressed' : 'enabled'];
|
|
26
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
27
|
+
style: [styles.container, {
|
|
28
|
+
backgroundColor: color.background
|
|
29
|
+
}]
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
31
|
+
icon: iconMapper[type],
|
|
32
|
+
size: 24,
|
|
33
|
+
containerStyle: {
|
|
34
|
+
backgroundColor: colors.background,
|
|
35
|
+
padding: 2,
|
|
36
|
+
borderRadius: 8,
|
|
37
|
+
marginRight: 8
|
|
38
|
+
}
|
|
39
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
40
|
+
body3: true,
|
|
41
|
+
ellipsizeMode: 'middle',
|
|
42
|
+
numberOfLines: 1,
|
|
43
|
+
color: color.textMsg,
|
|
44
|
+
style: styles.name
|
|
45
|
+
}, STRINGS.GROUP_CHANNEL.MESSAGE_BUBBLE_FILE_TITLE(message)));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const styles = createStyleSheet({
|
|
49
|
+
container: {
|
|
50
|
+
flexDirection: 'row',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
paddingHorizontal: 12,
|
|
54
|
+
paddingVertical: 6,
|
|
55
|
+
borderRadius: 16
|
|
56
|
+
},
|
|
57
|
+
name: {
|
|
58
|
+
flexShrink: 1
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export default BaseFileMessage;
|
|
62
|
+
//# sourceMappingURL=BaseFileMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Icon","Text","createStyleSheet","useUIKitTheme","useLocalization","iconMapper","audio","image","video","file","BaseFileMessage","message","variant","pressed","type","STRINGS","colors","color","ui","styles","container","backgroundColor","background","padding","borderRadius","marginRight","textMsg","name","GROUP_CHANNEL","MESSAGE_BUBBLE_FILE_TITLE","flexDirection","alignItems","justifyContent","paddingHorizontal","paddingVertical","flexShrink"],"sources":["BaseFileMessage.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { Icon, Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\n\nimport { useLocalization } from '../../../hooks/useContext';\nimport type { FileMessageProps } from './index';\n\nconst iconMapper = { audio: 'file-audio', image: 'photo', video: 'play', file: 'file-document' } as const;\n\ntype Props = FileMessageProps & {\n type: 'image' | 'audio' | 'video' | 'file';\n};\nconst BaseFileMessage = ({ message, variant, pressed, type }: Props) => {\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n const color = colors.ui.message[variant][pressed ? 'pressed' : 'enabled'];\n return (\n <View style={[styles.container, { backgroundColor: color.background }]}>\n <Icon\n icon={iconMapper[type]}\n size={24}\n containerStyle={{ backgroundColor: colors.background, padding: 2, borderRadius: 8, marginRight: 8 }}\n />\n <Text body3 ellipsizeMode={'middle'} numberOfLines={1} color={color.textMsg} style={styles.name}>\n {STRINGS.GROUP_CHANNEL.MESSAGE_BUBBLE_FILE_TITLE(message)}\n </Text>\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: 12,\n paddingVertical: 6,\n borderRadius: 16,\n },\n name: {\n flexShrink: 1,\n },\n});\n\nexport default BaseFileMessage;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,gBAArB,EAAuCC,aAAvC,QAA4D,yCAA5D;AAEA,SAASC,eAAT,QAAgC,2BAAhC;AAGA,MAAMC,UAAU,GAAG;EAAEC,KAAK,EAAE,YAAT;EAAuBC,KAAK,EAAE,OAA9B;EAAuCC,KAAK,EAAE,MAA9C;EAAsDC,IAAI,EAAE;AAA5D,CAAnB;;AAKA,MAAMC,eAAe,GAAG,QAAgD;EAAA,IAA/C;IAAEC,OAAF;IAAWC,OAAX;IAAoBC,OAApB;IAA6BC;EAA7B,CAA+C;EACtE,MAAM;IAAEC;EAAF,IAAcX,eAAe,EAAnC;EACA,MAAM;IAAEY;EAAF,IAAab,aAAa,EAAhC;EACA,MAAMc,KAAK,GAAGD,MAAM,CAACE,EAAP,CAAUP,OAAV,CAAkBC,OAAlB,EAA2BC,OAAO,GAAG,SAAH,GAAe,SAAjD,CAAd;EACA,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAE,CAACM,MAAM,CAACC,SAAR,EAAmB;MAAEC,eAAe,EAAEJ,KAAK,CAACK;IAAzB,CAAnB;EAAb,gBACE,oBAAC,IAAD;IACE,IAAI,EAAEjB,UAAU,CAACS,IAAD,CADlB;IAEE,IAAI,EAAE,EAFR;IAGE,cAAc,EAAE;MAAEO,eAAe,EAAEL,MAAM,CAACM,UAA1B;MAAsCC,OAAO,EAAE,CAA/C;MAAkDC,YAAY,EAAE,CAAhE;MAAmEC,WAAW,EAAE;IAAhF;EAHlB,EADF,eAME,oBAAC,IAAD;IAAM,KAAK,MAAX;IAAY,aAAa,EAAE,QAA3B;IAAqC,aAAa,EAAE,CAApD;IAAuD,KAAK,EAAER,KAAK,CAACS,OAApE;IAA6E,KAAK,EAAEP,MAAM,CAACQ;EAA3F,GACGZ,OAAO,CAACa,aAAR,CAAsBC,yBAAtB,CAAgDlB,OAAhD,CADH,CANF,CADF;AAYD,CAhBD;;AAkBA,MAAMQ,MAAM,GAAGjB,gBAAgB,CAAC;EAC9BkB,SAAS,EAAE;IACTU,aAAa,EAAE,KADN;IAETC,UAAU,EAAE,QAFH;IAGTC,cAAc,EAAE,QAHP;IAITC,iBAAiB,EAAE,EAJV;IAKTC,eAAe,EAAE,CALR;IAMTV,YAAY,EAAE;EANL,CADmB;EAS9BG,IAAI,EAAE;IACJQ,UAAU,EAAE;EADR;AATwB,CAAD,CAA/B;AAcA,eAAezB,eAAf"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Icon, Image, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
3
|
+
import { getAvailableUriFromFileMessage } from '@sendbird/uikit-utils';
|
|
4
|
+
|
|
5
|
+
const ImageFileMessage = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
message
|
|
8
|
+
} = _ref;
|
|
9
|
+
const {
|
|
10
|
+
colors
|
|
11
|
+
} = useUIKitTheme();
|
|
12
|
+
const [imageNotFound, setImageNotFound] = useState(false);
|
|
13
|
+
const fileUrl = getAvailableUriFromFileMessage(message);
|
|
14
|
+
const style = [styles.image, {
|
|
15
|
+
backgroundColor: colors.onBackground04
|
|
16
|
+
}];
|
|
17
|
+
|
|
18
|
+
if (imageNotFound) {
|
|
19
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
20
|
+
containerStyle: style,
|
|
21
|
+
icon: 'thumbnail-none',
|
|
22
|
+
size: 48,
|
|
23
|
+
color: colors.onBackground02
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return /*#__PURE__*/React.createElement(Image, {
|
|
28
|
+
source: {
|
|
29
|
+
uri: fileUrl
|
|
30
|
+
},
|
|
31
|
+
style: style,
|
|
32
|
+
resizeMode: 'cover',
|
|
33
|
+
resizeMethod: 'resize',
|
|
34
|
+
onError: () => setImageNotFound(true)
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const styles = createStyleSheet({
|
|
39
|
+
image: {
|
|
40
|
+
width: 240,
|
|
41
|
+
maxWidth: 240,
|
|
42
|
+
height: 160,
|
|
43
|
+
borderRadius: 16
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export default ImageFileMessage;
|
|
47
|
+
//# sourceMappingURL=ImageFileMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","Icon","Image","createStyleSheet","useUIKitTheme","getAvailableUriFromFileMessage","ImageFileMessage","message","colors","imageNotFound","setImageNotFound","fileUrl","style","styles","image","backgroundColor","onBackground04","onBackground02","uri","width","maxWidth","height","borderRadius"],"sources":["ImageFileMessage.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Icon, Image, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { getAvailableUriFromFileMessage } from '@sendbird/uikit-utils';\n\nimport type { FileMessageProps } from './index';\n\nconst ImageFileMessage = ({ message }: FileMessageProps) => {\n const { colors } = useUIKitTheme();\n const [imageNotFound, setImageNotFound] = useState(false);\n\n const fileUrl = getAvailableUriFromFileMessage(message);\n const style = [styles.image, { backgroundColor: colors.onBackground04 }];\n\n if (imageNotFound) {\n return <Icon containerStyle={style} icon={'thumbnail-none'} size={48} color={colors.onBackground02} />;\n }\n\n return (\n <Image\n source={{ uri: fileUrl }}\n style={style}\n resizeMode={'cover'}\n resizeMethod={'resize'}\n onError={() => setImageNotFound(true)}\n />\n );\n};\n\nconst styles = createStyleSheet({\n image: {\n width: 240,\n maxWidth: 240,\n height: 160,\n borderRadius: 16,\n },\n});\n\nexport default ImageFileMessage;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAEA,SAASC,IAAT,EAAeC,KAAf,EAAsBC,gBAAtB,EAAwCC,aAAxC,QAA6D,yCAA7D;AACA,SAASC,8BAAT,QAA+C,uBAA/C;;AAIA,MAAMC,gBAAgB,GAAG,QAAmC;EAAA,IAAlC;IAAEC;EAAF,CAAkC;EAC1D,MAAM;IAAEC;EAAF,IAAaJ,aAAa,EAAhC;EACA,MAAM,CAACK,aAAD,EAAgBC,gBAAhB,IAAoCV,QAAQ,CAAC,KAAD,CAAlD;EAEA,MAAMW,OAAO,GAAGN,8BAA8B,CAACE,OAAD,CAA9C;EACA,MAAMK,KAAK,GAAG,CAACC,MAAM,CAACC,KAAR,EAAe;IAAEC,eAAe,EAAEP,MAAM,CAACQ;EAA1B,CAAf,CAAd;;EAEA,IAAIP,aAAJ,EAAmB;IACjB,oBAAO,oBAAC,IAAD;MAAM,cAAc,EAAEG,KAAtB;MAA6B,IAAI,EAAE,gBAAnC;MAAqD,IAAI,EAAE,EAA3D;MAA+D,KAAK,EAAEJ,MAAM,CAACS;IAA7E,EAAP;EACD;;EAED,oBACE,oBAAC,KAAD;IACE,MAAM,EAAE;MAAEC,GAAG,EAAEP;IAAP,CADV;IAEE,KAAK,EAAEC,KAFT;IAGE,UAAU,EAAE,OAHd;IAIE,YAAY,EAAE,QAJhB;IAKE,OAAO,EAAE,MAAMF,gBAAgB,CAAC,IAAD;EALjC,EADF;AASD,CApBD;;AAsBA,MAAMG,MAAM,GAAGV,gBAAgB,CAAC;EAC9BW,KAAK,EAAE;IACLK,KAAK,EAAE,GADF;IAELC,QAAQ,EAAE,GAFL;IAGLC,MAAM,EAAE,GAHH;IAILC,YAAY,EAAE;EAJT;AADuB,CAAD,CAA/B;AASA,eAAehB,gBAAf"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { getFileExtension, getFileType } from '@sendbird/uikit-utils';
|
|
5
|
+
import BaseFileMessage from './BaseFileMessage';
|
|
6
|
+
import ImageFileMessage from './ImageFileMessage';
|
|
7
|
+
|
|
8
|
+
const FileMessage = props => {
|
|
9
|
+
const fileType = getFileType(props.message.type || getFileExtension(props.message.name));
|
|
10
|
+
if (fileType === 'image') return /*#__PURE__*/React.createElement(ImageFileMessage, props);
|
|
11
|
+
return /*#__PURE__*/React.createElement(BaseFileMessage, _extends({}, props, {
|
|
12
|
+
type: fileType
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default /*#__PURE__*/React.memo(FileMessage);
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","getFileExtension","getFileType","BaseFileMessage","ImageFileMessage","FileMessage","props","fileType","message","type","name","memo"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SendbirdFileMessage, getFileExtension, getFileType } from '@sendbird/uikit-utils';\n\nimport type { MessageRendererInterface } from '../index';\nimport BaseFileMessage from './BaseFileMessage';\nimport ImageFileMessage from './ImageFileMessage';\n\nexport type FileMessageProps = MessageRendererInterface<SendbirdFileMessage>;\nconst FileMessage = (props: FileMessageProps) => {\n const fileType = getFileType(props.message.type || getFileExtension(props.message.name));\n\n if (fileType === 'image') return <ImageFileMessage {...props} />;\n return <BaseFileMessage {...props} type={fileType} />;\n};\n\nexport default React.memo(FileMessage);\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAA8BC,gBAA9B,EAAgDC,WAAhD,QAAmE,uBAAnE;AAGA,OAAOC,eAAP,MAA4B,mBAA5B;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;;AAGA,MAAMC,WAAW,GAAIC,KAAD,IAA6B;EAC/C,MAAMC,QAAQ,GAAGL,WAAW,CAACI,KAAK,CAACE,OAAN,CAAcC,IAAd,IAAsBR,gBAAgB,CAACK,KAAK,CAACE,OAAN,CAAcE,IAAf,CAAvC,CAA5B;EAEA,IAAIH,QAAQ,KAAK,OAAjB,EAA0B,oBAAO,oBAAC,gBAAD,EAAsBD,KAAtB,CAAP;EAC1B,oBAAO,oBAAC,eAAD,eAAqBA,KAArB;IAA4B,IAAI,EAAEC;EAAlC,GAAP;AACD,CALD;;AAOA,4BAAeP,KAAK,CAACW,IAAN,CAAWN,WAAX,CAAf"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { createStyleSheet } from '@sendbird/uikit-react-native-foundation';
|
|
4
|
+
|
|
5
|
+
const MessageContainer = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
children
|
|
8
|
+
} = _ref;
|
|
9
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
10
|
+
style: styles.container
|
|
11
|
+
}, children);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const styles = createStyleSheet({
|
|
15
|
+
container: {
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
paddingHorizontal: 16
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export default MessageContainer;
|
|
21
|
+
//# sourceMappingURL=MessageContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","createStyleSheet","MessageContainer","children","styles","container","flexDirection","paddingHorizontal"],"sources":["MessageContainer.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { createStyleSheet } from '@sendbird/uikit-react-native-foundation';\n\nconst MessageContainer = ({ children }: React.PropsWithChildren) => {\n return <View style={styles.container}>{children}</View>;\n};\n\nconst styles = createStyleSheet({\n container: {\n flexDirection: 'column',\n paddingHorizontal: 16,\n },\n});\n\nexport default MessageContainer;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,gBAAT,QAAiC,yCAAjC;;AAEA,MAAMC,gBAAgB,GAAG,QAA2C;EAAA,IAA1C;IAAEC;EAAF,CAA0C;EAClE,oBAAO,oBAAC,IAAD;IAAM,KAAK,EAAEC,MAAM,CAACC;EAApB,GAAgCF,QAAhC,CAAP;AACD,CAFD;;AAIA,MAAMC,MAAM,GAAGH,gBAAgB,CAAC;EAC9BI,SAAS,EAAE;IACTC,aAAa,EAAE,QADN;IAETC,iBAAiB,EAAE;EAFV;AADmB,CAAD,CAA/B;AAOA,eAAeL,gBAAf"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import isSameDay from 'date-fns/isSameDay';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
5
|
+
import { useLocalization } from '../../hooks/useContext';
|
|
6
|
+
|
|
7
|
+
const MessageDateSeparator = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
message,
|
|
10
|
+
prevMessage
|
|
11
|
+
} = _ref;
|
|
12
|
+
const {
|
|
13
|
+
STRINGS
|
|
14
|
+
} = useLocalization();
|
|
15
|
+
const {
|
|
16
|
+
colors
|
|
17
|
+
} = useUIKitTheme();
|
|
18
|
+
const sameDay = isSameDay(message.createdAt, (prevMessage === null || prevMessage === void 0 ? void 0 : prevMessage.createdAt) ?? 0);
|
|
19
|
+
if (sameDay) return null;
|
|
20
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
21
|
+
style: styles.container
|
|
22
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
23
|
+
style: [styles.view, {
|
|
24
|
+
backgroundColor: colors.ui.dateSeparator.default.none.background
|
|
25
|
+
}]
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
27
|
+
caption1: true,
|
|
28
|
+
color: colors.ui.dateSeparator.default.none.text
|
|
29
|
+
}, STRINGS.GROUP_CHANNEL.LIST_DATE_SEPARATOR(new Date(message.createdAt)))));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const styles = createStyleSheet({
|
|
33
|
+
container: {
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
marginVertical: 16
|
|
36
|
+
},
|
|
37
|
+
view: {
|
|
38
|
+
borderRadius: 10,
|
|
39
|
+
paddingVertical: 4,
|
|
40
|
+
paddingHorizontal: 10
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export default MessageDateSeparator;
|
|
44
|
+
//# sourceMappingURL=MessageDateSeparator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isSameDay","React","View","Text","createStyleSheet","useUIKitTheme","useLocalization","MessageDateSeparator","message","prevMessage","STRINGS","colors","sameDay","createdAt","styles","container","view","backgroundColor","ui","dateSeparator","default","none","background","text","GROUP_CHANNEL","LIST_DATE_SEPARATOR","Date","alignItems","marginVertical","borderRadius","paddingVertical","paddingHorizontal"],"sources":["MessageDateSeparator.tsx"],"sourcesContent":["import isSameDay from 'date-fns/isSameDay';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\n\nimport { useLocalization } from '../../hooks/useContext';\n\ntype Props = {\n message: SendbirdMessage;\n prevMessage?: SendbirdMessage;\n};\n\nconst MessageDateSeparator = ({ message, prevMessage }: Props) => {\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n const sameDay = isSameDay(message.createdAt, prevMessage?.createdAt ?? 0);\n if (sameDay) return null;\n return (\n <View style={styles.container}>\n <View style={[styles.view, { backgroundColor: colors.ui.dateSeparator.default.none.background }]}>\n <Text caption1 color={colors.ui.dateSeparator.default.none.text}>\n {STRINGS.GROUP_CHANNEL.LIST_DATE_SEPARATOR(new Date(message.createdAt))}\n </Text>\n </View>\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n alignItems: 'center',\n marginVertical: 16,\n },\n view: {\n borderRadius: 10,\n paddingVertical: 4,\n paddingHorizontal: 10,\n },\n});\n\nexport default MessageDateSeparator;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,oBAAtB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,IAAT,EAAeC,gBAAf,EAAiCC,aAAjC,QAAsD,yCAAtD;AAGA,SAASC,eAAT,QAAgC,wBAAhC;;AAOA,MAAMC,oBAAoB,GAAG,QAAqC;EAAA,IAApC;IAAEC,OAAF;IAAWC;EAAX,CAAoC;EAChE,MAAM;IAAEC;EAAF,IAAcJ,eAAe,EAAnC;EACA,MAAM;IAAEK;EAAF,IAAaN,aAAa,EAAhC;EACA,MAAMO,OAAO,GAAGZ,SAAS,CAACQ,OAAO,CAACK,SAAT,EAAoB,CAAAJ,WAAW,SAAX,IAAAA,WAAW,WAAX,YAAAA,WAAW,CAAEI,SAAb,KAA0B,CAA9C,CAAzB;EACA,IAAID,OAAJ,EAAa,OAAO,IAAP;EACb,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEE,MAAM,CAACC;EAApB,gBACE,oBAAC,IAAD;IAAM,KAAK,EAAE,CAACD,MAAM,CAACE,IAAR,EAAc;MAAEC,eAAe,EAAEN,MAAM,CAACO,EAAP,CAAUC,aAAV,CAAwBC,OAAxB,CAAgCC,IAAhC,CAAqCC;IAAxD,CAAd;EAAb,gBACE,oBAAC,IAAD;IAAM,QAAQ,MAAd;IAAe,KAAK,EAAEX,MAAM,CAACO,EAAP,CAAUC,aAAV,CAAwBC,OAAxB,CAAgCC,IAAhC,CAAqCE;EAA3D,GACGb,OAAO,CAACc,aAAR,CAAsBC,mBAAtB,CAA0C,IAAIC,IAAJ,CAASlB,OAAO,CAACK,SAAjB,CAA1C,CADH,CADF,CADF,CADF;AASD,CAdD;;AAgBA,MAAMC,MAAM,GAAGV,gBAAgB,CAAC;EAC9BW,SAAS,EAAE;IACTY,UAAU,EAAE,QADH;IAETC,cAAc,EAAE;EAFP,CADmB;EAK9BZ,IAAI,EAAE;IACJa,YAAY,EAAE,EADV;IAEJC,eAAe,EAAE,CAFb;IAGJC,iBAAiB,EAAE;EAHf;AALwB,CAAD,CAA/B;AAYA,eAAexB,oBAAf"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { Avatar, createStyleSheet } from '@sendbird/uikit-react-native-foundation';
|
|
4
|
+
|
|
5
|
+
const MessageIncomingAvatar = _ref => {
|
|
6
|
+
var _message$sender;
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
message,
|
|
10
|
+
grouping
|
|
11
|
+
} = _ref;
|
|
12
|
+
if (grouping) return /*#__PURE__*/React.createElement(View, {
|
|
13
|
+
style: styles.avatar
|
|
14
|
+
});
|
|
15
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
16
|
+
style: styles.avatar
|
|
17
|
+
}, (message.isFileMessage() || message.isUserMessage()) && /*#__PURE__*/React.createElement(Avatar, {
|
|
18
|
+
size: 26,
|
|
19
|
+
uri: (_message$sender = message.sender) === null || _message$sender === void 0 ? void 0 : _message$sender.profileUrl
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const styles = createStyleSheet({
|
|
24
|
+
avatar: {
|
|
25
|
+
width: 26,
|
|
26
|
+
marginRight: 12
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export default MessageIncomingAvatar;
|
|
30
|
+
//# sourceMappingURL=MessageIncomingAvatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Avatar","createStyleSheet","MessageIncomingAvatar","message","grouping","styles","avatar","isFileMessage","isUserMessage","sender","profileUrl","width","marginRight"],"sources":["MessageIncomingAvatar.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { Avatar, createStyleSheet } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\n\ntype Props = {\n message: SendbirdMessage;\n grouping: boolean;\n};\nconst MessageIncomingAvatar = ({ message, grouping }: Props) => {\n if (grouping) return <View style={styles.avatar} />;\n return (\n <View style={styles.avatar}>\n {(message.isFileMessage() || message.isUserMessage()) && <Avatar size={26} uri={message.sender?.profileUrl} />}\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n avatar: {\n width: 26,\n marginRight: 12,\n },\n});\n\nexport default MessageIncomingAvatar;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,MAAT,EAAiBC,gBAAjB,QAAyC,yCAAzC;;AAOA,MAAMC,qBAAqB,GAAG,QAAkC;EAAA;;EAAA,IAAjC;IAAEC,OAAF;IAAWC;EAAX,CAAiC;EAC9D,IAAIA,QAAJ,EAAc,oBAAO,oBAAC,IAAD;IAAM,KAAK,EAAEC,MAAM,CAACC;EAApB,EAAP;EACd,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAED,MAAM,CAACC;EAApB,GACG,CAACH,OAAO,CAACI,aAAR,MAA2BJ,OAAO,CAACK,aAAR,EAA5B,kBAAwD,oBAAC,MAAD;IAAQ,IAAI,EAAE,EAAd;IAAkB,GAAG,qBAAEL,OAAO,CAACM,MAAV,oDAAE,gBAAgBC;EAAvC,EAD3D,CADF;AAKD,CAPD;;AASA,MAAML,MAAM,GAAGJ,gBAAgB,CAAC;EAC9BK,MAAM,EAAE;IACNK,KAAK,EAAE,EADD;IAENC,WAAW,EAAE;EAFP;AADsB,CAAD,CAA/B;AAOA,eAAeV,qBAAf"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
4
|
+
import { useLocalization } from '../../hooks/useContext';
|
|
5
|
+
|
|
6
|
+
const MessageIncomingSenderName = _ref => {
|
|
7
|
+
var _message$sender;
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
message,
|
|
11
|
+
grouping
|
|
12
|
+
} = _ref;
|
|
13
|
+
const {
|
|
14
|
+
colors
|
|
15
|
+
} = useUIKitTheme();
|
|
16
|
+
const {
|
|
17
|
+
STRINGS
|
|
18
|
+
} = useLocalization();
|
|
19
|
+
if (grouping) return null;
|
|
20
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
21
|
+
style: styles.sender
|
|
22
|
+
}, (message.isFileMessage() || message.isUserMessage()) && /*#__PURE__*/React.createElement(Text, {
|
|
23
|
+
caption1: true,
|
|
24
|
+
color: colors.ui.message.incoming.enabled.textSenderName
|
|
25
|
+
}, ((_message$sender = message.sender) === null || _message$sender === void 0 ? void 0 : _message$sender.nickname) || STRINGS.LABELS.USER_NO_NAME));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const styles = createStyleSheet({
|
|
29
|
+
sender: {
|
|
30
|
+
marginLeft: 12,
|
|
31
|
+
marginBottom: 4
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export default MessageIncomingSenderName;
|
|
35
|
+
//# sourceMappingURL=MessageIncomingSenderName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Text","createStyleSheet","useUIKitTheme","useLocalization","MessageIncomingSenderName","message","grouping","colors","STRINGS","styles","sender","isFileMessage","isUserMessage","ui","incoming","enabled","textSenderName","nickname","LABELS","USER_NO_NAME","marginLeft","marginBottom"],"sources":["MessageIncomingSenderName.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\n\nimport { useLocalization } from '../../hooks/useContext';\n\ntype Props = {\n message: SendbirdMessage;\n grouping: boolean;\n};\nconst MessageIncomingSenderName = ({ message, grouping }: Props) => {\n const { colors } = useUIKitTheme();\n const { STRINGS } = useLocalization();\n if (grouping) return null;\n\n return (\n <View style={styles.sender}>\n {(message.isFileMessage() || message.isUserMessage()) && (\n <Text caption1 color={colors.ui.message.incoming.enabled.textSenderName}>\n {message.sender?.nickname || STRINGS.LABELS.USER_NO_NAME}\n </Text>\n )}\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n sender: {\n marginLeft: 12,\n marginBottom: 4,\n },\n});\n\nexport default MessageIncomingSenderName;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,IAAT,EAAeC,gBAAf,EAAiCC,aAAjC,QAAsD,yCAAtD;AAGA,SAASC,eAAT,QAAgC,wBAAhC;;AAMA,MAAMC,yBAAyB,GAAG,QAAkC;EAAA;;EAAA,IAAjC;IAAEC,OAAF;IAAWC;EAAX,CAAiC;EAClE,MAAM;IAAEC;EAAF,IAAaL,aAAa,EAAhC;EACA,MAAM;IAAEM;EAAF,IAAcL,eAAe,EAAnC;EACA,IAAIG,QAAJ,EAAc,OAAO,IAAP;EAEd,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEG,MAAM,CAACC;EAApB,GACG,CAACL,OAAO,CAACM,aAAR,MAA2BN,OAAO,CAACO,aAAR,EAA5B,kBACC,oBAAC,IAAD;IAAM,QAAQ,MAAd;IAAe,KAAK,EAAEL,MAAM,CAACM,EAAP,CAAUR,OAAV,CAAkBS,QAAlB,CAA2BC,OAA3B,CAAmCC;EAAzD,GACG,oBAAAX,OAAO,CAACK,MAAR,oEAAgBO,QAAhB,KAA4BT,OAAO,CAACU,MAAR,CAAeC,YAD9C,CAFJ,CADF;AASD,CAdD;;AAgBA,MAAMV,MAAM,GAAGR,gBAAgB,CAAC;EAC9BS,MAAM,EAAE;IACNU,UAAU,EAAE,EADN;IAENC,YAAY,EAAE;EAFR;AADsB,CAAD,CAA/B;AAOA,eAAejB,yBAAf"}
|