stream-chat-react-native-core 3.9.0-next.1 → 3.9.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/lib/commonjs/components/Attachment/Gallery.js +21 -9
  2. package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
  3. package/lib/commonjs/components/Channel/Channel.js +22 -12
  4. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  5. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +4 -0
  6. package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  7. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +4 -0
  8. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  9. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +9 -6
  10. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  11. package/lib/commonjs/components/MessageList/MessageList.js +40 -31
  12. package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
  13. package/lib/commonjs/components/MessageList/hooks/useMessageList.js +1 -1
  14. package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
  15. package/lib/commonjs/components/MessageList/utils/getGroupStyles.js +1 -5
  16. package/lib/commonjs/components/MessageList/utils/getGroupStyles.js.map +1 -1
  17. package/lib/commonjs/contexts/channelContext/ChannelContext.js +2 -2
  18. package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
  19. package/lib/commonjs/contexts/messagesContext/MessagesContext.js +2 -2
  20. package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
  21. package/lib/commonjs/version.json +1 -1
  22. package/lib/module/components/Attachment/Gallery.js +21 -9
  23. package/lib/module/components/Attachment/Gallery.js.map +1 -1
  24. package/lib/module/components/Channel/Channel.js +22 -12
  25. package/lib/module/components/Channel/Channel.js.map +1 -1
  26. package/lib/module/components/Channel/hooks/useCreateChannelContext.js +4 -0
  27. package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
  28. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +4 -0
  29. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  30. package/lib/module/components/Message/MessageSimple/MessageSimple.js +9 -6
  31. package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  32. package/lib/module/components/MessageList/MessageList.js +40 -31
  33. package/lib/module/components/MessageList/MessageList.js.map +1 -1
  34. package/lib/module/components/MessageList/hooks/useMessageList.js +1 -1
  35. package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
  36. package/lib/module/components/MessageList/utils/getGroupStyles.js +1 -5
  37. package/lib/module/components/MessageList/utils/getGroupStyles.js.map +1 -1
  38. package/lib/module/contexts/channelContext/ChannelContext.js +2 -2
  39. package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
  40. package/lib/module/contexts/messagesContext/MessagesContext.js +2 -2
  41. package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
  42. package/lib/module/version.json +1 -1
  43. package/lib/typescript/components/Attachment/Gallery.d.ts +1 -1
  44. package/lib/typescript/components/Channel/Channel.d.ts +2 -1
  45. package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
  46. package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +4 -2
  47. package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +1 -1
  48. package/lib/typescript/components/MessageList/MessageList.d.ts +1 -1
  49. package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +3 -1
  50. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +3 -1
  51. package/package.json +1 -1
  52. package/src/components/Attachment/Gallery.tsx +20 -5
  53. package/src/components/Channel/Channel.tsx +10 -0
  54. package/src/components/Channel/hooks/useCreateChannelContext.ts +4 -0
  55. package/src/components/Channel/hooks/useCreateMessagesContext.ts +4 -0
  56. package/src/components/Message/MessageSimple/MessageSimple.tsx +9 -3
  57. package/src/components/MessageList/MessageList.tsx +52 -27
  58. package/src/components/MessageList/hooks/useMessageList.ts +1 -1
  59. package/src/components/MessageList/utils/getGroupStyles.ts +3 -8
  60. package/src/contexts/channelContext/ChannelContext.tsx +2 -0
  61. package/src/contexts/messagesContext/MessagesContext.tsx +2 -0
  62. package/src/version.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["MessagesContext.tsx"],"names":["MessagesContext","React","createContext","MessagesProvider","children","value","useMessagesContext","withMessagesContext","Component","WithMessagesContextComponent","props","messagesContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;;;;;;;;AA4jBO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAAxB;;;;AAEA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAS9BC,QAT8B,QAS9BA,QAT8B;AAAA,MAU9BC,KAV8B,QAU9BA,KAV8B;AAAA,SAc9B,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAd8B;AAAA,CAAzB;;;;AAmBA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB;AAAA,SAQ3B,uBAAWN,eAAX,CAR2B;AAAA,CAA3B;;;;AAeA,IAAMO,mBAAmB,GAAG,SAAtBA,mBAAsB,CAUjCC,SAViC,EAW6C;AAC9E,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGL,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,eAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAAeJ,SAAf,CAAjE;AACA,SAAOC,4BAAP;AACD,CArBM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport { getDisplayName } from '../utils/getDisplayName';\n\nimport type { TouchableOpacityProps } from 'react-native';\n\nimport type { ChannelState, MessageResponse } from 'stream-chat';\n\nimport type { Alignment } from '../messageContext/MessageContext';\nimport type { MessageAction } from '../messageOverlayContext/MessageOverlayContext';\nimport type { SuggestionCommand } from '../suggestionsContext/SuggestionsContext';\nimport type { DeepPartial } from '../themeContext/ThemeContext';\nimport type { Theme } from '../themeContext/utils/theme';\nimport type { TDateTimeParserInput } from '../translationContext/TranslationContext';\n\nimport type { AttachmentProps } from '../../components/Attachment/Attachment';\nimport type { AttachmentActionsProps } from '../../components/Attachment/AttachmentActions';\nimport type { CardProps } from '../../components/Attachment/Card';\nimport type { FileAttachmentProps } from '../../components/Attachment/FileAttachment';\nimport type { FileAttachmentGroupProps } from '../../components/Attachment/FileAttachmentGroup';\nimport type { FileIconProps } from '../../components/Attachment/FileIcon';\nimport type { GalleryProps } from '../../components/Attachment/Gallery';\nimport type { GiphyProps } from '../../components/Attachment/Giphy';\nimport type {\n MessageProps,\n MessageTouchableHandlerPayload,\n} from '../../components/Message/Message';\nimport type { MessageAvatarProps } from '../../components/Message/MessageSimple/MessageAvatar';\nimport type { MessageContentProps } from '../../components/Message/MessageSimple/MessageContent';\nimport type { MessageDeletedProps } from '../../components/Message/MessageSimple/MessageDeleted';\nimport type { MessageFooterProps } from '../../components/Message/MessageSimple/MessageFooter';\nimport type { MessageRepliesProps } from '../../components/Message/MessageSimple/MessageReplies';\nimport type { MessageRepliesAvatarsProps } from '../../components/Message/MessageSimple/MessageRepliesAvatars';\nimport type { MessageStatusProps } from '../../components/Message/MessageSimple/MessageStatus';\nimport type { MessageSimpleProps } from '../../components/Message/MessageSimple/MessageSimple';\nimport type { MessageTextProps } from '../../components/Message/MessageSimple/MessageTextContainer';\nimport type { MarkdownRules } from '../../components/Message/MessageSimple/utils/renderText';\nimport type { DateHeaderProps } from '../../components/MessageList/DateHeader';\nimport type { MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { InlineDateSeparatorProps } from '../../components/MessageList/InlineDateSeparator';\nimport type { MessageListProps } from '../../components/MessageList/MessageList';\nimport type { ScrollToBottomButtonProps } from '../../components/MessageList/ScrollToBottomButton';\nimport type { MessageSystemProps } from '../../components/MessageList/MessageSystem';\nimport type { OverlayReactionListProps } from '../../components/MessageOverlay/OverlayReactionList';\nimport type { ReactionListProps } from '../../components/Message/MessageSimple/ReactionList';\nimport type { ReplyProps } from '../../components/Reply/Reply';\nimport type { FlatList } from '../../native';\nimport type {\n DefaultAttachmentType,\n DefaultChannelType,\n DefaultCommandType,\n DefaultEventType,\n DefaultMessageType,\n DefaultReactionType,\n DefaultUserType,\n UnknownType,\n} from '../../types/types';\nimport type { ReactionData } from '../../utils/utils';\n\nexport type MessagesConfig = {\n mutesEnabled?: boolean;\n quotedRepliesEnabled?: boolean;\n reactionsEnabled?: boolean;\n threadRepliesEnabled?: boolean;\n};\n\nexport type MessageContentType = 'attachments' | 'files' | 'gallery' | 'quoted_reply' | 'text';\n\nexport type MessagesContextValue<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = MessagesConfig & {\n /**\n * UI component for Attachment.\n * Defaults to: [Attachment](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Attachment.tsx)\n */\n Attachment: React.ComponentType<AttachmentProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component to display AttachmentActions. e.g., send, shuffle, cancel in case of giphy\n * Defaults to: [AttachmentActions](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/AttachmentActions.tsx)\n */\n AttachmentActions: React.ComponentType<AttachmentActionsProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component to display generic media type e.g. giphy, url preview etc\n * Defaults to: [Card](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Card.tsx)\n */\n Card: React.ComponentType<CardProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for DateHeader\n * Defaults to: [DateHeader](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageList/DateHeader.tsx)\n **/\n DateHeader: React.ComponentType<DateHeaderProps>;\n /** Should keyboard be dismissed when messaged is touched */\n dismissKeyboardOnMessageTouch: boolean;\n /**\n * UI component to display File type attachment.\n * Defaults to: [FileAttachment](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileAttachment.tsx)\n */\n FileAttachment: React.ComponentType<FileAttachmentProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component to display group of File type attachments or multiple file attachments (in single message).\n * Defaults to: [FileAttachmentGroup](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileAttachmentGroup.tsx)\n */\n FileAttachmentGroup: React.ComponentType<FileAttachmentGroupProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for attachment icon for type 'file' attachment.\n * Defaults to: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileIcon.tsx\n */\n FileAttachmentIcon: React.ComponentType<FileIconProps>;\n FlatList: typeof FlatList;\n /**\n * UI component to display image attachments\n * Defaults to: [Gallery](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Gallery.tsx)\n */\n Gallery: React.ComponentType<GalleryProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for Giphy\n * Defaults to: [Giphy](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Giphy.tsx)\n */\n Giphy: React.ComponentType<GiphyProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * When true, messageList will be scrolled at first unread message, when opened.\n */\n initialScrollToFirstUnreadMessage: boolean;\n /**\n * UI component for Message Date Separator Component\n * Defaults to: [InlineDateSeparator](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageList/InlineDateSeparator.tsx)\n */\n InlineDateSeparator: React.ComponentType<InlineDateSeparatorProps>;\n /**\n * UI component for InlineUnreadIndicator\n * Defaults to: [InlineUnreadIndicator](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/InlineUnreadIndicator.tsx)\n **/\n InlineUnreadIndicator: React.ComponentType;\n Message: React.ComponentType<MessageProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for MessageAvatar\n * Defaults to: [MessageAvatar](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageAvatar.tsx)\n **/\n MessageAvatar: React.ComponentType<MessageAvatarProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for MessageContent\n * Defaults to: [MessageContent](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageContent.tsx)\n */\n MessageContent: React.ComponentType<MessageContentProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /** Order to render the message content */\n messageContentOrder: MessageContentType[];\n /**\n * UI component for MessageDeleted\n * Defaults to: [MessageDeleted](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageSimple/MessageDeleted.tsx)\n */\n MessageDeleted: React.ComponentType<MessageDeletedProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Custom message footer component\n */\n MessageFooter: React.ComponentType<MessageFooterProps<At, Ch, Co, Ev, Me, Re, Us>>;\n MessageList: React.ComponentType<MessageListProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for MessageReplies\n * Defaults to: [MessageReplies](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageSimple/MessageReplies.tsx)\n */\n MessageReplies: React.ComponentType<MessageRepliesProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI Component for MessageRepliesAvatars\n * Defaults to: [MessageRepliesAvatars](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageSimple/MessageRepliesAvatars.tsx)\n */\n MessageRepliesAvatars: React.ComponentType<\n MessageRepliesAvatarsProps<At, Ch, Co, Ev, Me, Re, Us>\n >;\n /**\n * UI component for MessageSimple\n * Defaults to: [MessageSimple](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageSimple.tsx)\n */\n MessageSimple: React.ComponentType<MessageSimpleProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for MessageStatus (delivered/read)\n * Defaults to: [MessageStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageStatus.tsx)\n */\n MessageStatus: React.ComponentType<MessageStatusProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for MessageSystem\n * Defaults to: [MessageSystem](https://getstream.github.io/stream-chat-react-native/v3/#messagesystem)\n */\n MessageSystem: React.ComponentType<MessageSystemProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for OverlayReactionList\n */\n OverlayReactionList: React.ComponentType<OverlayReactionListProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for ReactionList\n * Defaults to: [ReactionList](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Reaction/ReactionList.tsx)\n */\n ReactionList: React.ComponentType<ReactionListProps<At, Ch, Co, Ev, Me, Re, Us>>;\n removeMessage: (message: { id: string; parent_id?: string }) => void;\n /**\n * UI component for Reply\n * Defaults to: [Reply](https://getstream.github.io/stream-chat-react-native/v3/#reply)\n */\n Reply: React.ComponentType<ReplyProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Override the api request for retry message functionality.\n */\n retrySendMessage: (message: MessageResponse<At, Ch, Co, Me, Re, Us>) => Promise<void>;\n /**\n * UI component for ScrollToBottomButton\n * Defaults to: [ScrollToBottomButton](https://getstream.github.io/stream-chat-react-native/v3/#ScrollToBottomButton)\n */\n ScrollToBottomButton: React.ComponentType<ScrollToBottomButtonProps>;\n setEditingState: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void;\n setQuotedMessageState: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void;\n supportedReactions: ReactionData[];\n /**\n * UI component for TypingIndicator\n * Defaults to: [TypingIndicator](https://getstream.github.io/stream-chat-react-native/v3/#typingindicator)\n */\n TypingIndicator: React.ComponentType;\n /**\n * UI component for TypingIndicatorContainer\n * Defaults to: [TypingIndicatorContainer](https://getstream.github.io/stream-chat-react-native/v3/#typingindicatorcontainer)\n */\n TypingIndicatorContainer: React.ComponentType;\n updateMessage: (\n updatedMessage: MessageResponse<At, Ch, Co, Me, Re, Us>,\n extraState?: {\n commands?: SuggestionCommand<Co>[];\n messageInput?: string;\n threadMessages?: ChannelState<At, Ch, Co, Ev, Me, Re, Us>['threads'][string];\n },\n ) => void;\n /**\n * Custom UI component to display enriched url preview.\n * Defaults to https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Card.tsx\n */\n UrlPreview: React.ComponentType<CardProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Provide any additional props for `TouchableOpacity` which wraps inner MessageContent component here.\n * Please check docs for TouchableOpacity for supported props - https://reactnative.dev/docs/touchableopacity#props\n *\n * @overrideType Object\n */\n additionalTouchableProps?: Omit<TouchableOpacityProps, 'style'>;\n /**\n * When false, pop-out animation will be disabled for message bubble, onLongPress\n */\n animatedLongPress?: boolean;\n /**\n * Full override of the block user button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n blockUser?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Custom UI component to override default cover (between Header and Footer) of Card component.\n * Accepts the same props as Card component.\n */\n CardCover?: React.ComponentType<CardProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Custom UI component to override default Footer of Card component.\n * Accepts the same props as Card component.\n */\n CardFooter?: React.ComponentType<CardProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Custom UI component to override default header of Card component.\n * Accepts the same props as Card component.\n */\n CardHeader?: React.ComponentType<CardProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Full override of the copy message button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n copyMessage?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Full override of the delete message button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n deleteMessage?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n disableTypingIndicator?: boolean;\n /**\n * Full override of the edit message button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n editMessage?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Full override of the flag message button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n flagMessage?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Whether messages should be aligned to right or left part of screen.\n * By default, messages will be received messages will be aligned to left and\n * sent messages will be aligned to right.\n */\n forceAlignMessages?: Alignment | boolean;\n /**\n * Optional function to custom format the message date\n */\n formatDate?: (date: TDateTimeParserInput) => string;\n handleBlock?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when a copy message action is invoked */\n handleCopy?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when a delete message action is invoked */\n handleDelete?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when an edit message action is invoked */\n handleEdit?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void;\n /** Handler to access when a flag message action is invoked */\n handleFlag?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when a mute user action is invoked */\n handleMute?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when a quoted reply action is invoked */\n handleQuotedReply?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to process a reaction */\n handleReaction?: (\n message: MessageType<At, Ch, Co, Ev, Me, Re, Us>,\n reactionType: string,\n ) => Promise<void>;\n /** Handler to access when a retry action is invoked */\n handleRetry?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when a thread reply action is invoked */\n handleThreadReply?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Object specifying rules defined within simple-markdown https://github.com/Khan/simple-markdown#adding-a-simple-extension */\n markdownRules?: MarkdownRules;\n /**\n * Use this prop to override message actions (which pop-up in message overlay).\n *\n * You can either completely override the default messageActions object.\n *\n * ```\n * <Channel\n * messageActions=[\n * {\n * action: () => { someAction() };\n * title: \"Pin Message\";\n * icon: PinIcon;\n * titleStyle: {};\n * },\n * {\n * action: () => { someAction() };\n * title: \"Delete Message\";\n * icon: PinIcon;\n * titleStyle: {};\n * }\n * ]\n * >\n * </Channel>\n * ```\n *\n * Or you can selectly keep certain action and remove some:\n *\n * e.g. Lets say you only want to keep threadReply and copyMessage actions\n *\n * ```\n * <Channel\n * messageActions={({\n * blockUser,\n * copyMessage,\n * deleteMessage,\n * editMessage,\n * flagMessage,\n * muteUser,\n * quotedReply,\n * retry,\n * threadReply,\n * }) => ([\n * threadReply, copyMessage\n * ])}\n * >\n * </Channel>\n * ```\n *\n * @overrideType Function | Array<Objects>\n */\n messageActions?:\n | (MessageAction | null)[]\n | (({\n blockUser,\n canModifyMessage,\n copyMessage,\n deleteMessage,\n dismissOverlay,\n editMessage,\n error,\n flagMessage,\n isMyMessage,\n isThreadMessage,\n message,\n messageReactions,\n muteUser,\n quotedRepliesEnabled,\n quotedReply,\n retry,\n threadRepliesEnabled,\n threadReply,\n }: {\n blockUser: MessageAction | null;\n canModifyMessage: boolean;\n copyMessage: MessageAction | null;\n deleteMessage: MessageAction | null;\n dismissOverlay: () => void;\n editMessage: MessageAction | null;\n error: boolean;\n flagMessage: MessageAction | null;\n isMyMessage: boolean;\n isThreadMessage: boolean;\n message: MessageType<At, Ch, Co, Ev, Me, Re, Us>;\n messageReactions: boolean;\n muteUser: MessageAction | null;\n quotedReply: MessageAction | null;\n retry: MessageAction | null;\n threadReply: MessageAction | null;\n quotedRepliesEnabled?: boolean;\n threadRepliesEnabled?: boolean;\n }) => (MessageAction | null)[] | undefined);\n /**\n * Custom message header component\n */\n MessageHeader?: React.ComponentType<MessageFooterProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /** Custom UI component for message text */\n MessageText?: React.ComponentType<MessageTextProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Full override of the mute user button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n * */\n muteUser?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Theme provided only to messages that are the current users\n */\n myMessageTheme?: DeepPartial<Theme>;\n /**\n * Add double tap handler for message.\n *\n * ```\n * <Channel\n * onDoubleTapMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * message // message object on which longPress occured\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onDoubleTapMessage?: (\n payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>,\n ) => void;\n /**\n * Override default handler for onLongPress on message. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onLongPressMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occured\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onLongPressMessage?: (\n payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>,\n ) => void;\n /**\n * Add onPressIn handler for attachments. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onPressInMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occured\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onPressInMessage?: (payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void;\n /**\n * Override onPress handler for message. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onPressMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occurred\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onPressMessage?: (payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void;\n /**\n * Full override of the quoted reply button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n quotedReply?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Full override of the resend button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n * */\n retry?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Full override of the reaction function on Message and Message Overlay\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n * */\n selectReaction?: (\n message: MessageType<At, Ch, Co, Ev, Me, Re, Us>,\n ) => (reactionType: string) => Promise<void>;\n /**\n * Full override of the thread reply button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n * */\n threadReply?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction;\n};\n\nexport const MessagesContext = React.createContext({} as MessagesContextValue);\n\nexport const MessagesProvider = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>;\n}>) => (\n <MessagesContext.Provider value={value as unknown as MessagesContextValue}>\n {children}\n </MessagesContext.Provider>\n);\n\nexport const useMessagesContext = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>() => useContext(MessagesContext) as unknown as MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>;\n\n/**\n * Typescript currently does not support partial inference so if MessagesContext\n * typing is desired while using the HOC withMessagesContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withMessagesContext = <\n P extends UnknownType,\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>>> => {\n const WithMessagesContextComponent = (\n props: Omit<P, keyof MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>>,\n ) => {\n const messagesContext = useMessagesContext<At, Ch, Co, Ev, Me, Re, Us>();\n\n return <Component {...(props as P)} {...messagesContext} />;\n };\n WithMessagesContextComponent.displayName = `WithMessagesContext${getDisplayName(Component)}`;\n return WithMessagesContextComponent;\n};\n"]}
1
+ {"version":3,"sources":["MessagesContext.tsx"],"names":["MessagesContext","React","createContext","MessagesProvider","children","value","useMessagesContext","withMessagesContext","Component","WithMessagesContextComponent","props","messagesContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;;;;;;;;AA8jBO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAAxB;;;;AAEA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAS9BC,QAT8B,QAS9BA,QAT8B;AAAA,MAU9BC,KAV8B,QAU9BA,KAV8B;AAAA,SAc9B,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAd8B;AAAA,CAAzB;;;;AAmBA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB;AAAA,SAQ3B,uBAAWN,eAAX,CAR2B;AAAA,CAA3B;;;;AAeA,IAAMO,mBAAmB,GAAG,SAAtBA,mBAAsB,CAUjCC,SAViC,EAW6C;AAC9E,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGL,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,eAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAAeJ,SAAf,CAAjE;AACA,SAAOC,4BAAP;AACD,CArBM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport { getDisplayName } from '../utils/getDisplayName';\n\nimport type { TouchableOpacityProps } from 'react-native';\n\nimport type { ChannelState, MessageResponse } from 'stream-chat';\n\nimport type { Alignment } from '../messageContext/MessageContext';\nimport type { MessageAction } from '../messageOverlayContext/MessageOverlayContext';\nimport type { SuggestionCommand } from '../suggestionsContext/SuggestionsContext';\nimport type { DeepPartial } from '../themeContext/ThemeContext';\nimport type { Theme } from '../themeContext/utils/theme';\nimport type { TDateTimeParserInput } from '../translationContext/TranslationContext';\n\nimport type { AttachmentProps } from '../../components/Attachment/Attachment';\nimport type { AttachmentActionsProps } from '../../components/Attachment/AttachmentActions';\nimport type { CardProps } from '../../components/Attachment/Card';\nimport type { FileAttachmentProps } from '../../components/Attachment/FileAttachment';\nimport type { FileAttachmentGroupProps } from '../../components/Attachment/FileAttachmentGroup';\nimport type { FileIconProps } from '../../components/Attachment/FileIcon';\nimport type { GalleryProps } from '../../components/Attachment/Gallery';\nimport type { GiphyProps } from '../../components/Attachment/Giphy';\nimport type {\n MessageProps,\n MessageTouchableHandlerPayload,\n} from '../../components/Message/Message';\nimport type { MessageAvatarProps } from '../../components/Message/MessageSimple/MessageAvatar';\nimport type { MessageContentProps } from '../../components/Message/MessageSimple/MessageContent';\nimport type { MessageDeletedProps } from '../../components/Message/MessageSimple/MessageDeleted';\nimport type { MessageFooterProps } from '../../components/Message/MessageSimple/MessageFooter';\nimport type { MessageRepliesProps } from '../../components/Message/MessageSimple/MessageReplies';\nimport type { MessageRepliesAvatarsProps } from '../../components/Message/MessageSimple/MessageRepliesAvatars';\nimport type { MessageStatusProps } from '../../components/Message/MessageSimple/MessageStatus';\nimport type { MessageSimpleProps } from '../../components/Message/MessageSimple/MessageSimple';\nimport type { MessageTextProps } from '../../components/Message/MessageSimple/MessageTextContainer';\nimport type { MarkdownRules } from '../../components/Message/MessageSimple/utils/renderText';\nimport type { DateHeaderProps } from '../../components/MessageList/DateHeader';\nimport type { MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { InlineDateSeparatorProps } from '../../components/MessageList/InlineDateSeparator';\nimport type { MessageListProps } from '../../components/MessageList/MessageList';\nimport type { ScrollToBottomButtonProps } from '../../components/MessageList/ScrollToBottomButton';\nimport type { MessageSystemProps } from '../../components/MessageList/MessageSystem';\nimport type { OverlayReactionListProps } from '../../components/MessageOverlay/OverlayReactionList';\nimport type { ReactionListProps } from '../../components/Message/MessageSimple/ReactionList';\nimport type { ReplyProps } from '../../components/Reply/Reply';\nimport type { FlatList } from '../../native';\nimport type {\n DefaultAttachmentType,\n DefaultChannelType,\n DefaultCommandType,\n DefaultEventType,\n DefaultMessageType,\n DefaultReactionType,\n DefaultUserType,\n UnknownType,\n} from '../../types/types';\nimport type { ReactionData } from '../../utils/utils';\n\nexport type MessagesConfig = {\n mutesEnabled?: boolean;\n quotedRepliesEnabled?: boolean;\n reactionsEnabled?: boolean;\n threadRepliesEnabled?: boolean;\n};\n\nexport type MessageContentType = 'attachments' | 'files' | 'gallery' | 'quoted_reply' | 'text';\n\nexport type MessagesContextValue<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = MessagesConfig & {\n /**\n * UI component for Attachment.\n * Defaults to: [Attachment](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Attachment.tsx)\n */\n Attachment: React.ComponentType<AttachmentProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component to display AttachmentActions. e.g., send, shuffle, cancel in case of giphy\n * Defaults to: [AttachmentActions](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/AttachmentActions.tsx)\n */\n AttachmentActions: React.ComponentType<AttachmentActionsProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component to display generic media type e.g. giphy, url preview etc\n * Defaults to: [Card](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Card.tsx)\n */\n Card: React.ComponentType<CardProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for DateHeader\n * Defaults to: [DateHeader](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageList/DateHeader.tsx)\n **/\n DateHeader: React.ComponentType<DateHeaderProps>;\n /** Should keyboard be dismissed when messaged is touched */\n dismissKeyboardOnMessageTouch: boolean;\n enableMessageGroupingByUser: boolean;\n /**\n * UI component to display File type attachment.\n * Defaults to: [FileAttachment](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileAttachment.tsx)\n */\n FileAttachment: React.ComponentType<FileAttachmentProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component to display group of File type attachments or multiple file attachments (in single message).\n * Defaults to: [FileAttachmentGroup](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileAttachmentGroup.tsx)\n */\n FileAttachmentGroup: React.ComponentType<FileAttachmentGroupProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for attachment icon for type 'file' attachment.\n * Defaults to: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileIcon.tsx\n */\n FileAttachmentIcon: React.ComponentType<FileIconProps>;\n FlatList: typeof FlatList;\n /**\n * UI component to display image attachments\n * Defaults to: [Gallery](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Gallery.tsx)\n */\n Gallery: React.ComponentType<GalleryProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for Giphy\n * Defaults to: [Giphy](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Giphy.tsx)\n */\n Giphy: React.ComponentType<GiphyProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * When true, messageList will be scrolled at first unread message, when opened.\n */\n initialScrollToFirstUnreadMessage: boolean;\n /**\n * UI component for Message Date Separator Component\n * Defaults to: [InlineDateSeparator](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageList/InlineDateSeparator.tsx)\n */\n InlineDateSeparator: React.ComponentType<InlineDateSeparatorProps>;\n /**\n * UI component for InlineUnreadIndicator\n * Defaults to: [InlineUnreadIndicator](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/InlineUnreadIndicator.tsx)\n **/\n InlineUnreadIndicator: React.ComponentType;\n Message: React.ComponentType<MessageProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for MessageAvatar\n * Defaults to: [MessageAvatar](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageAvatar.tsx)\n **/\n MessageAvatar: React.ComponentType<MessageAvatarProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for MessageContent\n * Defaults to: [MessageContent](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageContent.tsx)\n */\n MessageContent: React.ComponentType<MessageContentProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /** Order to render the message content */\n messageContentOrder: MessageContentType[];\n /**\n * UI component for MessageDeleted\n * Defaults to: [MessageDeleted](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageSimple/MessageDeleted.tsx)\n */\n MessageDeleted: React.ComponentType<MessageDeletedProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Custom message footer component\n */\n MessageFooter: React.ComponentType<MessageFooterProps<At, Ch, Co, Ev, Me, Re, Us>>;\n MessageList: React.ComponentType<MessageListProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for MessageReplies\n * Defaults to: [MessageReplies](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageSimple/MessageReplies.tsx)\n */\n MessageReplies: React.ComponentType<MessageRepliesProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI Component for MessageRepliesAvatars\n * Defaults to: [MessageRepliesAvatars](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageSimple/MessageRepliesAvatars.tsx)\n */\n MessageRepliesAvatars: React.ComponentType<\n MessageRepliesAvatarsProps<At, Ch, Co, Ev, Me, Re, Us>\n >;\n /**\n * UI component for MessageSimple\n * Defaults to: [MessageSimple](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageSimple.tsx)\n */\n MessageSimple: React.ComponentType<MessageSimpleProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for MessageStatus (delivered/read)\n * Defaults to: [MessageStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/MessageSimple/MessageStatus.tsx)\n */\n MessageStatus: React.ComponentType<MessageStatusProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for MessageSystem\n * Defaults to: [MessageSystem](https://getstream.github.io/stream-chat-react-native/v3/#messagesystem)\n */\n MessageSystem: React.ComponentType<MessageSystemProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for OverlayReactionList\n */\n OverlayReactionList: React.ComponentType<OverlayReactionListProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * UI component for ReactionList\n * Defaults to: [ReactionList](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Reaction/ReactionList.tsx)\n */\n ReactionList: React.ComponentType<ReactionListProps<At, Ch, Co, Ev, Me, Re, Us>>;\n removeMessage: (message: { id: string; parent_id?: string }) => void;\n /**\n * UI component for Reply\n * Defaults to: [Reply](https://getstream.github.io/stream-chat-react-native/v3/#reply)\n */\n Reply: React.ComponentType<ReplyProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Override the api request for retry message functionality.\n */\n retrySendMessage: (message: MessageResponse<At, Ch, Co, Me, Re, Us>) => Promise<void>;\n /**\n * UI component for ScrollToBottomButton\n * Defaults to: [ScrollToBottomButton](https://getstream.github.io/stream-chat-react-native/v3/#ScrollToBottomButton)\n */\n ScrollToBottomButton: React.ComponentType<ScrollToBottomButtonProps>;\n setEditingState: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void;\n setQuotedMessageState: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void;\n supportedReactions: ReactionData[];\n /**\n * UI component for TypingIndicator\n * Defaults to: [TypingIndicator](https://getstream.github.io/stream-chat-react-native/v3/#typingindicator)\n */\n TypingIndicator: React.ComponentType;\n /**\n * UI component for TypingIndicatorContainer\n * Defaults to: [TypingIndicatorContainer](https://getstream.github.io/stream-chat-react-native/v3/#typingindicatorcontainer)\n */\n TypingIndicatorContainer: React.ComponentType;\n updateMessage: (\n updatedMessage: MessageResponse<At, Ch, Co, Me, Re, Us>,\n extraState?: {\n commands?: SuggestionCommand<Co>[];\n messageInput?: string;\n threadMessages?: ChannelState<At, Ch, Co, Ev, Me, Re, Us>['threads'][string];\n },\n ) => void;\n /**\n * Custom UI component to display enriched url preview.\n * Defaults to https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/Card.tsx\n */\n UrlPreview: React.ComponentType<CardProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Provide any additional props for `TouchableOpacity` which wraps inner MessageContent component here.\n * Please check docs for TouchableOpacity for supported props - https://reactnative.dev/docs/touchableopacity#props\n *\n * @overrideType Object\n */\n additionalTouchableProps?: Omit<TouchableOpacityProps, 'style'>;\n /**\n * When false, pop-out animation will be disabled for message bubble, onLongPress\n */\n animatedLongPress?: boolean;\n /**\n * Full override of the block user button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n blockUser?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Custom UI component to override default cover (between Header and Footer) of Card component.\n * Accepts the same props as Card component.\n */\n CardCover?: React.ComponentType<CardProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Custom UI component to override default Footer of Card component.\n * Accepts the same props as Card component.\n */\n CardFooter?: React.ComponentType<CardProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Custom UI component to override default header of Card component.\n * Accepts the same props as Card component.\n */\n CardHeader?: React.ComponentType<CardProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Full override of the copy message button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n copyMessage?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Full override of the delete message button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n deleteMessage?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n disableTypingIndicator?: boolean;\n /**\n * Full override of the edit message button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n editMessage?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Full override of the flag message button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n flagMessage?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Whether messages should be aligned to right or left part of screen.\n * By default, messages will be received messages will be aligned to left and\n * sent messages will be aligned to right.\n */\n forceAlignMessages?: Alignment | boolean;\n /**\n * Optional function to custom format the message date\n */\n formatDate?: (date: TDateTimeParserInput) => string;\n handleBlock?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when a copy message action is invoked */\n handleCopy?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when a delete message action is invoked */\n handleDelete?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when an edit message action is invoked */\n handleEdit?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void;\n /** Handler to access when a flag message action is invoked */\n handleFlag?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when a mute user action is invoked */\n handleMute?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when a quoted reply action is invoked */\n handleQuotedReply?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to process a reaction */\n handleReaction?: (\n message: MessageType<At, Ch, Co, Ev, Me, Re, Us>,\n reactionType: string,\n ) => Promise<void>;\n /** Handler to access when a retry action is invoked */\n handleRetry?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n /** Handler to access when a thread reply action is invoked */\n handleThreadReply?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;\n legacyImageViewerSwipeBehaviour?: boolean;\n /** Object specifying rules defined within simple-markdown https://github.com/Khan/simple-markdown#adding-a-simple-extension */\n markdownRules?: MarkdownRules;\n /**\n * Use this prop to override message actions (which pop-up in message overlay).\n *\n * You can either completely override the default messageActions object.\n *\n * ```\n * <Channel\n * messageActions=[\n * {\n * action: () => { someAction() };\n * title: \"Pin Message\";\n * icon: PinIcon;\n * titleStyle: {};\n * },\n * {\n * action: () => { someAction() };\n * title: \"Delete Message\";\n * icon: PinIcon;\n * titleStyle: {};\n * }\n * ]\n * >\n * </Channel>\n * ```\n *\n * Or you can selectly keep certain action and remove some:\n *\n * e.g. Lets say you only want to keep threadReply and copyMessage actions\n *\n * ```\n * <Channel\n * messageActions={({\n * blockUser,\n * copyMessage,\n * deleteMessage,\n * editMessage,\n * flagMessage,\n * muteUser,\n * quotedReply,\n * retry,\n * threadReply,\n * }) => ([\n * threadReply, copyMessage\n * ])}\n * >\n * </Channel>\n * ```\n *\n * @overrideType Function | Array<Objects>\n */\n messageActions?:\n | (MessageAction | null)[]\n | (({\n blockUser,\n canModifyMessage,\n copyMessage,\n deleteMessage,\n dismissOverlay,\n editMessage,\n error,\n flagMessage,\n isMyMessage,\n isThreadMessage,\n message,\n messageReactions,\n muteUser,\n quotedRepliesEnabled,\n quotedReply,\n retry,\n threadRepliesEnabled,\n threadReply,\n }: {\n blockUser: MessageAction | null;\n canModifyMessage: boolean;\n copyMessage: MessageAction | null;\n deleteMessage: MessageAction | null;\n dismissOverlay: () => void;\n editMessage: MessageAction | null;\n error: boolean;\n flagMessage: MessageAction | null;\n isMyMessage: boolean;\n isThreadMessage: boolean;\n message: MessageType<At, Ch, Co, Ev, Me, Re, Us>;\n messageReactions: boolean;\n muteUser: MessageAction | null;\n quotedReply: MessageAction | null;\n retry: MessageAction | null;\n threadReply: MessageAction | null;\n quotedRepliesEnabled?: boolean;\n threadRepliesEnabled?: boolean;\n }) => (MessageAction | null)[] | undefined);\n /**\n * Custom message header component\n */\n MessageHeader?: React.ComponentType<MessageFooterProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /** Custom UI component for message text */\n MessageText?: React.ComponentType<MessageTextProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Full override of the mute user button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n * */\n muteUser?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Theme provided only to messages that are the current users\n */\n myMessageTheme?: DeepPartial<Theme>;\n /**\n * Add double tap handler for message.\n *\n * ```\n * <Channel\n * onDoubleTapMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * message // message object on which longPress occured\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onDoubleTapMessage?: (\n payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>,\n ) => void;\n /**\n * Override default handler for onLongPress on message. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onLongPressMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occured\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onLongPressMessage?: (\n payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>,\n ) => void;\n /**\n * Add onPressIn handler for attachments. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onPressInMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occured\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onPressInMessage?: (payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void;\n /**\n * Override onPress handler for message. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onPressMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occurred\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onPressMessage?: (payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void;\n /**\n * Full override of the quoted reply button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n quotedReply?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Full override of the resend button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n * */\n retry?: ((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | null;\n /**\n * Full override of the reaction function on Message and Message Overlay\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n * */\n selectReaction?: (\n message: MessageType<At, Ch, Co, Ev, Me, Re, Us>,\n ) => (reactionType: string) => Promise<void>;\n /**\n * Full override of the thread reply button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n * */\n threadReply?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction;\n};\n\nexport const MessagesContext = React.createContext({} as MessagesContextValue);\n\nexport const MessagesProvider = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>;\n}>) => (\n <MessagesContext.Provider value={value as unknown as MessagesContextValue}>\n {children}\n </MessagesContext.Provider>\n);\n\nexport const useMessagesContext = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>() => useContext(MessagesContext) as unknown as MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>;\n\n/**\n * Typescript currently does not support partial inference so if MessagesContext\n * typing is desired while using the HOC withMessagesContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withMessagesContext = <\n P extends UnknownType,\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>>> => {\n const WithMessagesContextComponent = (\n props: Omit<P, keyof MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>>,\n ) => {\n const messagesContext = useMessagesContext<At, Ch, Co, Ev, Me, Re, Us>();\n\n return <Component {...(props as P)} {...messagesContext} />;\n };\n WithMessagesContextComponent.displayName = `WithMessagesContext${getDisplayName(Component)}`;\n return WithMessagesContextComponent;\n};\n"]}
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "3.9.0-next.1"
2
+ "version": "3.9.0-next.2"
3
3
  }
@@ -3,7 +3,7 @@ import { MessageContextValue } from '../../contexts/messageContext/MessageContex
3
3
  import { MessagesContextValue } from '../../contexts/messagesContext/MessagesContext';
4
4
  import { OverlayContextValue } from '../../contexts/overlayContext/OverlayContext';
5
5
  import type { DefaultAttachmentType, DefaultChannelType, DefaultCommandType, DefaultEventType, DefaultMessageType, DefaultReactionType, DefaultUserType, UnknownType } from '../../types/types';
6
- export declare type GalleryPropsWithContext<At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = DefaultCommandType, Ev extends UnknownType = DefaultEventType, Me extends UnknownType = DefaultMessageType, Re extends UnknownType = DefaultReactionType, Us extends UnknownType = DefaultUserType> = Pick<ImageGalleryContextValue, 'setImage'> & Pick<MessageContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'alignment' | 'groupStyles' | 'images' | 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress' | 'threadList'> & Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'additionalTouchableProps'> & Pick<OverlayContextValue, 'setBlurType' | 'setOverlay'> & {
6
+ export declare type GalleryPropsWithContext<At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = DefaultCommandType, Ev extends UnknownType = DefaultEventType, Me extends UnknownType = DefaultMessageType, Re extends UnknownType = DefaultReactionType, Us extends UnknownType = DefaultUserType> = Pick<ImageGalleryContextValue, 'setImage' | 'setImages'> & Pick<MessageContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'alignment' | 'groupStyles' | 'images' | 'message' | 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress' | 'threadList'> & Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'additionalTouchableProps' | 'legacyImageViewerSwipeBehaviour'> & Pick<OverlayContextValue, 'setBlurType' | 'setOverlay'> & {
7
7
  hasThreadReplies?: boolean;
8
8
  messageId?: string;
9
9
  messageText?: string;
@@ -13,7 +13,7 @@ import { TranslationContextValue } from '../../contexts/translationContext/Trans
13
13
  import { ReactionData } from '../../utils/utils';
14
14
  import type { DefaultAttachmentType, DefaultChannelType, DefaultCommandType, DefaultEventType, DefaultMessageType, DefaultReactionType, DefaultUserType, UnknownType } from '../../types/types';
15
15
  export declare const reactionData: ReactionData[];
16
- export declare type ChannelPropsWithContext<At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = DefaultCommandType, Ev extends UnknownType = DefaultEventType, Me extends UnknownType = DefaultMessageType, Re extends UnknownType = DefaultReactionType, Us extends UnknownType = DefaultUserType> = Partial<Pick<ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'channel' | 'EmptyStateIndicator' | 'enforceUniqueReaction' | 'giphyEnabled' | 'hideDateSeparators' | 'LoadingIndicator' | 'maxTimeBetweenGroupedMessages' | 'NetworkDownIndicator' | 'StickyHeader'>> & Pick<ChatContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'client'> & Partial<Omit<InputMessageInputContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'quotedMessage' | 'editing' | 'clearEditingState' | 'clearQuotedMessageState' | 'sendMessage'>> & Partial<SuggestionsContextValue<Co, Us>> & Pick<TranslationContextValue, 't'> & Partial<Pick<PaginatedMessageListContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'messages' | 'loadingMore' | 'loadingMoreRecent'>> & Partial<Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'additionalTouchableProps' | 'animatedLongPress' | 'Attachment' | 'AttachmentActions' | 'blockUser' | 'Card' | 'CardCover' | 'CardFooter' | 'CardHeader' | 'copyMessage' | 'DateHeader' | 'deleteMessage' | 'disableTypingIndicator' | 'dismissKeyboardOnMessageTouch' | 'editMessage' | 'FileAttachment' | 'FileAttachmentIcon' | 'FileAttachmentGroup' | 'flagMessage' | 'FlatList' | 'forceAlignMessages' | 'formatDate' | 'Gallery' | 'Giphy' | 'handleBlock' | 'handleCopy' | 'handleDelete' | 'handleEdit' | 'handleFlag' | 'handleMute' | 'handleReaction' | 'handleQuotedReply' | 'handleRetry' | 'handleThreadReply' | 'InlineDateSeparator' | 'InlineUnreadIndicator' | 'markdownRules' | 'Message' | 'messageActions' | 'MessageAvatar' | 'MessageContent' | 'messageContentOrder' | 'MessageDeleted' | 'MessageFooter' | 'MessageHeader' | 'MessageList' | 'MessageReplies' | 'MessageRepliesAvatars' | 'MessageSimple' | 'MessageStatus' | 'MessageSystem' | 'MessageText' | 'muteUser' | 'myMessageTheme' | 'onDoubleTapMessage' | 'onLongPressMessage' | 'onPressInMessage' | 'onPressMessage' | 'OverlayReactionList' | 'quotedReply' | 'ReactionList' | 'Reply' | 'retry' | 'ScrollToBottomButton' | 'selectReaction' | 'supportedReactions' | 'threadReply' | 'TypingIndicator' | 'TypingIndicatorContainer' | 'UrlPreview'>> & Partial<Pick<ThreadContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'allowThreadMessagesInChannel' | 'thread'>> & {
16
+ export declare type ChannelPropsWithContext<At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = DefaultCommandType, Ev extends UnknownType = DefaultEventType, Me extends UnknownType = DefaultMessageType, Re extends UnknownType = DefaultReactionType, Us extends UnknownType = DefaultUserType> = Partial<Pick<ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'channel' | 'EmptyStateIndicator' | 'enableMessageGroupingByUser' | 'enforceUniqueReaction' | 'giphyEnabled' | 'hideStickyDateHeader' | 'hideDateSeparators' | 'LoadingIndicator' | 'maxTimeBetweenGroupedMessages' | 'NetworkDownIndicator' | 'StickyHeader'>> & Pick<ChatContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'client'> & Partial<Omit<InputMessageInputContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'quotedMessage' | 'editing' | 'clearEditingState' | 'clearQuotedMessageState' | 'sendMessage'>> & Partial<SuggestionsContextValue<Co, Us>> & Pick<TranslationContextValue, 't'> & Partial<Pick<PaginatedMessageListContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'messages' | 'loadingMore' | 'loadingMoreRecent'>> & Partial<Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'additionalTouchableProps' | 'animatedLongPress' | 'Attachment' | 'AttachmentActions' | 'blockUser' | 'Card' | 'CardCover' | 'CardFooter' | 'CardHeader' | 'copyMessage' | 'DateHeader' | 'deleteMessage' | 'disableTypingIndicator' | 'dismissKeyboardOnMessageTouch' | 'editMessage' | 'FileAttachment' | 'FileAttachmentIcon' | 'FileAttachmentGroup' | 'flagMessage' | 'FlatList' | 'forceAlignMessages' | 'formatDate' | 'Gallery' | 'Giphy' | 'handleBlock' | 'handleCopy' | 'handleDelete' | 'handleEdit' | 'handleFlag' | 'handleMute' | 'handleReaction' | 'handleQuotedReply' | 'handleRetry' | 'handleThreadReply' | 'InlineDateSeparator' | 'InlineUnreadIndicator' | 'markdownRules' | 'Message' | 'messageActions' | 'MessageAvatar' | 'MessageContent' | 'messageContentOrder' | 'MessageDeleted' | 'MessageFooter' | 'MessageHeader' | 'MessageList' | 'MessageReplies' | 'MessageRepliesAvatars' | 'MessageSimple' | 'MessageStatus' | 'MessageSystem' | 'MessageText' | 'muteUser' | 'myMessageTheme' | 'onDoubleTapMessage' | 'onLongPressMessage' | 'onPressInMessage' | 'onPressMessage' | 'OverlayReactionList' | 'quotedReply' | 'ReactionList' | 'Reply' | 'retry' | 'ScrollToBottomButton' | 'selectReaction' | 'supportedReactions' | 'threadReply' | 'TypingIndicator' | 'TypingIndicatorContainer' | 'UrlPreview'>> & Partial<Pick<ThreadContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'allowThreadMessagesInChannel' | 'thread'>> & {
17
17
  /**
18
18
  * Additional props passed to keyboard avoiding view
19
19
  */
@@ -79,6 +79,7 @@ export declare type ChannelPropsWithContext<At extends UnknownType = DefaultAtta
79
79
  */
80
80
  KeyboardCompatibleView?: React.ComponentType<KeyboardAvoidingViewProps>;
81
81
  keyboardVerticalOffset?: number;
82
+ legacyImageViewerSwipeBehaviour?: boolean;
82
83
  /**
83
84
  * Custom loading error indicator to override the Stream default
84
85
  */
@@ -1,3 +1,3 @@
1
1
  import type { ChannelContextValue } from '../../../contexts/channelContext/ChannelContext';
2
2
  import type { DefaultAttachmentType, DefaultChannelType, DefaultUserType, UnknownType } from '../../../types/types';
3
- export declare const useCreateChannelContext: <At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = import("stream-chat").LiteralStringForUnion, Ev extends UnknownType = UnknownType, Me extends UnknownType = UnknownType, Re extends UnknownType = UnknownType, Us extends UnknownType = DefaultUserType>({ channel, disabled, EmptyStateIndicator, enforceUniqueReaction, error, giphyEnabled, hideDateSeparators, isAdmin, isModerator, isOwner, lastRead, loadChannelAtMessage, loading, LoadingIndicator, markRead, maxTimeBetweenGroupedMessages, members, NetworkDownIndicator, read, readEventsEnabled, reloadChannel, scrollToFirstUnreadThreshold, setLastRead, setTargetedMessage, StickyHeader, targetedMessage, typingEventsEnabled, watcherCount, watchers, }: ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>) => ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>;
3
+ export declare const useCreateChannelContext: <At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = import("stream-chat").LiteralStringForUnion, Ev extends UnknownType = UnknownType, Me extends UnknownType = UnknownType, Re extends UnknownType = UnknownType, Us extends UnknownType = DefaultUserType>({ channel, disabled, EmptyStateIndicator, enableMessageGroupingByUser, enforceUniqueReaction, error, giphyEnabled, hideDateSeparators, hideStickyDateHeader, isAdmin, isModerator, isOwner, lastRead, loadChannelAtMessage, loading, LoadingIndicator, markRead, maxTimeBetweenGroupedMessages, members, NetworkDownIndicator, read, readEventsEnabled, reloadChannel, scrollToFirstUnreadThreshold, setLastRead, setTargetedMessage, StickyHeader, targetedMessage, typingEventsEnabled, watcherCount, watchers, }: ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>) => ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>;
@@ -1,12 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import type { MessagesContextValue } from '../../../contexts/messagesContext/MessagesContext';
3
3
  import type { DefaultAttachmentType, DefaultChannelType, DefaultUserType, UnknownType } from '../../../types/types';
4
- export declare const useCreateMessagesContext: <At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = import("stream-chat").LiteralStringForUnion, Ev extends UnknownType = UnknownType, Me extends UnknownType = UnknownType, Re extends UnknownType = UnknownType, Us extends UnknownType = DefaultUserType>({ additionalTouchableProps, animatedLongPress, Attachment, AttachmentActions, blockUser, Card, CardCover, CardFooter, CardHeader, channelId, copyMessage, DateHeader, deleteMessage, disableTypingIndicator, dismissKeyboardOnMessageTouch, editMessage, FileAttachment, FileAttachmentGroup, FileAttachmentIcon, flagMessage, FlatList, forceAlignMessages, formatDate, Gallery, Giphy, handleBlock, handleCopy, handleDelete, handleEdit, handleFlag, handleMute, handleQuotedReply, handleReaction, handleRetry, handleThreadReply, initialScrollToFirstUnreadMessage, InlineDateSeparator, InlineUnreadIndicator, markdownRules, Message, messageActions, MessageAvatar, MessageContent, messageContentOrder, MessageDeleted, MessageFooter, MessageHeader, MessageList, MessageReplies, MessageRepliesAvatars, MessageSimple, MessageStatus, MessageSystem, MessageText, mutesEnabled, muteUser, myMessageTheme, onDoubleTapMessage, onLongPressMessage, onPressInMessage, onPressMessage, OverlayReactionList, quotedRepliesEnabled, quotedReply, ReactionList, reactionsEnabled, removeMessage, Reply, retry, retrySendMessage, ScrollToBottomButton, selectReaction, setEditingState, setQuotedMessageState, supportedReactions, threadRepliesEnabled, threadReply, TypingIndicator, TypingIndicatorContainer, updateMessage, UrlPreview, }: import("../../../contexts/messagesContext/MessagesContext").MessagesConfig & {
4
+ export declare const useCreateMessagesContext: <At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = import("stream-chat").LiteralStringForUnion, Ev extends UnknownType = UnknownType, Me extends UnknownType = UnknownType, Re extends UnknownType = UnknownType, Us extends UnknownType = DefaultUserType>({ additionalTouchableProps, animatedLongPress, Attachment, AttachmentActions, blockUser, Card, CardCover, CardFooter, CardHeader, channelId, copyMessage, DateHeader, deleteMessage, disableTypingIndicator, dismissKeyboardOnMessageTouch, editMessage, enableMessageGroupingByUser, FileAttachment, FileAttachmentGroup, FileAttachmentIcon, flagMessage, FlatList, forceAlignMessages, formatDate, Gallery, Giphy, handleBlock, handleCopy, handleDelete, handleEdit, handleFlag, handleMute, handleQuotedReply, handleReaction, handleRetry, handleThreadReply, initialScrollToFirstUnreadMessage, InlineDateSeparator, InlineUnreadIndicator, legacyImageViewerSwipeBehaviour, markdownRules, Message, messageActions, MessageAvatar, MessageContent, messageContentOrder, MessageDeleted, MessageFooter, MessageHeader, MessageList, MessageReplies, MessageRepliesAvatars, MessageSimple, MessageStatus, MessageSystem, MessageText, mutesEnabled, muteUser, myMessageTheme, onDoubleTapMessage, onLongPressMessage, onPressInMessage, onPressMessage, OverlayReactionList, quotedRepliesEnabled, quotedReply, ReactionList, reactionsEnabled, removeMessage, Reply, retry, retrySendMessage, ScrollToBottomButton, selectReaction, setEditingState, setQuotedMessageState, supportedReactions, threadRepliesEnabled, threadReply, TypingIndicator, TypingIndicatorContainer, updateMessage, UrlPreview, }: import("../../../contexts/messagesContext/MessagesContext").MessagesConfig & {
5
5
  Attachment: import("react").ComponentType<import("../..").AttachmentProps<At, Ch, Co, Ev, Me, Re, Us>>;
6
6
  AttachmentActions: import("react").ComponentType<import("../..").AttachmentActionsProps<At, Ch, Co, Ev, Me, Re, Us>>;
7
7
  Card: import("react").ComponentType<import("../..").CardProps<At, Ch, Co, Ev, Me, Re, Us>>;
8
8
  DateHeader: import("react").ComponentType<import("../..").DateHeaderProps>;
9
9
  dismissKeyboardOnMessageTouch: boolean;
10
+ enableMessageGroupingByUser: boolean;
10
11
  FileAttachment: import("react").ComponentType<import("../..").FileAttachmentProps<At, Ch, Co, Ev, Me, Re, Us>>;
11
12
  FileAttachmentGroup: import("react").ComponentType<import("../..").FileAttachmentGroupProps<At, Ch, Co, Ev, Me, Re, Us>>;
12
13
  FileAttachmentIcon: import("react").ComponentType<import("../..").FileIconProps>;
@@ -22,7 +23,7 @@ export declare const useCreateMessagesContext: <At extends UnknownType = Default
22
23
  messageContentOrder: import("../../../contexts/messagesContext/MessagesContext").MessageContentType[];
23
24
  MessageDeleted: import("react").ComponentType<import("../..").MessageDeletedProps<At, Ch, Co, Ev, Me, Re, Us>>;
24
25
  MessageFooter: import("react").ComponentType<import("../..").MessageFooterProps<At, Ch, Co, Ev, Me, Re, Us>>;
25
- MessageList: import("react").ComponentType<Partial<Pick<import("../../..").AttachmentPickerContextValue, "selectedPicker" | "closePicker" | "setSelectedPicker"> & Pick<import("../../..").ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>, "channel" | "disabled" | "EmptyStateIndicator" | "loadChannelAtMessage" | "loading" | "LoadingIndicator" | "markRead" | "NetworkDownIndicator" | "reloadChannel" | "scrollToFirstUnreadThreshold" | "setTargetedMessage" | "StickyHeader" | "targetedMessage" | "typingEventsEnabled"> & Pick<import("../../..").ChatContextValue<At, Ch, Co, Ev, Me, Re, Us>, "client"> & Pick<import("../../..").ImageGalleryContextValue<At, Ch, Co, Ev, Me, Re, Us>, "setImages"> & Pick<import("../../..").PaginatedMessageListContextValue<At, Ch, Co, Ev, Me, Re, Us>, "loadMore" | "loadMoreRecent"> & Pick<import("../../..").OverlayContextValue, "overlay"> & Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, "DateHeader" | "FlatList" | "initialScrollToFirstUnreadMessage" | "InlineDateSeparator" | "InlineUnreadIndicator" | "Message" | "MessageSystem" | "ScrollToBottomButton" | "TypingIndicator" | "TypingIndicatorContainer" | "disableTypingIndicator" | "myMessageTheme"> & Pick<import("../../..").ThreadContextValue<At, Ch, Co, Ev, Me, Re, Us>, "loadMoreThread" | "thread"> & Pick<import("../../..").TranslationContextValue, "t" | "tDateTimeParser"> & {
26
+ MessageList: import("react").ComponentType<Partial<Pick<import("../../..").AttachmentPickerContextValue, "selectedPicker" | "closePicker" | "setSelectedPicker"> & Pick<import("../../..").ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>, "channel" | "disabled" | "EmptyStateIndicator" | "hideStickyDateHeader" | "loadChannelAtMessage" | "loading" | "LoadingIndicator" | "markRead" | "NetworkDownIndicator" | "reloadChannel" | "scrollToFirstUnreadThreshold" | "setTargetedMessage" | "StickyHeader" | "targetedMessage" | "typingEventsEnabled"> & Pick<import("../../..").ChatContextValue<At, Ch, Co, Ev, Me, Re, Us>, "client"> & Pick<import("../../..").ImageGalleryContextValue<At, Ch, Co, Ev, Me, Re, Us>, "setImages"> & Pick<import("../../..").PaginatedMessageListContextValue<At, Ch, Co, Ev, Me, Re, Us>, "loadMore" | "loadMoreRecent"> & Pick<import("../../..").OverlayContextValue, "overlay"> & Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, "DateHeader" | "FlatList" | "initialScrollToFirstUnreadMessage" | "InlineDateSeparator" | "InlineUnreadIndicator" | "Message" | "MessageSystem" | "ScrollToBottomButton" | "TypingIndicator" | "TypingIndicatorContainer" | "disableTypingIndicator" | "legacyImageViewerSwipeBehaviour" | "myMessageTheme"> & Pick<import("../../..").ThreadContextValue<At, Ch, Co, Ev, Me, Re, Us>, "loadMoreThread" | "thread"> & Pick<import("../../..").TranslationContextValue, "t" | "tDateTimeParser"> & {
26
27
  additionalFlatListProps?: Partial<import("react-native").FlatListProps<import("../..").MessageType<At, Ch, Co, Ev, Me, Re, Us>>> | undefined;
27
28
  FooterComponent?: import("react").ComponentType<{}> | undefined;
28
29
  HeaderComponent?: import("react").ComponentType<{}> | undefined;
@@ -90,6 +91,7 @@ export declare const useCreateMessagesContext: <At extends UnknownType = Default
90
91
  handleReaction?: ((message: import("../..").MessageType<At, Ch, Co, Ev, Me, Re, Us>, reactionType: string) => Promise<void>) | undefined;
91
92
  handleRetry?: ((message: import("../..").MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>) | undefined;
92
93
  handleThreadReply?: ((message: import("../..").MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>) | undefined;
94
+ legacyImageViewerSwipeBehaviour?: boolean | undefined;
93
95
  markdownRules?: Partial<import("simple-markdown").DefaultRules> | undefined;
94
96
  messageActions?: (import("../../..").MessageAction | null)[] | (({ blockUser, canModifyMessage, copyMessage, deleteMessage, dismissOverlay, editMessage, error, flagMessage, isMyMessage, isThreadMessage, message, messageReactions, muteUser, quotedRepliesEnabled, quotedReply, retry, threadRepliesEnabled, threadReply, }: {
95
97
  blockUser: import("../../..").MessageAction | null;
@@ -1,7 +1,7 @@
1
1
  import { MessageContextValue } from '../../../contexts/messageContext/MessageContext';
2
2
  import { MessagesContextValue } from '../../../contexts/messagesContext/MessagesContext';
3
3
  import type { DefaultAttachmentType, DefaultChannelType, DefaultCommandType, DefaultEventType, DefaultMessageType, DefaultReactionType, DefaultUserType, UnknownType } from '../../../types/types';
4
- export declare type MessageSimplePropsWithContext<At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = DefaultCommandType, Ev extends UnknownType = DefaultEventType, Me extends UnknownType = DefaultMessageType, Re extends UnknownType = DefaultReactionType, Us extends UnknownType = DefaultUserType> = Pick<MessageContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'alignment' | 'channel' | 'groupStyles' | 'hasReactions' | 'message'> & Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'MessageAvatar' | 'MessageContent' | 'ReactionList'>;
4
+ export declare type MessageSimplePropsWithContext<At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = DefaultCommandType, Ev extends UnknownType = DefaultEventType, Me extends UnknownType = DefaultMessageType, Re extends UnknownType = DefaultReactionType, Us extends UnknownType = DefaultUserType> = Pick<MessageContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'alignment' | 'channel' | 'groupStyles' | 'hasReactions' | 'message'> & Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'enableMessageGroupingByUser' | 'MessageAvatar' | 'MessageContent' | 'ReactionList'>;
5
5
  export declare type MessageSimpleProps<At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = DefaultCommandType, Ev extends UnknownType = DefaultEventType, Me extends UnknownType = DefaultMessageType, Re extends UnknownType = DefaultReactionType, Us extends UnknownType = DefaultUserType> = Partial<MessageSimplePropsWithContext<At, Ch, Co, Ev, Me, Re, Us>>;
6
6
  /**
7
7
  *
@@ -11,7 +11,7 @@ import { PaginatedMessageListContextValue } from '../../contexts/paginatedMessag
11
11
  import { ThreadContextValue } from '../../contexts/threadContext/ThreadContext';
12
12
  import { TranslationContextValue } from '../../contexts/translationContext/TranslationContext';
13
13
  import type { DefaultAttachmentType, DefaultChannelType, DefaultCommandType, DefaultEventType, DefaultMessageType, DefaultReactionType, DefaultUserType, UnknownType } from '../../types/types';
14
- declare type MessageListPropsWithContext<At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = DefaultCommandType, Ev extends UnknownType = DefaultEventType, Me extends UnknownType = DefaultMessageType, Re extends UnknownType = DefaultReactionType, Us extends UnknownType = DefaultUserType> = Pick<AttachmentPickerContextValue, 'closePicker' | 'selectedPicker' | 'setSelectedPicker'> & Pick<ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'channel' | 'disabled' | 'EmptyStateIndicator' | 'loadChannelAtMessage' | 'loading' | 'LoadingIndicator' | 'markRead' | 'NetworkDownIndicator' | 'reloadChannel' | 'scrollToFirstUnreadThreshold' | 'setTargetedMessage' | 'StickyHeader' | 'targetedMessage' | 'typingEventsEnabled'> & Pick<ChatContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'client'> & Pick<ImageGalleryContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'setImages'> & Pick<PaginatedMessageListContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'loadMore' | 'loadMoreRecent'> & Pick<OverlayContextValue, 'overlay'> & Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'DateHeader' | 'disableTypingIndicator' | 'FlatList' | 'initialScrollToFirstUnreadMessage' | 'InlineDateSeparator' | 'InlineUnreadIndicator' | 'Message' | 'ScrollToBottomButton' | 'MessageSystem' | 'myMessageTheme' | 'TypingIndicator' | 'TypingIndicatorContainer'> & Pick<ThreadContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'loadMoreThread' | 'thread'> & Pick<TranslationContextValue, 't' | 'tDateTimeParser'> & {
14
+ declare type MessageListPropsWithContext<At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = DefaultCommandType, Ev extends UnknownType = DefaultEventType, Me extends UnknownType = DefaultMessageType, Re extends UnknownType = DefaultReactionType, Us extends UnknownType = DefaultUserType> = Pick<AttachmentPickerContextValue, 'closePicker' | 'selectedPicker' | 'setSelectedPicker'> & Pick<ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'channel' | 'disabled' | 'EmptyStateIndicator' | 'hideStickyDateHeader' | 'loadChannelAtMessage' | 'loading' | 'LoadingIndicator' | 'markRead' | 'NetworkDownIndicator' | 'reloadChannel' | 'scrollToFirstUnreadThreshold' | 'setTargetedMessage' | 'StickyHeader' | 'targetedMessage' | 'typingEventsEnabled'> & Pick<ChatContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'client'> & Pick<ImageGalleryContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'setImages'> & Pick<PaginatedMessageListContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'loadMore' | 'loadMoreRecent'> & Pick<OverlayContextValue, 'overlay'> & Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'DateHeader' | 'disableTypingIndicator' | 'FlatList' | 'initialScrollToFirstUnreadMessage' | 'InlineDateSeparator' | 'InlineUnreadIndicator' | 'legacyImageViewerSwipeBehaviour' | 'Message' | 'ScrollToBottomButton' | 'MessageSystem' | 'myMessageTheme' | 'TypingIndicator' | 'TypingIndicatorContainer'> & Pick<ThreadContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'loadMoreThread' | 'thread'> & Pick<TranslationContextValue, 't' | 'tDateTimeParser'> & {
15
15
  /**
16
16
  * Besides existing (default) UX behavior of underlying FlatList of MessageList component, if you want
17
17
  * to attach some additional props to underlying FlatList, you can add it to following prop.
@@ -30,6 +30,7 @@ export declare type ChannelContextValue<At extends UnknownType = DefaultAttachme
30
30
  * Hide inline date separators on channel
31
31
  */
32
32
  hideDateSeparators: boolean;
33
+ hideStickyDateHeader: boolean;
33
34
  /**
34
35
  * Returns true if the current user has admin privileges
35
36
  */
@@ -137,6 +138,7 @@ export declare type ChannelContextValue<At extends UnknownType = DefaultAttachme
137
138
  */
138
139
  channel?: Channel<At, Ch, Co, Ev, Me, Re, Us>;
139
140
  disabled?: boolean;
141
+ enableMessageGroupingByUser?: boolean;
140
142
  lastRead?: Date;
141
143
  /**
142
144
  * Maximum time in milliseconds that should occur between messages
@@ -168,4 +170,4 @@ export declare const useChannelContext: <At extends UnknownType = DefaultAttachm
168
170
  * typing is desired while using the HOC withChannelContext the Props for the
169
171
  * wrapped component must be provided as the first generic.
170
172
  */
171
- export declare const withChannelContext: <P extends UnknownType, At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = import("stream-chat").LiteralStringForUnion, Ev extends UnknownType = UnknownType, Me extends UnknownType = UnknownType, Re extends UnknownType = UnknownType, Us extends UnknownType = DefaultUserType>(Component: React.ComponentType<P>) => React.FC<Omit<P, "error" | "channel" | "hideDateSeparators" | "maxTimeBetweenGroupedMessages" | "read" | "disabled" | "members" | "watchers" | "EmptyStateIndicator" | "enforceUniqueReaction" | "giphyEnabled" | "isAdmin" | "isModerator" | "isOwner" | "loadChannelAtMessage" | "loading" | "LoadingIndicator" | "markRead" | "NetworkDownIndicator" | "reloadChannel" | "scrollToFirstUnreadThreshold" | "setLastRead" | "setTargetedMessage" | "lastRead" | "StickyHeader" | "targetedMessage" | "watcherCount" | keyof ChannelConfig>>;
173
+ export declare const withChannelContext: <P extends UnknownType, At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = import("stream-chat").LiteralStringForUnion, Ev extends UnknownType = UnknownType, Me extends UnknownType = UnknownType, Re extends UnknownType = UnknownType, Us extends UnknownType = DefaultUserType>(Component: React.ComponentType<P>) => React.FC<Omit<P, "error" | "channel" | "hideDateSeparators" | "maxTimeBetweenGroupedMessages" | "read" | "disabled" | "members" | "watchers" | "EmptyStateIndicator" | "enforceUniqueReaction" | "giphyEnabled" | "hideStickyDateHeader" | "isAdmin" | "isModerator" | "isOwner" | "loadChannelAtMessage" | "loading" | "LoadingIndicator" | "markRead" | "NetworkDownIndicator" | "reloadChannel" | "scrollToFirstUnreadThreshold" | "setLastRead" | "setTargetedMessage" | "enableMessageGroupingByUser" | "lastRead" | "StickyHeader" | "targetedMessage" | "watcherCount" | keyof ChannelConfig>>;
@@ -68,6 +68,7 @@ export declare type MessagesContextValue<At extends UnknownType = DefaultAttachm
68
68
  DateHeader: React.ComponentType<DateHeaderProps>;
69
69
  /** Should keyboard be dismissed when messaged is touched */
70
70
  dismissKeyboardOnMessageTouch: boolean;
71
+ enableMessageGroupingByUser: boolean;
71
72
  /**
72
73
  * UI component to display File type attachment.
73
74
  * Defaults to: [FileAttachment](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileAttachment.tsx)
@@ -292,6 +293,7 @@ export declare type MessagesContextValue<At extends UnknownType = DefaultAttachm
292
293
  handleRetry?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;
293
294
  /** Handler to access when a thread reply action is invoked */
294
295
  handleThreadReply?: (message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>;
296
+ legacyImageViewerSwipeBehaviour?: boolean;
295
297
  /** Object specifying rules defined within simple-markdown https://github.com/Khan/simple-markdown#adding-a-simple-extension */
296
298
  markdownRules?: MarkdownRules;
297
299
  /**
@@ -520,4 +522,4 @@ export declare const useMessagesContext: <At extends UnknownType = DefaultAttach
520
522
  * typing is desired while using the HOC withMessagesContext the Props for the
521
523
  * wrapped component must be provided as the first generic.
522
524
  */
523
- export declare const withMessagesContext: <P extends UnknownType, At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = import("stream-chat").LiteralStringForUnion, Ev extends UnknownType = UnknownType, Me extends UnknownType = UnknownType, Re extends UnknownType = UnknownType, Us extends UnknownType = DefaultUserType>(Component: React.ComponentType<P>) => React.FC<Omit<P, "editMessage" | "setQuotedMessageState" | "updateMessage" | "FileAttachmentIcon" | "Reply" | "retry" | "messageActions" | "handleReaction" | "OverlayReactionList" | "supportedReactions" | keyof MessagesConfig | "Attachment" | "AttachmentActions" | "Card" | "DateHeader" | "dismissKeyboardOnMessageTouch" | "FileAttachment" | "FileAttachmentGroup" | "FlatList" | "Gallery" | "Giphy" | "initialScrollToFirstUnreadMessage" | "InlineDateSeparator" | "InlineUnreadIndicator" | "Message" | "MessageAvatar" | "MessageContent" | "messageContentOrder" | "MessageDeleted" | "MessageFooter" | "MessageList" | "MessageReplies" | "MessageRepliesAvatars" | "MessageSimple" | "MessageStatus" | "MessageSystem" | "ReactionList" | "removeMessage" | "retrySendMessage" | "ScrollToBottomButton" | "setEditingState" | "TypingIndicator" | "TypingIndicatorContainer" | "UrlPreview" | "additionalTouchableProps" | "animatedLongPress" | "blockUser" | "CardCover" | "CardFooter" | "CardHeader" | "copyMessage" | "deleteMessage" | "disableTypingIndicator" | "flagMessage" | "forceAlignMessages" | "formatDate" | "handleBlock" | "handleCopy" | "handleDelete" | "handleEdit" | "handleFlag" | "handleMute" | "handleQuotedReply" | "handleRetry" | "handleThreadReply" | "markdownRules" | "MessageHeader" | "MessageText" | "muteUser" | "myMessageTheme" | "onDoubleTapMessage" | "onLongPressMessage" | "onPressInMessage" | "onPressMessage" | "quotedReply" | "selectReaction" | "threadReply">>;
525
+ export declare const withMessagesContext: <P extends UnknownType, At extends UnknownType = DefaultAttachmentType, Ch extends UnknownType = DefaultChannelType, Co extends string = import("stream-chat").LiteralStringForUnion, Ev extends UnknownType = UnknownType, Me extends UnknownType = UnknownType, Re extends UnknownType = UnknownType, Us extends UnknownType = DefaultUserType>(Component: React.ComponentType<P>) => React.FC<Omit<P, "editMessage" | "setQuotedMessageState" | "updateMessage" | "FileAttachmentIcon" | "Reply" | "enableMessageGroupingByUser" | "retry" | "messageActions" | "handleReaction" | "OverlayReactionList" | "supportedReactions" | keyof MessagesConfig | "Attachment" | "AttachmentActions" | "Card" | "DateHeader" | "dismissKeyboardOnMessageTouch" | "FileAttachment" | "FileAttachmentGroup" | "FlatList" | "Gallery" | "Giphy" | "initialScrollToFirstUnreadMessage" | "InlineDateSeparator" | "InlineUnreadIndicator" | "Message" | "MessageAvatar" | "MessageContent" | "messageContentOrder" | "MessageDeleted" | "MessageFooter" | "MessageList" | "MessageReplies" | "MessageRepliesAvatars" | "MessageSimple" | "MessageStatus" | "MessageSystem" | "ReactionList" | "removeMessage" | "retrySendMessage" | "ScrollToBottomButton" | "setEditingState" | "TypingIndicator" | "TypingIndicatorContainer" | "UrlPreview" | "additionalTouchableProps" | "animatedLongPress" | "blockUser" | "CardCover" | "CardFooter" | "CardHeader" | "copyMessage" | "deleteMessage" | "disableTypingIndicator" | "flagMessage" | "forceAlignMessages" | "formatDate" | "handleBlock" | "handleCopy" | "handleDelete" | "handleEdit" | "handleFlag" | "handleMute" | "handleQuotedReply" | "handleRetry" | "handleThreadReply" | "legacyImageViewerSwipeBehaviour" | "markdownRules" | "MessageHeader" | "MessageText" | "muteUser" | "myMessageTheme" | "onDoubleTapMessage" | "onLongPressMessage" | "onPressInMessage" | "onPressMessage" | "quotedReply" | "selectReaction" | "threadReply">>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stream-chat-react-native-core",
3
3
  "description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
4
- "version": "3.9.0-next.1",
4
+ "version": "3.9.0-next.2",
5
5
  "author": {
6
6
  "company": "Stream.io Inc",
7
7
  "name": "Stream.io Inc"
@@ -98,19 +98,23 @@ export type GalleryPropsWithContext<
98
98
  Me extends UnknownType = DefaultMessageType,
99
99
  Re extends UnknownType = DefaultReactionType,
100
100
  Us extends UnknownType = DefaultUserType,
101
- > = Pick<ImageGalleryContextValue, 'setImage'> &
101
+ > = Pick<ImageGalleryContextValue, 'setImage' | 'setImages'> &
102
102
  Pick<
103
103
  MessageContextValue<At, Ch, Co, Ev, Me, Re, Us>,
104
104
  | 'alignment'
105
105
  | 'groupStyles'
106
106
  | 'images'
107
+ | 'message'
107
108
  | 'onLongPress'
108
109
  | 'onPress'
109
110
  | 'onPressIn'
110
111
  | 'preventPress'
111
112
  | 'threadList'
112
113
  > &
113
- Pick<MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'additionalTouchableProps'> &
114
+ Pick<
115
+ MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>,
116
+ 'additionalTouchableProps' | 'legacyImageViewerSwipeBehaviour'
117
+ > &
114
118
  Pick<OverlayContextValue, 'setBlurType' | 'setOverlay'> & {
115
119
  hasThreadReplies?: boolean;
116
120
  messageId?: string;
@@ -134,6 +138,8 @@ const GalleryWithContext = <
134
138
  groupStyles,
135
139
  hasThreadReplies,
136
140
  images,
141
+ legacyImageViewerSwipeBehaviour,
142
+ message,
137
143
  messageId,
138
144
  messageText,
139
145
  onLongPress,
@@ -142,6 +148,7 @@ const GalleryWithContext = <
142
148
  preventPress,
143
149
  setBlurType,
144
150
  setImage,
151
+ setImages,
145
152
  setOverlay,
146
153
  threadList,
147
154
  } = props;
@@ -217,6 +224,9 @@ const GalleryWithContext = <
217
224
  >
218
225
  {column.map(({ height, url }, rowIndex) => {
219
226
  const defaultOnPress = () => {
227
+ if (!legacyImageViewerSwipeBehaviour) {
228
+ setImages([message]);
229
+ }
220
230
  setImage({ messageId, url });
221
231
  setBlurType(blurType);
222
232
  setOverlay('gallery');
@@ -413,7 +423,7 @@ export const Gallery = <
413
423
  threadList: propThreadList,
414
424
  } = props;
415
425
 
416
- const { setImage: contextSetImage } = useImageGalleryContext();
426
+ const { setImage: contextSetImage, setImages } = useImageGalleryContext();
417
427
  const {
418
428
  alignment: contextAlignment,
419
429
  groupStyles: contextGroupStyles,
@@ -425,8 +435,10 @@ export const Gallery = <
425
435
  preventPress: contextPreventPress,
426
436
  threadList: contextThreadList,
427
437
  } = useMessageContext<At, Ch, Co, Ev, Me, Re, Us>();
428
- const { additionalTouchableProps: contextAdditionalTouchableProps } =
429
- useMessagesContext<At, Ch, Co, Ev, Me, Re, Us>();
438
+ const {
439
+ additionalTouchableProps: contextAdditionalTouchableProps,
440
+ legacyImageViewerSwipeBehaviour,
441
+ } = useMessagesContext<At, Ch, Co, Ev, Me, Re, Us>();
430
442
  const { setBlurType: contextSetBlurType, setOverlay: contextSetOverlay } = useOverlayContext();
431
443
 
432
444
  const images = propImages || contextImages;
@@ -454,6 +466,8 @@ export const Gallery = <
454
466
  groupStyles,
455
467
  hasThreadReplies: hasThreadReplies || !!message?.reply_count,
456
468
  images,
469
+ legacyImageViewerSwipeBehaviour,
470
+ message,
457
471
  messageId: messageId || message?.id,
458
472
  messageText: messageText || message?.text,
459
473
  onLongPress,
@@ -462,6 +476,7 @@ export const Gallery = <
462
476
  preventPress,
463
477
  setBlurType,
464
478
  setImage,
479
+ setImages,
465
480
  setOverlay,
466
481
  threadList,
467
482
  }}
@@ -187,8 +187,10 @@ export type ChannelPropsWithContext<
187
187
  ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>,
188
188
  | 'channel'
189
189
  | 'EmptyStateIndicator'
190
+ | 'enableMessageGroupingByUser'
190
191
  | 'enforceUniqueReaction'
191
192
  | 'giphyEnabled'
193
+ | 'hideStickyDateHeader'
192
194
  | 'hideDateSeparators'
193
195
  | 'LoadingIndicator'
194
196
  | 'maxTimeBetweenGroupedMessages'
@@ -360,6 +362,7 @@ export type ChannelPropsWithContext<
360
362
  */
361
363
  KeyboardCompatibleView?: React.ComponentType<KeyboardAvoidingViewProps>;
362
364
  keyboardVerticalOffset?: number;
365
+ legacyImageViewerSwipeBehaviour?: boolean;
363
366
  /**
364
367
  * Custom loading error indicator to override the Stream default
365
368
  */
@@ -423,6 +426,7 @@ const ChannelWithContext = <
423
426
  doUpdateMessageRequest,
424
427
  editMessage: editMessageProp,
425
428
  EmptyStateIndicator = EmptyStateIndicatorDefault,
429
+ enableMessageGroupingByUser = true,
426
430
  enforceUniqueReaction = false,
427
431
  FileAttachment = FileAttachmentDefault,
428
432
  FileAttachmentIcon = FileIconDefault,
@@ -450,6 +454,7 @@ const ChannelWithContext = <
450
454
  hasFilePicker = true,
451
455
  hasImagePicker = true,
452
456
  hideDateSeparators = false,
457
+ hideStickyDateHeader = false,
453
458
  ImageUploadPreview = ImageUploadPreviewDefault,
454
459
  initialScrollToFirstUnreadMessage = false,
455
460
  initialValue,
@@ -460,6 +465,7 @@ const ChannelWithContext = <
460
465
  keyboardBehavior,
461
466
  KeyboardCompatibleView = KeyboardCompatibleViewDefault,
462
467
  keyboardVerticalOffset,
468
+ legacyImageViewerSwipeBehaviour = true,
463
469
  LoadingErrorIndicator = LoadingErrorIndicatorDefault,
464
470
  LoadingIndicator = LoadingIndicatorDefault,
465
471
  loadingMore: loadingMoreProp,
@@ -1569,12 +1575,14 @@ const ChannelWithContext = <
1569
1575
  channel,
1570
1576
  disabled: !!channel?.data?.frozen && disableIfFrozenChannel,
1571
1577
  EmptyStateIndicator,
1578
+ enableMessageGroupingByUser,
1572
1579
  enforceUniqueReaction,
1573
1580
  error,
1574
1581
  giphyEnabled:
1575
1582
  giphyEnabled ??
1576
1583
  !!(channel?.getConfig?.()?.commands || [])?.some((command) => command.name === 'giphy'),
1577
1584
  hideDateSeparators,
1585
+ hideStickyDateHeader,
1578
1586
  isAdmin,
1579
1587
  isModerator,
1580
1588
  isOwner,
@@ -1667,6 +1675,7 @@ const ChannelWithContext = <
1667
1675
  disableTypingIndicator,
1668
1676
  dismissKeyboardOnMessageTouch,
1669
1677
  editMessage: editMessageProp,
1678
+ enableMessageGroupingByUser,
1670
1679
  FileAttachment,
1671
1680
  FileAttachmentGroup,
1672
1681
  FileAttachmentIcon,
@@ -1689,6 +1698,7 @@ const ChannelWithContext = <
1689
1698
  initialScrollToFirstUnreadMessage,
1690
1699
  InlineDateSeparator,
1691
1700
  InlineUnreadIndicator,
1701
+ legacyImageViewerSwipeBehaviour,
1692
1702
  markdownRules,
1693
1703
  Message,
1694
1704
  messageActions,
@@ -24,10 +24,12 @@ export const useCreateChannelContext = <
24
24
  channel,
25
25
  disabled,
26
26
  EmptyStateIndicator,
27
+ enableMessageGroupingByUser,
27
28
  enforceUniqueReaction,
28
29
  error,
29
30
  giphyEnabled,
30
31
  hideDateSeparators,
32
+ hideStickyDateHeader,
31
33
  isAdmin,
32
34
  isModerator,
33
35
  isOwner,
@@ -64,10 +66,12 @@ export const useCreateChannelContext = <
64
66
  channel,
65
67
  disabled,
66
68
  EmptyStateIndicator,
69
+ enableMessageGroupingByUser,
67
70
  enforceUniqueReaction,
68
71
  error,
69
72
  giphyEnabled,
70
73
  hideDateSeparators,
74
+ hideStickyDateHeader,
71
75
  isAdmin,
72
76
  isModerator,
73
77
  isOwner,
@@ -37,6 +37,7 @@ export const useCreateMessagesContext = <
37
37
  disableTypingIndicator,
38
38
  dismissKeyboardOnMessageTouch,
39
39
  editMessage,
40
+ enableMessageGroupingByUser,
40
41
  FileAttachment,
41
42
  FileAttachmentGroup,
42
43
  FileAttachmentIcon,
@@ -59,6 +60,7 @@ export const useCreateMessagesContext = <
59
60
  initialScrollToFirstUnreadMessage,
60
61
  InlineDateSeparator,
61
62
  InlineUnreadIndicator,
63
+ legacyImageViewerSwipeBehaviour,
62
64
  markdownRules,
63
65
  Message,
64
66
  messageActions,
@@ -130,6 +132,7 @@ export const useCreateMessagesContext = <
130
132
  disableTypingIndicator,
131
133
  dismissKeyboardOnMessageTouch,
132
134
  editMessage,
135
+ enableMessageGroupingByUser,
133
136
  FileAttachment,
134
137
  FileAttachmentGroup,
135
138
  FileAttachmentIcon,
@@ -152,6 +155,7 @@ export const useCreateMessagesContext = <
152
155
  initialScrollToFirstUnreadMessage,
153
156
  InlineDateSeparator,
154
157
  InlineUnreadIndicator,
158
+ legacyImageViewerSwipeBehaviour,
155
159
  markdownRules,
156
160
  Message,
157
161
  messageActions,