stream-chat-react-native-core 4.4.0 → 4.5.1-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 +25 -18
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +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 +25 -18
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +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/AttachmentPicker/AttachmentPicker.tsx +32 -32
- 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
|
@@ -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
|
|
|
@@ -209,13 +209,7 @@ var AttachmentPicker = _react["default"].forwardRef(function (props, ref) {
|
|
|
209
209
|
photos = _useState12[0],
|
|
210
210
|
setPhotos = _useState12[1];
|
|
211
211
|
|
|
212
|
-
var
|
|
213
|
-
setSelectedPicker(undefined);
|
|
214
|
-
|
|
215
|
-
if (ref != null && ref.current) {
|
|
216
|
-
ref.current.close();
|
|
217
|
-
}
|
|
218
|
-
};
|
|
212
|
+
var bottomSheetCloseOnKeyboardShowTimeout = (0, _react.useRef)();
|
|
219
213
|
|
|
220
214
|
var getMorePhotos = function () {
|
|
221
215
|
var _ref2 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee() {
|
|
@@ -291,6 +285,19 @@ var AttachmentPicker = _react["default"].forwardRef(function (props, ref) {
|
|
|
291
285
|
};
|
|
292
286
|
}, [selectedPicker]);
|
|
293
287
|
(0, _react.useEffect)(function () {
|
|
288
|
+
var hideAttachmentPicker = function hideAttachmentPicker() {
|
|
289
|
+
if (bottomSheetCloseOnKeyboardShowTimeout.current) {
|
|
290
|
+
clearTimeout(bottomSheetCloseOnKeyboardShowTimeout.current);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
setSelectedPicker(undefined);
|
|
294
|
+
bottomSheetCloseOnKeyboardShowTimeout.current = setTimeout(function () {
|
|
295
|
+
var _current;
|
|
296
|
+
|
|
297
|
+
return (_current = ref.current) == null ? void 0 : _current.close();
|
|
298
|
+
}, 150);
|
|
299
|
+
};
|
|
300
|
+
|
|
294
301
|
var keyboardSubscription = _reactNative.Platform.OS === 'ios' ? _reactNative.Keyboard.addListener('keyboardWillShow', hideAttachmentPicker) : _reactNative.Keyboard.addListener('keyboardDidShow', hideAttachmentPicker);
|
|
295
302
|
return function () {
|
|
296
303
|
if (keyboardSubscription != null && keyboardSubscription.remove) {
|
|
@@ -303,6 +310,10 @@ var AttachmentPicker = _react["default"].forwardRef(function (props, ref) {
|
|
|
303
310
|
} else {
|
|
304
311
|
_reactNative.Keyboard.removeListener('keyboardDidShow', hideAttachmentPicker);
|
|
305
312
|
}
|
|
313
|
+
|
|
314
|
+
if (bottomSheetCloseOnKeyboardShowTimeout.current) {
|
|
315
|
+
clearTimeout(bottomSheetCloseOnKeyboardShowTimeout.current);
|
|
316
|
+
}
|
|
306
317
|
};
|
|
307
318
|
}, []);
|
|
308
319
|
(0, _react.useEffect)(function () {
|
|
@@ -337,22 +348,18 @@ var AttachmentPicker = _react["default"].forwardRef(function (props, ref) {
|
|
|
337
348
|
var statusBarHeight = (_StatusBar$currentHei = _reactNative.StatusBar.currentHeight) != null ? _StatusBar$currentHei : 0;
|
|
338
349
|
var bottomBarHeight = fullScreenHeight - screenHeight - statusBarHeight;
|
|
339
350
|
var androidBottomBarHeightAdjustment = _reactNative.Platform.OS === 'android' ? bottomBarHeight === statusBarHeight ? translucentStatusBar ? 0 : (_StatusBar$currentHei2 = _reactNative.StatusBar.currentHeight) != null ? _StatusBar$currentHei2 : 0 : translucentStatusBar ? bottomBarHeight > statusBarHeight ? -bottomBarHeight + statusBarHeight : bottomBarHeight > 0 ? -statusBarHeight : 0 : bottomBarHeight > 0 ? 0 : statusBarHeight : 0;
|
|
340
|
-
var initialSnapPoint = (
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}, [fullScreenHeight, handleHeight, topInset]);
|
|
346
|
-
var snapPoints = [initialSnapPoint, finalSnapPoint];
|
|
351
|
+
var initialSnapPoint = (attachmentPickerBottomSheetHeight != null ? attachmentPickerBottomSheetHeight : _reactNative.Platform.OS === 'android') ? 308 + (fullScreenHeight - screenHeight + androidBottomBarHeightAdjustment) - handleHeight : 308 + (fullScreenHeight - screenHeight + androidBottomBarHeightAdjustment);
|
|
352
|
+
var finalSnapPoint = _reactNative.Platform.OS === 'android' ? fullScreenHeight - topInset - handleHeight : fullScreenHeight - topInset;
|
|
353
|
+
var snapPoints = (0, _react.useMemo)(function () {
|
|
354
|
+
return [initialSnapPoint, finalSnapPoint];
|
|
355
|
+
}, [initialSnapPoint, finalSnapPoint]);
|
|
347
356
|
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_bottomSheet["default"], {
|
|
348
357
|
containerHeight: fullScreenHeight,
|
|
349
358
|
enablePanDownToClose: true,
|
|
350
359
|
handleComponent: photoError ? null : AttachmentPickerBottomSheetHandle,
|
|
351
360
|
handleHeight: handleHeight,
|
|
352
361
|
index: -1,
|
|
353
|
-
onChange:
|
|
354
|
-
return setCurrentIndex(index);
|
|
355
|
-
},
|
|
362
|
+
onChange: setCurrentIndex,
|
|
356
363
|
ref: ref,
|
|
357
364
|
snapPoints: snapPoints,
|
|
358
365
|
__self: _this,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentPicker.tsx"],"names":["styles","StyleSheet","create","container","flexGrow","overlay","alignItems","flex","screenHeight","fullScreenHeight","Dimensions","get","height","AttachmentImage","props","ImageOverlaySelectedComponent","numberOfAttachmentPickerImageColumns","onPress","selected","uri","theme","attachmentPicker","image","imageOverlay","colors","size","margin","width","backgroundColor","renderImage","item","asset","maxNumberOfFiles","setSelectedImages","images","filter","length","AttachmentPicker","React","forwardRef","ref","AttachmentPickerBottomSheetHandle","attachmentPickerBottomSheetHandleHeight","attachmentPickerBottomSheetHeight","AttachmentPickerError","attachmentPickerErrorButtonText","AttachmentPickerErrorImage","attachmentPickerErrorText","numberOfAttachmentImagesToLoadPerCall","translucentStatusBar","bottomSheetContentContainer","white","closePicker","selectedImages","selectedPicker","setSelectedPicker","topInset","currentIndex","setCurrentIndex","endCursor","setEndCursor","photoError","setPhotoError","hasNextPage","setHasNextPage","loadingPhotos","setLoadingPhotos","photos","setPhotos","hideAttachmentPicker","undefined","current","close","getMorePhotos","after","first","results","assets","console","log","backAction","backHandler","BackHandler","addEventListener","remove","keyboardSubscription","Platform","OS","Keyboard","addListener","removeListener","selectedPhotos","map","some","handleHeight","statusBarHeight","StatusBar","currentHeight","bottomBarHeight","androidBottomBarHeightAdjustment","initialSnapPoint","finalSnapPoint","snapPoints","index","opacity","displayName"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AAWA;;AAQA;;AACA;;AACA;;AACA;;;;;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,QAAQ,EAAE;AADD,GADoB;AAI/BC,EAAAA,OAAO,EAAE;AACPC,IAAAA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GAbP;AAcE,IAAA,UAAU,EAAE8D,UAdd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAgBE,gCAAC,gCAAD;AACE,IAAA,qBAAqB,EAAE,CACrBtG,MAAM,CAACG,SADc,EAErB;AAAEyB,MAAAA,eAAe,EAAEuB;AAAnB,KAFqB,EAGrBD,2BAHqB,EAIrB;AAAEsD,MAAAA,OAAO,EAAE3C,UAAU,GAAG,CAAH,GAAO;AAA5B,KAJqB,CADzB;AAOE,IAAA,IAAI,EAAE8B,cAPR;AAQE,IAAA,YAAY,EAAE,sBAAC7D,IAAD;AAAA,aAAUA,IAAI,CAACC,KAAL,CAAWZ,GAArB;AAAA,KARhB;AASE,IAAA,UAAU,EAAEH,oCAAF,WAAEA,oCAAF,GAA0C,CATtD;AAUE,IAAA,YAAY,EAAEyD,aAVhB;AAWE,IAAA,UAAU,EAAE5C,WAXd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAhBF,CADF,EA+BGyB,cAAc,KAAK,QAAnB,IAA+BO,UAA/B,IACC,gCAAC,qBAAD;AACE,IAAA,iCAAiC,EAAElB,iCADrC;AAEE,IAAA,+BAA+B,EAAEE,+BAFnC;AAGE,IAAA,0BAA0B,EAAEC,0BAH9B;AAIE,IAAA,yBAAyB,EAAEC,yBAJ7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAhCJ,CADF;AA0CD,CA5O6B,CAAzB;;;AA+OPV,gBAAgB,CAACoE,WAAjB,GAA+B,kBAA/B","sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport {\n BackHandler,\n Dimensions,\n ImageBackground,\n Keyboard,\n Platform,\n StatusBar,\n StyleSheet,\n View,\n} from 'react-native';\n\nimport BottomSheet, {\n BottomSheetFlatList,\n BottomSheetHandleProps,\n TouchableOpacity,\n} from '@gorhom/bottom-sheet';\n\nimport type { AttachmentPickerErrorProps } from './components/AttachmentPickerError';\n\nimport { useAttachmentPickerContext } from '../../contexts/attachmentPickerContext/AttachmentPickerContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Asset, getPhotos } from '../../native';\nimport { vh, vw } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n container: {\n flexGrow: 1,\n },\n overlay: {\n alignItems: 'flex-end',\n flex: 1,\n },\n});\n\nconst screenHeight = vh(100);\nconst fullScreenHeight = Dimensions.get('window').height;\n\ntype AttachmentImageProps = {\n ImageOverlaySelectedComponent: React.ComponentType;\n onPress: () => void;\n selected: boolean;\n uri: string;\n numberOfAttachmentPickerImageColumns?: number;\n};\n\nconst AttachmentImage: React.FC<AttachmentImageProps> = (props) => {\n const {\n ImageOverlaySelectedComponent,\n numberOfAttachmentPickerImageColumns,\n onPress,\n selected,\n uri,\n } = props;\n const {\n theme: {\n attachmentPicker: { image, imageOverlay },\n colors: { overlay },\n },\n } = useTheme();\n\n const size = vw(100) / (numberOfAttachmentPickerImageColumns || 3) - 2;\n\n return (\n <TouchableOpacity onPress={onPress}>\n <ImageBackground\n source={{ uri }}\n style={[\n {\n height: size,\n margin: 1,\n width: size,\n },\n image,\n ]}\n >\n {selected && (\n <View style={[styles.overlay, { backgroundColor: overlay }, imageOverlay]}>\n <ImageOverlaySelectedComponent />\n </View>\n )}\n </ImageBackground>\n </TouchableOpacity>\n );\n};\n\nconst renderImage = ({\n item,\n}: {\n item: {\n asset: Asset;\n ImageOverlaySelectedComponent: React.ComponentType;\n maxNumberOfFiles: number;\n selected: boolean;\n setSelectedImages: React.Dispatch<React.SetStateAction<Asset[]>>;\n numberOfAttachmentPickerImageColumns?: number;\n };\n}) => {\n const {\n asset,\n ImageOverlaySelectedComponent,\n maxNumberOfFiles,\n numberOfAttachmentPickerImageColumns,\n selected,\n setSelectedImages,\n } = item;\n const onPress = () => {\n if (selected) {\n setSelectedImages((images) => images.filter((image) => image.uri !== asset.uri));\n } else {\n setSelectedImages((images) => {\n if (images.length >= maxNumberOfFiles) {\n return images;\n }\n return [...images, asset];\n });\n }\n };\n\n return (\n <AttachmentImage\n ImageOverlaySelectedComponent={ImageOverlaySelectedComponent}\n numberOfAttachmentPickerImageColumns={numberOfAttachmentPickerImageColumns}\n onPress={onPress}\n selected={selected}\n uri={asset.uri}\n />\n );\n};\n\nexport type AttachmentPickerProps = {\n /**\n * Custom UI component to render [draggable handle](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/1.png) of attachment picker.\n *\n * **Default** [AttachmentPickerBottomSheetHandle](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.tsx)\n */\n AttachmentPickerBottomSheetHandle: React.FC<BottomSheetHandleProps>;\n /**\n * Custom UI component to render error component while opening attachment picker.\n *\n * **Default** [AttachmentPickerError](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/AttachmentPickerError.tsx)\n */\n AttachmentPickerError: React.ComponentType<AttachmentPickerErrorProps>;\n /**\n * Custom UI component to render error image for attachment picker\n *\n * **Default** [AttachmentPickerErrorImage](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/AttachmentPickerErrorImage.tsx)\n */\n AttachmentPickerErrorImage: React.ComponentType;\n /**\n * Custom UI component to render overlay component, that shows up on top of [selected image](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/1.png) (with tick mark)\n *\n * **Default** [ImageOverlaySelectedComponent](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/ImageOverlaySelectedComponent.tsx)\n */\n ImageOverlaySelectedComponent: React.ComponentType;\n attachmentPickerBottomSheetHandleHeight?: number;\n attachmentPickerBottomSheetHeight?: number;\n attachmentPickerErrorButtonText?: string;\n attachmentPickerErrorText?: string;\n numberOfAttachmentImagesToLoadPerCall?: number;\n numberOfAttachmentPickerImageColumns?: number;\n translucentStatusBar?: boolean;\n};\n\nexport const AttachmentPicker = React.forwardRef(\n (props: AttachmentPickerProps, ref: React.ForwardedRef<BottomSheet>) => {\n const {\n AttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage,\n attachmentPickerErrorText,\n ImageOverlaySelectedComponent,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n translucentStatusBar,\n } = props;\n\n const {\n theme: {\n attachmentPicker: { bottomSheetContentContainer },\n colors: { white },\n },\n } = useTheme();\n const {\n closePicker,\n maxNumberOfFiles,\n selectedImages,\n selectedPicker,\n setSelectedImages,\n setSelectedPicker,\n topInset,\n } = useAttachmentPickerContext();\n\n const [currentIndex, setCurrentIndex] = useState(-1);\n const [endCursor, setEndCursor] = useState<string>();\n const [photoError, setPhotoError] = useState(false);\n const [hasNextPage, setHasNextPage] = useState(true);\n const [loadingPhotos, setLoadingPhotos] = useState(false);\n const [photos, setPhotos] = useState<Asset[]>([]);\n\n const hideAttachmentPicker = () => {\n setSelectedPicker(undefined);\n if ((ref as React.MutableRefObject<BottomSheet>)?.current) {\n (ref as React.MutableRefObject<BottomSheet>).current.close();\n }\n };\n\n const getMorePhotos = async () => {\n if (hasNextPage && !loadingPhotos && currentIndex > -1 && selectedPicker === 'images') {\n setLoadingPhotos(true);\n try {\n const results = await getPhotos({\n after: endCursor,\n first: numberOfAttachmentImagesToLoadPerCall ?? 60,\n });\n if (endCursor) {\n setPhotos([...photos, ...results.assets]);\n } else {\n setPhotos(results.assets);\n }\n setEndCursor(results.endCursor);\n setHasNextPage(results.hasNextPage || false);\n } catch (error) {\n console.log(error);\n setPhotoError(true);\n }\n setLoadingPhotos(false);\n }\n };\n\n useEffect(() => {\n const backAction = () => {\n if (selectedPicker) {\n setSelectedPicker(undefined);\n closePicker();\n return true;\n }\n\n return false;\n };\n\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [selectedPicker]);\n\n useEffect(() => {\n const keyboardSubscription =\n Platform.OS === 'ios'\n ? Keyboard.addListener('keyboardWillShow', hideAttachmentPicker)\n : Keyboard.addListener('keyboardDidShow', hideAttachmentPicker);\n\n return () => {\n if (keyboardSubscription?.remove) {\n keyboardSubscription.remove();\n return;\n }\n\n // To keep compatibility with older versions of React Native, where `remove()` is not available\n if (Platform.OS === 'ios') {\n Keyboard.removeListener('keyboardWillShow', hideAttachmentPicker);\n } else {\n Keyboard.removeListener('keyboardDidShow', hideAttachmentPicker);\n }\n };\n }, []);\n\n useEffect(() => {\n if (currentIndex < 0) {\n setSelectedPicker(undefined);\n if (!loadingPhotos) {\n setEndCursor(undefined);\n setHasNextPage(true);\n }\n }\n }, [currentIndex]);\n\n useEffect(() => {\n if (\n selectedPicker === 'images' &&\n endCursor === undefined &&\n currentIndex > -1 &&\n !loadingPhotos\n ) {\n setPhotoError(false);\n getMorePhotos();\n }\n }, [currentIndex, selectedPicker]);\n\n const selectedPhotos = photos.map((asset) => ({\n asset,\n ImageOverlaySelectedComponent,\n maxNumberOfFiles,\n numberOfAttachmentPickerImageColumns,\n selected: selectedImages.some((image) => image.uri === asset.uri),\n setSelectedImages,\n }));\n\n const handleHeight = attachmentPickerBottomSheetHandleHeight || 20;\n\n /**\n * This is to handle issues with Android measurements coming back incorrect.\n * If the StatusBar height is perfectly 1/2 of the difference between the two\n * dimensions for screen and window, it is incorrect and we need to account for\n * this. If you use a translucent header bar more adjustments are needed.\n */\n const statusBarHeight = StatusBar.currentHeight ?? 0;\n const bottomBarHeight = fullScreenHeight - screenHeight - statusBarHeight;\n const androidBottomBarHeightAdjustment =\n Platform.OS === 'android'\n ? bottomBarHeight === statusBarHeight\n ? translucentStatusBar\n ? 0\n : StatusBar.currentHeight ?? 0\n : translucentStatusBar\n ? bottomBarHeight > statusBarHeight\n ? -bottomBarHeight + statusBarHeight\n : bottomBarHeight > 0\n ? -statusBarHeight\n : 0\n : bottomBarHeight > 0\n ? 0\n : statusBarHeight\n : 0;\n\n const initialSnapPoint = useMemo(\n () =>\n attachmentPickerBottomSheetHeight ?? Platform.OS === 'android'\n ? 308 +\n (fullScreenHeight - screenHeight + androidBottomBarHeightAdjustment) -\n handleHeight\n : 308 + (fullScreenHeight - screenHeight + androidBottomBarHeightAdjustment),\n [\n attachmentPickerBottomSheetHeight,\n androidBottomBarHeightAdjustment,\n fullScreenHeight,\n handleHeight,\n screenHeight,\n ],\n );\n\n const finalSnapPoint = useMemo(\n () =>\n Platform.OS === 'android'\n ? fullScreenHeight - topInset - handleHeight\n : fullScreenHeight - topInset,\n [fullScreenHeight, handleHeight, topInset],\n );\n\n /**\n * Snap points changing cause a rerender of the position,\n * this is an issue if you are calling close on the bottom sheet.\n */\n const snapPoints = [initialSnapPoint, finalSnapPoint];\n\n return (\n <>\n <BottomSheet\n containerHeight={fullScreenHeight}\n enablePanDownToClose={true}\n handleComponent={\n /**\n * using `null` here instead of `style={{ opacity: photoError ? 0 : 1 }}`\n * as opacity is not an allowed style\n */\n photoError ? null : AttachmentPickerBottomSheetHandle\n }\n handleHeight={handleHeight}\n index={-1}\n onChange={(index: number) => setCurrentIndex(index)}\n ref={ref}\n snapPoints={snapPoints}\n >\n <BottomSheetFlatList\n contentContainerStyle={[\n styles.container,\n { backgroundColor: white },\n bottomSheetContentContainer,\n { opacity: photoError ? 0 : 1 },\n ]}\n data={selectedPhotos}\n keyExtractor={(item) => item.asset.uri}\n numColumns={numberOfAttachmentPickerImageColumns ?? 3}\n onEndReached={getMorePhotos}\n renderItem={renderImage}\n />\n </BottomSheet>\n {selectedPicker === 'images' && photoError && (\n <AttachmentPickerError\n attachmentPickerBottomSheetHeight={attachmentPickerBottomSheetHeight}\n attachmentPickerErrorButtonText={attachmentPickerErrorButtonText}\n AttachmentPickerErrorImage={AttachmentPickerErrorImage}\n attachmentPickerErrorText={attachmentPickerErrorText}\n />\n )}\n </>\n );\n },\n);\n\nAttachmentPicker.displayName = 'AttachmentPicker';\n"]}
|
|
1
|
+
{"version":3,"sources":["AttachmentPicker.tsx"],"names":["styles","StyleSheet","create","container","flexGrow","overlay","alignItems","flex","screenHeight","fullScreenHeight","Dimensions","get","height","AttachmentImage","props","ImageOverlaySelectedComponent","numberOfAttachmentPickerImageColumns","onPress","selected","uri","theme","attachmentPicker","image","imageOverlay","colors","size","margin","width","backgroundColor","renderImage","item","asset","maxNumberOfFiles","setSelectedImages","images","filter","length","AttachmentPicker","React","forwardRef","ref","AttachmentPickerBottomSheetHandle","attachmentPickerBottomSheetHandleHeight","attachmentPickerBottomSheetHeight","AttachmentPickerError","attachmentPickerErrorButtonText","AttachmentPickerErrorImage","attachmentPickerErrorText","numberOfAttachmentImagesToLoadPerCall","translucentStatusBar","bottomSheetContentContainer","white","closePicker","selectedImages","selectedPicker","setSelectedPicker","topInset","currentIndex","setCurrentIndex","endCursor","setEndCursor","photoError","setPhotoError","hasNextPage","setHasNextPage","loadingPhotos","setLoadingPhotos","photos","setPhotos","bottomSheetCloseOnKeyboardShowTimeout","getMorePhotos","after","first","results","assets","console","log","backAction","undefined","backHandler","BackHandler","addEventListener","remove","hideAttachmentPicker","current","clearTimeout","setTimeout","close","keyboardSubscription","Platform","OS","Keyboard","addListener","removeListener","selectedPhotos","map","some","handleHeight","statusBarHeight","StatusBar","currentHeight","bottomBarHeight","androidBottomBarHeightAdjustment","initialSnapPoint","finalSnapPoint","snapPoints","opacity","displayName"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AAWA;;AAQA;;AACA;;AACA;;AACA;;;;;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,QAAQ,EAAE;AADD,GADoB;AAI/BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,UAAU,EAAE,UADL;AAEPC,IAAAA,IAAI,EAAE;AAFC;AAJsB,CAAlB,CAAf;;AAUA,IAAMC,YAAY,GAAG,eAAG,GAAH,CAArB;;AACA,IAAMC,gBAAgB,GAAGC,wBAAWC,G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A;AAAA,KAgBE,gCAAC,gCAAD;AACE,IAAA,qBAAqB,EAAE,CACrBzG,MAAM,CAACG,SADc,EAErB;AAAEyB,MAAAA,eAAe,EAAEuB;AAAnB,KAFqB,EAGrBD,2BAHqB,EAIrB;AAAEwD,MAAAA,OAAO,EAAE7C,UAAU,GAAG,CAAH,GAAO;AAA5B,KAJqB,CADzB;AAOE,IAAA,IAAI,EAAEiC,cAPR;AAQE,IAAA,YAAY,EAAE,sBAAChE,IAAD;AAAA,aAAUA,IAAI,CAACC,KAAL,CAAWZ,GAArB;AAAA,KARhB;AASE,IAAA,UAAU,EAAEH,oCAAF,WAAEA,oCAAF,GAA0C,CATtD;AAUE,IAAA,YAAY,EAAEsD,aAVhB;AAWE,IAAA,UAAU,EAAEzC,WAXd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAhBF,CADF,EA+BGyB,cAAc,KAAK,QAAnB,IAA+BO,UAA/B,IACC,gCAAC,qBAAD;AACE,IAAA,iCAAiC,EAAElB,iCADrC;AAEE,IAAA,+BAA+B,EAAEE,+BAFnC;AAGE,IAAA,0BAA0B,EAAEC,0BAH9B;AAIE,IAAA,yBAAyB,EAAEC,yBAJ7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAhCJ,CADF;AA0CD,CA5O6B,CAAzB;;;AA+OPV,gBAAgB,CAACsE,WAAjB,GAA+B,kBAA/B","sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from 'react';\nimport {\n BackHandler,\n Dimensions,\n ImageBackground,\n Keyboard,\n Platform,\n StatusBar,\n StyleSheet,\n View,\n} from 'react-native';\n\nimport BottomSheet, {\n BottomSheetFlatList,\n BottomSheetHandleProps,\n TouchableOpacity,\n} from '@gorhom/bottom-sheet';\n\nimport type { AttachmentPickerErrorProps } from './components/AttachmentPickerError';\n\nimport { useAttachmentPickerContext } from '../../contexts/attachmentPickerContext/AttachmentPickerContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Asset, getPhotos } from '../../native';\nimport { vh, vw } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n container: {\n flexGrow: 1,\n },\n overlay: {\n alignItems: 'flex-end',\n flex: 1,\n },\n});\n\nconst screenHeight = vh(100);\nconst fullScreenHeight = Dimensions.get('window').height;\n\ntype AttachmentImageProps = {\n ImageOverlaySelectedComponent: React.ComponentType;\n onPress: () => void;\n selected: boolean;\n uri: string;\n numberOfAttachmentPickerImageColumns?: number;\n};\n\nconst AttachmentImage: React.FC<AttachmentImageProps> = (props) => {\n const {\n ImageOverlaySelectedComponent,\n numberOfAttachmentPickerImageColumns,\n onPress,\n selected,\n uri,\n } = props;\n const {\n theme: {\n attachmentPicker: { image, imageOverlay },\n colors: { overlay },\n },\n } = useTheme();\n\n const size = vw(100) / (numberOfAttachmentPickerImageColumns || 3) - 2;\n\n return (\n <TouchableOpacity onPress={onPress}>\n <ImageBackground\n source={{ uri }}\n style={[\n {\n height: size,\n margin: 1,\n width: size,\n },\n image,\n ]}\n >\n {selected && (\n <View style={[styles.overlay, { backgroundColor: overlay }, imageOverlay]}>\n <ImageOverlaySelectedComponent />\n </View>\n )}\n </ImageBackground>\n </TouchableOpacity>\n );\n};\n\nconst renderImage = ({\n item,\n}: {\n item: {\n asset: Asset;\n ImageOverlaySelectedComponent: React.ComponentType;\n maxNumberOfFiles: number;\n selected: boolean;\n setSelectedImages: React.Dispatch<React.SetStateAction<Asset[]>>;\n numberOfAttachmentPickerImageColumns?: number;\n };\n}) => {\n const {\n asset,\n ImageOverlaySelectedComponent,\n maxNumberOfFiles,\n numberOfAttachmentPickerImageColumns,\n selected,\n setSelectedImages,\n } = item;\n const onPress = () => {\n if (selected) {\n setSelectedImages((images) => images.filter((image) => image.uri !== asset.uri));\n } else {\n setSelectedImages((images) => {\n if (images.length >= maxNumberOfFiles) {\n return images;\n }\n return [...images, asset];\n });\n }\n };\n\n return (\n <AttachmentImage\n ImageOverlaySelectedComponent={ImageOverlaySelectedComponent}\n numberOfAttachmentPickerImageColumns={numberOfAttachmentPickerImageColumns}\n onPress={onPress}\n selected={selected}\n uri={asset.uri}\n />\n );\n};\n\nexport type AttachmentPickerProps = {\n /**\n * Custom UI component to render [draggable handle](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/1.png) of attachment picker.\n *\n * **Default** [AttachmentPickerBottomSheetHandle](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.tsx)\n */\n AttachmentPickerBottomSheetHandle: React.FC<BottomSheetHandleProps>;\n /**\n * Custom UI component to render error component while opening attachment picker.\n *\n * **Default** [AttachmentPickerError](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/AttachmentPickerError.tsx)\n */\n AttachmentPickerError: React.ComponentType<AttachmentPickerErrorProps>;\n /**\n * Custom UI component to render error image for attachment picker\n *\n * **Default** [AttachmentPickerErrorImage](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/AttachmentPickerErrorImage.tsx)\n */\n AttachmentPickerErrorImage: React.ComponentType;\n /**\n * Custom UI component to render overlay component, that shows up on top of [selected image](https://github.com/GetStream/stream-chat-react-native/blob/master/screenshots/docs/1.png) (with tick mark)\n *\n * **Default** [ImageOverlaySelectedComponent](https://github.com/GetStream/stream-chat-react-native/blob/master/package/src/components/AttachmentPicker/components/ImageOverlaySelectedComponent.tsx)\n */\n ImageOverlaySelectedComponent: React.ComponentType;\n attachmentPickerBottomSheetHandleHeight?: number;\n attachmentPickerBottomSheetHeight?: number;\n attachmentPickerErrorButtonText?: string;\n attachmentPickerErrorText?: string;\n numberOfAttachmentImagesToLoadPerCall?: number;\n numberOfAttachmentPickerImageColumns?: number;\n translucentStatusBar?: boolean;\n};\n\nexport const AttachmentPicker = React.forwardRef(\n (props: AttachmentPickerProps, ref: React.ForwardedRef<BottomSheet>) => {\n const {\n AttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage,\n attachmentPickerErrorText,\n ImageOverlaySelectedComponent,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n translucentStatusBar,\n } = props;\n\n const {\n theme: {\n attachmentPicker: { bottomSheetContentContainer },\n colors: { white },\n },\n } = useTheme();\n const {\n closePicker,\n maxNumberOfFiles,\n selectedImages,\n selectedPicker,\n setSelectedImages,\n setSelectedPicker,\n topInset,\n } = useAttachmentPickerContext();\n\n const [currentIndex, setCurrentIndex] = useState(-1);\n const [endCursor, setEndCursor] = useState<string>();\n const [photoError, setPhotoError] = useState(false);\n const [hasNextPage, setHasNextPage] = useState(true);\n const [loadingPhotos, setLoadingPhotos] = useState(false);\n const [photos, setPhotos] = useState<Asset[]>([]);\n const bottomSheetCloseOnKeyboardShowTimeout = useRef<NodeJS.Timeout>();\n\n const getMorePhotos = async () => {\n if (hasNextPage && !loadingPhotos && currentIndex > -1 && selectedPicker === 'images') {\n setLoadingPhotos(true);\n try {\n const results = await getPhotos({\n after: endCursor,\n first: numberOfAttachmentImagesToLoadPerCall ?? 60,\n });\n if (endCursor) {\n setPhotos([...photos, ...results.assets]);\n } else {\n setPhotos(results.assets);\n }\n setEndCursor(results.endCursor);\n setHasNextPage(results.hasNextPage || false);\n } catch (error) {\n console.log(error);\n setPhotoError(true);\n }\n setLoadingPhotos(false);\n }\n };\n\n useEffect(() => {\n const backAction = () => {\n if (selectedPicker) {\n setSelectedPicker(undefined);\n closePicker();\n return true;\n }\n\n return false;\n };\n\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [selectedPicker]);\n\n useEffect(() => {\n const hideAttachmentPicker = () => {\n if (bottomSheetCloseOnKeyboardShowTimeout.current) {\n clearTimeout(bottomSheetCloseOnKeyboardShowTimeout.current);\n }\n setSelectedPicker(undefined);\n // This short timeout is to prevent a race condition\n // where the close function is called during the point when a internal container layout happens within the bottomsheet due to keyboard affecting the layout\n // If the container layout measures a shorter height than previous but if the close snapped to the previous height's position, the bottom sheet will show up\n // this short delay ensures that close function is always called after a container layout due to keyboard change\n bottomSheetCloseOnKeyboardShowTimeout.current = setTimeout(\n () => (ref as React.MutableRefObject<BottomSheet | undefined>).current?.close(),\n 150,\n );\n };\n const keyboardSubscription =\n Platform.OS === 'ios'\n ? Keyboard.addListener('keyboardWillShow', hideAttachmentPicker)\n : Keyboard.addListener('keyboardDidShow', hideAttachmentPicker);\n\n return () => {\n if (keyboardSubscription?.remove) {\n keyboardSubscription.remove();\n return;\n }\n\n // To keep compatibility with older versions of React Native, where `remove()` is not available\n if (Platform.OS === 'ios') {\n Keyboard.removeListener('keyboardWillShow', hideAttachmentPicker);\n } else {\n Keyboard.removeListener('keyboardDidShow', hideAttachmentPicker);\n }\n if (bottomSheetCloseOnKeyboardShowTimeout.current) {\n clearTimeout(bottomSheetCloseOnKeyboardShowTimeout.current);\n }\n };\n }, []);\n\n useEffect(() => {\n if (currentIndex < 0) {\n setSelectedPicker(undefined);\n if (!loadingPhotos) {\n setEndCursor(undefined);\n setHasNextPage(true);\n }\n }\n }, [currentIndex]);\n\n useEffect(() => {\n if (\n selectedPicker === 'images' &&\n endCursor === undefined &&\n currentIndex > -1 &&\n !loadingPhotos\n ) {\n setPhotoError(false);\n getMorePhotos();\n }\n }, [currentIndex, selectedPicker]);\n\n const selectedPhotos = photos.map((asset) => ({\n asset,\n ImageOverlaySelectedComponent,\n maxNumberOfFiles,\n numberOfAttachmentPickerImageColumns,\n selected: selectedImages.some((image) => image.uri === asset.uri),\n setSelectedImages,\n }));\n\n const handleHeight = attachmentPickerBottomSheetHandleHeight || 20;\n\n /**\n * This is to handle issues with Android measurements coming back incorrect.\n * If the StatusBar height is perfectly 1/2 of the difference between the two\n * dimensions for screen and window, it is incorrect and we need to account for\n * this. If you use a translucent header bar more adjustments are needed.\n */\n const statusBarHeight = StatusBar.currentHeight ?? 0;\n const bottomBarHeight = fullScreenHeight - screenHeight - statusBarHeight;\n const androidBottomBarHeightAdjustment =\n Platform.OS === 'android'\n ? bottomBarHeight === statusBarHeight\n ? translucentStatusBar\n ? 0\n : StatusBar.currentHeight ?? 0\n : translucentStatusBar\n ? bottomBarHeight > statusBarHeight\n ? -bottomBarHeight + statusBarHeight\n : bottomBarHeight > 0\n ? -statusBarHeight\n : 0\n : bottomBarHeight > 0\n ? 0\n : statusBarHeight\n : 0;\n\n const initialSnapPoint =\n attachmentPickerBottomSheetHeight ?? Platform.OS === 'android'\n ? 308 + (fullScreenHeight - screenHeight + androidBottomBarHeightAdjustment) - handleHeight\n : 308 + (fullScreenHeight - screenHeight + androidBottomBarHeightAdjustment);\n\n const finalSnapPoint =\n Platform.OS === 'android'\n ? fullScreenHeight - topInset - handleHeight\n : fullScreenHeight - topInset;\n\n /**\n * Snap points changing cause a rerender of the position,\n * this is an issue if you are calling close on the bottom sheet.\n */\n const snapPoints = useMemo(\n () => [initialSnapPoint, finalSnapPoint],\n [initialSnapPoint, finalSnapPoint],\n );\n\n return (\n <>\n <BottomSheet\n containerHeight={fullScreenHeight}\n enablePanDownToClose={true}\n handleComponent={\n /**\n * using `null` here instead of `style={{ opacity: photoError ? 0 : 1 }}`\n * as opacity is not an allowed style\n */\n photoError ? null : AttachmentPickerBottomSheetHandle\n }\n handleHeight={handleHeight}\n index={-1}\n onChange={setCurrentIndex}\n ref={ref}\n snapPoints={snapPoints}\n >\n <BottomSheetFlatList\n contentContainerStyle={[\n styles.container,\n { backgroundColor: white },\n bottomSheetContentContainer,\n { opacity: photoError ? 0 : 1 },\n ]}\n data={selectedPhotos}\n keyExtractor={(item) => item.asset.uri}\n numColumns={numberOfAttachmentPickerImageColumns ?? 3}\n onEndReached={getMorePhotos}\n renderItem={renderImage}\n />\n </BottomSheet>\n {selectedPicker === 'images' && photoError && (\n <AttachmentPickerError\n attachmentPickerBottomSheetHeight={attachmentPickerBottomSheetHeight}\n attachmentPickerErrorButtonText={attachmentPickerErrorButtonText}\n AttachmentPickerErrorImage={AttachmentPickerErrorImage}\n attachmentPickerErrorText={attachmentPickerErrorText}\n />\n )}\n </>\n );\n },\n);\n\nAttachmentPicker.displayName = 'AttachmentPicker';\n"]}
|
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: {
|
|
@@ -12,7 +12,7 @@ var _ThemeContext = require("../../../contexts/themeContext/ThemeContext");
|
|
|
12
12
|
var _icons = require("../../../icons");
|
|
13
13
|
|
|
14
14
|
var _this = this,
|
|
15
|
-
_jsxFileName = "/
|
|
15
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AttachmentPicker/components/AttachmentPickerErrorImage.tsx";
|
|
16
16
|
|
|
17
17
|
var AttachmentPickerErrorImage = function AttachmentPickerErrorImage() {
|
|
18
18
|
var _useTheme = (0, _ThemeContext.useTheme)(),
|
|
@@ -24,7 +24,7 @@ var _ThemeContext = require("../../../contexts/themeContext/ThemeContext");
|
|
|
24
24
|
var _native = require("../../../native");
|
|
25
25
|
|
|
26
26
|
var _this = this,
|
|
27
|
-
_jsxFileName = "/
|
|
27
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AttachmentPicker/components/AttachmentSelectionBar.tsx";
|
|
28
28
|
|
|
29
29
|
var styles = _reactNative.StyleSheet.create({
|
|
30
30
|
container: {
|
|
@@ -12,7 +12,7 @@ var _ThemeContext = require("../../../contexts/themeContext/ThemeContext");
|
|
|
12
12
|
var _icons = require("../../../icons");
|
|
13
13
|
|
|
14
14
|
var _this = this,
|
|
15
|
-
_jsxFileName = "/
|
|
15
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AttachmentPicker/components/CameraSelectorIcon.tsx";
|
|
16
16
|
|
|
17
17
|
var CameraSelectorIcon = function CameraSelectorIcon() {
|
|
18
18
|
var _useTheme = (0, _ThemeContext.useTheme)(),
|
|
@@ -12,7 +12,7 @@ var _ThemeContext = require("../../../contexts/themeContext/ThemeContext");
|
|
|
12
12
|
var _icons = require("../../../icons");
|
|
13
13
|
|
|
14
14
|
var _this = this,
|
|
15
|
-
_jsxFileName = "/
|
|
15
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AttachmentPicker/components/FileSelectorIcon.tsx";
|
|
16
16
|
|
|
17
17
|
var FileSelectorIcon = function FileSelectorIcon() {
|
|
18
18
|
var _useTheme = (0, _ThemeContext.useTheme)(),
|
package/lib/commonjs/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js
CHANGED
|
@@ -14,7 +14,7 @@ var _ThemeContext = require("../../../contexts/themeContext/ThemeContext");
|
|
|
14
14
|
var _icons = require("../../../icons");
|
|
15
15
|
|
|
16
16
|
var _this = this,
|
|
17
|
-
_jsxFileName = "/
|
|
17
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AttachmentPicker/components/ImageOverlaySelectedComponent.tsx";
|
|
18
18
|
|
|
19
19
|
var styles = _reactNative.StyleSheet.create({
|
|
20
20
|
check: {
|
|
@@ -12,7 +12,7 @@ var _ThemeContext = require("../../../contexts/themeContext/ThemeContext");
|
|
|
12
12
|
var _icons = require("../../../icons");
|
|
13
13
|
|
|
14
14
|
var _this = this,
|
|
15
|
-
_jsxFileName = "/
|
|
15
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AttachmentPicker/components/ImageSelectorIcon.tsx";
|
|
16
16
|
|
|
17
17
|
var ImageSelectorIcon = function ImageSelectorIcon(_ref) {
|
|
18
18
|
var selectedPicker = _ref.selectedPicker;
|
|
@@ -34,7 +34,7 @@ var _TranslationContext = require("../../contexts/translationContext/Translation
|
|
|
34
34
|
var _utils = require("../../utils/utils");
|
|
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/AutoCompleteInput/AutoCompleteInput.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
|
|
|
@@ -14,7 +14,7 @@ var _ThemeContext = require("../../contexts/themeContext/ThemeContext");
|
|
|
14
14
|
var _icons = require("../../icons");
|
|
15
15
|
|
|
16
16
|
var _this = this,
|
|
17
|
-
_jsxFileName = "/
|
|
17
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.tsx";
|
|
18
18
|
|
|
19
19
|
var styles = _reactNative.StyleSheet.create({
|
|
20
20
|
iconContainer: {
|
|
@@ -20,7 +20,7 @@ var _Lightning = require("../../icons/Lightning");
|
|
|
20
20
|
var _Smile = require("../../icons/Smile");
|
|
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/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx";
|
|
24
24
|
|
|
25
25
|
var styles = _reactNative.StyleSheet.create({
|
|
26
26
|
container: {
|
|
@@ -20,7 +20,7 @@ var _AtMentions = require("../../icons/AtMentions");
|
|
|
20
20
|
var _Avatar = require("../Avatar/Avatar");
|
|
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/AutoCompleteInput/AutoCompleteSuggestionItem.tsx";
|
|
24
24
|
|
|
25
25
|
var styles = _reactNative.StyleSheet.create({
|
|
26
26
|
args: {
|
|
@@ -20,7 +20,7 @@ var _ThemeContext = require("../../contexts/themeContext/ThemeContext");
|
|
|
20
20
|
var _excluded = ["children"];
|
|
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/AutoCompleteInput/AutoCompleteSuggestionList.tsx";
|
|
24
24
|
|
|
25
25
|
var SuggestionsItem = function SuggestionsItem(props) {
|
|
26
26
|
var children = props.children,
|
|
@@ -22,7 +22,7 @@ var _ThemeContext = require("../../contexts/themeContext/ThemeContext");
|
|
|
22
22
|
var _getResizedImageUrl = require("../../utils/getResizedImageUrl");
|
|
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/Avatar/Avatar.tsx";
|
|
26
26
|
|
|
27
27
|
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); }
|
|
28
28
|
|
|
@@ -20,7 +20,7 @@ var _ThemeContext = require("../../contexts/themeContext/ThemeContext");
|
|
|
20
20
|
var _getResizedImageUrl = require("../../utils/getResizedImageUrl");
|
|
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/Avatar/GroupAvatar.tsx";
|
|
24
24
|
|
|
25
25
|
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); }
|
|
26
26
|
|
|
@@ -183,7 +183,7 @@ var _excluded = ["attachments", "mentioned_users", "parent_id", "text"],
|
|
|
183
183
|
_excluded2 = ["__html", "attachments", "created_at", "html", "id", "mentioned_users", "parent_id", "quoted_message", "reactions", "status", "text", "type", "updated_at", "user"];
|
|
184
184
|
|
|
185
185
|
var _this = this,
|
|
186
|
-
_jsxFileName = "/
|
|
186
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Channel/Channel.tsx";
|
|
187
187
|
|
|
188
188
|
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); }
|
|
189
189
|
|