stream-chat-react-native-core 4.4.0 → 4.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/commonjs/components/Attachment/Attachment.js +1 -1
- package/lib/commonjs/components/Attachment/AttachmentActions.js +1 -1
- package/lib/commonjs/components/Attachment/Card.js +26 -29
- package/lib/commonjs/components/Attachment/Card.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachment.js +20 -25
- package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +1 -1
- package/lib/commonjs/components/Attachment/FileIcon.js +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +1 -1
- package/lib/commonjs/components/Attachment/hooks/useGoToURL.js +42 -0
- package/lib/commonjs/components/Attachment/hooks/useGoToURL.js.map +1 -0
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +1 -1
- package/lib/commonjs/components/Channel/Channel.js +1 -1
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js +4 -12
- package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateThreadContext.js +4 -12
- package/lib/commonjs/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +1 -1
- package/lib/commonjs/components/ChannelList/Skeleton.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +1 -1
- package/lib/commonjs/components/Chat/Chat.js +9 -5
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useAppSettings.js +80 -0
- package/lib/commonjs/components/Chat/hooks/useAppSettings.js.map +1 -0
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +3 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +1 -1
- package/lib/commonjs/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDot.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDots.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/commonjs/components/Message/Message.js +28 -23
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +29 -15
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActions.js +1 -1
- package/lib/commonjs/components/MessageInput/AttachButton.js +1 -1
- package/lib/commonjs/components/MessageInput/CommandsButton.js +1 -1
- package/lib/commonjs/components/MessageInput/CooldownTimer.js +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +109 -41
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +118 -25
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +1 -1
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +1 -1
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +1 -1
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +1 -1
- package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js +53 -21
- package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/InputEditingStateHeader.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputGiphySearch.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputReplyStateHeader.js +1 -1
- package/lib/commonjs/components/MessageList/DateHeader.js +1 -1
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +1 -1
- package/lib/commonjs/components/MessageList/MessageSystem.js +1 -1
- package/lib/commonjs/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js +1 -1
- package/lib/commonjs/components/Reply/Reply.js +1 -1
- package/lib/commonjs/components/Spinner/Spinner.js +1 -1
- package/lib/commonjs/components/Thread/Thread.js +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +1 -1
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +1 -1
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +3 -3
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +1 -1
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js +3 -3
- package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +146 -120
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +1 -1
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +1 -1
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +1 -1
- package/lib/commonjs/contexts/themeContext/ThemeContext.js +1 -1
- package/lib/commonjs/contexts/threadContext/ThreadContext.js +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +1 -1
- package/lib/commonjs/contexts/typingContext/TypingContext.js +1 -1
- package/lib/commonjs/i18n/en.json +2 -0
- package/lib/commonjs/i18n/fr.json +2 -0
- package/lib/commonjs/i18n/hi.json +2 -0
- package/lib/commonjs/i18n/it.json +2 -0
- package/lib/commonjs/i18n/ja.json +3 -1
- package/lib/commonjs/i18n/ko.json +3 -1
- package/lib/commonjs/i18n/nl.json +2 -0
- package/lib/commonjs/i18n/ru.json +2 -0
- package/lib/commonjs/i18n/tr.json +2 -0
- package/lib/commonjs/icons/ArrowRight.js +1 -1
- package/lib/commonjs/icons/AtMentions.js +1 -1
- package/lib/commonjs/icons/Attach.js +1 -1
- package/lib/commonjs/icons/Audio.js +1 -1
- package/lib/commonjs/icons/CSV.js +1 -1
- package/lib/commonjs/icons/Camera.js +1 -1
- package/lib/commonjs/icons/Check.js +1 -1
- package/lib/commonjs/icons/CheckAll.js +1 -1
- package/lib/commonjs/icons/CheckSend.js +1 -1
- package/lib/commonjs/icons/CircleClose.js +1 -1
- package/lib/commonjs/icons/CirclePlus.js +1 -1
- package/lib/commonjs/icons/CircleRight.js +1 -1
- package/lib/commonjs/icons/Close.js +1 -1
- package/lib/commonjs/icons/Copy.js +1 -1
- package/lib/commonjs/icons/CurveLineLeftUp.js +1 -1
- package/lib/commonjs/icons/DOC.js +1 -1
- package/lib/commonjs/icons/DOCX.js +1 -1
- package/lib/commonjs/icons/Delete.js +1 -1
- package/lib/commonjs/icons/Down.js +1 -1
- package/lib/commonjs/icons/DownloadArrow.js +1 -1
- package/lib/commonjs/icons/DownloadCloud.js +1 -1
- package/lib/commonjs/icons/Edit.js +1 -1
- package/lib/commonjs/icons/Error.js +1 -1
- package/lib/commonjs/icons/Eye.js +1 -1
- package/lib/commonjs/icons/Flag.js +1 -1
- package/lib/commonjs/icons/Folder.js +1 -1
- package/lib/commonjs/icons/GenericFile.js +1 -1
- package/lib/commonjs/icons/GiphyIcon.js +1 -1
- package/lib/commonjs/icons/Grid.js +1 -1
- package/lib/commonjs/icons/Group.js +1 -1
- package/lib/commonjs/icons/HTML.js +1 -1
- package/lib/commonjs/icons/Imgur.js +1 -1
- package/lib/commonjs/icons/LOLReaction.js +1 -1
- package/lib/commonjs/icons/Lightning.js +1 -1
- package/lib/commonjs/icons/Link.js +1 -1
- package/lib/commonjs/icons/Loading.js +1 -1
- package/lib/commonjs/icons/Logo.js +1 -1
- package/lib/commonjs/icons/LoveReaction.js +1 -1
- package/lib/commonjs/icons/MD.js +1 -1
- package/lib/commonjs/icons/MailOpen.js +1 -1
- package/lib/commonjs/icons/MenuPointHorizontal.js +1 -1
- package/lib/commonjs/icons/MenuPointVertical.js +1 -1
- package/lib/commonjs/icons/MessageFlag.js +1 -1
- package/lib/commonjs/icons/MessageIcon.js +1 -1
- package/lib/commonjs/icons/Mute.js +1 -1
- package/lib/commonjs/icons/Notification.js +1 -1
- package/lib/commonjs/icons/ODT.js +1 -1
- package/lib/commonjs/icons/PDF.js +1 -1
- package/lib/commonjs/icons/PPT.js +1 -1
- package/lib/commonjs/icons/PPTX.js +1 -1
- package/lib/commonjs/icons/Picture.js +1 -1
- package/lib/commonjs/icons/Pin.js +1 -1
- package/lib/commonjs/icons/PinHeader.js +1 -1
- package/lib/commonjs/icons/RAR.js +1 -1
- package/lib/commonjs/icons/RTF.js +1 -1
- package/lib/commonjs/icons/Refresh.js +1 -1
- package/lib/commonjs/icons/SEVEN_Z.js +1 -1
- package/lib/commonjs/icons/Search.js +1 -1
- package/lib/commonjs/icons/SendRight.js +1 -1
- package/lib/commonjs/icons/SendUp.js +1 -1
- package/lib/commonjs/icons/Share.js +1 -1
- package/lib/commonjs/icons/ShareRightArrow.js +1 -1
- package/lib/commonjs/icons/Smile.js +1 -1
- package/lib/commonjs/icons/Sound.js +1 -1
- package/lib/commonjs/icons/TAR.js +1 -1
- package/lib/commonjs/icons/TXT.js +1 -1
- package/lib/commonjs/icons/ThreadReply.js +1 -1
- package/lib/commonjs/icons/ThumbsDownReaction.js +1 -1
- package/lib/commonjs/icons/ThumbsUpReaction.js +1 -1
- package/lib/commonjs/icons/Time.js +1 -1
- package/lib/commonjs/icons/Unknown.js +1 -1
- package/lib/commonjs/icons/Unpin.js +1 -1
- package/lib/commonjs/icons/User.js +1 -1
- package/lib/commonjs/icons/UserAdd.js +1 -1
- package/lib/commonjs/icons/UserAdmin.js +1 -1
- package/lib/commonjs/icons/UserDelete.js +1 -1
- package/lib/commonjs/icons/UserMinus.js +1 -1
- package/lib/commonjs/icons/Warning.js +38 -0
- package/lib/commonjs/icons/Warning.js.map +1 -0
- package/lib/commonjs/icons/WutReaction.js +1 -1
- package/lib/commonjs/icons/XLS.js +1 -1
- package/lib/commonjs/icons/XLSX.js +1 -1
- package/lib/commonjs/icons/ZIP.js +1 -1
- package/lib/commonjs/icons/index.js +13 -0
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/icons/utils/base.js +1 -1
- package/lib/commonjs/utils/utils.js +33 -2
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +1 -1
- package/lib/module/components/Attachment/AttachmentActions.js +1 -1
- package/lib/module/components/Attachment/Card.js +26 -29
- package/lib/module/components/Attachment/Card.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +20 -25
- package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js +1 -1
- package/lib/module/components/Attachment/FileIcon.js +1 -1
- package/lib/module/components/Attachment/Gallery.js +1 -1
- package/lib/module/components/Attachment/Giphy.js +1 -1
- package/lib/module/components/Attachment/hooks/useGoToURL.js +42 -0
- package/lib/module/components/Attachment/hooks/useGoToURL.js.map +1 -0
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js +1 -1
- package/lib/module/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +1 -1
- package/lib/module/components/Avatar/Avatar.js +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +1 -1
- package/lib/module/components/Channel/Channel.js +1 -1
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js +4 -12
- package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateThreadContext.js +4 -12
- package/lib/module/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +1 -1
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +1 -1
- package/lib/module/components/ChannelList/Skeleton.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +1 -1
- package/lib/module/components/Chat/Chat.js +9 -5
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useAppSettings.js +80 -0
- package/lib/module/components/Chat/hooks/useAppSettings.js.map +1 -0
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +3 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js +1 -1
- package/lib/module/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingDot.js +1 -1
- package/lib/module/components/Indicators/LoadingDots.js +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/module/components/Message/Message.js +28 -23
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageReplies.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageStatus.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +1 -1
- package/lib/module/components/Message/MessageSimple/ReactionList.js +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.js +29 -15
- package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.test.js +1 -1
- package/lib/module/components/Message/hooks/useMessageActions.js +1 -1
- package/lib/module/components/MessageInput/AttachButton.js +1 -1
- package/lib/module/components/MessageInput/CommandsButton.js +1 -1
- package/lib/module/components/MessageInput/CooldownTimer.js +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +109 -41
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +118 -25
- package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +1 -1
- package/lib/module/components/MessageInput/MoreOptionsButton.js +1 -1
- package/lib/module/components/MessageInput/SendButton.js +1 -1
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +1 -1
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +1 -1
- package/lib/module/components/MessageInput/UploadProgressIndicator.js +53 -21
- package/lib/module/components/MessageInput/UploadProgressIndicator.js.map +1 -1
- package/lib/module/components/MessageInput/components/InputEditingStateHeader.js +1 -1
- package/lib/module/components/MessageInput/components/InputGiphySearch.js +1 -1
- package/lib/module/components/MessageInput/components/InputReplyStateHeader.js +1 -1
- package/lib/module/components/MessageList/DateHeader.js +1 -1
- package/lib/module/components/MessageList/InlineDateSeparator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/module/components/MessageList/MessageList.js +1 -1
- package/lib/module/components/MessageList/MessageSystem.js +1 -1
- package/lib/module/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/module/components/MessageList/ScrollToBottomButton.js +1 -1
- package/lib/module/components/MessageList/TypingIndicator.js +1 -1
- package/lib/module/components/MessageList/TypingIndicatorContainer.js +1 -1
- package/lib/module/components/MessageOverlay/MessageActionList.js +1 -1
- package/lib/module/components/MessageOverlay/MessageActionListItem.js +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionList.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactions.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js +1 -1
- package/lib/module/components/Reply/Reply.js +1 -1
- package/lib/module/components/Spinner/Spinner.js +1 -1
- package/lib/module/components/Thread/Thread.js +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +1 -1
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js +1 -1
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +3 -3
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +1 -1
- package/lib/module/contexts/keyboardContext/KeyboardContext.js +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js +3 -3
- package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +146 -120
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +1 -1
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +1 -1
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +1 -1
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +1 -1
- package/lib/module/contexts/themeContext/ThemeContext.js +1 -1
- package/lib/module/contexts/threadContext/ThreadContext.js +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +1 -1
- package/lib/module/contexts/typingContext/TypingContext.js +1 -1
- package/lib/module/i18n/en.json +2 -0
- package/lib/module/i18n/fr.json +2 -0
- package/lib/module/i18n/hi.json +2 -0
- package/lib/module/i18n/it.json +2 -0
- package/lib/module/i18n/ja.json +3 -1
- package/lib/module/i18n/ko.json +3 -1
- package/lib/module/i18n/nl.json +2 -0
- package/lib/module/i18n/ru.json +2 -0
- package/lib/module/i18n/tr.json +2 -0
- package/lib/module/icons/ArrowRight.js +1 -1
- package/lib/module/icons/AtMentions.js +1 -1
- package/lib/module/icons/Attach.js +1 -1
- package/lib/module/icons/Audio.js +1 -1
- package/lib/module/icons/CSV.js +1 -1
- package/lib/module/icons/Camera.js +1 -1
- package/lib/module/icons/Check.js +1 -1
- package/lib/module/icons/CheckAll.js +1 -1
- package/lib/module/icons/CheckSend.js +1 -1
- package/lib/module/icons/CircleClose.js +1 -1
- package/lib/module/icons/CirclePlus.js +1 -1
- package/lib/module/icons/CircleRight.js +1 -1
- package/lib/module/icons/Close.js +1 -1
- package/lib/module/icons/Copy.js +1 -1
- package/lib/module/icons/CurveLineLeftUp.js +1 -1
- package/lib/module/icons/DOC.js +1 -1
- package/lib/module/icons/DOCX.js +1 -1
- package/lib/module/icons/Delete.js +1 -1
- package/lib/module/icons/Down.js +1 -1
- package/lib/module/icons/DownloadArrow.js +1 -1
- package/lib/module/icons/DownloadCloud.js +1 -1
- package/lib/module/icons/Edit.js +1 -1
- package/lib/module/icons/Error.js +1 -1
- package/lib/module/icons/Eye.js +1 -1
- package/lib/module/icons/Flag.js +1 -1
- package/lib/module/icons/Folder.js +1 -1
- package/lib/module/icons/GenericFile.js +1 -1
- package/lib/module/icons/GiphyIcon.js +1 -1
- package/lib/module/icons/Grid.js +1 -1
- package/lib/module/icons/Group.js +1 -1
- package/lib/module/icons/HTML.js +1 -1
- package/lib/module/icons/Imgur.js +1 -1
- package/lib/module/icons/LOLReaction.js +1 -1
- package/lib/module/icons/Lightning.js +1 -1
- package/lib/module/icons/Link.js +1 -1
- package/lib/module/icons/Loading.js +1 -1
- package/lib/module/icons/Logo.js +1 -1
- package/lib/module/icons/LoveReaction.js +1 -1
- package/lib/module/icons/MD.js +1 -1
- package/lib/module/icons/MailOpen.js +1 -1
- package/lib/module/icons/MenuPointHorizontal.js +1 -1
- package/lib/module/icons/MenuPointVertical.js +1 -1
- package/lib/module/icons/MessageFlag.js +1 -1
- package/lib/module/icons/MessageIcon.js +1 -1
- package/lib/module/icons/Mute.js +1 -1
- package/lib/module/icons/Notification.js +1 -1
- package/lib/module/icons/ODT.js +1 -1
- package/lib/module/icons/PDF.js +1 -1
- package/lib/module/icons/PPT.js +1 -1
- package/lib/module/icons/PPTX.js +1 -1
- package/lib/module/icons/Picture.js +1 -1
- package/lib/module/icons/Pin.js +1 -1
- package/lib/module/icons/PinHeader.js +1 -1
- package/lib/module/icons/RAR.js +1 -1
- package/lib/module/icons/RTF.js +1 -1
- package/lib/module/icons/Refresh.js +1 -1
- package/lib/module/icons/SEVEN_Z.js +1 -1
- package/lib/module/icons/Search.js +1 -1
- package/lib/module/icons/SendRight.js +1 -1
- package/lib/module/icons/SendUp.js +1 -1
- package/lib/module/icons/Share.js +1 -1
- package/lib/module/icons/ShareRightArrow.js +1 -1
- package/lib/module/icons/Smile.js +1 -1
- package/lib/module/icons/Sound.js +1 -1
- package/lib/module/icons/TAR.js +1 -1
- package/lib/module/icons/TXT.js +1 -1
- package/lib/module/icons/ThreadReply.js +1 -1
- package/lib/module/icons/ThumbsDownReaction.js +1 -1
- package/lib/module/icons/ThumbsUpReaction.js +1 -1
- package/lib/module/icons/Time.js +1 -1
- package/lib/module/icons/Unknown.js +1 -1
- package/lib/module/icons/Unpin.js +1 -1
- package/lib/module/icons/User.js +1 -1
- package/lib/module/icons/UserAdd.js +1 -1
- package/lib/module/icons/UserAdmin.js +1 -1
- package/lib/module/icons/UserDelete.js +1 -1
- package/lib/module/icons/UserMinus.js +1 -1
- package/lib/module/icons/Warning.js +38 -0
- package/lib/module/icons/Warning.js.map +1 -0
- package/lib/module/icons/WutReaction.js +1 -1
- package/lib/module/icons/XLS.js +1 -1
- package/lib/module/icons/XLSX.js +1 -1
- package/lib/module/icons/ZIP.js +1 -1
- package/lib/module/icons/index.js +13 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/icons/utils/base.js +1 -1
- package/lib/module/utils/utils.js +33 -2
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/FileAttachment.d.ts +0 -1
- package/lib/typescript/components/Attachment/hooks/useGoToURL.d.ts +2 -0
- package/lib/typescript/components/Chat/hooks/__tests__/useAppSettings.test.d.ts +1 -0
- package/lib/typescript/components/Chat/hooks/useAppSettings.d.ts +3 -0
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/components/Message/Message.d.ts +12 -2
- package/lib/typescript/components/MessageInput/UploadProgressIndicator.d.ts +1 -3
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +5 -1
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +4 -4
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +3 -3
- package/lib/typescript/i18n/en.json +2 -0
- package/lib/typescript/i18n/fr.json +2 -0
- package/lib/typescript/i18n/hi.json +2 -0
- package/lib/typescript/i18n/it.json +2 -0
- package/lib/typescript/i18n/ja.json +3 -1
- package/lib/typescript/i18n/ko.json +3 -1
- package/lib/typescript/i18n/nl.json +2 -0
- package/lib/typescript/i18n/ru.json +2 -0
- package/lib/typescript/i18n/tr.json +2 -0
- package/lib/typescript/icons/Warning.d.ts +3 -0
- package/lib/typescript/icons/index.d.ts +1 -0
- package/lib/typescript/utils/Streami18n.d.ts +6 -0
- package/lib/typescript/utils/utils.d.ts +15 -2
- package/package.json +1 -1
- package/src/components/Attachment/Card.tsx +5 -13
- package/src/components/Attachment/FileAttachment.tsx +5 -13
- package/src/components/Attachment/__tests__/Attachment.test.js +39 -0
- package/src/components/Attachment/hooks/useGoToURL.ts +27 -0
- package/src/components/Channel/Channel.tsx +1 -1
- package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts +3 -9
- package/src/components/Channel/hooks/useCreateThreadContext.ts +3 -9
- package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +1 -0
- package/src/components/Chat/Chat.tsx +4 -0
- package/src/components/Chat/hooks/__tests__/useAppSettings.test.tsx +34 -0
- package/src/components/Chat/hooks/useAppSettings.ts +39 -0
- package/src/components/Chat/hooks/useCreateChatContext.ts +2 -0
- package/src/components/Message/Message.tsx +56 -48
- package/src/components/Message/MessageSimple/utils/renderText.tsx +17 -2
- package/src/components/MessageInput/FileUploadPreview.tsx +60 -14
- package/src/components/MessageInput/ImageUploadPreview.tsx +95 -42
- package/src/components/MessageInput/UploadProgressIndicator.tsx +49 -22
- package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +50 -80
- package/src/components/MessageInput/__tests__/ImageUploadPreview.test.js +49 -74
- package/src/components/MessageInput/__tests__/UploadProgressIndicator.test.js +36 -13
- package/src/components/MessageInput/__tests__/__snapshots__/UploadProgressIndicator.test.js.snap +122 -17
- package/src/contexts/chatContext/ChatContext.tsx +5 -1
- package/src/contexts/messageContext/MessageContext.tsx +7 -4
- package/src/contexts/messageInputContext/MessageInputContext.tsx +127 -96
- package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +2 -2
- package/src/i18n/en.json +2 -0
- package/src/i18n/fr.json +2 -0
- package/src/i18n/hi.json +2 -0
- package/src/i18n/it.json +2 -0
- package/src/i18n/ja.json +3 -1
- package/src/i18n/ko.json +3 -1
- package/src/i18n/nl.json +2 -0
- package/src/i18n/ru.json +2 -0
- package/src/i18n/tr.json +2 -0
- package/src/icons/Warning.tsx +12 -0
- package/src/icons/index.ts +1 -0
- package/src/utils/utils.ts +53 -1
- package/src/version.json +1 -1
- package/CHANGELOG.md +0 -1519
- package/src/components/MessageInput/__tests__/__snapshots__/FileUploadPreview.test.js.snap +0 -4413
- package/src/components/MessageInput/__tests__/__snapshots__/ImageUploadPreview.test.js.snap +0 -2373
package/README.md
CHANGED
|
@@ -42,10 +42,9 @@ For complete pricing details visit our [Chat Pricing Page](https://getstream.io/
|
|
|
42
42
|
|
|
43
43
|
## 🔮 Example Apps
|
|
44
44
|
|
|
45
|
-
This repo includes
|
|
45
|
+
This repo includes 3 example apps. One made with Expo, two in TypeScript. One TypeScript app is a simple implementation for reference, the other is a more full featured app example.
|
|
46
46
|
|
|
47
47
|
- [Expo example](./examples/ExpoMessaging)
|
|
48
|
-
- [Native example](./examples/NativeMessaging)
|
|
49
48
|
- [Typescript example](./examples/TypeScriptMessaging)
|
|
50
49
|
- [Fully featured messaging application](./examples/SampleApp)
|
|
51
50
|
|
|
@@ -53,6 +52,7 @@ Besides, our team maintains a dedicated repository for fully-fledged sample appl
|
|
|
53
52
|
|
|
54
53
|
- [Slack Clone](https://github.com/GetStream/react-native-samples/tree/main/projects/SlackClone#slack-clone-using-react-native-and-stream-chat)
|
|
55
54
|
- [iMessage Clone](https://github.com/GetStream/react-native-samples/tree/main/projects/iMessageClone#imessage-clone)
|
|
55
|
+
- [WhatsApp Clone](https://github.com/GetStream/react-native-samples/tree/main/projects/WhatsAppClone#whatsapp-clone-using-react-native-and-stream-chat)
|
|
56
56
|
|
|
57
57
|
## 💬 Keep in mind
|
|
58
58
|
|
|
@@ -22,7 +22,7 @@ var _Giphy = require("../../components/Attachment/Giphy");
|
|
|
22
22
|
var _MessagesContext = require("../../contexts/messagesContext/MessagesContext");
|
|
23
23
|
|
|
24
24
|
var _this = this,
|
|
25
|
-
_jsxFileName = "/
|
|
25
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/Attachment.tsx";
|
|
26
26
|
|
|
27
27
|
var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
28
28
|
var _attachment$actions;
|
|
@@ -21,7 +21,7 @@ var _excluded = ["defaultBackgroundColor", "defaultBorderColor", "primaryBackgro
|
|
|
21
21
|
_excluded2 = ["defaultColor", "primaryColor"];
|
|
22
22
|
|
|
23
23
|
var _this = this,
|
|
24
|
-
_jsxFileName = "/
|
|
24
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/AttachmentActions.tsx";
|
|
25
25
|
|
|
26
26
|
var styles = _reactNative.StyleSheet.create({
|
|
27
27
|
actionButton: {
|
|
@@ -7,12 +7,16 @@ exports.Card = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
10
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
13
|
|
|
12
14
|
var _react = _interopRequireDefault(require("react"));
|
|
13
15
|
|
|
14
16
|
var _reactNative = require("react-native");
|
|
15
17
|
|
|
18
|
+
var _useGoToURL3 = require("./hooks/useGoToURL");
|
|
19
|
+
|
|
16
20
|
var _MessageContext = require("../../contexts/messageContext/MessageContext");
|
|
17
21
|
|
|
18
22
|
var _MessagesContext = require("../../contexts/messagesContext/MessagesContext");
|
|
@@ -24,7 +28,7 @@ var _utils = require("../../utils/utils");
|
|
|
24
28
|
var _excluded = ["description", "title"];
|
|
25
29
|
|
|
26
30
|
var _this = this,
|
|
27
|
-
_jsxFileName = "/
|
|
31
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/Card.tsx";
|
|
28
32
|
|
|
29
33
|
var styles = _reactNative.StyleSheet.create({
|
|
30
34
|
authorName: {
|
|
@@ -70,18 +74,6 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
70
74
|
}
|
|
71
75
|
});
|
|
72
76
|
|
|
73
|
-
var goToURL = function goToURL(url) {
|
|
74
|
-
if (!url) return;
|
|
75
|
-
|
|
76
|
-
_reactNative.Linking.canOpenURL(url).then(function (supported) {
|
|
77
|
-
if (supported) {
|
|
78
|
-
_reactNative.Linking.openURL(url);
|
|
79
|
-
} else {
|
|
80
|
-
console.log("Don't know how to open URI: " + url);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
|
|
85
77
|
var CardWithContext = function CardWithContext(props) {
|
|
86
78
|
var additionalTouchableProps = props.additionalTouchableProps,
|
|
87
79
|
author_name = props.author_name,
|
|
@@ -123,8 +115,13 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
123
115
|
|
|
124
116
|
var uri = image_url || thumb_url;
|
|
125
117
|
|
|
118
|
+
var _useGoToURL = (0, _useGoToURL3.useGoToURL)(og_scrape_url || uri),
|
|
119
|
+
_useGoToURL2 = (0, _slicedToArray2["default"])(_useGoToURL, 2),
|
|
120
|
+
error = _useGoToURL2[0],
|
|
121
|
+
openURL = _useGoToURL2[1];
|
|
122
|
+
|
|
126
123
|
var defaultOnPress = function defaultOnPress() {
|
|
127
|
-
return
|
|
124
|
+
return !error && openURL && openURL();
|
|
128
125
|
};
|
|
129
126
|
|
|
130
127
|
return _react["default"].createElement(_reactNative.TouchableOpacity, (0, _extends2["default"])({
|
|
@@ -161,28 +158,28 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
161
158
|
__self: _this,
|
|
162
159
|
__source: {
|
|
163
160
|
fileName: _jsxFileName,
|
|
164
|
-
lineNumber:
|
|
161
|
+
lineNumber: 147,
|
|
165
162
|
columnNumber: 5
|
|
166
163
|
}
|
|
167
164
|
}), CardHeader && _react["default"].createElement(CardHeader, (0, _extends2["default"])({}, props, {
|
|
168
165
|
__self: _this,
|
|
169
166
|
__source: {
|
|
170
167
|
fileName: _jsxFileName,
|
|
171
|
-
lineNumber:
|
|
168
|
+
lineNumber: 179,
|
|
172
169
|
columnNumber: 22
|
|
173
170
|
}
|
|
174
171
|
})), CardCover && _react["default"].createElement(CardCover, (0, _extends2["default"])({}, props, {
|
|
175
172
|
__self: _this,
|
|
176
173
|
__source: {
|
|
177
174
|
fileName: _jsxFileName,
|
|
178
|
-
lineNumber:
|
|
175
|
+
lineNumber: 180,
|
|
179
176
|
columnNumber: 21
|
|
180
177
|
}
|
|
181
178
|
})), uri && !CardCover && _react["default"].createElement(_reactNative.View, {
|
|
182
179
|
__self: _this,
|
|
183
180
|
__source: {
|
|
184
181
|
fileName: _jsxFileName,
|
|
185
|
-
lineNumber:
|
|
182
|
+
lineNumber: 182,
|
|
186
183
|
columnNumber: 9
|
|
187
184
|
}
|
|
188
185
|
}, _react["default"].createElement(_reactNative.Image, {
|
|
@@ -194,7 +191,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
194
191
|
__self: _this,
|
|
195
192
|
__source: {
|
|
196
193
|
fileName: _jsxFileName,
|
|
197
|
-
lineNumber:
|
|
194
|
+
lineNumber: 183,
|
|
198
195
|
columnNumber: 11
|
|
199
196
|
}
|
|
200
197
|
}), author_name && _react["default"].createElement(_reactNative.View, {
|
|
@@ -202,7 +199,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
202
199
|
__self: _this,
|
|
203
200
|
__source: {
|
|
204
201
|
fileName: _jsxFileName,
|
|
205
|
-
lineNumber:
|
|
202
|
+
lineNumber: 189,
|
|
206
203
|
columnNumber: 13
|
|
207
204
|
}
|
|
208
205
|
}, _react["default"].createElement(_reactNative.View, {
|
|
@@ -212,7 +209,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
212
209
|
__self: _this,
|
|
213
210
|
__source: {
|
|
214
211
|
fileName: _jsxFileName,
|
|
215
|
-
lineNumber:
|
|
212
|
+
lineNumber: 190,
|
|
216
213
|
columnNumber: 15
|
|
217
214
|
}
|
|
218
215
|
}, _react["default"].createElement(_reactNative.Text, {
|
|
@@ -222,14 +219,14 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
222
219
|
__self: _this,
|
|
223
220
|
__source: {
|
|
224
221
|
fileName: _jsxFileName,
|
|
225
|
-
lineNumber:
|
|
222
|
+
lineNumber: 198,
|
|
226
223
|
columnNumber: 17
|
|
227
224
|
}
|
|
228
225
|
}, author_name)))), CardFooter ? _react["default"].createElement(CardFooter, (0, _extends2["default"])({}, props, {
|
|
229
226
|
__self: _this,
|
|
230
227
|
__source: {
|
|
231
228
|
fileName: _jsxFileName,
|
|
232
|
-
lineNumber:
|
|
229
|
+
lineNumber: 214,
|
|
233
230
|
columnNumber: 9
|
|
234
231
|
}
|
|
235
232
|
})) : _react["default"].createElement(_reactNative.View, {
|
|
@@ -237,7 +234,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
237
234
|
__self: _this,
|
|
238
235
|
__source: {
|
|
239
236
|
fileName: _jsxFileName,
|
|
240
|
-
lineNumber:
|
|
237
|
+
lineNumber: 216,
|
|
241
238
|
columnNumber: 9
|
|
242
239
|
}
|
|
243
240
|
}, _react["default"].createElement(_reactNative.View, {
|
|
@@ -249,7 +246,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
249
246
|
__self: _this,
|
|
250
247
|
__source: {
|
|
251
248
|
fileName: _jsxFileName,
|
|
252
|
-
lineNumber:
|
|
249
|
+
lineNumber: 217,
|
|
253
250
|
columnNumber: 11
|
|
254
251
|
}
|
|
255
252
|
}, !uri && author_name && _react["default"].createElement(_reactNative.Text, {
|
|
@@ -259,7 +256,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
259
256
|
__self: _this,
|
|
260
257
|
__source: {
|
|
261
258
|
fileName: _jsxFileName,
|
|
262
|
-
lineNumber:
|
|
259
|
+
lineNumber: 226,
|
|
263
260
|
columnNumber: 15
|
|
264
261
|
}
|
|
265
262
|
}, author_name), title && _react["default"].createElement(_reactNative.Text, {
|
|
@@ -270,7 +267,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
270
267
|
__self: _this,
|
|
271
268
|
__source: {
|
|
272
269
|
fileName: _jsxFileName,
|
|
273
|
-
lineNumber:
|
|
270
|
+
lineNumber: 238,
|
|
274
271
|
columnNumber: 15
|
|
275
272
|
}
|
|
276
273
|
}, title), text && _react["default"].createElement(_reactNative.Text, {
|
|
@@ -281,7 +278,7 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
281
278
|
__self: _this,
|
|
282
279
|
__source: {
|
|
283
280
|
fileName: _jsxFileName,
|
|
284
|
-
lineNumber:
|
|
281
|
+
lineNumber: 246,
|
|
285
282
|
columnNumber: 15
|
|
286
283
|
}
|
|
287
284
|
}, text))));
|
|
@@ -320,7 +317,7 @@ var Card = function Card(props) {
|
|
|
320
317
|
__self: _this,
|
|
321
318
|
__source: {
|
|
322
319
|
fileName: _jsxFileName,
|
|
323
|
-
lineNumber:
|
|
320
|
+
lineNumber: 287,
|
|
324
321
|
columnNumber: 5
|
|
325
322
|
}
|
|
326
323
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Card.tsx"],"names":["styles","StyleSheet","create","authorName","fontSize","fontWeight","authorNameContainer","borderTopRightRadius","paddingHorizontal","paddingTop","authorNameFooter","padding","authorNameMask","bottom","left","position","cardCover","borderRadius","height","marginHorizontal","cardFooter","flexDirection","justifyContent","container","overflow","width","description","title","goToURL","url","Linking","canOpenURL","then","supported","openURL","console","log","CardWithContext","props","additionalTouchableProps","author_name","CardCover","CardFooter","CardHeader","image_url","og_scrape_url","onLongPress","onPress","onPressIn","preventPress","stylesProp","text","thumb_url","theme","colors","accent_blue","black","blue_alice","transparent","messageSimple","card","authorNameFooterContainer","cover","footer","titleStyle","footerStyle","noURI","uri","defaultOnPress","event","emitter","defaultHandler","backgroundColor","color","borderLeftColor","MemoizedCard","React","memo","Card","message","channelId","cid","messageId","id","displayName"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAeA;;AAIA;;AAIA;;AAEA;;;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,QAAQ,EAAE,IAAZ;AAAkBC,IAAAA,UAAU,EAAE;AAA9B,GADmB;AAE/BC,EAAAA,mBAAmB,EAAE;AACnBC,IAAAA,oBAAoB,EAAE,EADH;AAEnBC,IAAAA,iBAAiB,EAAE,CAFA;AAGnBC,IAAAA,UAAU,EAAE;AAHO,GAFU;AAO/BC,EAAAA,gBAAgB,EAAE;AAChBN,IAAAA,QAAQ,EAAE,IADM;AAEhBC,IAAAA,UAAU,EAAE,KAFI;AAGhBM,IAAAA,OAAO,EAAE;AAHO,GAPa;AAY/BC,EAAAA,cAAc,EAAE;AACdC,IAAAA,MAAM,EAAE,CADM;AAEdC,IAAAA,IAAI,EAAE,CAFQ;AAGdC,IAAAA,QAAQ,EAAE;AAHI,GAZe;AAiB/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,YAAY,EAAE,CADL;AAETC,IAAAA,MAAM,EAAE,GAFC;AAGTC,IAAAA,gBAAgB,EAAE;AAHT,GAjBoB;AAsB/BC,EAAAA,UAAU,EAAE;AACVC,IAAAA,aAAa,EAAE,KADL;AAEVC,IAAAA,cAAc,EAAE,eAFN;AAGVX,IAAAA,OAAO,EAAE;AAHC,GAtBmB;AA2B/BY,EAAAA,SAAS,EAAE;AACTC,IAAAA,QAAQ,EAAE,QADD;AAETC,IAAAA,KAAK,EAAE;AAFE,GA3BoB;AA+B/BC,EAAAA,WAAW,EAAE;AACXtB,IAAAA,QAAQ,EAAE,EADC;AAEXe,IAAAA,gBAAgB,EAAE;AAFP,GA/BkB;AAmC/BQ,EAAAA,KAAK,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AAA,UAAU,EAAVA,UAJJ;AAKIC,IAAAA,UAAU,EAAVA,UALJ;AAMIqC,IAAAA,SAAS,EAAED,OAAO,CAACE,GANvB;AAOIC,IAAAA,SAAS,EAAEH,OAAO,CAACI,EAPvB;AAQIrC,IAAAA,WAAW,EAAXA,WARJ;AASIC,IAAAA,OAAO,EAAPA,OATJ;AAUIC,IAAAA,SAAS,EAATA,SAVJ;AAWIC,IAAAA,YAAY,EAAZA;AAXJ,KAaMX,KAbN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAiBD,CA3BM;;;AA6BPwC,IAAI,CAACM,WAAL,GAAmB,2BAAnB","sourcesContent":["import React from 'react';\nimport {\n Image,\n ImageStyle,\n Linking,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { makeImageCompatibleUrl } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n authorName: { fontSize: 14.5, fontWeight: '600' },\n authorNameContainer: {\n borderTopRightRadius: 15,\n paddingHorizontal: 8,\n paddingTop: 8,\n },\n authorNameFooter: {\n fontSize: 14.5,\n fontWeight: '600',\n padding: 8,\n },\n authorNameMask: {\n bottom: 0,\n left: 8,\n position: 'absolute',\n },\n cardCover: {\n borderRadius: 8,\n height: 140,\n marginHorizontal: 8,\n },\n cardFooter: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n container: {\n overflow: 'hidden',\n width: 256,\n },\n description: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n title: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n});\n\nconst goToURL = (url?: string) => {\n if (!url) return;\n Linking.canOpenURL(url).then((supported) => {\n if (supported) {\n Linking.openURL(url);\n } else {\n console.log(`Don't know how to open URI: ${url}`);\n }\n });\n};\n\nexport type CardPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Pick<\n MessageContextValue<StreamChatGenerics>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'\n > &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n > & {\n channelId: string | undefined;\n messageId: string | undefined;\n styles?: Partial<{\n authorName: StyleProp<TextStyle>;\n authorNameContainer: StyleProp<ViewStyle>;\n authorNameFooter: StyleProp<TextStyle>;\n authorNameFooterContainer: StyleProp<ViewStyle>;\n authorNameMask: StyleProp<ViewStyle>;\n cardCover: StyleProp<ImageStyle>;\n cardFooter: StyleProp<ViewStyle>;\n container: StyleProp<ViewStyle>;\n description: StyleProp<TextStyle>;\n title: StyleProp<TextStyle>;\n }>;\n };\n\nconst CardWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n additionalTouchableProps,\n author_name,\n CardCover,\n CardFooter,\n CardHeader,\n image_url,\n og_scrape_url,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n styles: stylesProp = {},\n text,\n thumb_url,\n title,\n } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, blue_alice, transparent },\n messageSimple: {\n card: {\n authorName,\n authorNameContainer,\n authorNameFooter,\n authorNameFooterContainer,\n authorNameMask,\n container,\n cover,\n footer: { description, title: titleStyle, ...footerStyle },\n noURI,\n },\n },\n },\n } = useTheme();\n\n const uri = image_url || thumb_url;\n\n const defaultOnPress = () => goToURL(og_scrape_url || uri);\n\n return (\n <TouchableOpacity\n disabled={preventPress}\n onLongPress={(event) => {\n if (onLongPress) {\n onLongPress({\n emitter: 'card',\n event,\n });\n }\n }}\n onPress={(event) => {\n if (onPress) {\n onPress({\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n onPressIn={(event) => {\n if (onPressIn) {\n onPressIn({\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n style={[styles.container, container, stylesProp.container]}\n testID='card-attachment'\n {...additionalTouchableProps}\n >\n {CardHeader && <CardHeader {...props} />}\n {CardCover && <CardCover {...props} />}\n {uri && !CardCover && (\n <View>\n <Image\n resizeMode='cover'\n source={{ uri: makeImageCompatibleUrl(uri) }}\n style={[styles.cardCover, cover, stylesProp.cardCover]}\n />\n {author_name && (\n <View style={[styles.authorNameMask, authorNameMask, stylesProp.authorNameMask]}>\n <View\n style={[\n styles.authorNameContainer,\n { backgroundColor: blue_alice },\n authorNameContainer,\n stylesProp.authorNameContainer,\n ]}\n >\n <Text\n style={[\n styles.authorName,\n { color: accent_blue },\n authorName,\n stylesProp.authorName,\n ]}\n >\n {author_name}\n </Text>\n </View>\n </View>\n )}\n </View>\n )}\n {CardFooter ? (\n <CardFooter {...props} />\n ) : (\n <View style={[styles.cardFooter, footerStyle, stylesProp.cardFooter]}>\n <View\n style={[\n authorNameFooterContainer,\n { backgroundColor: transparent },\n !uri ? { borderLeftColor: accent_blue, ...noURI } : {},\n stylesProp.authorNameFooterContainer,\n ]}\n >\n {!uri && author_name && (\n <Text\n style={[\n styles.authorNameFooter,\n { color: accent_blue },\n authorNameFooter,\n stylesProp.authorNameFooter,\n ]}\n >\n {author_name}\n </Text>\n )}\n {title && (\n <Text\n numberOfLines={1}\n style={[styles.title, { color: black }, titleStyle, stylesProp.title]}\n >\n {title}\n </Text>\n )}\n {text && (\n <Text\n numberOfLines={3}\n style={[styles.description, { color: black }, description, stylesProp.description]}\n >\n {text}\n </Text>\n )}\n </View>\n </View>\n )}\n </TouchableOpacity>\n );\n};\n\nconst MemoizedCard = React.memo(CardWithContext, () => true) as typeof CardWithContext;\n\nexport type CardProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Partial<\n Pick<MessageContextValue<StreamChatGenerics>, 'onLongPress' | 'onPress' | 'onPressIn'> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n >\n >;\n\n/**\n * UI component for card in attachments.\n */\nexport const Card = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardProps<StreamChatGenerics>,\n) => {\n const { message, onLongPress, onPress, onPressIn, preventPress } =\n useMessageContext<StreamChatGenerics>();\n const { additionalTouchableProps, CardCover, CardFooter, CardHeader } =\n useMessagesContext<StreamChatGenerics>();\n\n return (\n <MemoizedCard\n {...{\n additionalTouchableProps,\n CardCover,\n CardFooter,\n CardHeader,\n channelId: message.cid,\n messageId: message.id,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n }}\n {...props}\n />\n );\n};\n\nCard.displayName = 'Card{messageSimple{card}}';\n"]}
|
|
1
|
+
{"version":3,"sources":["Card.tsx"],"names":["styles","StyleSheet","create","authorName","fontSize","fontWeight","authorNameContainer","borderTopRightRadius","paddingHorizontal","paddingTop","authorNameFooter","padding","authorNameMask","bottom","left","position","cardCover","borderRadius","height","marginHorizontal","cardFooter","flexDirection","justifyContent","container","overflow","width","description","title","CardWithContext","props","additionalTouchableProps","author_name","CardCover","CardFooter","CardHeader","image_url","og_scrape_url","onLongPress","onPress","onPressIn","preventPress","stylesProp","text","thumb_url","theme","colors","accent_blue","black","blue_alice","transparent","messageSimple","card","authorNameFooterContainer","cover","footer","titleStyle","footerStyle","noURI","uri","error","openURL","defaultOnPress","event","emitter","defaultHandler","backgroundColor","color","borderLeftColor","MemoizedCard","React","memo","Card","message","channelId","cid","messageId","id","displayName"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAcA;;A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;AA6BP0C,IAAI,CAACM,WAAL,GAAmB,2BAAnB","sourcesContent":["import React from 'react';\nimport {\n Image,\n ImageStyle,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { useGoToURL } from './hooks/useGoToURL';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { makeImageCompatibleUrl } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n authorName: { fontSize: 14.5, fontWeight: '600' },\n authorNameContainer: {\n borderTopRightRadius: 15,\n paddingHorizontal: 8,\n paddingTop: 8,\n },\n authorNameFooter: {\n fontSize: 14.5,\n fontWeight: '600',\n padding: 8,\n },\n authorNameMask: {\n bottom: 0,\n left: 8,\n position: 'absolute',\n },\n cardCover: {\n borderRadius: 8,\n height: 140,\n marginHorizontal: 8,\n },\n cardFooter: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n container: {\n overflow: 'hidden',\n width: 256,\n },\n description: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n title: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n});\n\nexport type CardPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Pick<\n MessageContextValue<StreamChatGenerics>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'\n > &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n > & {\n channelId: string | undefined;\n messageId: string | undefined;\n styles?: Partial<{\n authorName: StyleProp<TextStyle>;\n authorNameContainer: StyleProp<ViewStyle>;\n authorNameFooter: StyleProp<TextStyle>;\n authorNameFooterContainer: StyleProp<ViewStyle>;\n authorNameMask: StyleProp<ViewStyle>;\n cardCover: StyleProp<ImageStyle>;\n cardFooter: StyleProp<ViewStyle>;\n container: StyleProp<ViewStyle>;\n description: StyleProp<TextStyle>;\n title: StyleProp<TextStyle>;\n }>;\n };\n\nconst CardWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n additionalTouchableProps,\n author_name,\n CardCover,\n CardFooter,\n CardHeader,\n image_url,\n og_scrape_url,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n styles: stylesProp = {},\n text,\n thumb_url,\n title,\n } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, blue_alice, transparent },\n messageSimple: {\n card: {\n authorName,\n authorNameContainer,\n authorNameFooter,\n authorNameFooterContainer,\n authorNameMask,\n container,\n cover,\n footer: { description, title: titleStyle, ...footerStyle },\n noURI,\n },\n },\n },\n } = useTheme();\n\n const uri = image_url || thumb_url;\n\n const [error, openURL] = useGoToURL(og_scrape_url || uri);\n\n const defaultOnPress = () => !error && openURL && openURL();\n\n return (\n <TouchableOpacity\n disabled={preventPress}\n onLongPress={(event) => {\n if (onLongPress) {\n onLongPress({\n emitter: 'card',\n event,\n });\n }\n }}\n onPress={(event) => {\n if (onPress) {\n onPress({\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n onPressIn={(event) => {\n if (onPressIn) {\n onPressIn({\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n style={[styles.container, container, stylesProp.container]}\n testID='card-attachment'\n {...additionalTouchableProps}\n >\n {CardHeader && <CardHeader {...props} />}\n {CardCover && <CardCover {...props} />}\n {uri && !CardCover && (\n <View>\n <Image\n resizeMode='cover'\n source={{ uri: makeImageCompatibleUrl(uri) }}\n style={[styles.cardCover, cover, stylesProp.cardCover]}\n />\n {author_name && (\n <View style={[styles.authorNameMask, authorNameMask, stylesProp.authorNameMask]}>\n <View\n style={[\n styles.authorNameContainer,\n { backgroundColor: blue_alice },\n authorNameContainer,\n stylesProp.authorNameContainer,\n ]}\n >\n <Text\n style={[\n styles.authorName,\n { color: accent_blue },\n authorName,\n stylesProp.authorName,\n ]}\n >\n {author_name}\n </Text>\n </View>\n </View>\n )}\n </View>\n )}\n {CardFooter ? (\n <CardFooter {...props} />\n ) : (\n <View style={[styles.cardFooter, footerStyle, stylesProp.cardFooter]}>\n <View\n style={[\n authorNameFooterContainer,\n { backgroundColor: transparent },\n !uri ? { borderLeftColor: accent_blue, ...noURI } : {},\n stylesProp.authorNameFooterContainer,\n ]}\n >\n {!uri && author_name && (\n <Text\n style={[\n styles.authorNameFooter,\n { color: accent_blue },\n authorNameFooter,\n stylesProp.authorNameFooter,\n ]}\n >\n {author_name}\n </Text>\n )}\n {title && (\n <Text\n numberOfLines={1}\n style={[styles.title, { color: black }, titleStyle, stylesProp.title]}\n >\n {title}\n </Text>\n )}\n {text && (\n <Text\n numberOfLines={3}\n style={[styles.description, { color: black }, description, stylesProp.description]}\n >\n {text}\n </Text>\n )}\n </View>\n </View>\n )}\n </TouchableOpacity>\n );\n};\n\nconst MemoizedCard = React.memo(CardWithContext, () => true) as typeof CardWithContext;\n\nexport type CardProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Partial<\n Pick<MessageContextValue<StreamChatGenerics>, 'onLongPress' | 'onPress' | 'onPressIn'> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n >\n >;\n\n/**\n * UI component for card in attachments.\n */\nexport const Card = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardProps<StreamChatGenerics>,\n) => {\n const { message, onLongPress, onPress, onPressIn, preventPress } =\n useMessageContext<StreamChatGenerics>();\n const { additionalTouchableProps, CardCover, CardFooter, CardHeader } =\n useMessagesContext<StreamChatGenerics>();\n\n return (\n <MemoizedCard\n {...{\n additionalTouchableProps,\n CardCover,\n CardFooter,\n CardHeader,\n channelId: message.cid,\n messageId: message.id,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n }}\n {...props}\n />\n );\n};\n\nCard.displayName = 'Card{messageSimple{card}}';\n"]}
|
|
@@ -3,14 +3,18 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getFileSizeDisplayText = exports.FileAttachment = void 0;
|
|
7
7
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
10
12
|
var _react = _interopRequireDefault(require("react"));
|
|
11
13
|
|
|
12
14
|
var _reactNative = require("react-native");
|
|
13
15
|
|
|
16
|
+
var _useGoToURL3 = require("./hooks/useGoToURL");
|
|
17
|
+
|
|
14
18
|
var _AttachmentActions = require("../../components/Attachment/AttachmentActions");
|
|
15
19
|
|
|
16
20
|
var _FileIcon = require("../../components/Attachment/FileIcon");
|
|
@@ -24,7 +28,7 @@ var _ThemeContext = require("../../contexts/themeContext/ThemeContext");
|
|
|
24
28
|
var _utils = require("../../utils/utils");
|
|
25
29
|
|
|
26
30
|
var _this = this,
|
|
27
|
-
_jsxFileName = "/
|
|
31
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/FileAttachment.tsx";
|
|
28
32
|
|
|
29
33
|
var styles = _reactNative.StyleSheet.create({
|
|
30
34
|
container: {
|
|
@@ -73,8 +77,13 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
|
|
|
73
77
|
fileSize = _useTheme$theme$messa.fileSize,
|
|
74
78
|
title = _useTheme$theme$messa.title;
|
|
75
79
|
|
|
80
|
+
var _useGoToURL = (0, _useGoToURL3.useGoToURL)(attachment.asset_url),
|
|
81
|
+
_useGoToURL2 = (0, _slicedToArray2["default"])(_useGoToURL, 2),
|
|
82
|
+
error = _useGoToURL2[0],
|
|
83
|
+
openURL = _useGoToURL2[1];
|
|
84
|
+
|
|
76
85
|
var defaultOnPress = function defaultOnPress() {
|
|
77
|
-
return
|
|
86
|
+
return !error && openURL && openURL();
|
|
78
87
|
};
|
|
79
88
|
|
|
80
89
|
return _react["default"].createElement(_reactNative.TouchableOpacity, (0, _extends2["default"])({
|
|
@@ -110,7 +119,7 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
|
|
|
110
119
|
__self: _this,
|
|
111
120
|
__source: {
|
|
112
121
|
fileName: _jsxFileName,
|
|
113
|
-
lineNumber:
|
|
122
|
+
lineNumber: 103,
|
|
114
123
|
columnNumber: 5
|
|
115
124
|
}
|
|
116
125
|
}), _react["default"].createElement(_reactNative.View, {
|
|
@@ -120,7 +129,7 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
|
|
|
120
129
|
__self: _this,
|
|
121
130
|
__source: {
|
|
122
131
|
fileName: _jsxFileName,
|
|
123
|
-
lineNumber:
|
|
132
|
+
lineNumber: 134,
|
|
124
133
|
columnNumber: 7
|
|
125
134
|
}
|
|
126
135
|
}, _react["default"].createElement(FileAttachmentIcon, {
|
|
@@ -129,7 +138,7 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
|
|
|
129
138
|
__self: _this,
|
|
130
139
|
__source: {
|
|
131
140
|
fileName: _jsxFileName,
|
|
132
|
-
lineNumber:
|
|
141
|
+
lineNumber: 135,
|
|
133
142
|
columnNumber: 9
|
|
134
143
|
}
|
|
135
144
|
}), _react["default"].createElement(_reactNative.View, {
|
|
@@ -137,7 +146,7 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
|
|
|
137
146
|
__self: _this,
|
|
138
147
|
__source: {
|
|
139
148
|
fileName: _jsxFileName,
|
|
140
|
-
lineNumber:
|
|
149
|
+
lineNumber: 136,
|
|
141
150
|
columnNumber: 9
|
|
142
151
|
}
|
|
143
152
|
}, _react["default"].createElement(_reactNative.Text, {
|
|
@@ -148,7 +157,7 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
|
|
|
148
157
|
__self: _this,
|
|
149
158
|
__source: {
|
|
150
159
|
fileName: _jsxFileName,
|
|
151
|
-
lineNumber:
|
|
160
|
+
lineNumber: 137,
|
|
152
161
|
columnNumber: 11
|
|
153
162
|
}
|
|
154
163
|
}, attachment.title), _react["default"].createElement(_reactNative.Text, {
|
|
@@ -158,14 +167,14 @@ var FileAttachmentWithContext = function FileAttachmentWithContext(props) {
|
|
|
158
167
|
__self: _this,
|
|
159
168
|
__source: {
|
|
160
169
|
fileName: _jsxFileName,
|
|
161
|
-
lineNumber:
|
|
170
|
+
lineNumber: 140,
|
|
162
171
|
columnNumber: 11
|
|
163
172
|
}
|
|
164
173
|
}, getFileSizeDisplayText(attachment.file_size)))), (_attachment$actions = attachment.actions) != null && _attachment$actions.length ? _react["default"].createElement(AttachmentActions, (0, _extends2["default"])({}, attachment, {
|
|
165
174
|
__self: _this,
|
|
166
175
|
__source: {
|
|
167
176
|
fileName: _jsxFileName,
|
|
168
|
-
lineNumber:
|
|
177
|
+
lineNumber: 145,
|
|
169
178
|
columnNumber: 37
|
|
170
179
|
}
|
|
171
180
|
})) : null);
|
|
@@ -197,7 +206,7 @@ var FileAttachment = function FileAttachment(props) {
|
|
|
197
206
|
__self: _this,
|
|
198
207
|
__source: {
|
|
199
208
|
fileName: _jsxFileName,
|
|
200
|
-
lineNumber:
|
|
209
|
+
lineNumber: 168,
|
|
201
210
|
columnNumber: 5
|
|
202
211
|
}
|
|
203
212
|
}));
|
|
@@ -220,19 +229,5 @@ var getFileSizeDisplayText = function getFileSizeDisplayText(size) {
|
|
|
220
229
|
};
|
|
221
230
|
|
|
222
231
|
exports.getFileSizeDisplayText = getFileSizeDisplayText;
|
|
223
|
-
|
|
224
|
-
var goToURL = function goToURL(url) {
|
|
225
|
-
if (!url) return;
|
|
226
|
-
|
|
227
|
-
_reactNative.Linking.canOpenURL(url).then(function (supported) {
|
|
228
|
-
if (supported) {
|
|
229
|
-
_reactNative.Linking.openURL(url);
|
|
230
|
-
} else {
|
|
231
|
-
console.log("Don't know how to open URI: " + url);
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
exports.goToURL = goToURL;
|
|
237
232
|
FileAttachment.displayName = 'FileAttachment{messageSimple{file}}';
|
|
238
233
|
//# sourceMappingURL=FileAttachment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FileAttachment.tsx"],"names":["styles","StyleSheet","create","container","alignItems","borderRadius","flexDirection","padding","details","maxWidth","paddingLeft","size","fontSize","title","fontWeight","FileAttachmentWithContext","props","additionalTouchableProps","attachment","attachmentSize","AttachmentActions","FileAttachmentIcon","onLongPress","onPress","onPressIn","preventPress","stylesProp","theme","colors","black","grey","white","messageSimple","file","fileSize","defaultOnPress","goToURL","asset_url","event","emitter","defaultHandler","backgroundColor","mime_type","color","getFileSizeDisplayText","file_size","actions","length","FileAttachment","AttachmentActionsDefault","FileIconDefault","parseFloat","Math","floor","url","Linking","canOpenURL","then","supported","openURL","console","log","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;AAaA;;AACA;;AACA;;AAIA;;AAIA;;AAEA;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,UAAU,EAAE,QADH;AAETC,IAAAA,YAAY,EAAE,EAFL;AAGTC,IAAAA,aAAa,EAAE,KAHN;AAITC,IAAAA,OAAO,EAAE;AAJA,GADoB;AAO/BC,EAAAA,OAAO,EAAE;AACPC,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CAA7B","sourcesContent":["import React from 'react';\nimport {\n Linking,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { AttachmentActions as AttachmentActionsDefault } from '../../components/Attachment/AttachmentActions';\nimport { FileIcon as FileIconDefault } from '../../components/Attachment/FileIcon';\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { vw } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n borderRadius: 12,\n flexDirection: 'row',\n padding: 8,\n },\n details: {\n maxWidth: vw(60),\n paddingLeft: 16,\n },\n size: {\n fontSize: 12,\n },\n title: {\n fontSize: 14,\n fontWeight: '700',\n },\n});\n\nexport type FileAttachmentPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n MessageContextValue<StreamChatGenerics>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'\n> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'AttachmentActions' | 'FileAttachmentIcon'\n > & {\n /** The attachment to render */\n attachment: Attachment<StreamChatGenerics>;\n attachmentSize?: number;\n styles?: Partial<{\n container: StyleProp<ViewStyle>;\n details: StyleProp<ViewStyle>;\n size: StyleProp<TextStyle>;\n title: StyleProp<TextStyle>;\n }>;\n };\n\nconst FileAttachmentWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileAttachmentPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n additionalTouchableProps,\n attachment,\n attachmentSize,\n AttachmentActions,\n FileAttachmentIcon,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n styles: stylesProp = {},\n } = props;\n\n const {\n theme: {\n colors: { black, grey, white },\n messageSimple: {\n file: { container, details, fileSize, title },\n },\n },\n } = useTheme();\n\n const defaultOnPress = () => goToURL(attachment.asset_url);\n\n return (\n <TouchableOpacity\n disabled={preventPress}\n onLongPress={(event) => {\n if (onLongPress) {\n onLongPress({\n emitter: 'fileAttachment',\n event,\n });\n }\n }}\n onPress={(event) => {\n if (onPress) {\n onPress({\n defaultHandler: defaultOnPress,\n emitter: 'fileAttachment',\n event,\n });\n }\n }}\n onPressIn={(event) => {\n if (onPressIn) {\n onPressIn({\n defaultHandler: defaultOnPress,\n emitter: 'fileAttachment',\n event,\n });\n }\n }}\n testID='file-attachment'\n {...additionalTouchableProps}\n >\n <View style={[styles.container, { backgroundColor: white }, container, stylesProp.container]}>\n <FileAttachmentIcon mimeType={attachment.mime_type} size={attachmentSize} />\n <View style={[styles.details, details, stylesProp.details]}>\n <Text numberOfLines={2} style={[styles.title, { color: black }, title, stylesProp.title]}>\n {attachment.title}\n </Text>\n <Text style={[styles.size, { color: grey }, fileSize, stylesProp.size]}>\n {getFileSizeDisplayText(attachment.file_size)}\n </Text>\n </View>\n </View>\n {attachment.actions?.length ? <AttachmentActions {...attachment} /> : null}\n </TouchableOpacity>\n );\n};\n\nexport type FileAttachmentProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<Omit<FileAttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>> &\n Pick<FileAttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>;\n\nexport const FileAttachment = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileAttachmentProps<StreamChatGenerics>,\n) => {\n const { onLongPress, onPress, onPressIn, preventPress } = useMessageContext<StreamChatGenerics>();\n const {\n additionalTouchableProps,\n AttachmentActions = AttachmentActionsDefault,\n FileAttachmentIcon = FileIconDefault,\n } = useMessagesContext<StreamChatGenerics>();\n\n return (\n <FileAttachmentWithContext\n {...{\n additionalTouchableProps,\n AttachmentActions,\n FileAttachmentIcon,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n }}\n {...props}\n />\n );\n};\n\nexport const getFileSizeDisplayText = (size?: number | string) => {\n if (!size) return;\n if (typeof size === 'string') {\n size = parseFloat(size);\n }\n\n if (size < 1000 * 1000) {\n return `${Math.floor(Math.floor(size / 10) / 100)} KB`;\n }\n\n return `${Math.floor(Math.floor(size / 10000) / 100)} MB`;\n};\n\nexport const goToURL = (url?: string) => {\n if (!url) return;\n Linking.canOpenURL(url).then((supported) => {\n if (supported) {\n Linking.openURL(url);\n } else {\n console.log(`Don't know how to open URI: ${url}`);\n }\n });\n};\n\nFileAttachment.displayName = 'FileAttachment{messageSimple{file}}';\n"]}
|
|
1
|
+
{"version":3,"sources":["FileAttachment.tsx"],"names":["styles","StyleSheet","create","container","alignItems","borderRadius","flexDirection","padding","details","maxWidth","paddingLeft","size","fontSize","title","fontWeight","FileAttachmentWithContext","props","additionalTouchableProps","attachment","attachmentSize","AttachmentActions","FileAttachmentIcon","onLongPress","onPress","onPressIn","preventPress","stylesProp","theme","colors","black","grey","white","messageSimple","file","fileSize","asset_url","error","openURL","defaultOnPress","event","emitter","defaultHandler","backgroundColor","mime_type","color","getFileSizeDisplayText","file_size","actions","length","FileAttachment","AttachmentActionsDefault","FileIconDefault","parseFloat","Math","floor","displayName"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAYA;;AAEA;;AACA;;AACA;;AAIA;;AAIA;;AAEA;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,UAAU,EAAE,QADH;AAETC,IAAAA,YAAY,EAAE,EAFL;AAGTC,IAAAA,aAAa,EAAE,KAHN;AAITC,IAAAA,OAAO,EAAE;AAJA,GADoB;AAO/BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,QAAQ,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AAA,kDAEEG,iBAFF;AAAA,MAEEA,iBAFF,sCAEsB8B,oCAFtB;AAAA,kDAGE7B,kBAHF;AAAA,MAGEA,kBAHF,sCAGuB8B,kBAHvB;;AAMA,SACE,gCAAC,yBAAD;AAEIlC,IAAAA,wBAAwB,EAAxBA,wBAFJ;AAGIG,IAAAA,iBAAiB,EAAjBA,iBAHJ;AAIIC,IAAAA,kBAAkB,EAAlBA,kBAJJ;AAKIC,IAAAA,WAAW,EAAXA,WALJ;AAMIC,IAAAA,OAAO,EAAPA,OANJ;AAOIC,IAAAA,SAAS,EAATA,SAPJ;AAQIC,IAAAA,YAAY,EAAZA;AARJ,KAUMT,KAVN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAcD,CA1BM;;;;AA4BA,IAAM6B,sBAAsB,GAAG,SAAzBA,sBAAyB,CAAClC,IAAD,EAA4B;AAChE,MAAI,CAACA,IAAL,EAAW;;AACX,MAAI,OAAOA,IAAP,KAAgB,QAApB,EAA8B;AAC5BA,IAAAA,IAAI,GAAGyC,UAAU,CAACzC,IAAD,CAAjB;AACD;;AAED,MAAIA,IAAI,GAAG,OAAO,IAAlB,EAAwB;AACtB,WAAU0C,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACC,KAAL,CAAW3C,IAAI,GAAG,EAAlB,IAAwB,GAAnC,CAAV;AACD;;AAED,SAAU0C,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACC,KAAL,CAAW3C,IAAI,GAAG,KAAlB,IAA2B,GAAtC,CAAV;AACD,CAXM;;;AAaPsC,cAAc,CAACM,WAAf,GAA6B,qCAA7B","sourcesContent":["import React from 'react';\nimport {\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { useGoToURL } from './hooks/useGoToURL';\n\nimport { AttachmentActions as AttachmentActionsDefault } from '../../components/Attachment/AttachmentActions';\nimport { FileIcon as FileIconDefault } from '../../components/Attachment/FileIcon';\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { vw } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n borderRadius: 12,\n flexDirection: 'row',\n padding: 8,\n },\n details: {\n maxWidth: vw(60),\n paddingLeft: 16,\n },\n size: {\n fontSize: 12,\n },\n title: {\n fontSize: 14,\n fontWeight: '700',\n },\n});\n\nexport type FileAttachmentPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n MessageContextValue<StreamChatGenerics>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'\n> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'AttachmentActions' | 'FileAttachmentIcon'\n > & {\n /** The attachment to render */\n attachment: Attachment<StreamChatGenerics>;\n attachmentSize?: number;\n styles?: Partial<{\n container: StyleProp<ViewStyle>;\n details: StyleProp<ViewStyle>;\n size: StyleProp<TextStyle>;\n title: StyleProp<TextStyle>;\n }>;\n };\n\nconst FileAttachmentWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileAttachmentPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n additionalTouchableProps,\n attachment,\n attachmentSize,\n AttachmentActions,\n FileAttachmentIcon,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n styles: stylesProp = {},\n } = props;\n\n const {\n theme: {\n colors: { black, grey, white },\n messageSimple: {\n file: { container, details, fileSize, title },\n },\n },\n } = useTheme();\n\n const [error, openURL] = useGoToURL(attachment.asset_url);\n\n const defaultOnPress = () => !error && openURL && openURL();\n\n return (\n <TouchableOpacity\n disabled={preventPress}\n onLongPress={(event) => {\n if (onLongPress) {\n onLongPress({\n emitter: 'fileAttachment',\n event,\n });\n }\n }}\n onPress={(event) => {\n if (onPress) {\n onPress({\n defaultHandler: defaultOnPress,\n emitter: 'fileAttachment',\n event,\n });\n }\n }}\n onPressIn={(event) => {\n if (onPressIn) {\n onPressIn({\n defaultHandler: defaultOnPress,\n emitter: 'fileAttachment',\n event,\n });\n }\n }}\n testID='file-attachment'\n {...additionalTouchableProps}\n >\n <View style={[styles.container, { backgroundColor: white }, container, stylesProp.container]}>\n <FileAttachmentIcon mimeType={attachment.mime_type} size={attachmentSize} />\n <View style={[styles.details, details, stylesProp.details]}>\n <Text numberOfLines={2} style={[styles.title, { color: black }, title, stylesProp.title]}>\n {attachment.title}\n </Text>\n <Text style={[styles.size, { color: grey }, fileSize, stylesProp.size]}>\n {getFileSizeDisplayText(attachment.file_size)}\n </Text>\n </View>\n </View>\n {attachment.actions?.length ? <AttachmentActions {...attachment} /> : null}\n </TouchableOpacity>\n );\n};\n\nexport type FileAttachmentProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<Omit<FileAttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>> &\n Pick<FileAttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>;\n\nexport const FileAttachment = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileAttachmentProps<StreamChatGenerics>,\n) => {\n const { onLongPress, onPress, onPressIn, preventPress } = useMessageContext<StreamChatGenerics>();\n const {\n additionalTouchableProps,\n AttachmentActions = AttachmentActionsDefault,\n FileAttachmentIcon = FileIconDefault,\n } = useMessagesContext<StreamChatGenerics>();\n\n return (\n <FileAttachmentWithContext\n {...{\n additionalTouchableProps,\n AttachmentActions,\n FileAttachmentIcon,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n }}\n {...props}\n />\n );\n};\n\nexport const getFileSizeDisplayText = (size?: number | string) => {\n if (!size) return;\n if (typeof size === 'string') {\n size = parseFloat(size);\n }\n\n if (size < 1000 * 1000) {\n return `${Math.floor(Math.floor(size / 10) / 100)} KB`;\n }\n\n return `${Math.floor(Math.floor(size / 10000) / 100)} MB`;\n};\n\nFileAttachment.displayName = 'FileAttachment{messageSimple{file}}';\n"]}
|
|
@@ -18,7 +18,7 @@ var _MessagesContext = require("../../contexts/messagesContext/MessagesContext")
|
|
|
18
18
|
var _ThemeContext = require("../../contexts/themeContext/ThemeContext");
|
|
19
19
|
|
|
20
20
|
var _this = this,
|
|
21
|
-
_jsxFileName = "/
|
|
21
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/FileAttachmentGroup.tsx";
|
|
22
22
|
|
|
23
23
|
var styles = _reactNative.StyleSheet.create({
|
|
24
24
|
container: {
|
|
@@ -50,7 +50,7 @@ var _XLSX = require("../../icons/XLSX");
|
|
|
50
50
|
var _ZIP = require("../../icons/ZIP");
|
|
51
51
|
|
|
52
52
|
var _this = this,
|
|
53
|
-
_jsxFileName = "/
|
|
53
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/FileIcon.tsx";
|
|
54
54
|
|
|
55
55
|
var audioFileTypes = ['audio/1d-interleaved-parityfec', 'audio/32kadpcm', 'audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/ac3', 'audio/AMR', 'audio/AMR-WB', 'audio/amr-wb+', 'audio/aptx', 'audio/asc', 'audio/ATRAC-ADVANCED-LOSSLESS', 'audio/ATRAC-X', 'audio/ATRAC3', 'audio/basic', 'audio/BV16', 'audio/BV32', 'audio/clearmode', 'audio/CN', 'audio/DAT12', 'audio/dls', 'audio/dsr-es201108', 'audio/dsr-es202050', 'audio/dsr-es202211', 'audio/dsr-es202212', 'audio/DV', 'audio/DVI4', 'audio/eac3', 'audio/encaprtp', 'audio/EVRC', 'audio/EVRC-QCP', 'audio/EVRC0', 'audio/EVRC1', 'audio/EVRCB', 'audio/EVRCB0', 'audio/EVRCB1', 'audio/EVRCNW', 'audio/EVRCNW0', 'audio/EVRCNW1', 'audio/EVRCWB', 'audio/EVRCWB0', 'audio/EVRCWB1', 'audio/EVS', 'audio/example', 'audio/flexfec', 'audio/fwdred', 'audio/G711-0', 'audio/G719', 'audio/G7221', 'audio/G722', 'audio/G723', 'audio/G726-16', 'audio/G726-24', 'audio/G726-32', 'audio/G726-40', 'audio/G728', 'audio/G729', 'audio/G7291', 'audio/G729D', 'audio/G729E', 'audio/GSM', 'audio/GSM-EFR', 'audio/GSM-HR-08', 'audio/iLBC', 'audio/ip-mr_v2.5', 'audio/L8', 'audio/L16', 'audio/L20', 'audio/L24', 'audio/LPC', 'audio/MELP', 'audio/MELP600', 'audio/MELP1200', 'audio/MELP2400', 'audio/mhas', 'audio/mobile-xmf', 'audio/MPA', 'audio/mp4', 'audio/MP4A-LATM', 'audio/mpa-robust', 'audio/mpeg', 'audio/mpeg4-generic', 'audio/ogg', 'audio/opus', 'audio/parityfec', 'audio/PCMA', 'audio/PCMA-WB', 'audio/PCMU', 'audio/PCMU-WB', 'audio/prs.sid', 'audio/raptorfec', 'audio/RED', 'audio/rtp-enc-aescm128', 'audio/rtploopback', 'audio/rtp-midi', 'audio/rtx', 'audio/SMV', 'audio/SMV0', 'audio/SMV-QCP', 'audio/sofa', 'audio/sp-midi', 'audio/speex', 'audio/t140c', 'audio/t38', 'audio/telephone-event', 'audio/TETRA_ACELP', 'audio/TETRA_ACELP_BB', 'audio/tone', 'audio/TSVCIS', 'audio/UEMCLIP', 'audio/ulpfec', 'audio/usac', 'audio/VDVI', 'audio/VMR-WB', 'audio/vnd.3gpp.iufp', 'audio/vnd.4SB', 'audio/vnd.audiokoz', 'audio/vnd.CELP', 'audio/vnd.cisco.nse', 'audio/vnd.cmles.radio-events', 'audio/vnd.cns.anp1', 'audio/vnd.cns.inf1', 'audio/vnd.dece.audio', 'audio/vnd.digital-winds', 'audio/vnd.dlna.adts', 'audio/vnd.dolby.heaac.1', 'audio/vnd.dolby.heaac.2', 'audio/vnd.dolby.mlp', 'audio/vnd.dolby.mps', 'audio/vnd.dolby.pl2', 'audio/vnd.dolby.pl2x', 'audio/vnd.dolby.pl2z', 'audio/vnd.dolby.pulse.1', 'audio/vnd.dra', 'audio/vnd.dts', 'audio/vnd.dts.hd', 'audio/vnd.dts.uhd', 'audio/vnd.dvb.file', 'audio/vnd.everad.plj', 'audio/vnd.hns.audio', 'audio/vnd.lucent.voice', 'audio/vnd.ms-playready.media.pya', 'audio/vnd.nokia.mobile-xmf', 'audio/vnd.nortel.vbk', 'audio/vnd.nuera.ecelp4800', 'audio/vnd.nuera.ecelp7470', 'audio/vnd.nuera.ecelp9600', 'audio/vnd.octel.sbc', 'audio/vnd.presonus.multitrack', 'audio/vnd.qcelp', 'audio/vnd.rhetorex.32kadpcm', 'audio/vnd.rip', 'audio/vnd.sealedmedia.softseal.mpeg', 'audio/vnd.vmx.cvsd', 'audio/vorbis', 'audio/vorbis-config'];
|
|
56
56
|
var docMimeTypes = ['application/msword', 'application/msword-template', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text-template', 'application/vnd.oasis.opendocument.text-flat-xml'];
|
|
@@ -34,7 +34,7 @@ var _utils = require("../../utils/utils");
|
|
|
34
34
|
var _excluded = ["uri"];
|
|
35
35
|
|
|
36
36
|
var _this = this,
|
|
37
|
-
_jsxFileName = "/
|
|
37
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/Gallery.tsx";
|
|
38
38
|
|
|
39
39
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
40
40
|
|
|
@@ -28,7 +28,7 @@ var _Lightning = require("../../icons/Lightning");
|
|
|
28
28
|
var _utils = require("../../utils/utils");
|
|
29
29
|
|
|
30
30
|
var _this = this,
|
|
31
|
-
_jsxFileName = "/
|
|
31
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/Giphy.tsx";
|
|
32
32
|
|
|
33
33
|
var styles = _reactNative.StyleSheet.create({
|
|
34
34
|
actionsRow: {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useGoToURL = void 0;
|
|
7
|
+
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
|
|
12
|
+
var _reactNative = require("react-native");
|
|
13
|
+
|
|
14
|
+
var useGoToURL = function useGoToURL(url) {
|
|
15
|
+
var _useState = (0, _react.useState)(false),
|
|
16
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
17
|
+
error = _useState2[0],
|
|
18
|
+
setError = _useState2[1];
|
|
19
|
+
|
|
20
|
+
var finalUrl = url;
|
|
21
|
+
var pattern = new RegExp(/^\S+:\/\//);
|
|
22
|
+
|
|
23
|
+
if (!pattern.test(finalUrl)) {
|
|
24
|
+
finalUrl = 'http://' + url;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var openURL = function openURL() {
|
|
28
|
+
return _reactNative.Linking.canOpenURL(finalUrl).then(function (supported) {
|
|
29
|
+
if (supported) {
|
|
30
|
+
_reactNative.Linking.openURL(finalUrl);
|
|
31
|
+
} else {
|
|
32
|
+
setError(true);
|
|
33
|
+
console.log("Don't know how to open URI: " + finalUrl);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return [error, openURL];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.useGoToURL = useGoToURL;
|
|
42
|
+
//# sourceMappingURL=useGoToURL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useGoToURL.ts"],"names":["useGoToURL","url","error","setError","finalUrl","pattern","RegExp","test","openURL","Linking","canOpenURL","then","supported","console","log"],"mappings":";;;;;;;;;AAAA;;AACA;;AAIO,IAAMA,UAA0B,GAAG,SAA7BA,UAA6B,CAACC,GAAD,EAAkB;AAC1D,kBAA0B,qBAAkB,KAAlB,CAA1B;AAAA;AAAA,MAAOC,KAAP;AAAA,MAAcC,QAAd;;AAEA,MAAIC,QAAQ,GAAGH,GAAf;AACA,MAAMI,OAAO,GAAG,IAAIC,MAAJ,CAAW,WAAX,CAAhB;;AAEA,MAAI,CAACD,OAAO,CAACE,IAAR,CAAaH,QAAb,CAAL,EAA6B;AAC3BA,IAAAA,QAAQ,GAAG,YAAYH,GAAvB;AACD;;AAED,MAAMO,OAAO,GAAG,SAAVA,OAAU;AAAA,WACdC,qBAAQC,UAAR,CAAmBN,QAAnB,EAA6BO,IAA7B,CAAkC,UAACC,SAAD,EAAe;AAC/C,UAAIA,SAAJ,EAAe;AACbH,6BAAQD,OAAR,CAAgBJ,QAAhB;AACD,OAFD,MAEO;AACLD,QAAAA,QAAQ,CAAC,IAAD,CAAR;AACAU,QAAAA,OAAO,CAACC,GAAR,kCAA2CV,QAA3C;AACD;AACF,KAPD,CADc;AAAA,GAAhB;;AAUA,SAAO,CAACF,KAAD,EAAQM,OAAR,CAAP;AACD,CArBM","sourcesContent":["import { useState } from 'react';\nimport { Linking } from 'react-native';\n\nexport type UseGoToURLType = (url?: string) => [boolean, () => Promise<void>];\n\nexport const useGoToURL: UseGoToURLType = (url?: string) => {\n const [error, setError] = useState<boolean>(false);\n\n let finalUrl = url as string;\n const pattern = new RegExp(/^\\S+:\\/\\//);\n\n if (!pattern.test(finalUrl)) {\n finalUrl = 'http://' + url;\n }\n\n const openURL = () =>\n Linking.canOpenURL(finalUrl).then((supported) => {\n if (supported) {\n Linking.openURL(finalUrl);\n } else {\n setError(true);\n console.log(`Don't know how to open URI: ${finalUrl}`);\n }\n });\n\n return [error, openURL];\n};\n"]}
|
|
@@ -30,7 +30,7 @@ var _native = require("../../native");
|
|
|
30
30
|
var _utils = require("../../utils/utils");
|
|
31
31
|
|
|
32
32
|
var _this = this,
|
|
33
|
-
_jsxFileName = "/
|
|
33
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AttachmentPicker/AttachmentPicker.tsx";
|
|
34
34
|
|
|
35
35
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
36
36
|
|
package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js
CHANGED
|
@@ -16,7 +16,7 @@ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reani
|
|
|
16
16
|
var _ThemeContext = require("../../../contexts/themeContext/ThemeContext");
|
|
17
17
|
|
|
18
18
|
var _this = this,
|
|
19
|
-
_jsxFileName = "/
|
|
19
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.tsx";
|
|
20
20
|
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
|
|
@@ -20,7 +20,7 @@ var _ThemeContext = require("../../../contexts/themeContext/ThemeContext");
|
|
|
20
20
|
var _TranslationContext = require("../../../contexts/translationContext/TranslationContext");
|
|
21
21
|
|
|
22
22
|
var _this = this,
|
|
23
|
-
_jsxFileName = "/
|
|
23
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AttachmentPicker/components/AttachmentPickerError.tsx";
|
|
24
24
|
|
|
25
25
|
var styles = _reactNative.StyleSheet.create({
|
|
26
26
|
errorButtonText: {
|