stream-chat-react-native-core 3.8.3-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.
- package/lib/commonjs/components/Attachment/Gallery.js +21 -9
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +52 -30
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +4 -0
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +4 -0
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +9 -6
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +28 -23
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +40 -31
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js +1 -1
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getGroupStyles.js +1 -5
- package/lib/commonjs/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js +2 -2
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js +2 -2
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Gallery.js +21 -9
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +52 -30
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js +4 -0
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +4 -0
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +9 -6
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +28 -23
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +40 -31
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useMessageList.js +1 -1
- package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/module/components/MessageList/utils/getGroupStyles.js +1 -5
- package/lib/module/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js +2 -2
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js +2 -2
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Gallery.d.ts +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +3 -1
- package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +4 -2
- package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +1 -1
- package/lib/typescript/components/MessageList/MessageList.d.ts +1 -1
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +3 -1
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +3 -1
- package/package.json +1 -1
- package/src/components/Attachment/Gallery.tsx +20 -5
- package/src/components/Channel/Channel.tsx +124 -67
- package/src/components/Channel/hooks/useCreateChannelContext.ts +4 -0
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +4 -0
- package/src/components/Message/MessageSimple/MessageSimple.tsx +9 -3
- package/src/components/MessageInput/FileUploadPreview.tsx +68 -58
- package/src/components/MessageInput/__tests__/__snapshots__/FileUploadPreview.test.js.snap +778 -730
- package/src/components/MessageList/MessageList.tsx +52 -27
- package/src/components/MessageList/hooks/useMessageList.ts +1 -1
- package/src/components/MessageList/utils/getGroupStyles.ts +3 -8
- package/src/contexts/channelContext/ChannelContext.tsx +2 -0
- package/src/contexts/messagesContext/MessagesContext.tsx +2 -0
- package/src/version.json +1 -1
- package/lib/commonjs/components/Channel/utils/debounce.js +0 -20
- package/lib/commonjs/components/Channel/utils/debounce.js.map +0 -1
- package/lib/commonjs/components/Channel/utils/throttle.js +0 -20
- package/lib/commonjs/components/Channel/utils/throttle.js.map +0 -1
- package/lib/module/components/Channel/utils/debounce.js +0 -20
- package/lib/module/components/Channel/utils/debounce.js.map +0 -1
- package/lib/module/components/Channel/utils/throttle.js +0 -20
- package/lib/module/components/Channel/utils/throttle.js.map +0 -1
- package/lib/typescript/components/Channel/utils/debounce.d.ts +0 -2
- package/lib/typescript/components/Channel/utils/throttle.d.ts +0 -2
- package/src/components/Channel/utils/debounce.ts +0 -12
- package/src/components/Channel/utils/throttle.ts +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useMessageList.ts"],"names":["isMessageWithStylesReadByAndDateSeparator","message","readBy","undefined","useMessageList","params","inverted","noGroupByUser","threadList","client","hideDateSeparators","maxTimeBetweenGroupedMessages","read","messages","threadMessages","messageList","readList","dateSeparators","userId","userID","messageGroupStyles","readData","messagesWithStylesReadByAndDateSeparator","filter","msg","deleted_at","user","id","map","dateSeparator","groupStyles","reverse"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AAIA;;AACA;;AAiDO,IAAMA,yCAAyC,GAAG,SAA5CA,yCAA4C,CASvDC,OATuD;AAAA,SAWtDA,OAAD,CAA8EC,MAA9E,KACAC,SAZuD;AAAA,CAAlD;;;;AAcA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAS5BC,MAT4B,EAUzB;AACH,MAAQC,QAAR,GAAgDD,MAAhD,CAAQC,QAAR;AAAA,MAAkBC,aAAlB,GAAgDF,MAAhD,CAAkBE,aAAlB;AAAA,MAAiCC,UAAjC,GAAgDH,MAAhD,CAAiCG,UAAjC;;AACA,wBAAmB,kCAAnB;AAAA,MAAQC,MAAR,mBAAQA,MAAR;;AACA,2BACE,wCADF;AAAA,MAAQC,kBAAR,sBAAQA,kBAAR;AAAA,MAA4BC,6BAA5B,sBAA4BA,6BAA5B;AAAA,MAA2DC,IAA3D,sBAA2DA,IAA3D;;AAEA,8BAAqB,kEAArB;AAAA,MAAQC,QAAR,yBAAQA,QAAR;;AACA,0BAA2B,sCAA3B;AAAA,MAAQC,cAAR,qBAAQA,cAAR;;AAEA,MAAMC,WAAW,GAAGP,UAAU,GAAGM,cAAH,GAAoBD,QAAlD;AACA,MAAMG,QAA6E,GAAGR,UAAU,GAC5FL,SAD4F,GAE5FS,IAFJ;AAIA,MAAMK,cAAc,GAAG,0CAA8C;AACnEP,IAAAA,kBAAkB,EAAlBA,kBADmE;AAEnEG,IAAAA,QAAQ,EAAEE,WAFyD;AAGnEG,IAAAA,MAAM,EAAET,MAAM,CAACU;AAHoD,GAA9C,CAAvB;AAMA,MAAMC,kBAAkB,GAAG,oCAA2C;AACpEH,IAAAA,cAAc,EAAdA,cADoE;AAEpEP,IAAAA,kBAAkB,EAAlBA,kBAFoE;AAGpEC,IAAAA,6BAA6B,EAA7BA,6BAHoE;AAIpEE,IAAAA,QAAQ,EAAEE,WAJ0D;AAKpER,IAAAA,aAAa,EAAbA,aALoE;AAMpEW,IAAAA,MAAM,EAAET,MAAM,CAACU;AANqD,GAA3C,CAA3B;AASA,MAAME,QAAQ,GAAG,kCAAcZ,MAAM,CAACU,MAArB,EAA6BJ,WAA7B,EAA0CC,QAA1C,CAAjB;AAEA,MAAMM,wCAAwC,GAAGP,WAAW,CACzDQ,MAD8C,CACvC,UAACC,GAAD;AAAA;;AAAA,WAAS,CAACA,GAAG,CAACC,UAAL,IAAmB,cAAAD,GAAG,CAACE,IAAJ,+BAAUC,EAAV,MAAiBlB,MAAM,CAACU,MAApD;AAAA,GADuC,EAE9CS,GAF8C,CAE1C,UAACJ,GAAD;AAAA,yCACAA,GADA;AAEHK,MAAAA,aAAa,EAAEZ,cAAc,CAACO,GAAG,CAACG,EAAL,CAAd,IAA0BxB,SAFtC;AAGH2B,MAAAA,WAAW,EAAEV,kBAAkB,CAACI,GAAG,CAACG,EAAL,CAAlB,IAA8B,
|
|
1
|
+
{"version":3,"sources":["useMessageList.ts"],"names":["isMessageWithStylesReadByAndDateSeparator","message","readBy","undefined","useMessageList","params","inverted","noGroupByUser","threadList","client","hideDateSeparators","maxTimeBetweenGroupedMessages","read","messages","threadMessages","messageList","readList","dateSeparators","userId","userID","messageGroupStyles","readData","messagesWithStylesReadByAndDateSeparator","filter","msg","deleted_at","user","id","map","dateSeparator","groupStyles","reverse"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AAIA;;AACA;;AAiDO,IAAMA,yCAAyC,GAAG,SAA5CA,yCAA4C,CASvDC,OATuD;AAAA,SAWtDA,OAAD,CAA8EC,MAA9E,KACAC,SAZuD;AAAA,CAAlD;;;;AAcA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAS5BC,MAT4B,EAUzB;AACH,MAAQC,QAAR,GAAgDD,MAAhD,CAAQC,QAAR;AAAA,MAAkBC,aAAlB,GAAgDF,MAAhD,CAAkBE,aAAlB;AAAA,MAAiCC,UAAjC,GAAgDH,MAAhD,CAAiCG,UAAjC;;AACA,wBAAmB,kCAAnB;AAAA,MAAQC,MAAR,mBAAQA,MAAR;;AACA,2BACE,wCADF;AAAA,MAAQC,kBAAR,sBAAQA,kBAAR;AAAA,MAA4BC,6BAA5B,sBAA4BA,6BAA5B;AAAA,MAA2DC,IAA3D,sBAA2DA,IAA3D;;AAEA,8BAAqB,kEAArB;AAAA,MAAQC,QAAR,yBAAQA,QAAR;;AACA,0BAA2B,sCAA3B;AAAA,MAAQC,cAAR,qBAAQA,cAAR;;AAEA,MAAMC,WAAW,GAAGP,UAAU,GAAGM,cAAH,GAAoBD,QAAlD;AACA,MAAMG,QAA6E,GAAGR,UAAU,GAC5FL,SAD4F,GAE5FS,IAFJ;AAIA,MAAMK,cAAc,GAAG,0CAA8C;AACnEP,IAAAA,kBAAkB,EAAlBA,kBADmE;AAEnEG,IAAAA,QAAQ,EAAEE,WAFyD;AAGnEG,IAAAA,MAAM,EAAET,MAAM,CAACU;AAHoD,GAA9C,CAAvB;AAMA,MAAMC,kBAAkB,GAAG,oCAA2C;AACpEH,IAAAA,cAAc,EAAdA,cADoE;AAEpEP,IAAAA,kBAAkB,EAAlBA,kBAFoE;AAGpEC,IAAAA,6BAA6B,EAA7BA,6BAHoE;AAIpEE,IAAAA,QAAQ,EAAEE,WAJ0D;AAKpER,IAAAA,aAAa,EAAbA,aALoE;AAMpEW,IAAAA,MAAM,EAAET,MAAM,CAACU;AANqD,GAA3C,CAA3B;AASA,MAAME,QAAQ,GAAG,kCAAcZ,MAAM,CAACU,MAArB,EAA6BJ,WAA7B,EAA0CC,QAA1C,CAAjB;AAEA,MAAMM,wCAAwC,GAAGP,WAAW,CACzDQ,MAD8C,CACvC,UAACC,GAAD;AAAA;;AAAA,WAAS,CAACA,GAAG,CAACC,UAAL,IAAmB,cAAAD,GAAG,CAACE,IAAJ,+BAAUC,EAAV,MAAiBlB,MAAM,CAACU,MAApD;AAAA,GADuC,EAE9CS,GAF8C,CAE1C,UAACJ,GAAD;AAAA,yCACAA,GADA;AAEHK,MAAAA,aAAa,EAAEZ,cAAc,CAACO,GAAG,CAACG,EAAL,CAAd,IAA0BxB,SAFtC;AAGH2B,MAAAA,WAAW,EAAEV,kBAAkB,CAACI,GAAG,CAACG,EAAL,CAAlB,IAA8B,CAAC,QAAD,CAHxC;AAIHzB,MAAAA,MAAM,EAAEsB,GAAG,CAACG,EAAJ,GAASN,QAAQ,CAACG,GAAG,CAACG,EAAL,CAAR,IAAoB,KAA7B,GAAqC;AAJ1C;AAAA,GAF0C,CAAjD;AASA,SACErB,QAAQ,GACJgB,wCAAwC,CAACS,OAAzC,EADI,GAEJT,wCAHN;AAKD,CAtDM","sourcesContent":["import { getDateSeparators } from '../utils/getDateSeparators';\nimport { getGroupStyles } from '../utils/getGroupStyles';\nimport { getReadStates } from '../utils/getReadStates';\n\nimport { useChatContext } from '../../../contexts/chatContext/ChatContext';\nimport {\n ChannelContextValue,\n useChannelContext,\n} from '../../../contexts/channelContext/ChannelContext';\nimport { usePaginatedMessageListContext } from '../../../contexts/paginatedMessageListContext/PaginatedMessageListContext';\nimport { useThreadContext } from '../../../contexts/threadContext/ThreadContext';\n\nimport type { ChannelState, MessageResponse } from 'stream-chat';\n\nimport type {\n DefaultAttachmentType,\n DefaultChannelType,\n DefaultCommandType,\n DefaultEventType,\n DefaultMessageType,\n DefaultReactionType,\n DefaultUserType,\n UnknownType,\n} from '../../../types/types';\n\nexport type UseMessageListParams = {\n inverted?: boolean;\n noGroupByUser?: boolean;\n threadList?: boolean;\n};\n\nexport type GroupType = 'bottom' | 'middle' | 'single' | 'top';\n\nexport type MessagesWithStylesReadByAndDateSeparator<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = MessageResponse<At, Ch, Co, Me, Re, Us> & {\n groupStyles: GroupType[];\n readBy: boolean | number;\n dateSeparator?: Date;\n};\n\nexport type MessageType<\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 | ReturnType<ChannelState<At, Ch, Co, Ev, Me, Re, Us>['formatMessage']>\n | MessagesWithStylesReadByAndDateSeparator<At, Ch, Co, Me, Re, Us>;\n\n// Type guards to check MessageType\nexport const isMessageWithStylesReadByAndDateSeparator = <\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 message: MessageType<At, Ch, Co, Ev, Me, Re, Us>,\n): message is MessagesWithStylesReadByAndDateSeparator<At, Ch, Co, Me, Re, Us> =>\n (message as MessagesWithStylesReadByAndDateSeparator<At, Ch, Co, Me, Re, Us>).readBy !==\n undefined;\n\nexport const useMessageList = <\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 params: UseMessageListParams,\n) => {\n const { inverted, noGroupByUser, threadList } = params;\n const { client } = useChatContext<At, Ch, Co, Ev, Me, Re, Us>();\n const { hideDateSeparators, maxTimeBetweenGroupedMessages, read } =\n useChannelContext<At, Ch, Co, Ev, Me, Re, Us>();\n const { messages } = usePaginatedMessageListContext<At, Ch, Co, Ev, Me, Re, Us>();\n const { threadMessages } = useThreadContext<At, Ch, Co, Ev, Me, Re, Us>();\n\n const messageList = threadList ? threadMessages : messages;\n const readList: ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>['read'] | undefined = threadList\n ? undefined\n : read;\n\n const dateSeparators = getDateSeparators<At, Ch, Co, Ev, Me, Re, Us>({\n hideDateSeparators,\n messages: messageList,\n userId: client.userID,\n });\n\n const messageGroupStyles = getGroupStyles<At, Ch, Co, Ev, Me, Re, Us>({\n dateSeparators,\n hideDateSeparators,\n maxTimeBetweenGroupedMessages,\n messages: messageList,\n noGroupByUser,\n userId: client.userID,\n });\n\n const readData = getReadStates(client.userID, messageList, readList);\n\n const messagesWithStylesReadByAndDateSeparator = messageList\n .filter((msg) => !msg.deleted_at || msg.user?.id === client.userID)\n .map((msg) => ({\n ...msg,\n dateSeparator: dateSeparators[msg.id] || undefined,\n groupStyles: messageGroupStyles[msg.id] || ['single'],\n readBy: msg.id ? readData[msg.id] || false : false,\n }));\n\n return (\n inverted\n ? messagesWithStylesReadByAndDateSeparator.reverse()\n : messagesWithStylesReadByAndDateSeparator\n ) as MessageType<At, Ch, Co, Ev, Me, Re, Us>[];\n};\n"]}
|
|
@@ -10,6 +10,7 @@ var getGroupStyles = function getGroupStyles(params) {
|
|
|
10
10
|
messages = params.messages,
|
|
11
11
|
noGroupByUser = params.noGroupByUser,
|
|
12
12
|
userId = params.userId;
|
|
13
|
+
if (noGroupByUser) return {};
|
|
13
14
|
var messageGroupStyles = {};
|
|
14
15
|
var messagesFilteredForNonUser = messages.filter(function (message) {
|
|
15
16
|
var _message$user;
|
|
@@ -53,11 +54,6 @@ var getGroupStyles = function getGroupStyles(params) {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
if (noGroupByUser) {
|
|
57
|
-
groupStyles.splice(0, groupStyles.length);
|
|
58
|
-
groupStyles.push('single');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
57
|
if (message.id) {
|
|
62
58
|
messageGroupStyles[message.id] = groupStyles;
|
|
63
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["getGroupStyles.ts"],"names":["getGroupStyles","params","dateSeparators","hideDateSeparators","maxTimeBetweenGroupedMessages","messages","noGroupByUser","userId","messageGroupStyles","messagesFilteredForNonUser","filter","message","deleted_at","user","id","i","length","previousMessage","nextMessage","groupStyles","isTopMessage","type","includes","isBottomMessage","undefined","created_at","getTime","push","splice"],"mappings":";;;;;AAoCO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAS5BC,MAT4B,EAUzB;AACH,MACEC,cADF,GAOID,MAPJ,CACEC,cADF;AAAA,MAEEC,kBAFF,GAOIF,MAPJ,CAEEE,kBAFF;AAAA,MAGEC,6BAHF,GAOIH,MAPJ,CAGEG,6BAHF;AAAA,MAIEC,QAJF,GAOIJ,MAPJ,CAIEI,QAJF;AAAA,MAKEC,aALF,GAOIL,MAPJ,CAKEK,aALF;AAAA,MAMEC,MANF,GAOIN,MAPJ,CAMEM,MANF;
|
|
1
|
+
{"version":3,"sources":["getGroupStyles.ts"],"names":["getGroupStyles","params","dateSeparators","hideDateSeparators","maxTimeBetweenGroupedMessages","messages","noGroupByUser","userId","messageGroupStyles","messagesFilteredForNonUser","filter","message","deleted_at","user","id","i","length","previousMessage","nextMessage","groupStyles","isTopMessage","type","includes","isBottomMessage","undefined","created_at","getTime","push","splice"],"mappings":";;;;;AAoCO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAS5BC,MAT4B,EAUzB;AACH,MACEC,cADF,GAOID,MAPJ,CACEC,cADF;AAAA,MAEEC,kBAFF,GAOIF,MAPJ,CAEEE,kBAFF;AAAA,MAGEC,6BAHF,GAOIH,MAPJ,CAGEG,6BAHF;AAAA,MAIEC,QAJF,GAOIJ,MAPJ,CAIEI,QAJF;AAAA,MAKEC,aALF,GAOIL,MAPJ,CAKEK,aALF;AAAA,MAMEC,MANF,GAOIN,MAPJ,CAMEM,MANF;AASA,MAAID,aAAJ,EAAmB,OAAO,EAAP;AAEnB,MAAME,kBAAkD,GAAG,EAA3D;AAEA,MAAMC,0BAA0B,GAAGJ,QAAQ,CAACK,MAAT,CACjC,UAACC,OAAD;AAAA;;AAAA,WAAa,CAACA,OAAO,CAACC,UAAT,IAAuBL,MAAM,uBAAKI,OAAO,CAACE,IAAb,qBAAK,cAAcC,EAAnB,CAA1C;AAAA,GADiC,CAAnC;;AAIA,OAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGN,0BAA0B,CAACO,MAA/C,EAAuDD,CAAC,EAAxD,EAA4D;AAAA;;AAC1D,QAAME,eAAe,GAAGR,0BAA0B,CAACM,CAAC,GAAG,CAAL,CAAlD;AAGA,QAAMJ,OAAO,GAAGF,0BAA0B,CAACM,CAAD,CAA1C;AACA,QAAMG,WAAW,GAAGT,0BAA0B,CAACM,CAAC,GAAG,CAAL,CAA9C;AAGA,QAAMI,WAAwB,GAAG,EAAjC;;AAEA,QAAMZ,OAAM,GAAG,CAAAI,OAAO,QAAP,8BAAAA,OAAO,CAAEE,IAAT,oCAAeC,EAAf,KAAqB,IAApC;;AAEA,QAAMM,YAAY,GAChB,CAACH,eAAD,IACAA,eAAe,CAACI,IAAhB,KAAyB,QADzB,IAEAd,OAAM,MAAKU,eAAL,6CAAKA,eAAe,CAAEJ,IAAtB,qBAAK,sBAAuBC,EAA5B,CAFN,IAGAG,eAAe,CAACI,IAAhB,KAAyB,OAHzB,IAIA,CAAC,CAACJ,eAAe,CAACL,UAJlB,IAKC,CAACT,kBAAD,IAAuBD,cAAc,CAACS,OAAO,CAACG,EAAT,CALtC,8BAMAN,kBAAkB,CAACS,eAAe,CAACH,EAAjB,CANlB,qBAMA,sBAAwCQ,QAAxC,CAAiD,QAAjD,CANA,CADF;AASA,QAAMC,eAAe,GACnB,CAACL,WAAD,IACAA,WAAW,CAACG,IAAZ,KAAqB,QADrB,IAEAd,OAAM,MAAKW,WAAL,yCAAKA,WAAW,CAAEL,IAAlB,qBAAK,kBAAmBC,EAAxB,CAFN,IAGAI,WAAW,CAACG,IAAZ,KAAqB,OAHrB,IAIA,CAAC,CAACH,WAAW,CAACN,UAJd,IAKC,CAACT,kBAAD,IAAuBD,cAAc,CAACgB,WAAW,CAACJ,EAAb,CALtC,IAMCV,6BAA6B,KAAKoB,SAAlC,IACCN,WAAW,CAACO,UAAZ,CAAuBC,OAAvB,KAAmCf,OAAO,CAACc,UAAR,CAAmBC,OAAnB,EAAnC,GACEtB,6BATN;;AAcA,QAAIgB,YAAJ,EAAkB;AAChBD,MAAAA,WAAW,CAACQ,IAAZ,CAAiB,KAAjB;AACD;;AAKD,QAAIJ,eAAJ,EAAqB;AAKnB,UAAIH,YAAY,IAAIT,OAAO,CAACC,UAAxB,IAAsCD,OAAO,CAACU,IAAR,KAAiB,OAA3D,EAAoE;AAClEF,QAAAA,WAAW,CAACS,MAAZ,CAAmB,CAAnB,EAAsBT,WAAW,CAACH,MAAlC;AACAG,QAAAA,WAAW,CAACQ,IAAZ,CAAiB,QAAjB;AACD,OAHD,MAGO;AACLR,QAAAA,WAAW,CAACQ,IAAZ,CAAiB,QAAjB;AACD;AACF;;AAMD,QAAI,CAACP,YAAD,IAAiB,CAACG,eAAtB,EAAuC;AACrC,UAAIZ,OAAO,CAACC,UAAR,IAAsBD,OAAO,CAACU,IAAR,KAAiB,OAA3C,EAAoD;AAClDF,QAAAA,WAAW,CAACS,MAAZ,CAAmB,CAAnB,EAAsBT,WAAW,CAACH,MAAlC;AACAG,QAAAA,WAAW,CAACQ,IAAZ,CAAiB,QAAjB;AACD,OAHD,MAGO;AACLR,QAAAA,WAAW,CAACS,MAAZ,CAAmB,CAAnB,EAAsBT,WAAW,CAACH,MAAlC;AACAG,QAAAA,WAAW,CAACQ,IAAZ,CAAiB,QAAjB;AACD;AACF;;AAED,QAAIhB,OAAO,CAACG,EAAZ,EAAgB;AACdN,MAAAA,kBAAkB,CAACG,OAAO,CAACG,EAAT,CAAlB,GAAiCK,WAAjC;AACD;AACF;;AAED,SAAOX,kBAAP;AACD,CAvGM","sourcesContent":["import type { DateSeparators } from './getDateSeparators';\n\nimport type { GroupType } from '../hooks/useMessageList';\n\nimport type { PaginatedMessageListContextValue } from '../../../contexts/paginatedMessageListContext/PaginatedMessageListContext';\nimport type { ThreadContextValue } from '../../../contexts/threadContext/ThreadContext';\nimport type {\n DefaultAttachmentType,\n DefaultChannelType,\n DefaultCommandType,\n DefaultEventType,\n DefaultMessageType,\n DefaultReactionType,\n DefaultUserType,\n UnknownType,\n} from '../../../types/types';\n\nexport type GetGroupStylesParams<\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 dateSeparators: DateSeparators;\n messages:\n | PaginatedMessageListContextValue<At, Ch, Co, Ev, Me, Re, Us>['messages']\n | ThreadContextValue<At, Ch, Co, Ev, Me, Re, Us>['threadMessages'];\n hideDateSeparators?: boolean;\n maxTimeBetweenGroupedMessages?: number;\n noGroupByUser?: boolean;\n userId?: string;\n};\n\nexport const getGroupStyles = <\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 params: GetGroupStylesParams<At, Ch, Co, Ev, Me, Re, Us>,\n) => {\n const {\n dateSeparators,\n hideDateSeparators,\n maxTimeBetweenGroupedMessages,\n messages,\n noGroupByUser,\n userId,\n } = params;\n\n if (noGroupByUser) return {};\n\n const messageGroupStyles: { [key: string]: GroupType[] } = {};\n\n const messagesFilteredForNonUser = messages.filter(\n (message) => !message.deleted_at || userId === message.user?.id,\n );\n\n for (let i = 0; i < messagesFilteredForNonUser.length; i++) {\n const previousMessage = messagesFilteredForNonUser[i - 1] as\n | typeof messagesFilteredForNonUser[0]\n | undefined;\n const message = messagesFilteredForNonUser[i];\n const nextMessage = messagesFilteredForNonUser[i + 1] as\n | typeof messagesFilteredForNonUser[0]\n | undefined;\n const groupStyles: GroupType[] = [];\n\n const userId = message?.user?.id || null;\n\n const isTopMessage =\n !previousMessage ||\n previousMessage.type === 'system' ||\n userId !== previousMessage?.user?.id ||\n previousMessage.type === 'error' ||\n !!previousMessage.deleted_at ||\n (!hideDateSeparators && dateSeparators[message.id]) ||\n messageGroupStyles[previousMessage.id]?.includes('bottom');\n\n const isBottomMessage =\n !nextMessage ||\n nextMessage.type === 'system' ||\n userId !== nextMessage?.user?.id ||\n nextMessage.type === 'error' ||\n !!nextMessage.deleted_at ||\n (!hideDateSeparators && dateSeparators[nextMessage.id]) ||\n (maxTimeBetweenGroupedMessages !== undefined &&\n nextMessage.created_at.getTime() - message.created_at.getTime() >\n maxTimeBetweenGroupedMessages);\n\n /**\n * Add group styles key for top message\n */\n if (isTopMessage) {\n groupStyles.push('top');\n }\n\n /**\n * Add group styles key for bottom message\n */\n if (isBottomMessage) {\n /**\n * If the bottom message is also the top, or deleted, or an error,\n * add the key for single message instead of bottom\n */\n if (isTopMessage || message.deleted_at || message.type === 'error') {\n groupStyles.splice(0, groupStyles.length);\n groupStyles.push('single');\n } else {\n groupStyles.push('bottom');\n }\n }\n\n /**\n * Add the key for all non top or bottom messages, if the message is\n * deleted or an error add the key for single otherwise middle\n */\n if (!isTopMessage && !isBottomMessage) {\n if (message.deleted_at || message.type === 'error') {\n groupStyles.splice(0, groupStyles.length);\n groupStyles.push('single');\n } else {\n groupStyles.splice(0, groupStyles.length);\n groupStyles.push('middle');\n }\n }\n\n if (message.id) {\n messageGroupStyles[message.id] = groupStyles;\n }\n }\n\n return messageGroupStyles;\n};\n"]}
|
|
@@ -32,7 +32,7 @@ var ChannelProvider = function ChannelProvider(_ref) {
|
|
|
32
32
|
__self: _this,
|
|
33
33
|
__source: {
|
|
34
34
|
fileName: _jsxFileName,
|
|
35
|
-
lineNumber:
|
|
35
|
+
lineNumber: 205,
|
|
36
36
|
columnNumber: 3
|
|
37
37
|
}
|
|
38
38
|
}, children);
|
|
@@ -53,7 +53,7 @@ var withChannelContext = function withChannelContext(Component) {
|
|
|
53
53
|
__self: _this,
|
|
54
54
|
__source: {
|
|
55
55
|
fileName: _jsxFileName,
|
|
56
|
-
lineNumber:
|
|
56
|
+
lineNumber: 242,
|
|
57
57
|
columnNumber: 12
|
|
58
58
|
}
|
|
59
59
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChannelContext.tsx"],"names":["ChannelContext","React","createContext","ChannelProvider","children","value","useChannelContext","withChannelContext","Component","WithChannelContextComponent","props","channelContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["ChannelContext.tsx"],"names":["ChannelContext","React","createContext","ChannelProvider","children","value","useChannelContext","withChannelContext","Component","WithChannelContextComponent","props","channelContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;;;;;;;;AA0LO,IAAMA,cAAc,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAAvB;;;;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB;AAAA,MAS7BC,QAT6B,QAS7BA,QAT6B;AAAA,MAU7BC,KAV6B,QAU7BA,KAV6B;AAAA,SAc7B,gCAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAEA,KAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAd6B;AAAA,CAAxB;;;;AAmBA,IAAME,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,SAQ1B,uBAAWN,cAAX,CAR0B;AAAA,CAA1B;;;;AAeA,IAAMO,kBAAkB,GAAG,SAArBA,kBAAqB,CAUhCC,SAVgC,EAW6C;AAC7E,MAAMC,2BAA2B,GAAG,SAA9BA,2BAA8B,CAClCC,KADkC,EAE/B;AACH,QAAMC,cAAc,GAAGL,iBAAiB,EAAxC;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,cAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,2BAA2B,CAACG,WAA5B,0BAA+D,oCAAeJ,SAAf,CAA/D;AACA,SAAOC,2BAAP;AACD,CArBM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport { getDisplayName } from '../utils/getDisplayName';\n\nimport type { Channel, ChannelState } from 'stream-chat';\n\nimport type { EmptyStateProps } from '../../components/Indicators/EmptyStateIndicator';\nimport type { LoadingProps } from '../../components/Indicators/LoadingIndicator';\nimport type {\n DefaultAttachmentType,\n DefaultChannelType,\n DefaultCommandType,\n DefaultEventType,\n DefaultMessageType,\n DefaultReactionType,\n DefaultUserType,\n UnknownType,\n} from '../../types/types';\n\nexport type ChannelConfig = {\n readEventsEnabled?: boolean;\n typingEventsEnabled?: boolean;\n};\n\nexport type ChannelContextValue<\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 /**\n * Custom UI component to display empty state when channel has no messages.\n *\n * **Default** [EmptyStateIndicator](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Indicators/EmptyStateIndicator.tsx)\n */\n EmptyStateIndicator: React.ComponentType<EmptyStateProps>;\n /**\n * When set to true, reactions will be limited to 1 per user. If user selects another reaction\n * then his previous reaction will be removed and replaced with new one.\n *\n * This is similar to reaction UX on [iMessage application](https://en.wikipedia.org/wiki/IMessage).\n */\n enforceUniqueReaction: boolean;\n error: boolean;\n /**\n * When set to false, it will disable giphy command on MessageInput component.\n */\n giphyEnabled: boolean;\n /**\n * Hide inline date separators on channel\n */\n hideDateSeparators: boolean;\n hideStickyDateHeader: boolean;\n /**\n * Returns true if the current user has admin privileges\n */\n isAdmin: boolean;\n /**\n * Returns true if the current user is a moderator\n */\n isModerator: boolean;\n /**\n * Returns true if the current user is a owner\n */\n isOwner: boolean;\n loadChannelAtMessage: ({\n after,\n before,\n messageId,\n }: {\n after?: number;\n before?: number;\n messageId?: string;\n }) => Promise<void>;\n loading: boolean;\n /**\n * Custom loading indicator to override the Stream default\n */\n LoadingIndicator: React.ComponentType<LoadingProps>;\n markRead: () => void;\n /**\n *\n * ```json\n * {\n * \"thierry-123\": {\n * \"id\": \"thierry-123\",\n * \"role\": \"user\",\n * \"created_at\": \"2019-04-03T14:42:47.087869Z\",\n * \"updated_at\": \"2019-04-16T09:20:03.982283Z\",\n * \"last_active\": \"2019-04-16T11:23:51.168113408+02:00\",\n * \"online\": true\n * },\n * \"vishal-123\": {\n * \"id\": \"vishal-123\",\n * \"role\": \"user\",\n * \"created_at\": \"2019-05-03T14:42:47.087869Z\",\n * \"updated_at\": \"2019-05-16T09:20:03.982283Z\",\n * \"last_active\": \"2019-06-16T11:23:51.168113408+02:00\",\n * \"online\": false\n * }\n * }\n * ```\n */\n members: ChannelState<At, Ch, Co, Ev, Me, Re, Us>['members'];\n /**\n * Custom network down indicator to override the Stream default\n */\n NetworkDownIndicator: React.ComponentType;\n read: ChannelState<At, Ch, Co, Ev, Me, Re, Us>['read'];\n reloadChannel: () => Promise<void>;\n /**\n * When true, messagelist will be scrolled to first unread message, when opened.\n */\n scrollToFirstUnreadThreshold: number;\n setLastRead: React.Dispatch<React.SetStateAction<Date | undefined>>;\n setTargetedMessage: (messageId: string) => void;\n /**\n *\n * ```json\n * {\n * \"thierry-123\": {\n * \"id\": \"thierry-123\",\n * \"role\": \"user\",\n * \"created_at\": \"2019-04-03T14:42:47.087869Z\",\n * \"updated_at\": \"2019-04-16T09:20:03.982283Z\",\n * \"last_active\": \"2019-04-16T11:23:51.168113408+02:00\",\n * \"online\": true\n * },\n * \"vishal-123\": {\n * \"id\": \"vishal-123\",\n * \"role\": \"user\",\n * \"created_at\": \"2019-05-03T14:42:47.087869Z\",\n * \"updated_at\": \"2019-05-16T09:20:03.982283Z\",\n * \"last_active\": \"2019-06-16T11:23:51.168113408+02:00\",\n * \"online\": false\n * }\n * }\n * ```\n */\n watchers: ChannelState<At, Ch, Co, Ev, Me, Re, Us>['watchers'];\n /**\n * Instance of channel object from stream-chat package.\n *\n * Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript\n *\n * ```\n * import { StreamChat, Channel } from 'stream-chat';\n * import { Chat, Channel} from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key');\n * await client.connectUser('user_id', 'user_token');\n * const channel = client.channel('messaging', 'channel_id');\n * await channel.watch();\n *\n * <Chat client={client}>\n * <Channel channel={channel}>\n * </Channel>\n * </Chat>\n * ```\n *\n * @overrideType Channel\n */\n channel?: Channel<At, Ch, Co, Ev, Me, Re, Us>;\n disabled?: boolean;\n enableMessageGroupingByUser?: boolean;\n lastRead?: Date;\n /**\n * Maximum time in milliseconds that should occur between messages\n * to still consider them grouped together\n */\n maxTimeBetweenGroupedMessages?: number;\n /**\n * Custom UI component for sticky header of channel.\n *\n * **Default** [DateHeader](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageList/DateHeader.tsx)\n */\n StickyHeader?: React.ComponentType<{ dateString: string }>;\n /**\n * Id of message, around which Channel/MessageList gets loaded when opened.\n * You will see a highlighted background for targetted message, when opened.\n */\n targetedMessage?: string;\n watcherCount?: ChannelState<At, Ch, Co, Ev, Me, Re, Us>['watcher_count'];\n} & ChannelConfig;\n\nexport const ChannelContext = React.createContext({} as ChannelContextValue);\n\nexport const ChannelProvider = <\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: ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>;\n}>) => (\n <ChannelContext.Provider value={value as unknown as ChannelContextValue}>\n {children}\n </ChannelContext.Provider>\n);\n\nexport const useChannelContext = <\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(ChannelContext) as unknown as ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>;\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChannelContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChannelContext = <\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 ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>>> => {\n const WithChannelContextComponent = (\n props: Omit<P, keyof ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>>,\n ) => {\n const channelContext = useChannelContext<At, Ch, Co, Ev, Me, Re, Us>();\n\n return <Component {...(props as P)} {...channelContext} />;\n };\n WithChannelContextComponent.displayName = `WithChannelContext${getDisplayName(Component)}`;\n return WithChannelContextComponent;\n};\n"]}
|
|
@@ -32,7 +32,7 @@ var MessagesProvider = function MessagesProvider(_ref) {
|
|
|
32
32
|
__self: _this,
|
|
33
33
|
__source: {
|
|
34
34
|
fileName: _jsxFileName,
|
|
35
|
-
lineNumber:
|
|
35
|
+
lineNumber: 593,
|
|
36
36
|
columnNumber: 3
|
|
37
37
|
}
|
|
38
38
|
}, children);
|
|
@@ -53,7 +53,7 @@ var withMessagesContext = function withMessagesContext(Component) {
|
|
|
53
53
|
__self: _this,
|
|
54
54
|
__source: {
|
|
55
55
|
fileName: _jsxFileName,
|
|
56
|
-
lineNumber:
|
|
56
|
+
lineNumber: 630,
|
|
57
57
|
columnNumber: 12
|
|
58
58
|
}
|
|
59
59
|
}));
|
|
@@ -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"]}
|
package/lib/module/version.json
CHANGED
|
@@ -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
|
*/
|
|
@@ -89,6 +90,7 @@ export declare type ChannelPropsWithContext<At extends UnknownType = DefaultAtta
|
|
|
89
90
|
quotedRepliesEnabled?: boolean;
|
|
90
91
|
reactionsEnabled?: boolean;
|
|
91
92
|
readEventsEnabled?: boolean;
|
|
93
|
+
stateUpdateThrottleInterval?: number;
|
|
92
94
|
threadRepliesEnabled?: boolean;
|
|
93
95
|
typingEventsEnabled?: boolean;
|
|
94
96
|
uploadsEnabled?: boolean;
|
|
@@ -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.
|
|
4
|
+
"version": "3.9.0-next.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|