stream-chat-react-native-core 5.25.0-beta.6 → 5.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Channel/Channel.js +22 -17
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +22 -5
- package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +2 -2
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +1 -4
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +4 -4
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +2 -2
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +11 -8
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +7 -3
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +7 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +5 -5
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageInput/hooks/useCountdown.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +32 -30
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +5 -5
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +3 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/ThemeContext.js.map +1 -1
- package/lib/commonjs/i18n/en.json +1 -1
- package/lib/commonjs/i18n/es.json +56 -56
- package/lib/commonjs/i18n/fr.json +56 -56
- package/lib/commonjs/i18n/he.json +56 -56
- package/lib/commonjs/i18n/hi.json +56 -56
- package/lib/commonjs/i18n/it.json +56 -56
- package/lib/commonjs/i18n/ja.json +56 -56
- package/lib/commonjs/i18n/ko.json +56 -56
- package/lib/commonjs/i18n/nl.json +56 -56
- package/lib/commonjs/i18n/ru.json +56 -56
- package/lib/commonjs/i18n/tr.json +56 -56
- package/lib/commonjs/icons/ArrowRight.js.map +1 -1
- package/lib/commonjs/icons/AtMentions.js.map +1 -1
- package/lib/commonjs/icons/Attach.js.map +1 -1
- package/lib/commonjs/icons/Audio.js.map +1 -1
- package/lib/commonjs/icons/CSV.js.map +1 -1
- package/lib/commonjs/icons/Camera.js.map +1 -1
- package/lib/commonjs/icons/Check.js.map +1 -1
- package/lib/commonjs/icons/CheckAll.js.map +1 -1
- package/lib/commonjs/icons/CheckSend.js.map +1 -1
- package/lib/commonjs/icons/CircleClose.js.map +1 -1
- package/lib/commonjs/icons/CirclePlus.js.map +1 -1
- package/lib/commonjs/icons/CircleRight.js.map +1 -1
- package/lib/commonjs/icons/Close.js.map +1 -1
- package/lib/commonjs/icons/Copy.js.map +1 -1
- package/lib/commonjs/icons/CurveLineLeftUp.js.map +1 -1
- package/lib/commonjs/icons/DOC.js.map +1 -1
- package/lib/commonjs/icons/DOCX.js.map +1 -1
- package/lib/commonjs/icons/Delete.js.map +1 -1
- package/lib/commonjs/icons/Down.js.map +1 -1
- package/lib/commonjs/icons/DownloadArrow.js.map +1 -1
- package/lib/commonjs/icons/DownloadCloud.js.map +1 -1
- package/lib/commonjs/icons/Edit.js.map +1 -1
- package/lib/commonjs/icons/Error.js.map +1 -1
- package/lib/commonjs/icons/Eye.js.map +1 -1
- package/lib/commonjs/icons/Flag.js.map +1 -1
- package/lib/commonjs/icons/Folder.js.map +1 -1
- package/lib/commonjs/icons/GenericFile.js.map +1 -1
- package/lib/commonjs/icons/GiphyIcon.js.map +1 -1
- package/lib/commonjs/icons/Grid.js.map +1 -1
- package/lib/commonjs/icons/Group.js.map +1 -1
- package/lib/commonjs/icons/HTML.js.map +1 -1
- package/lib/commonjs/icons/Imgur.js.map +1 -1
- package/lib/commonjs/icons/LOLReaction.js.map +1 -1
- package/lib/commonjs/icons/Lightning.js.map +1 -1
- package/lib/commonjs/icons/Link.js.map +1 -1
- package/lib/commonjs/icons/Logo.js.map +1 -1
- package/lib/commonjs/icons/LoveReaction.js.map +1 -1
- package/lib/commonjs/icons/MD.js.map +1 -1
- package/lib/commonjs/icons/MailOpen.js.map +1 -1
- package/lib/commonjs/icons/MenuPointHorizontal.js.map +1 -1
- package/lib/commonjs/icons/MenuPointVertical.js.map +1 -1
- package/lib/commonjs/icons/MessageFlag.js.map +1 -1
- package/lib/commonjs/icons/MessageIcon.js.map +1 -1
- package/lib/commonjs/icons/Mute.js.map +1 -1
- package/lib/commonjs/icons/Notification.js.map +1 -1
- package/lib/commonjs/icons/ODT.js.map +1 -1
- package/lib/commonjs/icons/PDF.js.map +1 -1
- package/lib/commonjs/icons/PPT.js.map +1 -1
- package/lib/commonjs/icons/PPTX.js.map +1 -1
- package/lib/commonjs/icons/Pause.js.map +1 -1
- package/lib/commonjs/icons/Picture.js.map +1 -1
- package/lib/commonjs/icons/Pin.js.map +1 -1
- package/lib/commonjs/icons/PinHeader.js.map +1 -1
- package/lib/commonjs/icons/Play.js.map +1 -1
- package/lib/commonjs/icons/RAR.js.map +1 -1
- package/lib/commonjs/icons/RTF.js.map +1 -1
- package/lib/commonjs/icons/Recorder.js.map +1 -1
- package/lib/commonjs/icons/Refresh.js.map +1 -1
- package/lib/commonjs/icons/SEVEN_Z.js.map +1 -1
- package/lib/commonjs/icons/Search.js.map +1 -1
- package/lib/commonjs/icons/SendRight.js.map +1 -1
- package/lib/commonjs/icons/SendUp.js.map +1 -1
- package/lib/commonjs/icons/Share.js.map +1 -1
- package/lib/commonjs/icons/ShareRightArrow.js.map +1 -1
- package/lib/commonjs/icons/Smile.js.map +1 -1
- package/lib/commonjs/icons/Sound.js.map +1 -1
- package/lib/commonjs/icons/TAR.js.map +1 -1
- package/lib/commonjs/icons/TXT.js.map +1 -1
- package/lib/commonjs/icons/ThreadReply.js.map +1 -1
- package/lib/commonjs/icons/ThumbsDownReaction.js.map +1 -1
- package/lib/commonjs/icons/ThumbsUpReaction.js.map +1 -1
- package/lib/commonjs/icons/Time.js.map +1 -1
- package/lib/commonjs/icons/Unknown.js.map +1 -1
- package/lib/commonjs/icons/Unpin.js.map +1 -1
- package/lib/commonjs/icons/User.js.map +1 -1
- package/lib/commonjs/icons/UserAdd.js.map +1 -1
- package/lib/commonjs/icons/UserAdmin.js.map +1 -1
- package/lib/commonjs/icons/UserDelete.js.map +1 -1
- package/lib/commonjs/icons/UserMinus.js.map +1 -1
- package/lib/commonjs/icons/Video.js.map +1 -1
- package/lib/commonjs/icons/Warning.js.map +1 -1
- package/lib/commonjs/icons/WutReaction.js.map +1 -1
- package/lib/commonjs/icons/XLS.js.map +1 -1
- package/lib/commonjs/icons/XLSX.js.map +1 -1
- package/lib/commonjs/icons/ZIP.js.map +1 -1
- package/lib/commonjs/icons/utils/base.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Channel/Channel.js +22 -17
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +22 -5
- package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +2 -2
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +1 -4
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +4 -4
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +2 -2
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
- package/lib/module/components/Message/Message.js +11 -8
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +7 -3
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +7 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +5 -5
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageInput/hooks/useCountdown.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +32 -30
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageActionListItem.js +5 -5
- package/lib/module/components/MessageOverlay/MessageActionListItem.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +2 -2
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +3 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/themeContext/ThemeContext.js.map +1 -1
- package/lib/module/i18n/en.json +1 -1
- package/lib/module/i18n/es.json +56 -56
- package/lib/module/i18n/fr.json +56 -56
- package/lib/module/i18n/he.json +56 -56
- package/lib/module/i18n/hi.json +56 -56
- package/lib/module/i18n/it.json +56 -56
- package/lib/module/i18n/ja.json +56 -56
- package/lib/module/i18n/ko.json +56 -56
- package/lib/module/i18n/nl.json +56 -56
- package/lib/module/i18n/ru.json +56 -56
- package/lib/module/i18n/tr.json +56 -56
- package/lib/module/icons/ArrowRight.js.map +1 -1
- package/lib/module/icons/AtMentions.js.map +1 -1
- package/lib/module/icons/Attach.js.map +1 -1
- package/lib/module/icons/Audio.js.map +1 -1
- package/lib/module/icons/CSV.js.map +1 -1
- package/lib/module/icons/Camera.js.map +1 -1
- package/lib/module/icons/Check.js.map +1 -1
- package/lib/module/icons/CheckAll.js.map +1 -1
- package/lib/module/icons/CheckSend.js.map +1 -1
- package/lib/module/icons/CircleClose.js.map +1 -1
- package/lib/module/icons/CirclePlus.js.map +1 -1
- package/lib/module/icons/CircleRight.js.map +1 -1
- package/lib/module/icons/Close.js.map +1 -1
- package/lib/module/icons/Copy.js.map +1 -1
- package/lib/module/icons/CurveLineLeftUp.js.map +1 -1
- package/lib/module/icons/DOC.js.map +1 -1
- package/lib/module/icons/DOCX.js.map +1 -1
- package/lib/module/icons/Delete.js.map +1 -1
- package/lib/module/icons/Down.js.map +1 -1
- package/lib/module/icons/DownloadArrow.js.map +1 -1
- package/lib/module/icons/DownloadCloud.js.map +1 -1
- package/lib/module/icons/Edit.js.map +1 -1
- package/lib/module/icons/Error.js.map +1 -1
- package/lib/module/icons/Eye.js.map +1 -1
- package/lib/module/icons/Flag.js.map +1 -1
- package/lib/module/icons/Folder.js.map +1 -1
- package/lib/module/icons/GenericFile.js.map +1 -1
- package/lib/module/icons/GiphyIcon.js.map +1 -1
- package/lib/module/icons/Grid.js.map +1 -1
- package/lib/module/icons/Group.js.map +1 -1
- package/lib/module/icons/HTML.js.map +1 -1
- package/lib/module/icons/Imgur.js.map +1 -1
- package/lib/module/icons/LOLReaction.js.map +1 -1
- package/lib/module/icons/Lightning.js.map +1 -1
- package/lib/module/icons/Link.js.map +1 -1
- package/lib/module/icons/Logo.js.map +1 -1
- package/lib/module/icons/LoveReaction.js.map +1 -1
- package/lib/module/icons/MD.js.map +1 -1
- package/lib/module/icons/MailOpen.js.map +1 -1
- package/lib/module/icons/MenuPointHorizontal.js.map +1 -1
- package/lib/module/icons/MenuPointVertical.js.map +1 -1
- package/lib/module/icons/MessageFlag.js.map +1 -1
- package/lib/module/icons/MessageIcon.js.map +1 -1
- package/lib/module/icons/Mute.js.map +1 -1
- package/lib/module/icons/Notification.js.map +1 -1
- package/lib/module/icons/ODT.js.map +1 -1
- package/lib/module/icons/PDF.js.map +1 -1
- package/lib/module/icons/PPT.js.map +1 -1
- package/lib/module/icons/PPTX.js.map +1 -1
- package/lib/module/icons/Pause.js.map +1 -1
- package/lib/module/icons/Picture.js.map +1 -1
- package/lib/module/icons/Pin.js.map +1 -1
- package/lib/module/icons/PinHeader.js.map +1 -1
- package/lib/module/icons/Play.js.map +1 -1
- package/lib/module/icons/RAR.js.map +1 -1
- package/lib/module/icons/RTF.js.map +1 -1
- package/lib/module/icons/Recorder.js.map +1 -1
- package/lib/module/icons/Refresh.js.map +1 -1
- package/lib/module/icons/SEVEN_Z.js.map +1 -1
- package/lib/module/icons/Search.js.map +1 -1
- package/lib/module/icons/SendRight.js.map +1 -1
- package/lib/module/icons/SendUp.js.map +1 -1
- package/lib/module/icons/Share.js.map +1 -1
- package/lib/module/icons/ShareRightArrow.js.map +1 -1
- package/lib/module/icons/Smile.js.map +1 -1
- package/lib/module/icons/Sound.js.map +1 -1
- package/lib/module/icons/TAR.js.map +1 -1
- package/lib/module/icons/TXT.js.map +1 -1
- package/lib/module/icons/ThreadReply.js.map +1 -1
- package/lib/module/icons/ThumbsDownReaction.js.map +1 -1
- package/lib/module/icons/ThumbsUpReaction.js.map +1 -1
- package/lib/module/icons/Time.js.map +1 -1
- package/lib/module/icons/Unknown.js.map +1 -1
- package/lib/module/icons/Unpin.js.map +1 -1
- package/lib/module/icons/User.js.map +1 -1
- package/lib/module/icons/UserAdd.js.map +1 -1
- package/lib/module/icons/UserAdmin.js.map +1 -1
- package/lib/module/icons/UserDelete.js.map +1 -1
- package/lib/module/icons/UserMinus.js.map +1 -1
- package/lib/module/icons/Video.js.map +1 -1
- package/lib/module/icons/Warning.js.map +1 -1
- package/lib/module/icons/WutReaction.js.map +1 -1
- package/lib/module/icons/XLS.js.map +1 -1
- package/lib/module/icons/XLSX.js.map +1 -1
- package/lib/module/icons/ZIP.js.map +1 -1
- package/lib/module/icons/utils/base.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Attachment.d.ts +3 -3
- package/lib/typescript/components/Attachment/AttachmentActions.d.ts +2 -2
- package/lib/typescript/components/Attachment/AudioAttachment.d.ts +2 -2
- package/lib/typescript/components/Attachment/Card.d.ts +2 -2
- package/lib/typescript/components/Attachment/FileAttachment.d.ts +3 -3
- package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts +2 -2
- package/lib/typescript/components/Attachment/FileIcon.d.ts +1 -1
- package/lib/typescript/components/Attachment/Gallery.d.ts +2 -2
- package/lib/typescript/components/Attachment/GalleryImage.d.ts +2 -2
- package/lib/typescript/components/Attachment/Giphy.d.ts +2 -2
- package/lib/typescript/components/Attachment/ImageLoadingFailedIndicator.d.ts +1 -1
- package/lib/typescript/components/Attachment/ImageLoadingIndicator.d.ts +1 -1
- package/lib/typescript/components/Attachment/VideoThumbnail.d.ts +1 -1
- package/lib/typescript/components/Attachment/utils/buildGallery/types.d.ts +4 -4
- package/lib/typescript/components/Attachment/utils/getGalleryImageBorderRadius.d.ts +1 -1
- package/lib/typescript/components/Attachment/utils/openUrlSafely.d.ts +1 -1
- package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerError.d.ts +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerItem.d.ts +1 -1
- package/lib/typescript/components/AttachmentPicker/components/ImageSelectorIcon.d.ts +1 -1
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteInput.d.ts +2 -2
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionHeader.d.ts +2 -2
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionItem.d.ts +2 -2
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts +3 -3
- package/lib/typescript/components/Avatar/Avatar.d.ts +1 -1
- package/lib/typescript/components/Avatar/GroupAvatar.d.ts +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +2 -2
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +62 -1
- package/lib/typescript/components/Channel/hooks/useTargetedMessage.d.ts +1 -1
- package/lib/typescript/components/ChannelList/ChannelList.d.ts +1 -1
- package/lib/typescript/components/ChannelList/ChannelListHeaderErrorIndicator.d.ts +1 -1
- package/lib/typescript/components/ChannelList/ChannelListMessenger.d.ts +2 -2
- package/lib/typescript/components/ChannelList/hooks/listeners/useAddedToChannelNotification.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelDeleted.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelHidden.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelTruncated.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelUpdated.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelVisible.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessage.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessageNotification.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useUserPresence.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +3 -3
- package/lib/typescript/components/ChannelList/utils.d.ts +2 -2
- package/lib/typescript/components/ChannelPreview/ChannelAvatar.d.ts +2 -2
- package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts +3 -3
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts +4 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessenger.d.ts +2 -2
- package/lib/typescript/components/ChannelPreview/ChannelPreviewStatus.d.ts +1 -2
- package/lib/typescript/components/ChannelPreview/ChannelPreviewTitle.d.ts +5 -4
- package/lib/typescript/components/ChannelPreview/ChannelPreviewUnreadCount.d.ts +5 -3
- package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayName.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/hooks/useLatestMessagePreview.d.ts +2 -2
- package/lib/typescript/components/Chat/Chat.d.ts +1 -1
- package/lib/typescript/components/Chat/hooks/handleEventToSyncDB.d.ts +1 -1
- package/lib/typescript/components/Chat/hooks/useSyncDatabase.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +3 -3
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryVideo.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +6 -6
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts +3 -3
- package/lib/typescript/components/ImageGallery/components/ImageGalleryOverlay.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +4 -4
- package/lib/typescript/components/ImageGallery/components/ImageGridHandle.d.ts +3 -3
- package/lib/typescript/components/Indicators/EmptyStateIndicator.d.ts +1 -1
- package/lib/typescript/components/Indicators/LoadingDot.d.ts +1 -1
- package/lib/typescript/components/Indicators/LoadingDots.d.ts +1 -1
- package/lib/typescript/components/Indicators/LoadingErrorIndicator.d.ts +1 -1
- package/lib/typescript/components/Indicators/LoadingIndicator.d.ts +1 -1
- package/lib/typescript/components/Message/Message.d.ts +18 -9
- package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageBounce.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageDeleted.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageError.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageFooter.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessagePinnedHeader.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageReplies.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageRepliesAvatars.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageStatus.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageTextContainer.d.ts +3 -3
- package/lib/typescript/components/Message/MessageSimple/ReactionList.d.ts +3 -3
- package/lib/typescript/components/Message/MessageSimple/utils/generateMarkdownText.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/utils/renderText.d.ts +2 -2
- package/lib/typescript/components/Message/utils/messageActions.d.ts +2 -2
- package/lib/typescript/components/MessageInput/AttachButton.d.ts +2 -2
- package/lib/typescript/components/MessageInput/CommandsButton.d.ts +2 -2
- package/lib/typescript/components/MessageInput/CooldownTimer.d.ts +1 -1
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +2 -2
- package/lib/typescript/components/MessageInput/ImageUploadPreview.d.ts +2 -2
- package/lib/typescript/components/MessageInput/InputButtons.d.ts +2 -2
- package/lib/typescript/components/MessageInput/MessageInput.d.ts +2 -2
- package/lib/typescript/components/MessageInput/MoreOptionsButton.d.ts +2 -2
- package/lib/typescript/components/MessageInput/SendButton.d.ts +2 -2
- package/lib/typescript/components/MessageInput/ShowThreadMessageInChannelButton.d.ts +2 -2
- package/lib/typescript/components/MessageInput/UploadProgressIndicator.d.ts +1 -1
- package/lib/typescript/components/MessageInput/components/InputEditingStateHeader.d.ts +2 -2
- package/lib/typescript/components/MessageInput/components/InputGiphySearch.d.ts +2 -2
- package/lib/typescript/components/MessageInput/components/InputReplyStateHeader.d.ts +2 -2
- package/lib/typescript/components/MessageList/DateHeader.d.ts +1 -1
- package/lib/typescript/components/MessageList/InlineDateSeparator.d.ts +1 -1
- package/lib/typescript/components/MessageList/InlineLoadingMoreIndicator.d.ts +1 -1
- package/lib/typescript/components/MessageList/InlineLoadingMoreRecentIndicator.d.ts +1 -1
- package/lib/typescript/components/MessageList/InlineLoadingMoreThreadIndicator.d.ts +1 -1
- package/lib/typescript/components/MessageList/MessageList.d.ts +2 -2
- package/lib/typescript/components/MessageList/MessageSystem.d.ts +1 -1
- package/lib/typescript/components/MessageList/ScrollToBottomButton.d.ts +1 -1
- package/lib/typescript/components/MessageList/TypingIndicatorContainer.d.ts +2 -2
- package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts +4 -4
- package/lib/typescript/components/MessageList/utils/filterTypingUsers.d.ts +1 -1
- package/lib/typescript/components/MessageList/utils/getDateSeparators.d.ts +2 -2
- package/lib/typescript/components/MessageList/utils/getGroupStyles.d.ts +1 -1
- package/lib/typescript/components/MessageList/utils/getReadStates.d.ts +1 -0
- package/lib/typescript/components/MessageOverlay/MessageActionList.d.ts +2 -2
- package/lib/typescript/components/MessageOverlay/MessageActionListItem.d.ts +19 -3
- package/lib/typescript/components/MessageOverlay/MessageOverlay.d.ts +2 -2
- package/lib/typescript/components/MessageOverlay/OverlayBackdrop.d.ts +1 -1
- package/lib/typescript/components/MessageOverlay/OverlayReactionList.d.ts +3 -3
- package/lib/typescript/components/MessageOverlay/OverlayReactions.d.ts +2 -2
- package/lib/typescript/components/MessageOverlay/OverlayReactionsAvatar.d.ts +1 -1
- package/lib/typescript/components/MessageOverlay/hooks/useMessageActionAnimation.d.ts +1 -1
- package/lib/typescript/components/ProgressControl/ProgressControl.d.ts +1 -1
- package/lib/typescript/components/RTLComponents/WritingDirectionAwareText.d.ts +1 -1
- package/lib/typescript/components/Reply/Reply.d.ts +2 -2
- package/lib/typescript/components/Spinner/Spinner.d.ts +1 -1
- package/lib/typescript/components/Thread/Thread.d.ts +2 -2
- package/lib/typescript/contexts/activeChannelsRefContext/ActiveChannelsRefContext.d.ts +1 -1
- package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +2 -2
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +1 -1
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +2 -2
- package/lib/typescript/contexts/channelsStateContext/ChannelsStateContext.d.ts +5 -5
- package/lib/typescript/contexts/channelsStateContext/useChannelState.d.ts +1 -1
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +4 -1
- package/lib/typescript/contexts/debugContext/DebugContext.d.ts +2 -2
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts +2 -2
- package/lib/typescript/contexts/keyboardContext/KeyboardContext.d.ts +1 -1
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +3 -3
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +6 -6
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts +1 -1
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +2 -2
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +3 -3
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +3 -3
- package/lib/typescript/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.d.ts +2 -2
- package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts +1 -1
- package/lib/typescript/contexts/suggestionsContext/SuggestionsContext.d.ts +6 -6
- package/lib/typescript/contexts/themeContext/ThemeContext.d.ts +5 -5
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +2 -2
- package/lib/typescript/contexts/threadContext/ThreadContext.d.ts +1 -1
- package/lib/typescript/contexts/translationContext/TranslationContext.d.ts +5 -5
- package/lib/typescript/contexts/typingContext/TypingContext.d.ts +1 -1
- package/lib/typescript/emoji-data/index.d.ts +2 -2
- package/lib/typescript/hooks/useAppStateListener.d.ts +1 -1
- package/lib/typescript/hooks/useStreami18n.d.ts +1 -1
- package/lib/typescript/hooks/useViewport.d.ts +1 -1
- package/lib/typescript/i18n/en.json +1 -1
- package/lib/typescript/i18n/es.json +56 -56
- package/lib/typescript/i18n/fr.json +56 -56
- package/lib/typescript/i18n/he.json +56 -56
- package/lib/typescript/i18n/hi.json +56 -56
- package/lib/typescript/i18n/it.json +56 -56
- package/lib/typescript/i18n/ja.json +56 -56
- package/lib/typescript/i18n/ko.json +56 -56
- package/lib/typescript/i18n/nl.json +56 -56
- package/lib/typescript/i18n/ru.json +56 -56
- package/lib/typescript/i18n/tr.json +56 -56
- package/lib/typescript/icons/ArrowRight.d.ts +2 -2
- package/lib/typescript/icons/AtMentions.d.ts +2 -2
- package/lib/typescript/icons/Attach.d.ts +2 -2
- package/lib/typescript/icons/Audio.d.ts +2 -2
- package/lib/typescript/icons/CSV.d.ts +2 -2
- package/lib/typescript/icons/Camera.d.ts +2 -2
- package/lib/typescript/icons/Check.d.ts +2 -2
- package/lib/typescript/icons/CheckAll.d.ts +2 -2
- package/lib/typescript/icons/CheckSend.d.ts +2 -2
- package/lib/typescript/icons/CircleClose.d.ts +2 -2
- package/lib/typescript/icons/CirclePlus.d.ts +2 -2
- package/lib/typescript/icons/CircleRight.d.ts +2 -2
- package/lib/typescript/icons/Close.d.ts +2 -2
- package/lib/typescript/icons/CurveLineLeftUp.d.ts +2 -2
- package/lib/typescript/icons/DOC.d.ts +2 -2
- package/lib/typescript/icons/DOCX.d.ts +2 -2
- package/lib/typescript/icons/Delete.d.ts +2 -2
- package/lib/typescript/icons/Down.d.ts +2 -2
- package/lib/typescript/icons/DownloadArrow.d.ts +2 -2
- package/lib/typescript/icons/DownloadCloud.d.ts +2 -2
- package/lib/typescript/icons/Edit.d.ts +2 -2
- package/lib/typescript/icons/Error.d.ts +2 -2
- package/lib/typescript/icons/Eye.d.ts +2 -2
- package/lib/typescript/icons/Flag.d.ts +2 -2
- package/lib/typescript/icons/Folder.d.ts +2 -2
- package/lib/typescript/icons/GenericFile.d.ts +2 -2
- package/lib/typescript/icons/GiphyIcon.d.ts +2 -2
- package/lib/typescript/icons/Grid.d.ts +2 -2
- package/lib/typescript/icons/Group.d.ts +2 -2
- package/lib/typescript/icons/HTML.d.ts +2 -2
- package/lib/typescript/icons/Imgur.d.ts +2 -2
- package/lib/typescript/icons/LOLReaction.d.ts +2 -2
- package/lib/typescript/icons/Lightning.d.ts +2 -2
- package/lib/typescript/icons/Link.d.ts +2 -2
- package/lib/typescript/icons/Loading.d.ts +1 -1
- package/lib/typescript/icons/Logo.d.ts +2 -2
- package/lib/typescript/icons/LoveReaction.d.ts +2 -2
- package/lib/typescript/icons/MD.d.ts +2 -2
- package/lib/typescript/icons/MailOpen.d.ts +2 -2
- package/lib/typescript/icons/MenuPointHorizontal.d.ts +2 -2
- package/lib/typescript/icons/MenuPointVertical.d.ts +2 -2
- package/lib/typescript/icons/MessageFlag.d.ts +2 -2
- package/lib/typescript/icons/MessageIcon.d.ts +2 -2
- package/lib/typescript/icons/Mute.d.ts +2 -2
- package/lib/typescript/icons/Notification.d.ts +2 -2
- package/lib/typescript/icons/ODT.d.ts +2 -2
- package/lib/typescript/icons/PDF.d.ts +2 -2
- package/lib/typescript/icons/PPT.d.ts +2 -2
- package/lib/typescript/icons/PPTX.d.ts +2 -2
- package/lib/typescript/icons/Pause.d.ts +2 -2
- package/lib/typescript/icons/Picture.d.ts +2 -2
- package/lib/typescript/icons/Pin.d.ts +2 -2
- package/lib/typescript/icons/PinHeader.d.ts +2 -2
- package/lib/typescript/icons/Play.d.ts +2 -2
- package/lib/typescript/icons/RAR.d.ts +2 -2
- package/lib/typescript/icons/RTF.d.ts +2 -2
- package/lib/typescript/icons/Recorder.d.ts +2 -2
- package/lib/typescript/icons/Refresh.d.ts +2 -2
- package/lib/typescript/icons/SEVEN_Z.d.ts +2 -2
- package/lib/typescript/icons/Search.d.ts +2 -2
- package/lib/typescript/icons/SendRight.d.ts +2 -2
- package/lib/typescript/icons/SendUp.d.ts +2 -2
- package/lib/typescript/icons/Share.d.ts +2 -2
- package/lib/typescript/icons/ShareRightArrow.d.ts +2 -2
- package/lib/typescript/icons/Smile.d.ts +2 -2
- package/lib/typescript/icons/Sound.d.ts +2 -2
- package/lib/typescript/icons/TAR.d.ts +2 -2
- package/lib/typescript/icons/TXT.d.ts +2 -2
- package/lib/typescript/icons/ThreadReply.d.ts +2 -2
- package/lib/typescript/icons/ThumbsDownReaction.d.ts +2 -2
- package/lib/typescript/icons/ThumbsUpReaction.d.ts +2 -2
- package/lib/typescript/icons/Time.d.ts +2 -2
- package/lib/typescript/icons/Unknown.d.ts +2 -2
- package/lib/typescript/icons/Unpin.d.ts +2 -2
- package/lib/typescript/icons/User.d.ts +2 -2
- package/lib/typescript/icons/UserAdd.d.ts +2 -2
- package/lib/typescript/icons/UserAdmin.d.ts +2 -2
- package/lib/typescript/icons/UserDelete.d.ts +2 -2
- package/lib/typescript/icons/UserMinus.d.ts +2 -2
- package/lib/typescript/icons/Video.d.ts +2 -2
- package/lib/typescript/icons/Warning.d.ts +2 -2
- package/lib/typescript/icons/WutReaction.d.ts +2 -2
- package/lib/typescript/icons/XLS.d.ts +2 -2
- package/lib/typescript/icons/XLSX.d.ts +2 -2
- package/lib/typescript/icons/ZIP.d.ts +2 -2
- package/lib/typescript/icons/utils/base.d.ts +5 -5
- package/lib/typescript/native.d.ts +26 -26
- package/lib/typescript/store/QuickSqliteClient.d.ts +1 -1
- package/lib/typescript/store/apis/upsertChannels.d.ts +2 -2
- package/lib/typescript/store/apis/upsertCidsForQuery.d.ts +2 -2
- package/lib/typescript/store/mappers/mapDateTimeToStorable.d.ts +1 -1
- package/lib/typescript/store/schema.d.ts +2 -2
- package/lib/typescript/store/sqlite-utils/appendOrderByClause.d.ts +1 -1
- package/lib/typescript/store/sqlite-utils/appendWhereCluase.d.ts +1 -1
- package/lib/typescript/store/sqlite-utils/createUpsertQuery.d.ts +1 -1
- package/lib/typescript/store/types.d.ts +8 -8
- package/lib/typescript/types/types.d.ts +7 -7
- package/lib/typescript/utils/StreamChatRN.d.ts +1 -1
- package/lib/typescript/utils/Streami18n.d.ts +2 -2
- package/lib/typescript/utils/compressImage.d.ts +1 -1
- package/lib/typescript/utils/getResizedImageUrl.d.ts +1 -1
- package/lib/typescript/utils/utils.d.ts +14 -14
- package/package.json +3 -7
- package/src/components/Channel/Channel.tsx +9 -3
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +11 -1
- package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +24 -6
- package/src/components/ChannelPreview/ChannelPreview.tsx +1 -1
- package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +3 -0
- package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +2 -3
- package/src/components/ChannelPreview/ChannelPreviewStatus.tsx +1 -3
- package/src/components/ChannelPreview/ChannelPreviewTitle.tsx +5 -12
- package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx +5 -4
- package/src/components/Message/Message.tsx +15 -1
- package/src/components/Message/MessageSimple/MessageContent.tsx +5 -0
- package/src/components/Message/MessageSimple/MessageSimple.tsx +8 -2
- package/src/components/MessageInput/MessageInput.tsx +3 -7
- package/src/components/MessageInput/hooks/useCountdown.ts +1 -1
- package/src/components/MessageList/MessageList.tsx +3 -1
- package/src/components/MessageOverlay/MessageActionListItem.tsx +16 -0
- package/src/contexts/channelsContext/ChannelsContext.tsx +1 -1
- package/src/contexts/chatContext/ChatContext.tsx +3 -0
- package/src/contexts/messageInputContext/MessageInputContext.tsx +1 -1
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +3 -0
- package/src/contexts/themeContext/ThemeContext.tsx +3 -3
- package/src/i18n/en.json +1 -1
- package/src/i18n/es.json +56 -56
- package/src/i18n/fr.json +56 -56
- package/src/i18n/he.json +56 -56
- package/src/i18n/hi.json +56 -56
- package/src/i18n/it.json +56 -56
- package/src/i18n/ja.json +56 -56
- package/src/i18n/ko.json +56 -56
- package/src/i18n/nl.json +56 -56
- package/src/i18n/ru.json +56 -56
- package/src/i18n/tr.json +56 -56
- package/src/icons/ArrowRight.tsx +1 -1
- package/src/icons/AtMentions.tsx +1 -1
- package/src/icons/Attach.tsx +1 -1
- package/src/icons/Audio.tsx +1 -1
- package/src/icons/CSV.tsx +1 -1
- package/src/icons/Camera.tsx +1 -1
- package/src/icons/Check.tsx +1 -1
- package/src/icons/CheckAll.tsx +1 -1
- package/src/icons/CheckSend.tsx +1 -1
- package/src/icons/CircleClose.tsx +1 -1
- package/src/icons/CirclePlus.tsx +1 -1
- package/src/icons/CircleRight.tsx +1 -1
- package/src/icons/Close.tsx +1 -1
- package/src/icons/Copy.tsx +1 -1
- package/src/icons/CurveLineLeftUp.tsx +1 -1
- package/src/icons/DOC.tsx +1 -1
- package/src/icons/DOCX.tsx +1 -1
- package/src/icons/Delete.tsx +1 -1
- package/src/icons/Down.tsx +1 -1
- package/src/icons/DownloadArrow.tsx +1 -1
- package/src/icons/DownloadCloud.tsx +1 -1
- package/src/icons/Edit.tsx +1 -1
- package/src/icons/Error.tsx +1 -1
- package/src/icons/Eye.tsx +1 -1
- package/src/icons/Flag.tsx +1 -1
- package/src/icons/Folder.tsx +1 -1
- package/src/icons/GenericFile.tsx +1 -1
- package/src/icons/GiphyIcon.tsx +1 -1
- package/src/icons/Grid.tsx +1 -1
- package/src/icons/Group.tsx +1 -1
- package/src/icons/HTML.tsx +1 -1
- package/src/icons/Imgur.tsx +1 -1
- package/src/icons/LOLReaction.tsx +1 -1
- package/src/icons/Lightning.tsx +1 -1
- package/src/icons/Link.tsx +1 -1
- package/src/icons/Logo.tsx +1 -1
- package/src/icons/LoveReaction.tsx +1 -1
- package/src/icons/MD.tsx +1 -1
- package/src/icons/MailOpen.tsx +1 -1
- package/src/icons/MenuPointHorizontal.tsx +1 -1
- package/src/icons/MenuPointVertical.tsx +1 -1
- package/src/icons/MessageFlag.tsx +1 -1
- package/src/icons/MessageIcon.tsx +1 -1
- package/src/icons/Mute.tsx +1 -1
- package/src/icons/Notification.tsx +1 -1
- package/src/icons/ODT.tsx +1 -1
- package/src/icons/PDF.tsx +1 -1
- package/src/icons/PPT.tsx +1 -1
- package/src/icons/PPTX.tsx +1 -1
- package/src/icons/Pause.tsx +1 -1
- package/src/icons/Picture.tsx +1 -1
- package/src/icons/Pin.tsx +1 -1
- package/src/icons/PinHeader.tsx +1 -1
- package/src/icons/Play.tsx +1 -1
- package/src/icons/RAR.tsx +1 -1
- package/src/icons/RTF.tsx +1 -1
- package/src/icons/Recorder.tsx +1 -1
- package/src/icons/Refresh.tsx +1 -1
- package/src/icons/SEVEN_Z.tsx +1 -1
- package/src/icons/Search.tsx +1 -1
- package/src/icons/SendRight.tsx +1 -1
- package/src/icons/SendUp.tsx +1 -1
- package/src/icons/Share.tsx +1 -1
- package/src/icons/ShareRightArrow.tsx +1 -1
- package/src/icons/Smile.tsx +1 -1
- package/src/icons/Sound.tsx +1 -1
- package/src/icons/TAR.tsx +1 -1
- package/src/icons/TXT.tsx +1 -1
- package/src/icons/ThreadReply.tsx +1 -1
- package/src/icons/ThumbsDownReaction.tsx +1 -1
- package/src/icons/ThumbsUpReaction.tsx +1 -1
- package/src/icons/Time.tsx +1 -1
- package/src/icons/Unknown.tsx +1 -1
- package/src/icons/Unpin.tsx +1 -1
- package/src/icons/User.tsx +1 -1
- package/src/icons/UserAdd.tsx +1 -1
- package/src/icons/UserAdmin.tsx +1 -1
- package/src/icons/UserDelete.tsx +1 -1
- package/src/icons/UserMinus.tsx +1 -1
- package/src/icons/Video.tsx +1 -1
- package/src/icons/Warning.tsx +1 -1
- package/src/icons/WutReaction.tsx +1 -1
- package/src/icons/XLS.tsx +1 -1
- package/src/icons/XLSX.tsx +1 -1
- package/src/icons/ZIP.tsx +1 -1
- package/src/icons/utils/base.tsx +2 -2
- package/src/version.json +1 -1
|
@@ -14,6 +14,7 @@ var useCreateInputMessageInputContext = function useCreateInputMessageInputConte
|
|
|
14
14
|
CommandsButton = _ref.CommandsButton,
|
|
15
15
|
compressImageQuality = _ref.compressImageQuality,
|
|
16
16
|
CooldownTimer = _ref.CooldownTimer,
|
|
17
|
+
disabled = _ref.disabled,
|
|
17
18
|
doDocUploadRequest = _ref.doDocUploadRequest,
|
|
18
19
|
doImageUploadRequest = _ref.doImageUploadRequest,
|
|
19
20
|
editing = _ref.editing,
|
|
@@ -59,6 +60,7 @@ var useCreateInputMessageInputContext = function useCreateInputMessageInputConte
|
|
|
59
60
|
CommandsButton: CommandsButton,
|
|
60
61
|
compressImageQuality: compressImageQuality,
|
|
61
62
|
CooldownTimer: CooldownTimer,
|
|
63
|
+
disabled: disabled,
|
|
62
64
|
doDocUploadRequest: doDocUploadRequest,
|
|
63
65
|
doImageUploadRequest: doImageUploadRequest,
|
|
64
66
|
editing: editing,
|
|
@@ -92,7 +94,7 @@ var useCreateInputMessageInputContext = function useCreateInputMessageInputConte
|
|
|
92
94
|
ShowThreadMessageInChannelButton: ShowThreadMessageInChannelButton,
|
|
93
95
|
UploadProgressIndicator: UploadProgressIndicator
|
|
94
96
|
};
|
|
95
|
-
}, [compressImageQuality, channelId, editingDep, initialValue, maxMessageLength, quotedMessageId]);
|
|
97
|
+
}, [compressImageQuality, channelId, disabled, editingDep, initialValue, maxMessageLength, quotedMessageId]);
|
|
96
98
|
return inputMessageInputContext;
|
|
97
99
|
};
|
|
98
100
|
exports.useCreateInputMessageInputContext = useCreateInputMessageInputContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","useCreateInputMessageInputContext","_ref","additionalTextInputProps","AttachButton","autoCompleteSuggestionsLimit","autoCompleteTriggerSettings","channelId","clearEditingState","clearQuotedMessageState","CommandsButton","compressImageQuality","CooldownTimer","doDocUploadRequest","doImageUploadRequest","editing","editMessage","emojiSearchIndex","FileUploadPreview","hasCommands","hasFilePicker","hasImagePicker","ImageUploadPreview","initialValue","Input","InputButtons","InputEditingStateHeader","InputGiphySearch","InputReplyStateHeader","maxMessageLength","maxNumberOfFiles","mentionAllAppUsersEnabled","mentionAllAppUsersQuery","MoreOptionsButton","numberOfLines","onChangeText","quotedMessage","SendButton","sendImageAsync","sendMessage","SendMessageDisallowedIndicator","setInputRef","setQuotedMessageState","ShowThreadMessageInChannelButton","UploadProgressIndicator","editingDep","id","quotedMessageId","inputMessageInputContext","useMemo","exports"],"sources":["useCreateInputMessageInputContext.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { InputMessageInputContextValue } from '../../../contexts/messageInputContext/MessageInputContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateInputMessageInputContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n additionalTextInputProps,\n AttachButton,\n autoCompleteSuggestionsLimit,\n autoCompleteTriggerSettings,\n channelId,\n clearEditingState,\n clearQuotedMessageState,\n CommandsButton,\n compressImageQuality,\n CooldownTimer,\n doDocUploadRequest,\n doImageUploadRequest,\n editing,\n editMessage,\n emojiSearchIndex,\n FileUploadPreview,\n hasCommands,\n hasFilePicker,\n hasImagePicker,\n ImageUploadPreview,\n initialValue,\n Input,\n InputButtons,\n InputEditingStateHeader,\n InputGiphySearch,\n InputReplyStateHeader,\n maxMessageLength,\n maxNumberOfFiles,\n mentionAllAppUsersEnabled,\n mentionAllAppUsersQuery,\n MoreOptionsButton,\n numberOfLines,\n onChangeText,\n quotedMessage,\n SendButton,\n sendImageAsync,\n sendMessage,\n SendMessageDisallowedIndicator,\n setInputRef,\n setQuotedMessageState,\n ShowThreadMessageInChannelButton,\n UploadProgressIndicator,\n}: InputMessageInputContextValue<StreamChatGenerics> & {\n /**\n * To ensure we allow re-render, when channel is changed\n */\n channelId?: string;\n}) => {\n const editingDep = typeof editing === 'boolean' ? editing : editing?.id;\n const quotedMessageId = quotedMessage\n ? typeof quotedMessage === 'boolean'\n ? ''\n : quotedMessage.id\n : '';\n\n const inputMessageInputContext: InputMessageInputContextValue<StreamChatGenerics> = useMemo(\n () => ({\n additionalTextInputProps,\n AttachButton,\n autoCompleteSuggestionsLimit,\n autoCompleteTriggerSettings,\n clearEditingState,\n clearQuotedMessageState,\n CommandsButton,\n compressImageQuality,\n CooldownTimer,\n doDocUploadRequest,\n doImageUploadRequest,\n editing,\n editMessage,\n emojiSearchIndex,\n FileUploadPreview,\n hasCommands,\n hasFilePicker,\n hasImagePicker,\n ImageUploadPreview,\n initialValue,\n Input,\n InputButtons,\n InputEditingStateHeader,\n InputGiphySearch,\n InputReplyStateHeader,\n maxMessageLength,\n maxNumberOfFiles,\n mentionAllAppUsersEnabled,\n mentionAllAppUsersQuery,\n MoreOptionsButton,\n numberOfLines,\n onChangeText,\n quotedMessage,\n SendButton,\n sendImageAsync,\n sendMessage,\n SendMessageDisallowedIndicator,\n setInputRef,\n setQuotedMessageState,\n ShowThreadMessageInChannelButton,\n UploadProgressIndicator,\n }),\n [compressImageQuality
|
|
1
|
+
{"version":3,"names":["_react","require","useCreateInputMessageInputContext","_ref","additionalTextInputProps","AttachButton","autoCompleteSuggestionsLimit","autoCompleteTriggerSettings","channelId","clearEditingState","clearQuotedMessageState","CommandsButton","compressImageQuality","CooldownTimer","disabled","doDocUploadRequest","doImageUploadRequest","editing","editMessage","emojiSearchIndex","FileUploadPreview","hasCommands","hasFilePicker","hasImagePicker","ImageUploadPreview","initialValue","Input","InputButtons","InputEditingStateHeader","InputGiphySearch","InputReplyStateHeader","maxMessageLength","maxNumberOfFiles","mentionAllAppUsersEnabled","mentionAllAppUsersQuery","MoreOptionsButton","numberOfLines","onChangeText","quotedMessage","SendButton","sendImageAsync","sendMessage","SendMessageDisallowedIndicator","setInputRef","setQuotedMessageState","ShowThreadMessageInChannelButton","UploadProgressIndicator","editingDep","id","quotedMessageId","inputMessageInputContext","useMemo","exports"],"sources":["useCreateInputMessageInputContext.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { InputMessageInputContextValue } from '../../../contexts/messageInputContext/MessageInputContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateInputMessageInputContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n additionalTextInputProps,\n AttachButton,\n autoCompleteSuggestionsLimit,\n autoCompleteTriggerSettings,\n channelId,\n clearEditingState,\n clearQuotedMessageState,\n CommandsButton,\n compressImageQuality,\n CooldownTimer,\n disabled,\n doDocUploadRequest,\n doImageUploadRequest,\n editing,\n editMessage,\n emojiSearchIndex,\n FileUploadPreview,\n hasCommands,\n hasFilePicker,\n hasImagePicker,\n ImageUploadPreview,\n initialValue,\n Input,\n InputButtons,\n InputEditingStateHeader,\n InputGiphySearch,\n InputReplyStateHeader,\n maxMessageLength,\n maxNumberOfFiles,\n mentionAllAppUsersEnabled,\n mentionAllAppUsersQuery,\n MoreOptionsButton,\n numberOfLines,\n onChangeText,\n quotedMessage,\n SendButton,\n sendImageAsync,\n sendMessage,\n SendMessageDisallowedIndicator,\n setInputRef,\n setQuotedMessageState,\n ShowThreadMessageInChannelButton,\n UploadProgressIndicator,\n}: InputMessageInputContextValue<StreamChatGenerics> & {\n /**\n * To ensure we allow re-render, when channel is changed\n */\n channelId?: string;\n}) => {\n const editingDep = typeof editing === 'boolean' ? editing : editing?.id;\n const quotedMessageId = quotedMessage\n ? typeof quotedMessage === 'boolean'\n ? ''\n : quotedMessage.id\n : '';\n\n const inputMessageInputContext: InputMessageInputContextValue<StreamChatGenerics> = useMemo(\n () => ({\n additionalTextInputProps,\n AttachButton,\n autoCompleteSuggestionsLimit,\n autoCompleteTriggerSettings,\n clearEditingState,\n clearQuotedMessageState,\n CommandsButton,\n compressImageQuality,\n CooldownTimer,\n disabled,\n doDocUploadRequest,\n doImageUploadRequest,\n editing,\n editMessage,\n emojiSearchIndex,\n FileUploadPreview,\n hasCommands,\n hasFilePicker,\n hasImagePicker,\n ImageUploadPreview,\n initialValue,\n Input,\n InputButtons,\n InputEditingStateHeader,\n InputGiphySearch,\n InputReplyStateHeader,\n maxMessageLength,\n maxNumberOfFiles,\n mentionAllAppUsersEnabled,\n mentionAllAppUsersQuery,\n MoreOptionsButton,\n numberOfLines,\n onChangeText,\n quotedMessage,\n SendButton,\n sendImageAsync,\n sendMessage,\n SendMessageDisallowedIndicator,\n setInputRef,\n setQuotedMessageState,\n ShowThreadMessageInChannelButton,\n UploadProgressIndicator,\n }),\n [\n compressImageQuality,\n channelId,\n disabled,\n editingDep,\n initialValue,\n maxMessageLength,\n quotedMessageId,\n ],\n );\n\n return inputMessageInputContext;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKO,IAAMC,iCAAiC,GAAG,SAApCA,iCAAiCA,CAAAC,IAAA,EAmDxC;EAAA,IAhDJC,wBAAwB,GAAAD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AAkB;MAClBC,oBAAoB,EAApBA,oBAAoB;MACpBC,OAAO,EAAPA,OAAO;MACPC,WAAW,EAAXA,WAAW;MACXC,gBAAgB,EAAhBA,gBAAgB;MAChBC,iBAAiB,EAAjBA,iBAAiB;MACjBC,WAAW,EAAXA,WAAW;MACXC,aAAa,EAAbA,aAAa;MACbC,cAAc,EAAdA,cAAc;MACdC,kBAAkB,EAAlBA,kBAAkB;MAClBC,YAAY,EAAZA,YAAY;MACZC,KAAK,EAALA,KAAK;MACLC,YAAY,EAAZA,YAAY;MACZC,uBAAuB,EAAvBA,uBAAuB;MACvBC,gBAAgB,EAAhBA,gBAAgB;MAChBC,qBAAqB,EAArBA,qBAAqB;MACrBC,gBAAgB,EAAhBA,gBAAgB;MAChBC,gBAAgB,EAAhBA,gBAAgB;MAChBC,yBAAyB,EAAzBA,yBAAyB;MACzBC,uBAAuB,EAAvBA,uBAAuB;MACvBC,iBAAiB,EAAjBA,iBAAiB;MACjBC,aAAa,EAAbA,aAAa;MACbC,YAAY,EAAZA,YAAY;MACZC,aAAa,EAAbA,aAAa;MACbC,UAAU,EAAVA,UAAU;MACVC,cAAc,EAAdA,cAAc;MACdC,WAAW,EAAXA,WAAW;MACXC,8BAA8B,EAA9BA,8BAA8B;MAC9BC,WAAW,EAAXA,WAAW;MACXC,qBAAqB,EAArBA,qBAAqB;MACrBC,gCAAgC,EAAhCA,gCAAgC;MAChCC,uBAAuB,EAAvBA;IACF,CAAC;EAAA,CAAC,EACF,CACElC,oBAAoB,EACpBJ,SAAS,EACTM,QAAQ,EACRiC,UAAU,EACVtB,YAAY,EACZM,gBAAgB,EAChBkB,eAAe,CAEnB,CAAC;EAED,OAAOC,wBAAwB;AACjC,CAAC;AAACE,OAAA,CAAAlD,iCAAA,GAAAA,iCAAA"}
|
|
@@ -5,23 +5,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
exports.useCreateOwnCapabilitiesContext = void 0;
|
|
6
6
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
7
|
var _extends3 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
9
|
var _react = require("react");
|
|
9
10
|
var _OwnCapabilitiesContext = require("../../../contexts/ownCapabilitiesContext/OwnCapabilitiesContext");
|
|
10
11
|
var useCreateOwnCapabilitiesContext = function useCreateOwnCapabilitiesContext(_ref) {
|
|
11
|
-
var _channel$data, _channel$
|
|
12
|
+
var _channel$data, _channel$data3;
|
|
12
13
|
var channel = _ref.channel,
|
|
13
14
|
overrideCapabilities = _ref.overrideCapabilities;
|
|
15
|
+
var _useState = (0, _react.useState)(JSON.stringify((_channel$data = channel.data) == null ? void 0 : _channel$data.own_capabilities)),
|
|
16
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
17
|
+
own_capabilities = _useState2[0],
|
|
18
|
+
setOwnCapabilites = _useState2[1];
|
|
14
19
|
var overrideCapabilitiesStr = overrideCapabilities ? JSON.stringify(Object.values(overrideCapabilities)) : null;
|
|
15
|
-
|
|
20
|
+
(0, _react.useEffect)(function () {
|
|
21
|
+
var _channel$data2;
|
|
22
|
+
setOwnCapabilites(JSON.stringify((_channel$data2 = channel.data) == null ? void 0 : _channel$data2.own_capabilities));
|
|
23
|
+
}, [(_channel$data3 = channel.data) == null ? void 0 : _channel$data3.own_capabilities]);
|
|
24
|
+
(0, _react.useEffect)(function () {
|
|
25
|
+
var listener = channel.on('capabilities.changed', function (event) {
|
|
26
|
+
if (event.own_capabilities) {
|
|
27
|
+
setOwnCapabilites(JSON.stringify(event.own_capabilities));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return function () {
|
|
31
|
+
listener.unsubscribe();
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
16
34
|
var ownCapabilitiesContext = (0, _react.useMemo)(function () {
|
|
17
|
-
var
|
|
18
|
-
var capabilities = (channel == null ? void 0 : (_channel$data3 = channel.data) == null ? void 0 : _channel$data3.own_capabilities) || [];
|
|
35
|
+
var capabilities = own_capabilities || [];
|
|
19
36
|
var ownCapabilitiesContext = Object.keys(_OwnCapabilitiesContext.allOwnCapabilities).reduce(function (result, capability) {
|
|
20
37
|
var _overrideCapabilities;
|
|
21
38
|
return (0, _extends3["default"])({}, result, (0, _defineProperty2["default"])({}, capability, (_overrideCapabilities = overrideCapabilities == null ? void 0 : overrideCapabilities[capability]) != null ? _overrideCapabilities : !!capabilities.includes(_OwnCapabilitiesContext.allOwnCapabilities[capability])));
|
|
22
39
|
}, {});
|
|
23
40
|
return ownCapabilitiesContext;
|
|
24
|
-
}, [channel.id, overrideCapabilitiesStr,
|
|
41
|
+
}, [channel.id, overrideCapabilitiesStr, own_capabilities]);
|
|
25
42
|
return ownCapabilitiesContext;
|
|
26
43
|
};
|
|
27
44
|
exports.useCreateOwnCapabilitiesContext = useCreateOwnCapabilitiesContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_OwnCapabilitiesContext","useCreateOwnCapabilitiesContext","_ref","_channel$data","_channel$
|
|
1
|
+
{"version":3,"names":["_react","require","_OwnCapabilitiesContext","useCreateOwnCapabilitiesContext","_ref","_channel$data","_channel$data3","channel","overrideCapabilities","_useState","useState","JSON","stringify","data","own_capabilities","_useState2","_slicedToArray2","setOwnCapabilites","overrideCapabilitiesStr","Object","values","useEffect","_channel$data2","listener","on","event","unsubscribe","ownCapabilitiesContext","useMemo","capabilities","keys","allOwnCapabilities","reduce","result","capability","_overrideCapabilities","_extends3","_defineProperty2","includes","id","exports"],"sources":["useCreateOwnCapabilitiesContext.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\n\nimport type { Channel } from 'stream-chat';\n\nimport {\n allOwnCapabilities,\n OwnCapabilitiesContextValue,\n OwnCapability,\n} from '../../../contexts/ownCapabilitiesContext/OwnCapabilitiesContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateOwnCapabilitiesContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n channel,\n overrideCapabilities,\n}: {\n channel: Channel<StreamChatGenerics>;\n overrideCapabilities?: Partial<OwnCapabilitiesContextValue>;\n}) => {\n const [own_capabilities, setOwnCapabilites] = useState(\n JSON.stringify(channel.data?.own_capabilities as Array<string>),\n );\n const overrideCapabilitiesStr = overrideCapabilities\n ? JSON.stringify(Object.values(overrideCapabilities))\n : null;\n\n // Effect to watch for changes in channel.data?.own_capabilities and update the own_capabilties state accordingly.\n useEffect(() => {\n setOwnCapabilites(JSON.stringify(channel.data?.own_capabilities as Array<string>));\n }, [channel.data?.own_capabilities]);\n\n // Effect to listen to the `capabilities.changed` event.\n useEffect(() => {\n const listener = channel.on('capabilities.changed', (event) => {\n if (event.own_capabilities) {\n setOwnCapabilites(JSON.stringify(event.own_capabilities as Array<string>));\n }\n });\n\n return () => {\n listener.unsubscribe();\n };\n }, []);\n\n const ownCapabilitiesContext: OwnCapabilitiesContextValue = useMemo(() => {\n const capabilities = (own_capabilities || []) as Array<string>;\n const ownCapabilitiesContext = Object.keys(allOwnCapabilities).reduce(\n (result, capability) => ({\n ...result,\n [capability]:\n overrideCapabilities?.[capability as OwnCapability] ??\n !!capabilities.includes(allOwnCapabilities[capability as OwnCapability]),\n }),\n {} as OwnCapabilitiesContextValue,\n );\n\n return ownCapabilitiesContext;\n }, [channel.id, overrideCapabilitiesStr, own_capabilities]);\n\n return ownCapabilitiesContext;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,uBAAA,GAAAD,OAAA;AAOO,IAAME,+BAA+B,GAAG,SAAlCA,+BAA+BA,CAAAC,IAAA,EAQtC;EAAA,IAAAC,aAAA,EAAAC,cAAA;EAAA,IALJC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,oBAAoB,GAAAJ,IAAA,CAApBI,oBA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AAA;MAAA,WAAAC,SAAA,iBACdH,MAAM,MAAAI,gBAAA,iBACRH,UAAU,GAAAC,qBAAA,GACT3B,oBAAoB,oBAApBA,oBAAoB,CAAG0B,UAAU,CAAkB,YAAAC,qBAAA,GACnD,CAAC,CAACN,YAAY,CAACS,QAAQ,CAACP,0CAAkB,CAACG,UAAU,CAAkB,CAAC;IAAA,CAC1E,EACF,CAAC,CACH,CAAC;IAED,OAAOP,sBAAsB;EAC/B,CAAC,EAAE,CAACpB,OAAO,CAACgC,EAAE,EAAErB,uBAAuB,EAAEJ,gBAAgB,CAAC,CAAC;EAE3D,OAAOa,sBAAsB;AAC/B,CAAC;AAACa,OAAA,CAAArC,+BAAA,GAAAA,+BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_useLatestMessagePreview","_ChannelsContext","_ChatContext","_useTranslatedMessage","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChannelPreviewWithContext","props","channel","client","channelListForceUpdate","forceUpdate","Preview","_useState","useState","state","messages","length","_useState2","_slicedToArray2","lastMessage","setLastMessage","translatedLastMessage","useTranslatedMessage","_useState3","_useState4","setForceUpdate","_useState5","countUnread","_useState6","unread","setUnread","latestMessagePreview","useLatestMessagePreview","channelLastMessage","channelLastMessageString","id","updated_at","useEffect","_client$on","on","unsubscribe","newUnreadCount","handleNewMessageEvent","event","message","parent_id","show_in_channel","handleUpdatedOrDeletedMessage","prevLastMessage","_event$message","listeners","forEach","l","handleReadEvent","_event$user","_event$user2","user","userID","prev","listener","createElement","__self","__source","fileName","lineNumber","columnNumber","ChannelPreview","_useChatContext","useChatContext","_useChannelsContext","useChannelsContext","_extends2","exports"],"sources":["ChannelPreview.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport type { Channel, ChannelState, Event, MessageResponse } from 'stream-chat';\n\nimport { useLatestMessagePreview } from './hooks/useLatestMessagePreview';\n\nimport {\n ChannelsContextValue,\n useChannelsContext,\n} from '../../contexts/channelsContext/ChannelsContext';\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\n\nimport { useTranslatedMessage } from '../../hooks/useTranslatedMessage';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nexport type ChannelPreviewPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Pick<ChannelsContextValue<StreamChatGenerics>, 'Preview' | 'forceUpdate'> & {\n /**\n * The previewed channel\n */\n channel: Channel<StreamChatGenerics>;\n };\n\n/**\n * This component manages state for the ChannelPreviewMessenger UI component and receives\n * all props from the ChannelListMessenger component.\n */\nconst ChannelPreviewWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewPropsWithContext<StreamChatGenerics>,\n) => {\n const { channel, client, forceUpdate: channelListForceUpdate, Preview } = props;\n\n const [lastMessage, setLastMessage] = useState<\n | ReturnType<ChannelState<StreamChatGenerics>['formatMessage']>\n | MessageResponse<StreamChatGenerics>\n | undefined\n >(channel.state.messages[channel.state.messages.length - 1]);\n\n const translatedLastMessage = useTranslatedMessage<StreamChatGenerics>(\n lastMessage || ({} as MessageResponse<StreamChatGenerics>),\n );\n\n const [forceUpdate, setForceUpdate] = useState(0);\n const [unread, setUnread] = useState(channel.countUnread());\n\n const latestMessagePreview = useLatestMessagePreview(channel, forceUpdate, translatedLastMessage);\n\n const channelLastMessage = channel.lastMessage();\n const channelLastMessageString = `${channelLastMessage?.id}${channelLastMessage?.updated_at}`;\n\n useEffect(() => {\n const { unsubscribe } = client.on('notification.mark_read', () => {\n setUnread(channel.countUnread());\n });\n return unsubscribe;\n }, []);\n\n useEffect(() => {\n if (\n channelLastMessage &&\n (channelLastMessage.id !== lastMessage?.id ||\n channelLastMessage.updated_at !== lastMessage?.updated_at)\n ) {\n setLastMessage(channelLastMessage);\n }\n\n const newUnreadCount = channel.countUnread();\n setUnread(newUnreadCount);\n }, [channelLastMessageString, channelListForceUpdate]);\n\n useEffect(() => {\n const handleNewMessageEvent = (event: Event<StreamChatGenerics>) => {\n const message = event.message;\n if (message && (!message.parent_id || message.show_in_channel)) {\n setLastMessage(event.message);\n setUnread(channel.countUnread());\n }\n };\n\n const handleUpdatedOrDeletedMessage = (event: Event<StreamChatGenerics>) => {\n setLastMessage((prevLastMessage) => {\n if (prevLastMessage?.id === event.message?.id) {\n return event.message;\n }\n return prevLastMessage;\n });\n };\n\n const listeners = [\n channel.on('message.new', handleNewMessageEvent),\n channel.on('message.updated', handleUpdatedOrDeletedMessage),\n channel.on('message.deleted', handleUpdatedOrDeletedMessage),\n ];\n\n return () => listeners.forEach((l) => l.unsubscribe());\n }, []);\n\n useEffect(() => {\n const handleReadEvent = (event: Event<StreamChatGenerics>) => {\n if (event.user?.id === client.userID) {\n setUnread(0);\n } else if (event.user?.id) {\n setForceUpdate((prev) => prev + 1);\n }\n };\n\n const listener = channel.on('message.read', handleReadEvent);\n return () => listener.unsubscribe();\n }, []);\n\n return <Preview channel={channel} latestMessagePreview={latestMessagePreview} unread={unread} />;\n};\n\nexport type ChannelPreviewProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<Omit<ChannelPreviewPropsWithContext<StreamChatGenerics>, 'channel'>> &\n Pick<ChannelPreviewPropsWithContext<StreamChatGenerics>, 'channel'>;\n\nexport const ChannelPreview = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewProps<StreamChatGenerics>,\n) => {\n const { client } = useChatContext<StreamChatGenerics>();\n const { forceUpdate, Preview } = useChannelsContext<StreamChatGenerics>();\n\n return <ChannelPreviewWithContext {...{ client, for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CAACjD,OAAO;IAACJ,OAAO,EAAEA,OAAQ;IAACwB,oBAAoB,EAAEA,oBAAqB;IAACF,MAAM,EAAEA,MAAO;IAAAgC,MAAA,EAAAhF,KAAA;IAAAiF,QAAA;MAAAC,QAAA,EAAAjF,YAAA;MAAAkF,UAAA;MAAAC,YAAA;IAAA;EAAA,CAAE,CAAC;AAClG,CAAC;AAOM,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAGzB5D,KAA8C,EAC3C;EACH,IAAA6D,eAAA,GAAmB,IAAAC,2BAAc,EAAqB,CAAC;IAA/C5D,MAAM,GAAA2D,eAAA,CAAN3D,MAAM;EACd,IAAA6D,mBAAA,GAAiC,IAAAC,mCAAkB,EAAqB,CAAC;IAAjE5D,WAAW,GAAA2D,mBAAA,CAAX3D,WAAW;IAAEC,OAAO,GAAA0D,mBAAA,CAAP1D,OAAO;EAE5B,OAAOrC,MAAA,YAAAsF,aAAA,CAACvD,yBAAyB,MAAAkE,SAAA;IAAO/D,MAAM,EAANA,MAAM;IAAEE,WAAW,EAAXA,WAAW;IAAEC,OAAO,EAAPA;EAAO,GAAQL,KAAK;IAAAuD,MAAA,EAAAhF,KAAA;IAAAiF,QAAA;MAAAC,QAAA,EAAAjF,YAAA;MAAAkF,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAG,CAAC;AACvF,CAAC;AAACO,OAAA,CAAAN,cAAA,GAAAA,cAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_useLatestMessagePreview","_ChannelsContext","_ChatContext","_useTranslatedMessage","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChannelPreviewWithContext","props","channel","client","channelListForceUpdate","forceUpdate","Preview","_useState","useState","state","messages","length","_useState2","_slicedToArray2","lastMessage","setLastMessage","translatedLastMessage","useTranslatedMessage","_useState3","_useState4","setForceUpdate","_useState5","countUnread","_useState6","unread","setUnread","latestMessagePreview","useLatestMessagePreview","channelLastMessage","channelLastMessageString","id","updated_at","useEffect","_client$on","on","unsubscribe","newUnreadCount","handleNewMessageEvent","event","message","parent_id","show_in_channel","handleUpdatedOrDeletedMessage","prevLastMessage","_event$message","listeners","forEach","l","handleReadEvent","_event$user","_event$user2","user","userID","prev","listener","createElement","__self","__source","fileName","lineNumber","columnNumber","ChannelPreview","_useChatContext","useChatContext","_useChannelsContext","useChannelsContext","_extends2","exports"],"sources":["ChannelPreview.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport type { Channel, ChannelState, Event, MessageResponse } from 'stream-chat';\n\nimport { useLatestMessagePreview } from './hooks/useLatestMessagePreview';\n\nimport {\n ChannelsContextValue,\n useChannelsContext,\n} from '../../contexts/channelsContext/ChannelsContext';\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\n\nimport { useTranslatedMessage } from '../../hooks/useTranslatedMessage';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nexport type ChannelPreviewPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Pick<ChannelsContextValue<StreamChatGenerics>, 'Preview' | 'forceUpdate'> & {\n /**\n * Instance of Channel from stream-chat package.\n */\n channel: Channel<StreamChatGenerics>;\n };\n\n/**\n * This component manages state for the ChannelPreviewMessenger UI component and receives\n * all props from the ChannelListMessenger component.\n */\nconst ChannelPreviewWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewPropsWithContext<StreamChatGenerics>,\n) => {\n const { channel, client, forceUpdate: channelListForceUpdate, Preview } = props;\n\n const [lastMessage, setLastMessage] = useState<\n | ReturnType<ChannelState<StreamChatGenerics>['formatMessage']>\n | MessageResponse<StreamChatGenerics>\n | undefined\n >(channel.state.messages[channel.state.messages.length - 1]);\n\n const translatedLastMessage = useTranslatedMessage<StreamChatGenerics>(\n lastMessage || ({} as MessageResponse<StreamChatGenerics>),\n );\n\n const [forceUpdate, setForceUpdate] = useState(0);\n const [unread, setUnread] = useState(channel.countUnread());\n\n const latestMessagePreview = useLatestMessagePreview(channel, forceUpdate, translatedLastMessage);\n\n const channelLastMessage = channel.lastMessage();\n const channelLastMessageString = `${channelLastMessage?.id}${channelLastMessage?.updated_at}`;\n\n useEffect(() => {\n const { unsubscribe } = client.on('notification.mark_read', () => {\n setUnread(channel.countUnread());\n });\n return unsubscribe;\n }, []);\n\n useEffect(() => {\n if (\n channelLastMessage &&\n (channelLastMessage.id !== lastMessage?.id ||\n channelLastMessage.updated_at !== lastMessage?.updated_at)\n ) {\n setLastMessage(channelLastMessage);\n }\n\n const newUnreadCount = channel.countUnread();\n setUnread(newUnreadCount);\n }, [channelLastMessageString, channelListForceUpdate]);\n\n useEffect(() => {\n const handleNewMessageEvent = (event: Event<StreamChatGenerics>) => {\n const message = event.message;\n if (message && (!message.parent_id || message.show_in_channel)) {\n setLastMessage(event.message);\n setUnread(channel.countUnread());\n }\n };\n\n const handleUpdatedOrDeletedMessage = (event: Event<StreamChatGenerics>) => {\n setLastMessage((prevLastMessage) => {\n if (prevLastMessage?.id === event.message?.id) {\n return event.message;\n }\n return prevLastMessage;\n });\n };\n\n const listeners = [\n channel.on('message.new', handleNewMessageEvent),\n channel.on('message.updated', handleUpdatedOrDeletedMessage),\n channel.on('message.deleted', handleUpdatedOrDeletedMessage),\n ];\n\n return () => listeners.forEach((l) => l.unsubscribe());\n }, []);\n\n useEffect(() => {\n const handleReadEvent = (event: Event<StreamChatGenerics>) => {\n if (event.user?.id === client.userID) {\n setUnread(0);\n } else if (event.user?.id) {\n setForceUpdate((prev) => prev + 1);\n }\n };\n\n const listener = channel.on('message.read', handleReadEvent);\n return () => listener.unsubscribe();\n }, []);\n\n return <Preview channel={channel} latestMessagePreview={latestMessagePreview} unread={unread} />;\n};\n\nexport type ChannelPreviewProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<Omit<ChannelPreviewPropsWithContext<StreamChatGenerics>, 'channel'>> &\n Pick<ChannelPreviewPropsWithContext<StreamChatGenerics>, 'channel'>;\n\nexport const ChannelPreview = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewProps<StreamChatGenerics>,\n) => {\n const { client } = useChatContext<StreamChatGenerics>();\n const { forceUpdate, Preview } = useChannelsContext<StreamChatGenerics>();\n\n return <ChannelPreviewWithContext {...{ client, forceUpdate, Preview }} {...props} />;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,wBAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAF,OAAA;AAIA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,qBAAA,GAAAJ,OAAA;AAAwE,IAAAK,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IA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CAAC;AACvF,CAAC;AAACO,OAAA,CAAAN,cAAA,GAAAA,cAAA"}
|
|
@@ -32,7 +32,7 @@ var ChannelPreviewMessage = function ChannelPreviewMessage(props) {
|
|
|
32
32
|
__self: _this,
|
|
33
33
|
__source: {
|
|
34
34
|
fileName: _jsxFileName,
|
|
35
|
-
lineNumber:
|
|
35
|
+
lineNumber: 42,
|
|
36
36
|
columnNumber: 5
|
|
37
37
|
}
|
|
38
38
|
}, latestMessagePreview == null ? void 0 : (_latestMessagePreview = latestMessagePreview.previews) == null ? void 0 : _latestMessagePreview.map(function (preview, index) {
|
|
@@ -44,7 +44,7 @@ var ChannelPreviewMessage = function ChannelPreviewMessage(props) {
|
|
|
44
44
|
__self: _this,
|
|
45
45
|
__source: {
|
|
46
46
|
fileName: _jsxFileName,
|
|
47
|
-
lineNumber:
|
|
47
|
+
lineNumber: 46,
|
|
48
48
|
columnNumber: 13
|
|
49
49
|
}
|
|
50
50
|
}, preview.text);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ThemeContext","_this","_jsxFileName","styles","StyleSheet","create","bold","fontWeight","message","flexShrink","fontSize","ChannelPreviewMessage","props","_latestMessagePreview","latestMessagePreview","_useTheme","useTheme","_useTheme$theme","theme","channelPreview","grey","colors","createElement","Text","numberOfLines","style","color","__self","__source","fileName","lineNumber","columnNumber","previews","map","preview","index","text","key","exports"],"sources":["ChannelPreviewMessage.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, Text } from 'react-native';\n\nimport type { LatestMessagePreview } from './hooks/useLatestMessagePreview';\n\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n bold: { fontWeight: '600' },\n message: {\n flexShrink: 1,\n fontSize: 12,\n },\n});\n\nexport type ChannelPreviewMessageProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n latestMessagePreview: LatestMessagePreview<StreamChatGenerics>;\n};\n\nexport const ChannelPreviewMessage = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewMessageProps<StreamChatGenerics>,\n) => {\n const { latestMessagePreview } = props;\n\n const {\n theme: {\n channelPreview: { message },\n colors: { grey },\n },\n } = useTheme();\n\n return (\n <Text numberOfLines={1} style={[styles.message, { color: grey }, message]}>\n {latestMessagePreview?.previews?.map(\n (preview, index) =>\n preview.text && (\n <Text\n key={`${preview.text}_${index}`}\n style={[{ color: grey }, preview.bold ? styles.bold : {}, message]}\n >\n {preview.text}\n </Text>\n ),\n )}\n </Text>\n );\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,aAAA,GAAAF,OAAA;AAAoE,IAAAG,KAAA;EAAAC,YAAA;AAIpE,IAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,IAAI,EAAE;IAAEC,UAAU,EAAE;EAAM,CAAC;EAC3BC,OAAO,EAAE;IACPC,UAAU,EAAE,CAAC;IACbC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ThemeContext","_this","_jsxFileName","styles","StyleSheet","create","bold","fontWeight","message","flexShrink","fontSize","ChannelPreviewMessage","props","_latestMessagePreview","latestMessagePreview","_useTheme","useTheme","_useTheme$theme","theme","channelPreview","grey","colors","createElement","Text","numberOfLines","style","color","__self","__source","fileName","lineNumber","columnNumber","previews","map","preview","index","text","key","exports"],"sources":["ChannelPreviewMessage.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, Text } from 'react-native';\n\nimport type { LatestMessagePreview } from './hooks/useLatestMessagePreview';\n\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n bold: { fontWeight: '600' },\n message: {\n flexShrink: 1,\n fontSize: 12,\n },\n});\n\nexport type ChannelPreviewMessageProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Latest message on a channel, formatted for preview.\n */\n latestMessagePreview: LatestMessagePreview<StreamChatGenerics>;\n};\n\nexport const ChannelPreviewMessage = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewMessageProps<StreamChatGenerics>,\n) => {\n const { latestMessagePreview } = props;\n\n const {\n theme: {\n channelPreview: { message },\n colors: { grey },\n },\n } = useTheme();\n\n return (\n <Text numberOfLines={1} style={[styles.message, { color: grey }, message]}>\n {latestMessagePreview?.previews?.map(\n (preview, index) =>\n preview.text && (\n <Text\n key={`${preview.text}_${index}`}\n style={[{ color: grey }, preview.bold ? styles.bold : {}, message]}\n >\n {preview.text}\n </Text>\n ),\n )}\n </Text>\n );\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,aAAA,GAAAF,OAAA;AAAoE,IAAAG,KAAA;EAAAC,YAAA;AAIpE,IAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,IAAI,EAAE;IAAEC,UAAU,EAAE;EAAM,CAAC;EAC3BC,OAAO,EAAE;IACPC,UAAU,EAAE,CAAC;IACbC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAWK,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAGhCC,KAAqD,EAClD;EAAA,IAAAC,qBAAA;EACH,IAAQC,oBAAoB,GAAKF,KAAK,CAA9BE,oBAAoB;EAE5B,IAAAC,SAAA,GAKI,IAAAC,sBAAQ,EAAC,CAAC;IAAAC,eAAA,GAAAF,SAAA,CAJZG,KAAK;IACeV,OAAO,GAAAS,eAAA,CAAzBE,cAAc,CAAIX,OAAO;IACfY,IAAI,GAAAH,eAAA,CAAdI,MAAM,CAAID,IAAI;EAIlB,OACExB,MAAA,YAAA0B,aAAA,CAACvB,YAAA,CAAAwB,IAAI;IAACC,aAAa,EAAE,CAAE;IAACC,KAAK,EAAE,CAACtB,MAAM,CAACK,OAAO,EAAE;MAAEkB,KAAK,EAAEN;IAAK,CAAC,EAAEZ,OAAO,CAAE;IAAAmB,MAAA,EAAA1B,KAAA;IAAA2B,QAAA;MAAAC,QAAA,EAAA3B,YAAA;MAAA4B,UAAA;MAAAC,YAAA;IAAA;EAAA,GACvEjB,oBAAoB,qBAAAD,qBAAA,GAApBC,oBAAoB,CAAEkB,QAAQ,qBAA9BnB,qBAAA,CAAgCoB,GAAG,CAClC,UAACC,OAAO,EAAEC,KAAK;IAAA,OACbD,OAAO,CAACE,IAAI,IACVxC,MAAA,YAAA0B,aAAA,CAACvB,YAAA,CAAAwB,IAAI;MACHc,GAAG,EAAKH,OAAO,CAACE,IAAI,SAAID,KAAQ;MAChCV,KAAK,EAAE,CAAC;QAAEC,KAAK,EAAEN;MAAK,CAAC,EAAEc,OAAO,CAAC5B,IAAI,GAAGH,MAAM,CAACG,IAAI,GAAG,CAAC,CAAC,EAAEE,OAAO,CAAE;MAAAmB,MAAA,EAAA1B,KAAA;MAAA2B,QAAA;QAAAC,QAAA,EAAA3B,YAAA;QAAA4B,UAAA;QAAAC,YAAA;MAAA;IAAA,GAElEG,OAAO,CAACE,IACL,CACP;EAAA,CACL,CACI,CAAC;AAEX,CAAC;AAACE,OAAA,CAAA3B,qBAAA,GAAAA,qBAAA"}
|
|
@@ -144,7 +144,6 @@ var ChannelPreviewMessengerWithContext = function ChannelPreviewMessengerWithCon
|
|
|
144
144
|
columnNumber: 9
|
|
145
145
|
}
|
|
146
146
|
}, _react["default"].createElement(PreviewTitle, {
|
|
147
|
-
channel: channel,
|
|
148
147
|
displayName: displayName,
|
|
149
148
|
__self: _this,
|
|
150
149
|
__source: {
|
|
@@ -168,7 +167,6 @@ var ChannelPreviewMessengerWithContext = function ChannelPreviewMessengerWithCon
|
|
|
168
167
|
columnNumber: 32
|
|
169
168
|
}
|
|
170
169
|
}), _react["default"].createElement(PreviewUnreadCount, {
|
|
171
|
-
channel: channel,
|
|
172
170
|
maxUnreadCount: maxUnreadCount,
|
|
173
171
|
unread: unread,
|
|
174
172
|
__self: _this,
|
|
@@ -194,7 +192,6 @@ var ChannelPreviewMessengerWithContext = function ChannelPreviewMessengerWithCon
|
|
|
194
192
|
columnNumber: 11
|
|
195
193
|
}
|
|
196
194
|
}), _react["default"].createElement(PreviewStatus, {
|
|
197
|
-
channel: channel,
|
|
198
195
|
formatLatestMessageDate: formatLatestMessageDate,
|
|
199
196
|
latestMessagePreview: latestMessagePreview,
|
|
200
197
|
__self: _this,
|
|
@@ -229,7 +226,7 @@ var ChannelPreviewMessenger = function ChannelPreviewMessenger(props) {
|
|
|
229
226
|
__self: _this,
|
|
230
227
|
__source: {
|
|
231
228
|
fileName: _jsxFileName,
|
|
232
|
-
lineNumber:
|
|
229
|
+
lineNumber: 223,
|
|
233
230
|
columnNumber: 5
|
|
234
231
|
}
|
|
235
232
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeGestureHandler","_ChannelAvatar","_ChannelPreviewMessage","_ChannelPreviewMutedStatus","_ChannelPreviewStatus","_ChannelPreviewTitle","_ChannelPreviewUnreadCount","_useChannelPreviewDisplayName","_ChannelsContext","_ChatContext","_ThemeContext","_useViewport2","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","styles","StyleSheet","create","container","borderBottomWidth","flex","flexDirection","paddingHorizontal","paddingVertical","contentContainer","row","alignItems","justifyContent","paddingLeft","statusContainer","display","title","fontSize","fontWeight","ChannelPreviewMessengerWithContext","props","channel","formatLatestMessageDate","latestMessagePreview","maxUnreadCount","onSelect","_props$PreviewAvatar","PreviewAvatar","ChannelAvatar","_props$PreviewMessage","PreviewMessage","ChannelPreviewMessage","_props$PreviewStatus","PreviewStatus","ChannelPreviewStatus","_props$PreviewTitle","PreviewTitle","ChannelPreviewTitle","_props$PreviewUnreadC","PreviewUnreadCount","ChannelPreviewUnreadCount","_props$PreviewMutedSt","PreviewMutedStatus","ChannelPreviewMutedStatus","unread","_useViewport","useViewport","vw","maxWidth","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$chann","channelPreview","_useTheme$theme$color","colors","border","white_snow","_useChatContext","useChatContext","client","displayName","useChannelPreviewDisplayName","Math","floor","_useState","useState","muteStatus","muted","_useState2","_slicedToArray2","isChannelMuted","setIsChannelMuted","useEffect","handleEvent","on","off","createElement","TouchableOpacity","onPress","style","backgroundColor","borderBottomColor","testID","__self","__source","fileName","lineNumber","columnNumber","View","id","MemoizedChannelPreviewMessengerWithContext","React","memo","ChannelPreviewMessenger","_useChannelsContext","useChannelsContext","_extends2","exports"],"sources":["ChannelPreviewMessenger.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { TouchableOpacity } from 'react-native-gesture-handler';\n\nimport { ChannelAvatar } from './ChannelAvatar';\nimport type { ChannelPreviewProps } from './ChannelPreview';\nimport { ChannelPreviewMessage } from './ChannelPreviewMessage';\nimport { ChannelPreviewMutedStatus } from './ChannelPreviewMutedStatus';\nimport { ChannelPreviewStatus } from './ChannelPreviewStatus';\nimport { ChannelPreviewTitle } from './ChannelPreviewTitle';\nimport { ChannelPreviewUnreadCount } from './ChannelPreviewUnreadCount';\nimport { useChannelPreviewDisplayName } from './hooks/useChannelPreviewDisplayName';\n\nimport type { LatestMessagePreview } from './hooks/useLatestMessagePreview';\n\nimport {\n ChannelsContextValue,\n useChannelsContext,\n} from '../../contexts/channelsContext/ChannelsContext';\nimport { useChatContext } from '../../contexts/chatContext/ChatContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { useViewport } from '../../hooks/useViewport';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n container: {\n borderBottomWidth: 1,\n flex: 1,\n flexDirection: 'row',\n paddingHorizontal: 8,\n paddingVertical: 12,\n },\n contentContainer: { flex: 1 },\n row: {\n alignItems: 'center',\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingLeft: 8,\n },\n statusContainer: {\n display: 'flex',\n flexDirection: 'row',\n },\n title: { fontSize: 14, fontWeight: '700' },\n});\n\nexport type ChannelPreviewMessengerPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChannelPreviewProps<StreamChatGenerics>, 'channel'> &\n Pick<\n ChannelsContextValue<StreamChatGenerics>,\n | 'maxUnreadCount'\n | 'onSelect'\n | 'PreviewAvatar'\n | 'PreviewMessage'\n | 'PreviewMutedStatus'\n | 'PreviewStatus'\n | 'PreviewTitle'\n | 'PreviewUnreadCount'\n > & {\n /**\n * Latest message on a channel, formatted for preview\n *\n * e.g.,\n *\n * ```json\n * {\n * created_at: '' ,\n * messageObject: { ... },\n * previews: {\n * bold: true,\n * text: 'This is the message preview text'\n * },\n * status: 0 | 1 | 2 // read states of the latest message.\n * }\n * ```\n *\n * The read status is either of the following:\n *\n * 0: The message was not sent by the current user\n * 1: The message was sent by the current user and is unread\n * 2: The message was sent by the current user and is read\n *\n * @overrideType object\n */\n latestMessagePreview: LatestMessagePreview<StreamChatGenerics>;\n /**\n * Formatter function for date of latest message.\n * @param date Message date\n * @returns Formatted date string\n *\n * By default today's date is shown in 'HH:mm A' format and other dates\n * are displayed in 'DD/MM/YY' format. props.latestMessage.created_at is the\n * default formatted date. This default logic is part of ChannelPreview component.\n */\n formatLatestMessageDate?: (date: Date) => string;\n /** Number of unread messages on the channel */\n unread?: number;\n };\n\nconst ChannelPreviewMessengerWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n channel,\n formatLatestMessageDate,\n latestMessagePreview,\n maxUnreadCount,\n onSelect,\n PreviewAvatar = ChannelAvatar,\n PreviewMessage = ChannelPreviewMessage,\n PreviewStatus = ChannelPreviewStatus,\n PreviewTitle = ChannelPreviewTitle,\n PreviewUnreadCount = ChannelPreviewUnreadCount,\n PreviewMutedStatus = ChannelPreviewMutedStatus,\n unread,\n } = props;\n const { vw } = useViewport();\n\n const maxWidth = vw(80) - 16 - 40;\n\n const {\n theme: {\n channelPreview: { container, contentContainer, row, title },\n colors: { border, white_snow },\n },\n } = useTheme();\n\n const { client } = useChatContext<StreamChatGenerics>();\n\n const displayName = useChannelPreviewDisplayName(\n channel,\n Math.floor(maxWidth / ((title.fontSize || styles.title.fontSize) / 2)),\n );\n\n const [isChannelMuted, setIsChannelMuted] = useState(() => channel.muteStatus().muted);\n\n useEffect(() => {\n const handleEvent = () => setIsChannelMuted(channel.muteStatus().muted);\n\n client.on('notification.channel_mutes_updated', handleEvent);\n return () => client.off('notification.channel_mutes_updated', handleEvent);\n }, [client]);\n\n return (\n <TouchableOpacity\n onPress={() => {\n if (onSelect) {\n onSelect(channel);\n }\n }}\n style={[\n styles.container,\n { backgroundColor: white_snow, borderBottomColor: border },\n container,\n ]}\n testID='channel-preview-button'\n >\n <PreviewAvatar channel={channel} />\n <View\n style={[styles.contentContainer, contentContainer]}\n testID={`channel-preview-content-${channel.id}`}\n >\n <View style={[styles.row, row]}>\n <PreviewTitle channel={channel} displayName={displayName} />\n <View style={[styles.statusContainer, row]}>\n {isChannelMuted && <PreviewMutedStatus />}\n <PreviewUnreadCount channel={channel} maxUnreadCount={maxUnreadCount} unread={unread} />\n </View>\n </View>\n <View style={[styles.row, row]}>\n <PreviewMessage latestMessagePreview={latestMessagePreview} />\n <PreviewStatus\n channel={channel}\n formatLatestMessageDate={formatLatestMessageDate}\n latestMessagePreview={latestMessagePreview}\n />\n </View>\n </View>\n </TouchableOpacity>\n );\n};\n\nexport type ChannelPreviewMessengerProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<\n Omit<\n ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n 'channel' | 'latestMessagePreview'\n >\n> &\n Pick<\n ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n 'channel' | 'latestMessagePreview'\n >;\n\nconst MemoizedChannelPreviewMessengerWithContext = React.memo(\n ChannelPreviewMessengerWithContext,\n) as typeof ChannelPreviewMessengerWithContext;\n\n/**\n * This UI component displays an individual preview item for each channel in a list. It also receives all props\n * from the ChannelPreview component.\n */\nexport const ChannelPreviewMessenger = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewMessengerProps<StreamChatGenerics>,\n) => {\n const {\n maxUnreadCount,\n onSelect,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n } = useChannelsContext<StreamChatGenerics>();\n return (\n <MemoizedChannelPreviewMessengerWithContext\n {...{\n maxUnreadCount,\n onSelect,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n }}\n {...props}\n />\n );\n};\n\nChannelPreviewMessenger.displayName = 'ChannelPreviewMessenger{channelPreview}';\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,0BAAA,GAAAL,OAAA;A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AAqE,mBAAA,CAAbrE,aAAa;IACbG,cAAc,GAAAkE,mBAAA,CAAdlE,cAAc;IACdY,kBAAkB,GAAAsD,mBAAA,CAAlBtD,kBAAkB;IAClBT,aAAa,GAAA+D,mBAAA,CAAb/D,aAAa;IACbG,YAAY,GAAA4D,mBAAA,CAAZ5D,YAAY;IACZG,kBAAkB,GAAAyD,mBAAA,CAAlBzD,kBAAkB;EAEpB,OACE/E,MAAA,YAAAsH,aAAA,CAACc,0CAA0C,MAAAM,SAAA;IAEvC1E,cAAc,EAAdA,cAAc;IACdC,QAAQ,EAARA,QAAQ;IACRE,aAAa,EAAbA,aAAa;IACbG,cAAc,EAAdA,cAAc;IACdY,kBAAkB,EAAlBA,kBAAkB;IAClBT,aAAa,EAAbA,aAAa;IACbG,YAAY,EAAZA,YAAY;IACZG,kBAAkB,EAAlBA;EAAkB,GAEhBnB,KAAK;IAAAiE,MAAA,EAAA7G,KAAA;IAAA8G,QAAA;MAAAC,QAAA,EAAA9G,YAAA;MAAA+G,UAAA;MAAAC,YAAA;IAAA;EAAA,EACV,CAAC;AAEN,CAAC;AAACU,OAAA,CAAAJ,uBAAA,GAAAA,uBAAA;AAEFA,uBAAuB,CAACjC,WAAW,GAAG,yCAAyC"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeGestureHandler","_ChannelAvatar","_ChannelPreviewMessage","_ChannelPreviewMutedStatus","_ChannelPreviewStatus","_ChannelPreviewTitle","_ChannelPreviewUnreadCount","_useChannelPreviewDisplayName","_ChannelsContext","_ChatContext","_ThemeContext","_useViewport2","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","styles","StyleSheet","create","container","borderBottomWidth","flex","flexDirection","paddingHorizontal","paddingVertical","contentContainer","row","alignItems","justifyContent","paddingLeft","statusContainer","display","title","fontSize","fontWeight","ChannelPreviewMessengerWithContext","props","channel","formatLatestMessageDate","latestMessagePreview","maxUnreadCount","onSelect","_props$PreviewAvatar","PreviewAvatar","ChannelAvatar","_props$PreviewMessage","PreviewMessage","ChannelPreviewMessage","_props$PreviewStatus","PreviewStatus","ChannelPreviewStatus","_props$PreviewTitle","PreviewTitle","ChannelPreviewTitle","_props$PreviewUnreadC","PreviewUnreadCount","ChannelPreviewUnreadCount","_props$PreviewMutedSt","PreviewMutedStatus","ChannelPreviewMutedStatus","unread","_useViewport","useViewport","vw","maxWidth","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$chann","channelPreview","_useTheme$theme$color","colors","border","white_snow","_useChatContext","useChatContext","client","displayName","useChannelPreviewDisplayName","Math","floor","_useState","useState","muteStatus","muted","_useState2","_slicedToArray2","isChannelMuted","setIsChannelMuted","useEffect","handleEvent","on","off","createElement","TouchableOpacity","onPress","style","backgroundColor","borderBottomColor","testID","__self","__source","fileName","lineNumber","columnNumber","View","id","MemoizedChannelPreviewMessengerWithContext","React","memo","ChannelPreviewMessenger","_useChannelsContext","useChannelsContext","_extends2","exports"],"sources":["ChannelPreviewMessenger.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { TouchableOpacity } from 'react-native-gesture-handler';\n\nimport { ChannelAvatar } from './ChannelAvatar';\nimport type { ChannelPreviewProps } from './ChannelPreview';\nimport { ChannelPreviewMessage } from './ChannelPreviewMessage';\nimport { ChannelPreviewMutedStatus } from './ChannelPreviewMutedStatus';\nimport { ChannelPreviewStatus } from './ChannelPreviewStatus';\nimport { ChannelPreviewTitle } from './ChannelPreviewTitle';\nimport { ChannelPreviewUnreadCount } from './ChannelPreviewUnreadCount';\nimport { useChannelPreviewDisplayName } from './hooks/useChannelPreviewDisplayName';\n\nimport type { LatestMessagePreview } from './hooks/useLatestMessagePreview';\n\nimport {\n ChannelsContextValue,\n useChannelsContext,\n} from '../../contexts/channelsContext/ChannelsContext';\nimport { useChatContext } from '../../contexts/chatContext/ChatContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { useViewport } from '../../hooks/useViewport';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n container: {\n borderBottomWidth: 1,\n flex: 1,\n flexDirection: 'row',\n paddingHorizontal: 8,\n paddingVertical: 12,\n },\n contentContainer: { flex: 1 },\n row: {\n alignItems: 'center',\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingLeft: 8,\n },\n statusContainer: {\n display: 'flex',\n flexDirection: 'row',\n },\n title: { fontSize: 14, fontWeight: '700' },\n});\n\nexport type ChannelPreviewMessengerPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChannelPreviewProps<StreamChatGenerics>, 'channel'> &\n Pick<\n ChannelsContextValue<StreamChatGenerics>,\n | 'maxUnreadCount'\n | 'onSelect'\n | 'PreviewAvatar'\n | 'PreviewMessage'\n | 'PreviewMutedStatus'\n | 'PreviewStatus'\n | 'PreviewTitle'\n | 'PreviewUnreadCount'\n > & {\n /**\n * Latest message on a channel, formatted for preview\n *\n * e.g.,\n *\n * ```json\n * {\n * created_at: '' ,\n * messageObject: { ... },\n * previews: {\n * bold: true,\n * text: 'This is the message preview text'\n * },\n * status: 0 | 1 | 2 // read states of the latest message.\n * }\n * ```\n *\n * The read status is either of the following:\n *\n * 0: The message was not sent by the current user\n * 1: The message was sent by the current user and is unread\n * 2: The message was sent by the current user and is read\n *\n * @overrideType object\n */\n latestMessagePreview: LatestMessagePreview<StreamChatGenerics>;\n /**\n * Formatter function for date of latest message.\n * @param date Message date\n * @returns Formatted date string\n *\n * By default today's date is shown in 'HH:mm A' format and other dates\n * are displayed in 'DD/MM/YY' format. props.latestMessage.created_at is the\n * default formatted date. This default logic is part of ChannelPreview component.\n */\n formatLatestMessageDate?: (date: Date) => string;\n /** Number of unread messages on the channel */\n unread?: number;\n };\n\nconst ChannelPreviewMessengerWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n channel,\n formatLatestMessageDate,\n latestMessagePreview,\n maxUnreadCount,\n onSelect,\n PreviewAvatar = ChannelAvatar,\n PreviewMessage = ChannelPreviewMessage,\n PreviewStatus = ChannelPreviewStatus,\n PreviewTitle = ChannelPreviewTitle,\n PreviewUnreadCount = ChannelPreviewUnreadCount,\n PreviewMutedStatus = ChannelPreviewMutedStatus,\n unread,\n } = props;\n const { vw } = useViewport();\n\n const maxWidth = vw(80) - 16 - 40;\n\n const {\n theme: {\n channelPreview: { container, contentContainer, row, title },\n colors: { border, white_snow },\n },\n } = useTheme();\n\n const { client } = useChatContext<StreamChatGenerics>();\n\n const displayName = useChannelPreviewDisplayName(\n channel,\n Math.floor(maxWidth / ((title.fontSize || styles.title.fontSize) / 2)),\n );\n\n const [isChannelMuted, setIsChannelMuted] = useState(() => channel.muteStatus().muted);\n\n useEffect(() => {\n const handleEvent = () => setIsChannelMuted(channel.muteStatus().muted);\n\n client.on('notification.channel_mutes_updated', handleEvent);\n return () => client.off('notification.channel_mutes_updated', handleEvent);\n }, [client]);\n\n return (\n <TouchableOpacity\n onPress={() => {\n if (onSelect) {\n onSelect(channel);\n }\n }}\n style={[\n styles.container,\n { backgroundColor: white_snow, borderBottomColor: border },\n container,\n ]}\n testID='channel-preview-button'\n >\n <PreviewAvatar channel={channel} />\n <View\n style={[styles.contentContainer, contentContainer]}\n testID={`channel-preview-content-${channel.id}`}\n >\n <View style={[styles.row, row]}>\n <PreviewTitle displayName={displayName} />\n <View style={[styles.statusContainer, row]}>\n {isChannelMuted && <PreviewMutedStatus />}\n <PreviewUnreadCount maxUnreadCount={maxUnreadCount} unread={unread} />\n </View>\n </View>\n <View style={[styles.row, row]}>\n <PreviewMessage latestMessagePreview={latestMessagePreview} />\n <PreviewStatus\n formatLatestMessageDate={formatLatestMessageDate}\n latestMessagePreview={latestMessagePreview}\n />\n </View>\n </View>\n </TouchableOpacity>\n );\n};\n\nexport type ChannelPreviewMessengerProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<\n Omit<\n ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n 'channel' | 'latestMessagePreview'\n >\n> &\n Pick<\n ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n 'channel' | 'latestMessagePreview'\n >;\n\nconst MemoizedChannelPreviewMessengerWithContext = React.memo(\n ChannelPreviewMessengerWithContext,\n) as typeof ChannelPreviewMessengerWithContext;\n\n/**\n * This UI component displays an individual preview item for each channel in a list. It also receives all props\n * from the ChannelPreview component.\n */\nexport const ChannelPreviewMessenger = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewMessengerProps<StreamChatGenerics>,\n) => {\n const {\n maxUnreadCount,\n onSelect,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n } = useChannelsContext<StreamChatGenerics>();\n return (\n <MemoizedChannelPreviewMessengerWithContext\n {...{\n maxUnreadCount,\n onSelect,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n }}\n {...props}\n />\n );\n};\n\nChannelPreviewMessenger.displayName = 'ChannelPreviewMessenger{channelPreview}';\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,0BAAA,GAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA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AAkB;IAClBT,aAAa,GAAA+D,mBAAA,CAAb/D,aAAa;IACbG,YAAY,GAAA4D,mBAAA,CAAZ5D,YAAY;IACZG,kBAAkB,GAAAyD,mBAAA,CAAlBzD,kBAAkB;EAEpB,OACE/E,MAAA,YAAAsH,aAAA,CAACc,0CAA0C,MAAAM,SAAA;IAEvC1E,cAAc,EAAdA,cAAc;IACdC,QAAQ,EAARA,QAAQ;IACRE,aAAa,EAAbA,aAAa;IACbG,cAAc,EAAdA,cAAc;IACdY,kBAAkB,EAAlBA,kBAAkB;IAClBT,aAAa,EAAbA,aAAa;IACbG,YAAY,EAAZA,YAAY;IACZG,kBAAkB,EAAlBA;EAAkB,GAEhBnB,KAAK;IAAAiE,MAAA,EAAA7G,KAAA;IAAA8G,QAAA;MAAAC,QAAA,EAAA9G,YAAA;MAAA+G,UAAA;MAAAC,YAAA;IAAA;EAAA,EACV,CAAC;AAEN,CAAC;AAACU,OAAA,CAAAJ,uBAAA,GAAAA,uBAAA;AAEFA,uBAAuB,CAACjC,WAAW,GAAG,yCAAyC"}
|
|
@@ -42,7 +42,7 @@ var ChannelPreviewStatus = function ChannelPreviewStatus(props) {
|
|
|
42
42
|
__self: _this,
|
|
43
43
|
__source: {
|
|
44
44
|
fileName: _jsxFileName,
|
|
45
|
-
lineNumber:
|
|
45
|
+
lineNumber: 48,
|
|
46
46
|
columnNumber: 5
|
|
47
47
|
}
|
|
48
48
|
}, status === _useLatestMessagePreview.MessageReadStatus.READ ? _react["default"].createElement(_icons.CheckAll, (0, _extends2["default"])({
|
|
@@ -51,7 +51,7 @@ var ChannelPreviewStatus = function ChannelPreviewStatus(props) {
|
|
|
51
51
|
__self: _this,
|
|
52
52
|
__source: {
|
|
53
53
|
fileName: _jsxFileName,
|
|
54
|
-
lineNumber:
|
|
54
|
+
lineNumber: 50,
|
|
55
55
|
columnNumber: 9
|
|
56
56
|
}
|
|
57
57
|
})) : status === _useLatestMessagePreview.MessageReadStatus.UNREAD ? _react["default"].createElement(_icons.Check, (0, _extends2["default"])({
|
|
@@ -60,7 +60,7 @@ var ChannelPreviewStatus = function ChannelPreviewStatus(props) {
|
|
|
60
60
|
__self: _this,
|
|
61
61
|
__source: {
|
|
62
62
|
fileName: _jsxFileName,
|
|
63
|
-
lineNumber:
|
|
63
|
+
lineNumber: 52,
|
|
64
64
|
columnNumber: 9
|
|
65
65
|
}
|
|
66
66
|
})) : null, _react["default"].createElement(_reactNative.Text, {
|
|
@@ -70,7 +70,7 @@ var ChannelPreviewStatus = function ChannelPreviewStatus(props) {
|
|
|
70
70
|
__self: _this,
|
|
71
71
|
__source: {
|
|
72
72
|
fileName: _jsxFileName,
|
|
73
|
-
lineNumber:
|
|
73
|
+
lineNumber: 54,
|
|
74
74
|
columnNumber: 7
|
|
75
75
|
}
|
|
76
76
|
}, formatLatestMessageDate && latestMessageDate ? formatLatestMessageDate(latestMessageDate) : latestMessagePreview.created_at));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_useLatestMessagePreview","_ThemeContext","_icons","_this","_jsxFileName","styles","StyleSheet","create","date","fontSize","marginLeft","textAlign","flexRow","flexDirection","ChannelPreviewStatus","props","_latestMessagePreview","formatLatestMessageDate","latestMessagePreview","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$chann","channelPreview","checkAllIcon","checkIcon","_useTheme$theme$color","colors","accent_blue","grey","created_at","messageObject","latestMessageDate","Date","status","createElement","View","style","__self","__source","fileName","lineNumber","columnNumber","MessageReadStatus","READ","CheckAll","_extends2","pathFill","UNREAD","Check","Text","color","exports"],"sources":["ChannelPreviewStatus.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport type {
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_useLatestMessagePreview","_ThemeContext","_icons","_this","_jsxFileName","styles","StyleSheet","create","date","fontSize","marginLeft","textAlign","flexRow","flexDirection","ChannelPreviewStatus","props","_latestMessagePreview","formatLatestMessageDate","latestMessagePreview","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$chann","channelPreview","checkAllIcon","checkIcon","_useTheme$theme$color","colors","accent_blue","grey","created_at","messageObject","latestMessageDate","Date","status","createElement","View","style","__self","__source","fileName","lineNumber","columnNumber","MessageReadStatus","READ","CheckAll","_extends2","pathFill","UNREAD","Check","Text","color","exports"],"sources":["ChannelPreviewStatus.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport type { ChannelPreviewMessengerPropsWithContext } from './ChannelPreviewMessenger';\nimport { MessageReadStatus } from './hooks/useLatestMessagePreview';\n\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Check, CheckAll } from '../../icons';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n date: {\n fontSize: 12,\n marginLeft: 2,\n textAlign: 'right',\n },\n flexRow: {\n flexDirection: 'row',\n },\n});\n\nexport type ChannelPreviewStatusProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n 'latestMessagePreview' | 'formatLatestMessageDate'\n>;\n\nexport const ChannelPreviewStatus = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewStatusProps<StreamChatGenerics>,\n) => {\n const { formatLatestMessageDate, latestMessagePreview } = props;\n const {\n theme: {\n channelPreview: { checkAllIcon, checkIcon, date },\n colors: { accent_blue, grey },\n },\n } = useTheme();\n\n const created_at = latestMessagePreview.messageObject?.created_at;\n const latestMessageDate = created_at ? new Date(created_at) : new Date();\n const status = latestMessagePreview.status;\n\n return (\n <View style={styles.flexRow}>\n {status === MessageReadStatus.READ ? (\n <CheckAll pathFill={accent_blue} {...checkAllIcon} />\n ) : status === MessageReadStatus.UNREAD ? (\n <Check pathFill={grey} {...checkIcon} />\n ) : null}\n <Text style={[styles.date, { color: grey }, date]}>\n {formatLatestMessageDate && latestMessageDate\n ? formatLatestMessageDate(latestMessageDate)\n : latestMessagePreview.created_at}\n </Text>\n </View>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,wBAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA8C,IAAAK,KAAA;EAAAC,YAAA;AAI9C,IAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,IAAI,EAAE;IACJC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,CAAC;IACbC,SAAS,EAAE;EACb,CAAC;EACDC,OAAO,EAAE;IACPC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AASK,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAG/BC,KAAoD,EACjD;EAAA,IAAAC,qBAAA;EACH,IAAQC,uBAAuB,GAA2BF,KAAK,CAAvDE,uBAAuB;IAAEC,oBAAoB,GAAKH,KAAK,CAA9BG,oBAAoB;EACrD,IAAAC,SAAA,GAKI,IAAAC,sBAAQ,EAAC,CAAC;IAAAC,eAAA,GAAAF,SAAA,CAJZG,KAAK;IAAAC,qBAAA,GAAAF,eAAA,CACHG,cAAc;IAAIC,YAAY,GAAAF,qBAAA,CAAZE,YAAY;IAAEC,SAAS,GAAAH,qBAAA,CAATG,SAAS;IAAElB,IAAI,GAAAe,qBAAA,CAAJf,IAAI;IAAAmB,qBAAA,GAAAN,eAAA,CAC/CO,MAAM;IAAIC,WAAW,GAAAF,qBAAA,CAAXE,WAAW;IAAEC,IAAI,GAAAH,qBAAA,CAAJG,IAAI;EAI/B,IAAMC,UAAU,IAAAf,qBAAA,GAAGE,oBAAoB,CAACc,aAAa,qBAAlChB,qBAAA,CAAoCe,UAAU;EACjE,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AACgB,iBAAiB,CAAC,GAC1Cf,oBAAoB,CAACa,UACrB,CACF,CAAC;AAEX,CAAC;AAACsB,OAAA,CAAAvC,oBAAA,GAAAA,oBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ThemeContext","_this","_jsxFileName","styles","StyleSheet","create","title","fontSize","fontWeight","ChannelPreviewTitle","props","displayName","_useTheme","useTheme","_useTheme$theme","theme","channelPreview","black","colors","createElement","Text","numberOfLines","style","color","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["ChannelPreviewTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, Text } from 'react-native';\n\nimport
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ThemeContext","_this","_jsxFileName","styles","StyleSheet","create","title","fontSize","fontWeight","ChannelPreviewTitle","props","displayName","_useTheme","useTheme","_useTheme$theme","theme","channelPreview","black","colors","createElement","Text","numberOfLines","style","color","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["ChannelPreviewTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, Text } from 'react-native';\n\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\n\nconst styles = StyleSheet.create({\n title: { fontSize: 14, fontWeight: '700' },\n});\n\nexport type ChannelPreviewTitleProps = {\n /**\n * Formatted name for the previewed channel.\n */\n displayName: string;\n};\n\nexport const ChannelPreviewTitle = (props: ChannelPreviewTitleProps) => {\n const { displayName } = props;\n const {\n theme: {\n channelPreview: { title },\n colors: { black },\n },\n } = useTheme();\n\n return (\n <Text numberOfLines={1} style={[styles.title, { color: black }, title]}>\n {displayName}\n </Text>\n );\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AAAoE,IAAAG,KAAA;EAAAC,YAAA;AAEpE,IAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,KAAK,EAAE;IAAEC,QAAQ,EAAE,EAAE;IAAEC,UAAU,EAAE;EAAM;AAC3C,CAAC,CAAC;AASK,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,KAA+B,EAAK;EACtE,IAAQC,WAAW,GAAKD,KAAK,CAArBC,WAAW;EACnB,IAAAC,SAAA,GAKI,IAAAC,sBAAQ,EAAC,CAAC;IAAAC,eAAA,GAAAF,SAAA,CAJZG,KAAK;IACeT,KAAK,GAAAQ,eAAA,CAAvBE,cAAc,CAAIV,KAAK;IACbW,KAAK,GAAAH,eAAA,CAAfI,MAAM,CAAID,KAAK;EAInB,OACErB,MAAA,YAAAuB,aAAA,CAACpB,YAAA,CAAAqB,IAAI;IAACC,aAAa,EAAE,CAAE;IAACC,KAAK,EAAE,CAACnB,MAAM,CAACG,KAAK,EAAE;MAAEiB,KAAK,EAAEN;IAAM,CAAC,EAAEX,KAAK,CAAE;IAAAkB,MAAA,EAAAvB,KAAA;IAAAwB,QAAA;MAAAC,QAAA,EAAAxB,YAAA;MAAAyB,UAAA;MAAAC,YAAA;IAAA;EAAA,GACpEjB,WACG,CAAC;AAEX,CAAC;AAACkB,OAAA,CAAApB,mBAAA,GAAAA,mBAAA"}
|
|
@@ -25,7 +25,7 @@ var ChannelPreviewUnreadCount = function ChannelPreviewUnreadCount(props) {
|
|
|
25
25
|
__self: _this,
|
|
26
26
|
__source: {
|
|
27
27
|
fileName: _jsxFileName,
|
|
28
|
-
lineNumber:
|
|
28
|
+
lineNumber: 34,
|
|
29
29
|
columnNumber: 5
|
|
30
30
|
}
|
|
31
31
|
}, _react["default"].createElement(_reactNative.Text, {
|
|
@@ -34,7 +34,7 @@ var ChannelPreviewUnreadCount = function ChannelPreviewUnreadCount(props) {
|
|
|
34
34
|
__self: _this,
|
|
35
35
|
__source: {
|
|
36
36
|
fileName: _jsxFileName,
|
|
37
|
-
lineNumber:
|
|
37
|
+
lineNumber: 35,
|
|
38
38
|
columnNumber: 7
|
|
39
39
|
}
|
|
40
40
|
}, unread > maxUnreadCount ? maxUnreadCount + "+" : unread));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ThemeContext","_this","_jsxFileName","ChannelPreviewUnreadCount","props","maxUnreadCount","unread","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$chann","channelPreview","unreadContainer","unreadText","accent_red","colors","createElement","View","style","styles","backgroundColor","__self","__source","fileName","lineNumber","columnNumber","Text","numberOfLines","exports","StyleSheet","create","alignItems","borderRadius","flexShrink","justifyContent","color","fontSize","fontWeight","paddingHorizontal","paddingVertical"],"sources":["ChannelPreviewUnreadCount.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport type {
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ThemeContext","_this","_jsxFileName","ChannelPreviewUnreadCount","props","maxUnreadCount","unread","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$chann","channelPreview","unreadContainer","unreadText","accent_red","colors","createElement","View","style","styles","backgroundColor","__self","__source","fileName","lineNumber","columnNumber","Text","numberOfLines","exports","StyleSheet","create","alignItems","borderRadius","flexShrink","justifyContent","color","fontSize","fontWeight","paddingHorizontal","paddingVertical"],"sources":["ChannelPreviewUnreadCount.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport type { ChannelsContextValue } from '../../contexts/channelsContext/ChannelsContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nexport type ChannelPreviewUnreadCountProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChannelsContextValue<StreamChatGenerics>, 'maxUnreadCount'> & {\n /**\n * Number of unread messages on the channel\n */\n unread?: number;\n};\n\nexport const ChannelPreviewUnreadCount = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewUnreadCountProps<StreamChatGenerics>,\n) => {\n const { maxUnreadCount, unread } = props;\n const {\n theme: {\n channelPreview: { unreadContainer, unreadText },\n colors: { accent_red },\n },\n } = useTheme();\n\n if (!unread) return null;\n\n return (\n <View style={[styles.unreadContainer, { backgroundColor: accent_red }, unreadContainer]}>\n <Text numberOfLines={1} style={[styles.unreadText, unreadText]}>\n {unread > maxUnreadCount ? `${maxUnreadCount}+` : unread}\n </Text>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n unreadContainer: {\n alignItems: 'center',\n borderRadius: 8,\n flexShrink: 1,\n justifyContent: 'center',\n },\n unreadText: {\n color: '#FFFFFF',\n fontSize: 11,\n fontWeight: '700',\n paddingHorizontal: 5,\n paddingVertical: 1,\n },\n});\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,aAAA,GAAAF,OAAA;AAAoE,IAAAG,KAAA;EAAAC,YAAA;AAa7D,IAAMC,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAGpCC,KAAyD,EACtD;EACH,IAAQC,cAAc,GAAaD,KAAK,CAAhCC,cAAc;IAAEC,MAAM,GAAKF,KAAK,CAAhBE,MAAM;EAC9B,IAAAC,SAAA,GAKI,IAAAC,sBAAQ,EAAC,CAAC;IAAAC,eAAA,GAAAF,SAAA,CAJZG,KAAK;IAAAC,qBAAA,GAAAF,eAAA,CACHG,cAAc;IAAIC,eAAe,GAAAF,qBAAA,CAAfE,eAAe;IAAEC,UAAU,GAAAH,qBAAA,CAAVG,UAAU;IACnCC,UAAU,GAAAN,eAAA,CAApBO,MAAM,CAAID,UAAU;EAIxB,IAAI,CAACT,MAAM,EAAE,OAAO,IAAI;EAExB,OACEV,MAAA,YAAAqB,aAAA,CAAClB,YAAA,CAAAmB,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACP,eAAe,EAAE;MAAEQ,eAAe,EAAEN;IAAW,CAAC,EAAEF,eAAe,CAAE;IAAAS,MAAA,EAAArB,KAAA;IAAAsB,QAAA;MAAAC,QAAA,EAAAtB,YAAA;MAAAuB,UAAA;MAAAC,YAAA;IAAA;EAAA,GACtF9B,MAAA,YAAAqB,aAAA,CAAClB,YAAA,CAAA4B,IAAI;IAACC,aAAa,EAAE,CAAE;IAACT,KAAK,EAAE,CAACC,MAAM,CAACN,UAAU,EAAEA,UAAU,CAAE;IAAAQ,MAAA,EAAArB,KAAA;IAAAsB,QAAA;MAAAC,QAAA,EAAAtB,YAAA;MAAAuB,UAAA;MAAAC,YAAA;IAAA;EAAA,GAC5DpB,MAAM,GAAGD,cAAc,GAAMA,cAAc,SAAMC,MAC9C,CACF,CAAC;AAEX,CAAC;AAACuB,OAAA,CAAA1B,yBAAA,GAAAA,yBAAA;AAEF,IAAMiB,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BlB,eAAe,EAAE;IACfmB,UAAU,EAAE,QAAQ;IACpBC,YAAY,EAAE,CAAC;IACfC,UAAU,EAAE,CAAC;IACbC,cAAc,EAAE;EAClB,CAAC;EACDrB,UAAU,EAAE;IACVsB,KAAK,EAAE,SAAS;IAChBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,iBAAiB,EAAE,CAAC;IACpBC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC"}
|
|
@@ -376,7 +376,6 @@ var MessageWithContext = function MessageWithContext(props) {
|
|
|
376
376
|
message: message,
|
|
377
377
|
messageActions: messageActions == null ? void 0 : messageActions.filter(Boolean),
|
|
378
378
|
messageContext: (0, _extends2["default"])({}, messageContext, {
|
|
379
|
-
disabled: true,
|
|
380
379
|
preventPress: true
|
|
381
380
|
}),
|
|
382
381
|
messageReactionTitle: !error && messageReactions ? t('Message Reactions') : undefined,
|
|
@@ -518,7 +517,7 @@ var MessageWithContext = function MessageWithContext(props) {
|
|
|
518
517
|
__self: _this,
|
|
519
518
|
__source: {
|
|
520
519
|
fileName: _jsxFileName,
|
|
521
|
-
lineNumber:
|
|
520
|
+
lineNumber: 740,
|
|
522
521
|
columnNumber: 5
|
|
523
522
|
}
|
|
524
523
|
}, _react["default"].createElement(_reactNative.View, {
|
|
@@ -528,7 +527,7 @@ var MessageWithContext = function MessageWithContext(props) {
|
|
|
528
527
|
__self: _this,
|
|
529
528
|
__source: {
|
|
530
529
|
fileName: _jsxFileName,
|
|
531
|
-
lineNumber:
|
|
530
|
+
lineNumber: 749,
|
|
532
531
|
columnNumber: 7
|
|
533
532
|
}
|
|
534
533
|
}, _react["default"].createElement(_reactNative.View, {
|
|
@@ -538,7 +537,7 @@ var MessageWithContext = function MessageWithContext(props) {
|
|
|
538
537
|
__self: _this,
|
|
539
538
|
__source: {
|
|
540
539
|
fileName: _jsxFileName,
|
|
541
|
-
lineNumber:
|
|
540
|
+
lineNumber: 757,
|
|
542
541
|
columnNumber: 9
|
|
543
542
|
}
|
|
544
543
|
}, _react["default"].createElement(_MessageContext.MessageProvider, {
|
|
@@ -546,14 +545,14 @@ var MessageWithContext = function MessageWithContext(props) {
|
|
|
546
545
|
__self: _this,
|
|
547
546
|
__source: {
|
|
548
547
|
fileName: _jsxFileName,
|
|
549
|
-
lineNumber:
|
|
548
|
+
lineNumber: 764,
|
|
550
549
|
columnNumber: 11
|
|
551
550
|
}
|
|
552
551
|
}, _react["default"].createElement(MessageSimple, {
|
|
553
552
|
__self: _this,
|
|
554
553
|
__source: {
|
|
555
554
|
fileName: _jsxFileName,
|
|
556
|
-
lineNumber:
|
|
555
|
+
lineNumber: 765,
|
|
557
556
|
columnNumber: 13
|
|
558
557
|
}
|
|
559
558
|
}), isBounceDialogOpen && _react["default"].createElement(MessageBounce, {
|
|
@@ -561,7 +560,7 @@ var MessageWithContext = function MessageWithContext(props) {
|
|
|
561
560
|
__self: _this,
|
|
562
561
|
__source: {
|
|
563
562
|
fileName: _jsxFileName,
|
|
564
|
-
lineNumber:
|
|
563
|
+
lineNumber: 766,
|
|
565
564
|
columnNumber: 36
|
|
566
565
|
}
|
|
567
566
|
})))));
|
|
@@ -569,6 +568,7 @@ var MessageWithContext = function MessageWithContext(props) {
|
|
|
569
568
|
var areEqual = function areEqual(prevProps, nextProps) {
|
|
570
569
|
var _prevMessage$quoted_m, _nextMessage$quoted_m, _prevMessage$quoted_m2, _nextMessage$quoted_m2, _prevMessage$user, _nextMessage$user;
|
|
571
570
|
var prevMutedUsers = prevProps.chatContext.mutedUsers,
|
|
571
|
+
prevDisabled = prevProps.disabled,
|
|
572
572
|
prevGoToMessage = prevProps.goToMessage,
|
|
573
573
|
prevGroupStyles = prevProps.groupStyles,
|
|
574
574
|
isAttachmentEqual = prevProps.isAttachmentEqual,
|
|
@@ -580,6 +580,7 @@ var areEqual = function areEqual(prevProps, nextProps) {
|
|
|
580
580
|
prevShowUnreadUnderlay = prevProps.showUnreadUnderlay,
|
|
581
581
|
prevT = prevProps.t;
|
|
582
582
|
var nextMutedUsers = nextProps.chatContext.mutedUsers,
|
|
583
|
+
nextDisabled = nextProps.disabled,
|
|
583
584
|
nextGoToMessage = nextProps.goToMessage,
|
|
584
585
|
nextGroupStyles = nextProps.groupStyles,
|
|
585
586
|
nextIsTargetedMessage = nextProps.isTargetedMessage,
|
|
@@ -589,6 +590,8 @@ var areEqual = function areEqual(prevProps, nextProps) {
|
|
|
589
590
|
nextMessagesContext = nextProps.messagesContext,
|
|
590
591
|
nextShowUnreadUnderlay = nextProps.showUnreadUnderlay,
|
|
591
592
|
nextT = nextProps.t;
|
|
593
|
+
var disabledEqual = prevDisabled === nextDisabled;
|
|
594
|
+
if (!disabledEqual) return false;
|
|
592
595
|
var membersEqual = Object.keys(prevMembers).length === Object.keys(nextMembers).length;
|
|
593
596
|
if (!membersEqual) return false;
|
|
594
597
|
var repliesEqual = prevMessage.reply_count === nextMessage.reply_count;
|
|
@@ -678,7 +681,7 @@ var Message = function Message(props) {
|
|
|
678
681
|
__self: _this,
|
|
679
682
|
__source: {
|
|
680
683
|
fileName: _jsxFileName,
|
|
681
|
-
lineNumber:
|
|
684
|
+
lineNumber: 945,
|
|
682
685
|
columnNumber: 5
|
|
683
686
|
}
|
|
684
687
|
}));
|