stream-chat-react-native-core 5.24.0-beta.4 → 5.24.0-beta.6
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/Attachment.js +22 -14
- package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/Card.js +11 -4
- package/lib/commonjs/components/Attachment/Card.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +24 -16
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +14 -7
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +22 -16
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +14 -8
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +10 -4
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js +6 -1
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +2 -2
- package/lib/commonjs/components/MessageInput/SendButton.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +9 -3
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js +2 -2
- package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/commonjs/i18n/en.json +1 -1
- package/lib/commonjs/i18n/fr.json +36 -36
- package/lib/commonjs/i18n/hi.json +36 -36
- package/lib/commonjs/i18n/it.json +36 -36
- package/lib/commonjs/i18n/nl.json +36 -36
- package/lib/commonjs/i18n/ru.json +36 -36
- package/lib/commonjs/i18n/tr.json +36 -36
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +22 -14
- package/lib/module/components/Attachment/Attachment.js.map +1 -1
- package/lib/module/components/Attachment/Card.js +11 -4
- package/lib/module/components/Attachment/Card.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +24 -16
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Message/Message.js +14 -7
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +22 -16
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +14 -8
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +10 -4
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/module/components/Message/hooks/useCreateMessageContext.js +6 -1
- package/lib/module/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/module/components/MessageInput/SendButton.js +2 -2
- package/lib/module/components/MessageInput/SendButton.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +9 -3
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js +2 -2
- package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/module/i18n/en.json +1 -1
- package/lib/module/i18n/fr.json +36 -36
- package/lib/module/i18n/hi.json +36 -36
- package/lib/module/i18n/it.json +36 -36
- package/lib/module/i18n/nl.json +36 -36
- package/lib/module/i18n/ru.json +36 -36
- package/lib/module/i18n/tr.json +36 -36
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Attachment.d.ts +2 -2
- package/lib/typescript/components/Attachment/Card.d.ts +2 -2
- package/lib/typescript/components/Attachment/Gallery.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageTextContainer.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts +1 -1
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +8 -2
- package/lib/typescript/i18n/en.json +1 -1
- package/lib/typescript/i18n/fr.json +36 -36
- package/lib/typescript/i18n/hi.json +36 -36
- package/lib/typescript/i18n/it.json +36 -36
- package/lib/typescript/i18n/nl.json +36 -36
- package/lib/typescript/i18n/ru.json +36 -36
- package/lib/typescript/i18n/tr.json +36 -36
- package/package.json +1 -1
- package/src/components/Attachment/Attachment.tsx +16 -2
- package/src/components/Attachment/Card.tsx +22 -4
- package/src/components/Attachment/Gallery.tsx +11 -0
- package/src/components/Message/Message.tsx +9 -0
- package/src/components/Message/MessageSimple/MessageContent.tsx +9 -0
- package/src/components/Message/MessageSimple/MessageSimple.tsx +9 -0
- package/src/components/Message/MessageSimple/MessageTextContainer.tsx +12 -2
- package/src/components/Message/hooks/useCreateMessageContext.ts +4 -0
- package/src/components/MessageInput/SendButton.tsx +2 -2
- package/src/components/MessageOverlay/MessageOverlay.tsx +8 -0
- package/src/contexts/messageContext/MessageContext.tsx +7 -1
- package/src/i18n/en.json +1 -1
- package/src/i18n/fr.json +36 -36
- package/src/i18n/hi.json +36 -36
- package/src/i18n/it.json +36 -36
- package/src/i18n/nl.json +36 -36
- package/src/i18n/ru.json +36 -36
- package/src/i18n/tr.json +36 -36
- package/src/version.json +1 -1
|
@@ -32,7 +32,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
32
32
|
__self: _this,
|
|
33
33
|
__source: {
|
|
34
34
|
fileName: _jsxFileName,
|
|
35
|
-
lineNumber:
|
|
35
|
+
lineNumber: 59,
|
|
36
36
|
columnNumber: 12
|
|
37
37
|
}
|
|
38
38
|
});
|
|
@@ -42,7 +42,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
42
42
|
__self: _this,
|
|
43
43
|
__source: {
|
|
44
44
|
fileName: _jsxFileName,
|
|
45
|
-
lineNumber:
|
|
45
|
+
lineNumber: 63,
|
|
46
46
|
columnNumber: 12
|
|
47
47
|
}
|
|
48
48
|
}));
|
|
@@ -53,7 +53,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
53
53
|
__self: _this,
|
|
54
54
|
__source: {
|
|
55
55
|
fileName: _jsxFileName,
|
|
56
|
-
lineNumber:
|
|
56
|
+
lineNumber: 69,
|
|
57
57
|
columnNumber: 9
|
|
58
58
|
}
|
|
59
59
|
}), hasAttachmentActions && _react["default"].createElement(AttachmentActions, (0, _extends2["default"])({
|
|
@@ -62,7 +62,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
62
62
|
__self: _this,
|
|
63
63
|
__source: {
|
|
64
64
|
fileName: _jsxFileName,
|
|
65
|
-
lineNumber:
|
|
65
|
+
lineNumber: 71,
|
|
66
66
|
columnNumber: 11
|
|
67
67
|
}
|
|
68
68
|
})));
|
|
@@ -73,7 +73,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
73
73
|
__self: _this,
|
|
74
74
|
__source: {
|
|
75
75
|
fileName: _jsxFileName,
|
|
76
|
-
lineNumber:
|
|
76
|
+
lineNumber: 80,
|
|
77
77
|
columnNumber: 9
|
|
78
78
|
}
|
|
79
79
|
}), hasAttachmentActions && _react["default"].createElement(AttachmentActions, (0, _extends2["default"])({
|
|
@@ -82,7 +82,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
82
82
|
__self: _this,
|
|
83
83
|
__source: {
|
|
84
84
|
fileName: _jsxFileName,
|
|
85
|
-
lineNumber:
|
|
85
|
+
lineNumber: 82,
|
|
86
86
|
columnNumber: 11
|
|
87
87
|
}
|
|
88
88
|
}))) : _react["default"].createElement(FileAttachment, {
|
|
@@ -90,7 +90,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
90
90
|
__self: _this,
|
|
91
91
|
__source: {
|
|
92
92
|
fileName: _jsxFileName,
|
|
93
|
-
lineNumber:
|
|
93
|
+
lineNumber: 86,
|
|
94
94
|
columnNumber: 7
|
|
95
95
|
}
|
|
96
96
|
});
|
|
@@ -101,7 +101,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
101
101
|
__self: _this,
|
|
102
102
|
__source: {
|
|
103
103
|
fileName: _jsxFileName,
|
|
104
|
-
lineNumber:
|
|
104
|
+
lineNumber: 91,
|
|
105
105
|
columnNumber: 12
|
|
106
106
|
}
|
|
107
107
|
});
|
|
@@ -111,7 +111,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
111
111
|
__self: _this,
|
|
112
112
|
__source: {
|
|
113
113
|
fileName: _jsxFileName,
|
|
114
|
-
lineNumber:
|
|
114
|
+
lineNumber: 97,
|
|
115
115
|
columnNumber: 9
|
|
116
116
|
}
|
|
117
117
|
})), _react["default"].createElement(AttachmentActions, (0, _extends2["default"])({
|
|
@@ -120,7 +120,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
120
120
|
__self: _this,
|
|
121
121
|
__source: {
|
|
122
122
|
fileName: _jsxFileName,
|
|
123
|
-
lineNumber:
|
|
123
|
+
lineNumber: 98,
|
|
124
124
|
columnNumber: 9
|
|
125
125
|
}
|
|
126
126
|
})));
|
|
@@ -129,7 +129,7 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
129
129
|
__self: _this,
|
|
130
130
|
__source: {
|
|
131
131
|
fileName: _jsxFileName,
|
|
132
|
-
lineNumber:
|
|
132
|
+
lineNumber: 102,
|
|
133
133
|
columnNumber: 12
|
|
134
134
|
}
|
|
135
135
|
}));
|
|
@@ -138,13 +138,17 @@ var AttachmentWithContext = function AttachmentWithContext(props) {
|
|
|
138
138
|
var areEqual = function areEqual(prevProps, nextProps) {
|
|
139
139
|
var _prevAttachment$actio, _nextAttachment$actio;
|
|
140
140
|
var prevAttachment = prevProps.attachment,
|
|
141
|
-
isAttachmentEqual = prevProps.isAttachmentEqual
|
|
142
|
-
|
|
141
|
+
isAttachmentEqual = prevProps.isAttachmentEqual,
|
|
142
|
+
prevMyMessageTheme = prevProps.myMessageTheme;
|
|
143
|
+
var nextAttachment = nextProps.attachment,
|
|
144
|
+
nextMyMessageTheme = nextProps.myMessageTheme;
|
|
143
145
|
var attachmentEqual = ((_prevAttachment$actio = prevAttachment.actions) == null ? void 0 : _prevAttachment$actio.length) === ((_nextAttachment$actio = nextAttachment.actions) == null ? void 0 : _nextAttachment$actio.length) && prevAttachment.image_url === nextAttachment.image_url && prevAttachment.thumb_url === nextAttachment.thumb_url;
|
|
144
146
|
if (!attachmentEqual) return false;
|
|
145
147
|
if (isAttachmentEqual) {
|
|
146
148
|
return isAttachmentEqual(prevAttachment, nextAttachment);
|
|
147
149
|
}
|
|
150
|
+
var messageThemeEqual = JSON.stringify(prevMyMessageTheme) === JSON.stringify(nextMyMessageTheme);
|
|
151
|
+
if (!messageThemeEqual) return false;
|
|
148
152
|
return true;
|
|
149
153
|
};
|
|
150
154
|
var MemoizedAttachment = _react["default"].memo(AttachmentWithContext, areEqual);
|
|
@@ -156,6 +160,7 @@ var Attachment = function Attachment(props) {
|
|
|
156
160
|
PropGallery = props.Gallery,
|
|
157
161
|
PropGiphy = props.Giphy,
|
|
158
162
|
PropGiphyVersion = props.giphyVersion,
|
|
163
|
+
PropMyMessageTheme = props.myMessageTheme,
|
|
159
164
|
PropUrlPreview = props.UrlPreview;
|
|
160
165
|
var _useMessagesContext = (0, _MessagesContext.useMessagesContext)(),
|
|
161
166
|
ContextAttachmentActions = _useMessagesContext.AttachmentActions,
|
|
@@ -165,6 +170,7 @@ var Attachment = function Attachment(props) {
|
|
|
165
170
|
ContextGiphy = _useMessagesContext.Giphy,
|
|
166
171
|
ContextGiphyVersion = _useMessagesContext.giphyVersion,
|
|
167
172
|
isAttachmentEqual = _useMessagesContext.isAttachmentEqual,
|
|
173
|
+
ContextMyMessageTheme = _useMessagesContext.myMessageTheme,
|
|
168
174
|
ContextUrlPreview = _useMessagesContext.UrlPreview;
|
|
169
175
|
if (!attachment) {
|
|
170
176
|
return null;
|
|
@@ -176,6 +182,7 @@ var Attachment = function Attachment(props) {
|
|
|
176
182
|
var Giphy = PropGiphy || ContextGiphy || _Giphy.Giphy;
|
|
177
183
|
var UrlPreview = PropUrlPreview || ContextUrlPreview || _Card.Card;
|
|
178
184
|
var giphyVersion = PropGiphyVersion || ContextGiphyVersion;
|
|
185
|
+
var myMessageTheme = PropMyMessageTheme || ContextMyMessageTheme;
|
|
179
186
|
return _react["default"].createElement(MemoizedAttachment, {
|
|
180
187
|
attachment: attachment,
|
|
181
188
|
AttachmentActions: AttachmentActions,
|
|
@@ -185,11 +192,12 @@ var Attachment = function Attachment(props) {
|
|
|
185
192
|
Giphy: Giphy,
|
|
186
193
|
giphyVersion: giphyVersion,
|
|
187
194
|
isAttachmentEqual: isAttachmentEqual,
|
|
195
|
+
myMessageTheme: myMessageTheme,
|
|
188
196
|
UrlPreview: UrlPreview,
|
|
189
197
|
__self: _this,
|
|
190
198
|
__source: {
|
|
191
199
|
fileName: _jsxFileName,
|
|
192
|
-
lineNumber:
|
|
200
|
+
lineNumber: 204,
|
|
193
201
|
columnNumber: 5
|
|
194
202
|
}
|
|
195
203
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_AttachmentActions","_Card","_FileAttachment","_Gallery","_Giphy","_MessagesContext","_native","_this","_jsxFileName","AttachmentWithContext","props","_attachment$actions","attachment","AttachmentActions","Card","FileAttachment","Gallery","Giphy","giphyVersion","UrlPreview","hasAttachmentActions","actions","length","type","createElement","__self","__source","fileName","lineNumber","columnNumber","og_scrape_url","title_link","_extends2","Fragment","images","key","id","isVideoPackageAvailable","videos","areEqual","prevProps","nextProps","_prevAttachment$actio","_nextAttachment$actio","prevAttachment","isAttachmentEqual","nextAttachment","attachmentEqual","image_url","thumb_url","MemoizedAttachment","React","memo","Attachment","PropAttachmentActions","PropCard","PropFileAttachment","PropGallery","PropGiphy","PropGiphyVersion","PropUrlPreview","_useMessagesContext","useMessagesContext","ContextAttachmentActions","ContextCard","ContextFileAttachment","ContextGallery","ContextGiphy","ContextGiphyVersion","ContextUrlPreview","AttachmentActionsDefault","CardDefault","FileAttachmentDefault","GalleryDefault","GiphyDefault","exports"],"sources":["Attachment.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { Attachment as AttachmentType } from 'stream-chat';\n\nimport { AttachmentActions as AttachmentActionsDefault } from '../../components/Attachment/AttachmentActions';\nimport { Card as CardDefault } from '../../components/Attachment/Card';\nimport { FileAttachment as FileAttachmentDefault } from '../../components/Attachment/FileAttachment';\nimport { Gallery as GalleryDefault } from '../../components/Attachment/Gallery';\nimport { Giphy as GiphyDefault } from '../../components/Attachment/Giphy';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { isVideoPackageAvailable } from '../../native';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nexport type ActionHandler = (name: string, value: string) => void;\n\nexport type AttachmentPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n MessagesContextValue<StreamChatGenerics>,\n | 'AttachmentActions'\n | 'Card'\n | 'FileAttachment'\n | 'Gallery'\n | 'giphyVersion'\n | 'Giphy'\n | 'isAttachmentEqual'\n | 'UrlPreview'\n> & {\n /**\n * The attachment to render\n */\n attachment: AttachmentType<StreamChatGenerics>;\n};\n\nconst AttachmentWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: AttachmentPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n attachment,\n AttachmentActions,\n Card,\n FileAttachment,\n Gallery,\n Giphy,\n giphyVersion,\n UrlPreview,\n } = props;\n\n const hasAttachmentActions = !!attachment.actions?.length;\n\n if (attachment.type === 'giphy' || attachment.type === 'imgur') {\n return <Giphy attachment={attachment} giphyVersion={giphyVersion} />;\n }\n\n if (attachment.og_scrape_url || attachment.title_link) {\n return <UrlPreview {...attachment} />;\n }\n\n if (attachment.type === 'image') {\n return (\n <>\n <Gallery images={[attachment]} />\n {hasAttachmentActions && (\n <AttachmentActions key={`key-actions-${attachment.id}`} {...attachment} />\n )}\n </>\n );\n }\n\n if (attachment.type === 'video' && !attachment.og_scrape_url) {\n return isVideoPackageAvailable() ? (\n <>\n <Gallery videos={[attachment]} />\n {hasAttachmentActions && (\n <AttachmentActions key={`key-actions-${attachment.id}`} {...attachment} />\n )}\n </>\n ) : (\n <FileAttachment attachment={attachment} />\n );\n }\n\n if (attachment.type === 'file' || attachment.type === 'audio') {\n return <FileAttachment attachment={attachment} />;\n }\n\n if (hasAttachmentActions) {\n return (\n <>\n <Card {...attachment} />\n <AttachmentActions key={`key-actions-${attachment.id}`} {...attachment} />\n </>\n );\n } else {\n return <Card {...attachment} />;\n }\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: AttachmentPropsWithContext<StreamChatGenerics>,\n nextProps: AttachmentPropsWithContext<StreamChatGenerics>,\n) => {\n const { attachment: prevAttachment, isAttachmentEqual } = prevProps;\n const { attachment: nextAttachment } = nextProps;\n\n const attachmentEqual =\n prevAttachment.actions?.length === nextAttachment.actions?.length &&\n prevAttachment.image_url === nextAttachment.image_url &&\n prevAttachment.thumb_url === nextAttachment.thumb_url;\n if (!attachmentEqual) return false;\n\n if (isAttachmentEqual) {\n return isAttachmentEqual(prevAttachment, nextAttachment);\n }\n\n return true;\n};\n\nconst MemoizedAttachment = React.memo(\n AttachmentWithContext,\n areEqual,\n) as typeof AttachmentWithContext;\n\nexport type AttachmentProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n | 'AttachmentActions'\n | 'Card'\n | 'FileAttachment'\n | 'Gallery'\n | 'Giphy'\n | 'giphyVersion'\n | 'UrlPreview'\n | 'isAttachmentEqual'\n >\n> &\n Pick<AttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>;\n\n/**\n * Attachment - The message attachment\n */\nexport const Attachment = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: AttachmentProps<StreamChatGenerics>,\n) => {\n const {\n attachment,\n AttachmentActions: PropAttachmentActions,\n Card: PropCard,\n FileAttachment: PropFileAttachment,\n Gallery: PropGallery,\n Giphy: PropGiphy,\n giphyVersion: PropGiphyVersion,\n UrlPreview: PropUrlPreview,\n } = props;\n\n const {\n AttachmentActions: ContextAttachmentActions,\n Card: ContextCard,\n FileAttachment: ContextFileAttachment,\n Gallery: ContextGallery,\n Giphy: ContextGiphy,\n giphyVersion: ContextGiphyVersion,\n isAttachmentEqual,\n UrlPreview: ContextUrlPreview,\n } = useMessagesContext<StreamChatGenerics>();\n\n if (!attachment) {\n return null;\n }\n\n const AttachmentActions =\n PropAttachmentActions || ContextAttachmentActions || AttachmentActionsDefault;\n const Card = PropCard || ContextCard || CardDefault;\n const FileAttachment = PropFileAttachment || ContextFileAttachment || FileAttachmentDefault;\n const Gallery = PropGallery || ContextGallery || GalleryDefault;\n const Giphy = PropGiphy || ContextGiphy || GiphyDefault;\n const UrlPreview = PropUrlPreview || ContextUrlPreview || CardDefault;\n const giphyVersion = PropGiphyVersion || ContextGiphyVersion;\n\n return (\n <MemoizedAttachment\n {...{\n attachment,\n AttachmentActions,\n Card,\n FileAttachment,\n Gallery,\n Giphy,\n giphyVersion,\n isAttachmentEqual,\n UrlPreview,\n }}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,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AAA;MAAAC,YAAA;IAAA;EAAA,CAEb,CAAC;AAEN,CAAC;AAAC8C,OAAA,CAAAtB,UAAA,GAAAA,UAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_AttachmentActions","_Card","_FileAttachment","_Gallery","_Giphy","_MessagesContext","_native","_this","_jsxFileName","AttachmentWithContext","props","_attachment$actions","attachment","AttachmentActions","Card","FileAttachment","Gallery","Giphy","giphyVersion","UrlPreview","hasAttachmentActions","actions","length","type","createElement","__self","__source","fileName","lineNumber","columnNumber","og_scrape_url","title_link","_extends2","Fragment","images","key","id","isVideoPackageAvailable","videos","areEqual","prevProps","nextProps","_prevAttachment$actio","_nextAttachment$actio","prevAttachment","isAttachmentEqual","prevMyMessageTheme","myMessageTheme","nextAttachment","nextMyMessageTheme","attachmentEqual","image_url","thumb_url","messageThemeEqual","JSON","stringify","MemoizedAttachment","React","memo","Attachment","PropAttachmentActions","PropCard","PropFileAttachment","PropGallery","PropGiphy","PropGiphyVersion","PropMyMessageTheme","PropUrlPreview","_useMessagesContext","useMessagesContext","ContextAttachmentActions","ContextCard","ContextFileAttachment","ContextGallery","ContextGiphy","ContextGiphyVersion","ContextMyMessageTheme","ContextUrlPreview","AttachmentActionsDefault","CardDefault","FileAttachmentDefault","GalleryDefault","GiphyDefault","exports"],"sources":["Attachment.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { Attachment as AttachmentType } from 'stream-chat';\n\nimport { AttachmentActions as AttachmentActionsDefault } from '../../components/Attachment/AttachmentActions';\nimport { Card as CardDefault } from '../../components/Attachment/Card';\nimport { FileAttachment as FileAttachmentDefault } from '../../components/Attachment/FileAttachment';\nimport { Gallery as GalleryDefault } from '../../components/Attachment/Gallery';\nimport { Giphy as GiphyDefault } from '../../components/Attachment/Giphy';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { isVideoPackageAvailable } from '../../native';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nexport type ActionHandler = (name: string, value: string) => void;\n\nexport type AttachmentPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n MessagesContextValue<StreamChatGenerics>,\n | 'AttachmentActions'\n | 'Card'\n | 'FileAttachment'\n | 'Gallery'\n | 'giphyVersion'\n | 'Giphy'\n | 'isAttachmentEqual'\n | 'UrlPreview'\n | 'myMessageTheme'\n> & {\n /**\n * The attachment to render\n */\n attachment: AttachmentType<StreamChatGenerics>;\n};\n\nconst AttachmentWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: AttachmentPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n attachment,\n AttachmentActions,\n Card,\n FileAttachment,\n Gallery,\n Giphy,\n giphyVersion,\n UrlPreview,\n } = props;\n\n const hasAttachmentActions = !!attachment.actions?.length;\n\n if (attachment.type === 'giphy' || attachment.type === 'imgur') {\n return <Giphy attachment={attachment} giphyVersion={giphyVersion} />;\n }\n\n if (attachment.og_scrape_url || attachment.title_link) {\n return <UrlPreview {...attachment} />;\n }\n\n if (attachment.type === 'image') {\n return (\n <>\n <Gallery images={[attachment]} />\n {hasAttachmentActions && (\n <AttachmentActions key={`key-actions-${attachment.id}`} {...attachment} />\n )}\n </>\n );\n }\n\n if (attachment.type === 'video' && !attachment.og_scrape_url) {\n return isVideoPackageAvailable() ? (\n <>\n <Gallery videos={[attachment]} />\n {hasAttachmentActions && (\n <AttachmentActions key={`key-actions-${attachment.id}`} {...attachment} />\n )}\n </>\n ) : (\n <FileAttachment attachment={attachment} />\n );\n }\n\n if (attachment.type === 'file' || attachment.type === 'audio') {\n return <FileAttachment attachment={attachment} />;\n }\n\n if (hasAttachmentActions) {\n return (\n <>\n <Card {...attachment} />\n <AttachmentActions key={`key-actions-${attachment.id}`} {...attachment} />\n </>\n );\n } else {\n return <Card {...attachment} />;\n }\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: AttachmentPropsWithContext<StreamChatGenerics>,\n nextProps: AttachmentPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n attachment: prevAttachment,\n isAttachmentEqual,\n myMessageTheme: prevMyMessageTheme,\n } = prevProps;\n const { attachment: nextAttachment, myMessageTheme: nextMyMessageTheme } = nextProps;\n\n const attachmentEqual =\n prevAttachment.actions?.length === nextAttachment.actions?.length &&\n prevAttachment.image_url === nextAttachment.image_url &&\n prevAttachment.thumb_url === nextAttachment.thumb_url;\n if (!attachmentEqual) return false;\n\n if (isAttachmentEqual) {\n return isAttachmentEqual(prevAttachment, nextAttachment);\n }\n\n const messageThemeEqual =\n JSON.stringify(prevMyMessageTheme) === JSON.stringify(nextMyMessageTheme);\n if (!messageThemeEqual) return false;\n\n return true;\n};\n\nconst MemoizedAttachment = React.memo(\n AttachmentWithContext,\n areEqual,\n) as typeof AttachmentWithContext;\n\nexport type AttachmentProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n | 'AttachmentActions'\n | 'Card'\n | 'FileAttachment'\n | 'Gallery'\n | 'Giphy'\n | 'giphyVersion'\n | 'myMessageTheme'\n | 'UrlPreview'\n | 'isAttachmentEqual'\n >\n> &\n Pick<AttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>;\n\n/**\n * Attachment - The message attachment\n */\nexport const Attachment = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: AttachmentProps<StreamChatGenerics>,\n) => {\n const {\n attachment,\n AttachmentActions: PropAttachmentActions,\n Card: PropCard,\n FileAttachment: PropFileAttachment,\n Gallery: PropGallery,\n Giphy: PropGiphy,\n giphyVersion: PropGiphyVersion,\n myMessageTheme: PropMyMessageTheme,\n UrlPreview: PropUrlPreview,\n } = props;\n\n const {\n AttachmentActions: ContextAttachmentActions,\n Card: ContextCard,\n FileAttachment: ContextFileAttachment,\n Gallery: ContextGallery,\n Giphy: ContextGiphy,\n giphyVersion: ContextGiphyVersion,\n isAttachmentEqual,\n myMessageTheme: ContextMyMessageTheme,\n UrlPreview: ContextUrlPreview,\n } = useMessagesContext<StreamChatGenerics>();\n\n if (!attachment) {\n return null;\n }\n\n const AttachmentActions =\n PropAttachmentActions || ContextAttachmentActions || AttachmentActionsDefault;\n const Card = PropCard || ContextCard || CardDefault;\n const FileAttachment = PropFileAttachment || ContextFileAttachment || FileAttachmentDefault;\n const Gallery = PropGallery || ContextGallery || GalleryDefault;\n const Giphy = PropGiphy || ContextGiphy || GiphyDefault;\n const UrlPreview = PropUrlPreview || ContextUrlPreview || CardDefault;\n const giphyVersion = PropGiphyVersion || ContextGiphyVersion;\n const myMessageTheme = PropMyMessageTheme || ContextMyMessageTheme;\n\n return (\n <MemoizedAttachment\n {...{\n attachment,\n AttachmentActions,\n Card,\n FileAttachment,\n Gallery,\n Giphy,\n giphyVersion,\n isAttachmentEqual,\n myMessageTheme,\n UrlPreview,\n }}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AAIA,IAAAO,OAAA,GAAAP,OAAA;AAAuD,IAAAQ,KAAA;EAAAC,YAAA;AA0BvD,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAGzBC,KAAqD,EAClD;EAAA,IAAAC,mBAAA;EACH,IACEC,UAAU,GAQRF,KAAK,CARPE,UAAU;IACVC,iBAAiB,GAOfH,KAAK,CAPPG,iBAAiB;IACjBC,IAAI,GAMFJ,KAAK,CANPI,IAAI;IACJC,cAAc,GAKZL,KAAK,CALPK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AAA;MAAAC,QAAA,EAAAnB,YAAA;MAAAoB,UAAA;MAAAC,YAAA;IAAA;EAAA,CAEb,CAAC;AAEN,CAAC;AAACsD,OAAA,CAAAxB,UAAA,GAAAA,UAAA"}
|
|
@@ -311,9 +311,14 @@ var CardWithContext = function CardWithContext(props) {
|
|
|
311
311
|
}
|
|
312
312
|
}, text))));
|
|
313
313
|
};
|
|
314
|
-
var
|
|
314
|
+
var areEqual = function areEqual(prevProps, nextProps) {
|
|
315
|
+
var prevMyMessageTheme = prevProps.myMessageTheme;
|
|
316
|
+
var nextMyMessageTheme = nextProps.myMessageTheme;
|
|
317
|
+
var messageThemeEqual = JSON.stringify(prevMyMessageTheme) === JSON.stringify(nextMyMessageTheme);
|
|
318
|
+
if (!messageThemeEqual) return false;
|
|
315
319
|
return true;
|
|
316
|
-
}
|
|
320
|
+
};
|
|
321
|
+
var MemoizedCard = _react["default"].memo(CardWithContext, areEqual);
|
|
317
322
|
var Card = function Card(props) {
|
|
318
323
|
var _useChatContext = (0, _ChatContext.useChatContext)(),
|
|
319
324
|
ImageComponent = _useChatContext.ImageComponent;
|
|
@@ -327,7 +332,8 @@ var Card = function Card(props) {
|
|
|
327
332
|
additionalTouchableProps = _useMessagesContext.additionalTouchableProps,
|
|
328
333
|
CardCover = _useMessagesContext.CardCover,
|
|
329
334
|
CardFooter = _useMessagesContext.CardFooter,
|
|
330
|
-
CardHeader = _useMessagesContext.CardHeader
|
|
335
|
+
CardHeader = _useMessagesContext.CardHeader,
|
|
336
|
+
myMessageTheme = _useMessagesContext.myMessageTheme;
|
|
331
337
|
return _react["default"].createElement(MemoizedCard, (0, _extends2["default"])({
|
|
332
338
|
key: "" + (message == null ? void 0 : message.id) + (message == null ? void 0 : message.updated_at),
|
|
333
339
|
additionalTouchableProps: additionalTouchableProps,
|
|
@@ -337,6 +343,7 @@ var Card = function Card(props) {
|
|
|
337
343
|
channelId: message.cid,
|
|
338
344
|
ImageComponent: ImageComponent,
|
|
339
345
|
messageId: message.id,
|
|
346
|
+
myMessageTheme: myMessageTheme,
|
|
340
347
|
onLongPress: onLongPress,
|
|
341
348
|
onPress: onPress,
|
|
342
349
|
onPressIn: onPressIn,
|
|
@@ -345,7 +352,7 @@ var Card = function Card(props) {
|
|
|
345
352
|
__self: _this,
|
|
346
353
|
__source: {
|
|
347
354
|
fileName: _jsxFileName,
|
|
348
|
-
lineNumber:
|
|
355
|
+
lineNumber: 336,
|
|
349
356
|
columnNumber: 5
|
|
350
357
|
}
|
|
351
358
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_openUrlSafely","_ChatContext","_MessageContext","_MessagesContext","_ThemeContext","_Play","_utils","_ImageBackground","_excluded","_this","_jsxFileName","styles","StyleSheet","create","authorName","fontSize","fontWeight","authorNameContainer","borderTopRightRadius","paddingHorizontal","paddingTop","authorNameFooter","padding","authorNameMask","bottom","left","position","cardCover","alignItems","borderRadius","height","justifyContent","marginHorizontal","cardFooter","flexDirection","container","overflow","width","description","playButtonStyle","elevation","title","CardWithContext","props","additionalTouchableProps","author_name","CardCover","CardFooter","CardHeader","_props$ImageComponent","ImageComponent","Image","image_url","og_scrape_url","onLongPress","onPress","onPressIn","preventPress","_props$styles","stylesProp","text","thumb_url","type","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$color","colors","accent_blue","black","blue_alice","transparent","white","_useTheme$theme$messa","messageSimple","card","authorNameFooterContainer","cover","_useTheme$theme$messa2","footer","titleStyle","footerStyle","_objectWithoutProperties2","noURI","roundedView","_useTheme$theme$messa3","playIcon","uri","defaultOnPress","openUrlSafely","isVideoCard","createElement","TouchableOpacity","_extends2","disabled","event","additionalInfo","url","emitter","defaultHandler","style","testID","__self","__source","fileName","lineNumber","columnNumber","View","ImageBackground","imageStyle","resizeMode","source","makeImageCompatibleUrl","backgroundColor","Play","pathFill","Text","color","borderLeftColor","numberOfLines","MemoizedCard","React","memo","Card","_useChatContext","useChatContext","_useMessageContext","useMessageContext","message","_useMessagesContext","useMessagesContext","key","id","updated_at","channelId","cid","messageId","exports","displayName"],"sources":["Card.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Image,\n ImageStyle,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { openUrlSafely } from './utils/openUrlSafely';\n\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Play } from '../../icons/Play';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { makeImageCompatibleUrl } from '../../utils/utils';\nimport { ImageBackground } from '../ImageBackground';\n\nconst styles = StyleSheet.create({\n authorName: { fontSize: 14.5, fontWeight: '600' },\n authorNameContainer: {\n borderTopRightRadius: 15,\n paddingHorizontal: 8,\n paddingTop: 8,\n },\n authorNameFooter: {\n fontSize: 14.5,\n fontWeight: '600',\n padding: 8,\n },\n authorNameMask: {\n bottom: 0,\n left: 2,\n position: 'absolute',\n },\n cardCover: {\n alignItems: 'center',\n borderRadius: 8,\n height: 140,\n justifyContent: 'center',\n marginHorizontal: 2,\n },\n cardFooter: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n container: {\n overflow: 'hidden',\n width: 256,\n },\n description: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n playButtonStyle: {\n alignItems: 'center',\n borderRadius: 50,\n elevation: 2,\n height: 36,\n justifyContent: 'center',\n width: 36,\n },\n title: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n});\n\nexport type CardPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Pick<ChatContextValue, 'ImageComponent'> &\n Pick<\n MessageContextValue<StreamChatGenerics>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'\n > &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n > & {\n channelId: string | undefined;\n messageId: string | undefined;\n styles?: Partial<{\n authorName: StyleProp<TextStyle>;\n authorNameContainer: StyleProp<ViewStyle>;\n authorNameFooter: StyleProp<TextStyle>;\n authorNameFooterContainer: StyleProp<ViewStyle>;\n authorNameMask: StyleProp<ViewStyle>;\n cardCover: StyleProp<ImageStyle>;\n cardFooter: StyleProp<ViewStyle>;\n container: StyleProp<ViewStyle>;\n description: StyleProp<TextStyle>;\n title: StyleProp<TextStyle>;\n }>;\n };\n\nconst CardWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n additionalTouchableProps,\n author_name,\n CardCover,\n CardFooter,\n CardHeader,\n ImageComponent = Image,\n image_url,\n og_scrape_url,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n styles: stylesProp = {},\n text,\n thumb_url,\n title,\n type,\n } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, blue_alice, transparent, white },\n messageSimple: {\n card: {\n authorName,\n authorNameContainer,\n authorNameFooter,\n authorNameFooterContainer,\n authorNameMask,\n container,\n cover,\n footer: { description, title: titleStyle, ...footerStyle },\n noURI,\n playButtonStyle: { roundedView },\n playIcon: { height, width },\n },\n },\n },\n } = useTheme();\n\n const uri = image_url || thumb_url;\n\n const defaultOnPress = () => openUrlSafely(og_scrape_url || uri);\n\n const isVideoCard = type === 'video' && og_scrape_url;\n\n return (\n <TouchableOpacity\n disabled={preventPress}\n onLongPress={(event) => {\n if (onLongPress) {\n onLongPress({\n additionalInfo: { url: og_scrape_url },\n emitter: 'card',\n event,\n });\n }\n }}\n onPress={(event) => {\n if (onPress) {\n onPress({\n additionalInfo: { url: og_scrape_url },\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n onPressIn={(event) => {\n if (onPressIn) {\n onPressIn({\n additionalInfo: { url: og_scrape_url },\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n style={[styles.container, container, stylesProp.container]}\n testID='card-attachment'\n {...additionalTouchableProps}\n >\n {CardHeader && <CardHeader {...props} />}\n {CardCover && <CardCover {...props} />}\n {uri && !CardCover && (\n <View>\n <ImageBackground\n ImageComponent={ImageComponent}\n imageStyle={styles.cardCover}\n resizeMode='cover'\n source={{ uri: makeImageCompatibleUrl(uri) }}\n style={[styles.cardCover, cover, stylesProp.cardCover]}\n >\n {isVideoCard ? (\n <View style={[styles.playButtonStyle, roundedView, { backgroundColor: white }]}>\n <Play height={height} pathFill={black} width={width} />\n </View>\n ) : null}\n </ImageBackground>\n {author_name && (\n <View style={[styles.authorNameMask, authorNameMask, stylesProp.authorNameMask]}>\n <View\n style={[\n styles.authorNameContainer,\n { backgroundColor: blue_alice },\n authorNameContainer,\n stylesProp.authorNameContainer,\n ]}\n >\n <Text\n style={[\n styles.authorName,\n { color: accent_blue },\n authorName,\n stylesProp.authorName,\n ]}\n >\n {author_name}\n </Text>\n </View>\n </View>\n )}\n </View>\n )}\n {CardFooter ? (\n <CardFooter {...props} />\n ) : (\n <View style={[styles.cardFooter, footerStyle, stylesProp.cardFooter]}>\n <View\n style={[\n authorNameFooterContainer,\n { backgroundColor: transparent },\n !uri ? { borderLeftColor: accent_blue, ...noURI } : {},\n stylesProp.authorNameFooterContainer,\n ]}\n >\n {!uri && author_name && (\n <Text\n style={[\n styles.authorNameFooter,\n { color: accent_blue },\n authorNameFooter,\n stylesProp.authorNameFooter,\n ]}\n >\n {author_name}\n </Text>\n )}\n {title && (\n <Text\n numberOfLines={1}\n style={[styles.title, { color: black }, titleStyle, stylesProp.title]}\n >\n {title}\n </Text>\n )}\n {text && (\n <Text\n numberOfLines={3}\n style={[styles.description, { color: black }, description, stylesProp.description]}\n >\n {text}\n </Text>\n )}\n </View>\n </View>\n )}\n </TouchableOpacity>\n );\n};\n\nconst MemoizedCard = React.memo(CardWithContext, () => true) as typeof CardWithContext;\n\nexport type CardProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Partial<\n Pick<ChatContextValue<StreamChatGenerics>, 'ImageComponent'> &\n Pick<MessageContextValue<StreamChatGenerics>, 'onLongPress' | 'onPress' | 'onPressIn'> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n >\n >;\n\n/**\n * UI component for card in attachments.\n */\nexport const Card = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardProps<StreamChatGenerics>,\n) => {\n const { ImageComponent } = useChatContext<StreamChatGenerics>();\n const { message, onLongPress, onPress, onPressIn, preventPress } =\n useMessageContext<StreamChatGenerics>();\n const { additionalTouchableProps, CardCover, CardFooter, CardHeader } =\n useMessagesContext<StreamChatGenerics>();\n\n return (\n <MemoizedCard\n key={`${message?.id}${message?.updated_at}`} // press listeners must change on message update, updating key ensures this\n {...{\n additionalTouchableProps,\n CardCover,\n CardFooter,\n CardHeader,\n channelId: message.cid,\n ImageComponent,\n messageId: message.id,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n }}\n {...props}\n />\n );\n};\n\nCard.displayName = 'Card{messageSimple{card}}';\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAcA,IAAAE,cAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAIA,IAAAK,gBAAA,GAAAL,OAAA;AAIA,IAAAM,aAAA,GAAAN,OAAA;AACA,I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C6B,YAAY,MAAA3B,SAAA;IACXsC,GAAG,QAAKH,OAAO,oBAAPA,OAAO,CAAEI,EAAE,KAAGJ,OAAO,oBAAPA,OAAO,CAAEK,UAAU,CAAG;IAE1C1F,wBAAwB,EAAxBA,wBAAwB;IACxBE,SAAS,EAATA,SAAS;IACTC,UAAU,EAAVA,UAAU;IACVC,UAAU,EAAVA,UAAU;IACVuF,SAAS,EAAEN,OAAO,CAACO,GAAG;IACtBtF,cAAc,EAAdA,cAAc;IACduF,SAAS,EAAER,OAAO,CAACI,EAAE;IACrB/E,WAAW,EAAXA,WAAW;IACXC,OAAO,EAAPA,OAAO;IACPC,SAAS,EAATA,SAAS;IACTC,YAAY,EAAZA;EAAY,GAEVd,KAAK;IAAA4D,MAAA,EAAA9F,KAAA;IAAA+F,QAAA;MAAAC,QAAA,EAAA/F,YAAA;MAAAgG,UAAA;MAAAC,YAAA;IAAA;EAAA,EACV,CAAC;AAEN,CAAC;AAAC+B,OAAA,CAAAd,IAAA,GAAAA,IAAA;AAEFA,IAAI,CAACe,WAAW,GAAG,2BAA2B"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_openUrlSafely","_ChatContext","_MessageContext","_MessagesContext","_ThemeContext","_Play","_utils","_ImageBackground","_excluded","_this","_jsxFileName","styles","StyleSheet","create","authorName","fontSize","fontWeight","authorNameContainer","borderTopRightRadius","paddingHorizontal","paddingTop","authorNameFooter","padding","authorNameMask","bottom","left","position","cardCover","alignItems","borderRadius","height","justifyContent","marginHorizontal","cardFooter","flexDirection","container","overflow","width","description","playButtonStyle","elevation","title","CardWithContext","props","additionalTouchableProps","author_name","CardCover","CardFooter","CardHeader","_props$ImageComponent","ImageComponent","Image","image_url","og_scrape_url","onLongPress","onPress","onPressIn","preventPress","_props$styles","stylesProp","text","thumb_url","type","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$color","colors","accent_blue","black","blue_alice","transparent","white","_useTheme$theme$messa","messageSimple","card","authorNameFooterContainer","cover","_useTheme$theme$messa2","footer","titleStyle","footerStyle","_objectWithoutProperties2","noURI","roundedView","_useTheme$theme$messa3","playIcon","uri","defaultOnPress","openUrlSafely","isVideoCard","createElement","TouchableOpacity","_extends2","disabled","event","additionalInfo","url","emitter","defaultHandler","style","testID","__self","__source","fileName","lineNumber","columnNumber","View","ImageBackground","imageStyle","resizeMode","source","makeImageCompatibleUrl","backgroundColor","Play","pathFill","Text","color","borderLeftColor","numberOfLines","areEqual","prevProps","nextProps","prevMyMessageTheme","myMessageTheme","nextMyMessageTheme","messageThemeEqual","JSON","stringify","MemoizedCard","React","memo","Card","_useChatContext","useChatContext","_useMessageContext","useMessageContext","message","_useMessagesContext","useMessagesContext","key","id","updated_at","channelId","cid","messageId","exports","displayName"],"sources":["Card.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Image,\n ImageStyle,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n TouchableOpacity,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { openUrlSafely } from './utils/openUrlSafely';\n\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Play } from '../../icons/Play';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { makeImageCompatibleUrl } from '../../utils/utils';\nimport { ImageBackground } from '../ImageBackground';\n\nconst styles = StyleSheet.create({\n authorName: { fontSize: 14.5, fontWeight: '600' },\n authorNameContainer: {\n borderTopRightRadius: 15,\n paddingHorizontal: 8,\n paddingTop: 8,\n },\n authorNameFooter: {\n fontSize: 14.5,\n fontWeight: '600',\n padding: 8,\n },\n authorNameMask: {\n bottom: 0,\n left: 2,\n position: 'absolute',\n },\n cardCover: {\n alignItems: 'center',\n borderRadius: 8,\n height: 140,\n justifyContent: 'center',\n marginHorizontal: 2,\n },\n cardFooter: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 10,\n },\n container: {\n overflow: 'hidden',\n width: 256,\n },\n description: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n playButtonStyle: {\n alignItems: 'center',\n borderRadius: 50,\n elevation: 2,\n height: 36,\n justifyContent: 'center',\n width: 36,\n },\n title: {\n fontSize: 12,\n marginHorizontal: 8,\n },\n});\n\nexport type CardPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Pick<ChatContextValue, 'ImageComponent'> &\n Pick<\n MessageContextValue<StreamChatGenerics>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'\n > &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader' | 'myMessageTheme'\n > & {\n channelId: string | undefined;\n messageId: string | undefined;\n styles?: Partial<{\n authorName: StyleProp<TextStyle>;\n authorNameContainer: StyleProp<ViewStyle>;\n authorNameFooter: StyleProp<TextStyle>;\n authorNameFooterContainer: StyleProp<ViewStyle>;\n authorNameMask: StyleProp<ViewStyle>;\n cardCover: StyleProp<ImageStyle>;\n cardFooter: StyleProp<ViewStyle>;\n container: StyleProp<ViewStyle>;\n description: StyleProp<TextStyle>;\n title: StyleProp<TextStyle>;\n }>;\n };\n\nconst CardWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n additionalTouchableProps,\n author_name,\n CardCover,\n CardFooter,\n CardHeader,\n ImageComponent = Image,\n image_url,\n og_scrape_url,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n styles: stylesProp = {},\n text,\n thumb_url,\n title,\n type,\n } = props;\n\n const {\n theme: {\n colors: { accent_blue, black, blue_alice, transparent, white },\n messageSimple: {\n card: {\n authorName,\n authorNameContainer,\n authorNameFooter,\n authorNameFooterContainer,\n authorNameMask,\n container,\n cover,\n footer: { description, title: titleStyle, ...footerStyle },\n noURI,\n playButtonStyle: { roundedView },\n playIcon: { height, width },\n },\n },\n },\n } = useTheme();\n\n const uri = image_url || thumb_url;\n\n const defaultOnPress = () => openUrlSafely(og_scrape_url || uri);\n\n const isVideoCard = type === 'video' && og_scrape_url;\n\n return (\n <TouchableOpacity\n disabled={preventPress}\n onLongPress={(event) => {\n if (onLongPress) {\n onLongPress({\n additionalInfo: { url: og_scrape_url },\n emitter: 'card',\n event,\n });\n }\n }}\n onPress={(event) => {\n if (onPress) {\n onPress({\n additionalInfo: { url: og_scrape_url },\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n onPressIn={(event) => {\n if (onPressIn) {\n onPressIn({\n additionalInfo: { url: og_scrape_url },\n defaultHandler: defaultOnPress,\n emitter: 'card',\n event,\n });\n }\n }}\n style={[styles.container, container, stylesProp.container]}\n testID='card-attachment'\n {...additionalTouchableProps}\n >\n {CardHeader && <CardHeader {...props} />}\n {CardCover && <CardCover {...props} />}\n {uri && !CardCover && (\n <View>\n <ImageBackground\n ImageComponent={ImageComponent}\n imageStyle={styles.cardCover}\n resizeMode='cover'\n source={{ uri: makeImageCompatibleUrl(uri) }}\n style={[styles.cardCover, cover, stylesProp.cardCover]}\n >\n {isVideoCard ? (\n <View style={[styles.playButtonStyle, roundedView, { backgroundColor: white }]}>\n <Play height={height} pathFill={black} width={width} />\n </View>\n ) : null}\n </ImageBackground>\n {author_name && (\n <View style={[styles.authorNameMask, authorNameMask, stylesProp.authorNameMask]}>\n <View\n style={[\n styles.authorNameContainer,\n { backgroundColor: blue_alice },\n authorNameContainer,\n stylesProp.authorNameContainer,\n ]}\n >\n <Text\n style={[\n styles.authorName,\n { color: accent_blue },\n authorName,\n stylesProp.authorName,\n ]}\n >\n {author_name}\n </Text>\n </View>\n </View>\n )}\n </View>\n )}\n {CardFooter ? (\n <CardFooter {...props} />\n ) : (\n <View style={[styles.cardFooter, footerStyle, stylesProp.cardFooter]}>\n <View\n style={[\n authorNameFooterContainer,\n { backgroundColor: transparent },\n !uri ? { borderLeftColor: accent_blue, ...noURI } : {},\n stylesProp.authorNameFooterContainer,\n ]}\n >\n {!uri && author_name && (\n <Text\n style={[\n styles.authorNameFooter,\n { color: accent_blue },\n authorNameFooter,\n stylesProp.authorNameFooter,\n ]}\n >\n {author_name}\n </Text>\n )}\n {title && (\n <Text\n numberOfLines={1}\n style={[styles.title, { color: black }, titleStyle, stylesProp.title]}\n >\n {title}\n </Text>\n )}\n {text && (\n <Text\n numberOfLines={3}\n style={[styles.description, { color: black }, description, stylesProp.description]}\n >\n {text}\n </Text>\n )}\n </View>\n </View>\n )}\n </TouchableOpacity>\n );\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: CardPropsWithContext<StreamChatGenerics>,\n nextProps: CardPropsWithContext<StreamChatGenerics>,\n) => {\n const { myMessageTheme: prevMyMessageTheme } = prevProps;\n const { myMessageTheme: nextMyMessageTheme } = nextProps;\n\n const messageThemeEqual =\n JSON.stringify(prevMyMessageTheme) === JSON.stringify(nextMyMessageTheme);\n if (!messageThemeEqual) return false;\n\n return true;\n};\n\nconst MemoizedCard = React.memo(CardWithContext, areEqual) as typeof CardWithContext;\n\nexport type CardProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> &\n Partial<\n Pick<ChatContextValue<StreamChatGenerics>, 'ImageComponent'> &\n Pick<\n MessageContextValue<StreamChatGenerics>,\n 'onLongPress' | 'onPress' | 'onPressIn' | 'myMessageTheme'\n > &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n 'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'\n >\n >;\n\n/**\n * UI component for card in attachments.\n */\nexport const Card = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: CardProps<StreamChatGenerics>,\n) => {\n const { ImageComponent } = useChatContext<StreamChatGenerics>();\n const { message, onLongPress, onPress, onPressIn, preventPress } =\n useMessageContext<StreamChatGenerics>();\n const { additionalTouchableProps, CardCover, CardFooter, CardHeader, myMessageTheme } =\n useMessagesContext<StreamChatGenerics>();\n\n return (\n <MemoizedCard\n key={`${message?.id}${message?.updated_at}`} // press listeners must change on message update, updating key ensures this\n {...{\n additionalTouchableProps,\n CardCover,\n CardFooter,\n CardHeader,\n channelId: message.cid,\n ImageComponent,\n messageId: message.id,\n myMessageTheme,\n onLongPress,\n onPress,\n onPressIn,\n preventPress,\n }}\n {...props}\n />\n );\n};\n\nCard.displayName = 'Card{messageSimple{card}}';\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAcA,IAAAE,cAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAIA,IAAAK,gBAAA,GAAAL,OAAA;AAIA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAEA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,gBAAA,GAAAT,OAAA;AAAqD,IAAAU,SAAA;AAAA,IAAAC,KAAA;EAAAC,YAAA;AAErD,IAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,UAAU,EAAE;IAAEC,QAAQ,EAAE,IAAI;IAAEC,UAAU,EAAE;EAAM,CAAC;EACjDC,mBAAmB,EAAE;IACnBC,oBAAoB,EAAE,EAAE;IACxBC,iBAAiB,EAAE,CAAC;IACpBC,UAAU,EAAE;EACd,CAAC;EACDC,gBAAgB,EAAE;IAChBN,QAAQ,EAAE,IAAI;IACdC,UAAU,EAAE,KAAK;IACjBM,OAAO,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E,KAAGJ,OAAO,oBAAPA,OAAO,CAAEK,UAAU,CAAG;IAE1CnG,wBAAwB,EAAxBA,wBAAwB;IACxBE,SAAS,EAATA,SAAS;IACTC,UAAU,EAAVA,UAAU;IACVC,UAAU,EAAVA,UAAU;IACVgG,SAAS,EAAEN,OAAO,CAACO,GAAG;IACtB/F,cAAc,EAAdA,cAAc;IACdgG,SAAS,EAAER,OAAO,CAACI,EAAE;IACrBjB,cAAc,EAAdA,cAAc;IACdvE,WAAW,EAAXA,WAAW;IACXC,OAAO,EAAPA,OAAO;IACPC,SAAS,EAATA,SAAS;IACTC,YAAY,EAAZA;EAAY,GAEVd,KAAK;IAAA4D,MAAA,EAAA9F,KAAA;IAAA+F,QAAA;MAAAC,QAAA,EAAA/F,YAAA;MAAAgG,UAAA;MAAAC,YAAA;IAAA;EAAA,EACV,CAAC;AAEN,CAAC;AAACwC,OAAA,CAAAd,IAAA,GAAAA,IAAA;AAEFA,IAAI,CAACe,WAAW,GAAG,2BAA2B"}
|
|
@@ -91,7 +91,7 @@ var GalleryWithContext = function GalleryWithContext(props) {
|
|
|
91
91
|
__self: _this,
|
|
92
92
|
__source: {
|
|
93
93
|
fileName: _jsxFileName,
|
|
94
|
-
lineNumber:
|
|
94
|
+
lineNumber: 151,
|
|
95
95
|
columnNumber: 5
|
|
96
96
|
}
|
|
97
97
|
}, thumbnailGrid.map(function (rows, colIndex) {
|
|
@@ -105,7 +105,7 @@ var GalleryWithContext = function GalleryWithContext(props) {
|
|
|
105
105
|
__self: _this,
|
|
106
106
|
__source: {
|
|
107
107
|
fileName: _jsxFileName,
|
|
108
|
-
lineNumber:
|
|
108
|
+
lineNumber: 166,
|
|
109
109
|
columnNumber: 11
|
|
110
110
|
}
|
|
111
111
|
}, rows.map(function (thumbnail, rowIndex) {
|
|
@@ -153,7 +153,7 @@ var GalleryWithContext = function GalleryWithContext(props) {
|
|
|
153
153
|
__self: _this,
|
|
154
154
|
__source: {
|
|
155
155
|
fileName: _jsxFileName,
|
|
156
|
-
lineNumber:
|
|
156
|
+
lineNumber: 198,
|
|
157
157
|
columnNumber: 17
|
|
158
158
|
}
|
|
159
159
|
});
|
|
@@ -255,7 +255,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
255
255
|
__self: _this,
|
|
256
256
|
__source: {
|
|
257
257
|
fileName: _jsxFileName,
|
|
258
|
-
lineNumber:
|
|
258
|
+
lineNumber: 325,
|
|
259
259
|
columnNumber: 5
|
|
260
260
|
}
|
|
261
261
|
}), thumbnail.type === 'video' ? _react["default"].createElement(VideoThumbnail, {
|
|
@@ -267,7 +267,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
267
267
|
__self: _this,
|
|
268
268
|
__source: {
|
|
269
269
|
fileName: _jsxFileName,
|
|
270
|
-
lineNumber:
|
|
270
|
+
lineNumber: 367,
|
|
271
271
|
columnNumber: 9
|
|
272
272
|
}
|
|
273
273
|
}) : _react["default"].createElement(_reactNative.View, {
|
|
@@ -275,7 +275,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
275
275
|
__self: _this,
|
|
276
276
|
__source: {
|
|
277
277
|
fileName: _jsxFileName,
|
|
278
|
-
lineNumber:
|
|
278
|
+
lineNumber: 379,
|
|
279
279
|
columnNumber: 9
|
|
280
280
|
}
|
|
281
281
|
}, _react["default"].createElement(GalleryImageThumbnail, {
|
|
@@ -286,7 +286,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
286
286
|
__self: _this,
|
|
287
287
|
__source: {
|
|
288
288
|
fileName: _jsxFileName,
|
|
289
|
-
lineNumber:
|
|
289
|
+
lineNumber: 380,
|
|
290
290
|
columnNumber: 11
|
|
291
291
|
}
|
|
292
292
|
})), colIndex === numOfColumns - 1 && rowIndex === numOfRows - 1 && imagesAndVideos.length > 4 ? _react["default"].createElement(_reactNative.View, {
|
|
@@ -296,7 +296,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
296
296
|
__self: _this,
|
|
297
297
|
__source: {
|
|
298
298
|
fileName: _jsxFileName,
|
|
299
|
-
lineNumber:
|
|
299
|
+
lineNumber: 389,
|
|
300
300
|
columnNumber: 9
|
|
301
301
|
}
|
|
302
302
|
}, _react["default"].createElement(_reactNative.Text, {
|
|
@@ -304,7 +304,7 @@ var GalleryThumbnail = function GalleryThumbnail(_ref) {
|
|
|
304
304
|
__self: _this,
|
|
305
305
|
__source: {
|
|
306
306
|
fileName: _jsxFileName,
|
|
307
|
-
lineNumber:
|
|
307
|
+
lineNumber: 397,
|
|
308
308
|
columnNumber: 11
|
|
309
309
|
}
|
|
310
310
|
}, "+" + (imagesAndVideos.length - 4))) : null);
|
|
@@ -330,7 +330,7 @@ var GalleryImageThumbnail = function GalleryImageThumbnail(_ref2) {
|
|
|
330
330
|
__self: _this,
|
|
331
331
|
__source: {
|
|
332
332
|
fileName: _jsxFileName,
|
|
333
|
-
lineNumber:
|
|
333
|
+
lineNumber: 432,
|
|
334
334
|
columnNumber: 5
|
|
335
335
|
}
|
|
336
336
|
}, isLoadingImageError ? _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(ImageLoadingFailedIndicator, {
|
|
@@ -338,7 +338,7 @@ var GalleryImageThumbnail = function GalleryImageThumbnail(_ref2) {
|
|
|
338
338
|
__self: _this,
|
|
339
339
|
__source: {
|
|
340
340
|
fileName: _jsxFileName,
|
|
341
|
-
lineNumber:
|
|
341
|
+
lineNumber: 443,
|
|
342
342
|
columnNumber: 11
|
|
343
343
|
}
|
|
344
344
|
}), _react["default"].createElement(_ImageReloadIndicator.ImageReloadIndicator, {
|
|
@@ -347,7 +347,7 @@ var GalleryImageThumbnail = function GalleryImageThumbnail(_ref2) {
|
|
|
347
347
|
__self: _this,
|
|
348
348
|
__source: {
|
|
349
349
|
fileName: _jsxFileName,
|
|
350
|
-
lineNumber:
|
|
350
|
+
lineNumber: 444,
|
|
351
351
|
columnNumber: 11
|
|
352
352
|
}
|
|
353
353
|
})) : _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_GalleryImage.GalleryImage, {
|
|
@@ -372,7 +372,7 @@ var GalleryImageThumbnail = function GalleryImageThumbnail(_ref2) {
|
|
|
372
372
|
__self: _this,
|
|
373
373
|
__source: {
|
|
374
374
|
fileName: _jsxFileName,
|
|
375
|
-
lineNumber:
|
|
375
|
+
lineNumber: 451,
|
|
376
376
|
columnNumber: 11
|
|
377
377
|
}
|
|
378
378
|
}), isLoadingImage && _react["default"].createElement(_reactNative.View, {
|
|
@@ -380,7 +380,7 @@ var GalleryImageThumbnail = function GalleryImageThumbnail(_ref2) {
|
|
|
380
380
|
__self: _this,
|
|
381
381
|
__source: {
|
|
382
382
|
fileName: _jsxFileName,
|
|
383
|
-
lineNumber:
|
|
383
|
+
lineNumber: 471,
|
|
384
384
|
columnNumber: 13
|
|
385
385
|
}
|
|
386
386
|
}, _react["default"].createElement(ImageLoadingIndicator, {
|
|
@@ -388,7 +388,7 @@ var GalleryImageThumbnail = function GalleryImageThumbnail(_ref2) {
|
|
|
388
388
|
__self: _this,
|
|
389
389
|
__source: {
|
|
390
390
|
fileName: _jsxFileName,
|
|
391
|
-
lineNumber:
|
|
391
|
+
lineNumber: 472,
|
|
392
392
|
columnNumber: 15
|
|
393
393
|
}
|
|
394
394
|
}))));
|
|
@@ -398,11 +398,13 @@ var areEqual = function areEqual(prevProps, nextProps) {
|
|
|
398
398
|
prevHasThreadReplies = prevProps.hasThreadReplies,
|
|
399
399
|
prevImages = prevProps.images,
|
|
400
400
|
prevMessage = prevProps.message,
|
|
401
|
+
prevMyMessageTheme = prevProps.myMessageTheme,
|
|
401
402
|
prevVideos = prevProps.videos;
|
|
402
403
|
var nextGroupStyles = nextProps.groupStyles,
|
|
403
404
|
nextHasThreadReplies = nextProps.hasThreadReplies,
|
|
404
405
|
nextImages = nextProps.images,
|
|
405
406
|
nextMessage = nextProps.message,
|
|
407
|
+
nextMyMessageTheme = nextProps.myMessageTheme,
|
|
406
408
|
nextVideos = nextProps.videos;
|
|
407
409
|
var messageEqual = (prevMessage == null ? void 0 : prevMessage.id) === (nextMessage == null ? void 0 : nextMessage.id) && "" + (prevMessage == null ? void 0 : prevMessage.updated_at) === "" + (nextMessage == null ? void 0 : nextMessage.updated_at);
|
|
408
410
|
if (!messageEqual) return false;
|
|
@@ -418,6 +420,8 @@ var areEqual = function areEqual(prevProps, nextProps) {
|
|
|
418
420
|
return (0, _utils.getUrlWithoutParams)(image.image_url) === (0, _utils.getUrlWithoutParams)(nextVideos[index].image_url) && (0, _utils.getUrlWithoutParams)(image.thumb_url) === (0, _utils.getUrlWithoutParams)(nextVideos[index].thumb_url);
|
|
419
421
|
});
|
|
420
422
|
if (!videosEqual) return false;
|
|
423
|
+
var messageThemeEqual = JSON.stringify(prevMyMessageTheme) === JSON.stringify(nextMyMessageTheme);
|
|
424
|
+
if (!messageThemeEqual) return false;
|
|
421
425
|
return true;
|
|
422
426
|
};
|
|
423
427
|
var MemoizedGallery = _react["default"].memo(GalleryWithContext, areEqual);
|
|
@@ -430,6 +434,7 @@ var Gallery = function Gallery(props) {
|
|
|
430
434
|
PropImageLoadingIndicator = props.ImageLoadingIndicator,
|
|
431
435
|
propImages = props.images,
|
|
432
436
|
propMessage = props.message,
|
|
437
|
+
propMyMessageTheme = props.myMessageTheme,
|
|
433
438
|
propOnLongPress = props.onLongPress,
|
|
434
439
|
propOnPress = props.onPress,
|
|
435
440
|
propOnPressIn = props.onPressIn,
|
|
@@ -458,6 +463,7 @@ var Gallery = function Gallery(props) {
|
|
|
458
463
|
ContextImageLoadingFailedIndicator = _useMessagesContext.ImageLoadingFailedIndicator,
|
|
459
464
|
ContextImageLoadingIndicator = _useMessagesContext.ImageLoadingIndicator,
|
|
460
465
|
legacyImageViewerSwipeBehaviour = _useMessagesContext.legacyImageViewerSwipeBehaviour,
|
|
466
|
+
contextMyMessageTheme = _useMessagesContext.myMessageTheme,
|
|
461
467
|
ContextVideoThumnbnail = _useMessagesContext.VideoThumbnail;
|
|
462
468
|
var _useOverlayContext = (0, _OverlayContext.useOverlayContext)(),
|
|
463
469
|
contextSetOverlay = _useOverlayContext.setOverlay;
|
|
@@ -478,6 +484,7 @@ var Gallery = function Gallery(props) {
|
|
|
478
484
|
var VideoThumbnail = PropVideoThumbnail || ContextVideoThumnbnail;
|
|
479
485
|
var ImageLoadingFailedIndicator = PropImageLoadingFailedIndicator || ContextImageLoadingFailedIndicator;
|
|
480
486
|
var ImageLoadingIndicator = PropImageLoadingIndicator || ContextImageLoadingIndicator;
|
|
487
|
+
var myMessageTheme = propMyMessageTheme || contextMyMessageTheme;
|
|
481
488
|
return _react["default"].createElement(MemoizedGallery, {
|
|
482
489
|
additionalTouchableProps: additionalTouchableProps,
|
|
483
490
|
alignment: alignment,
|
|
@@ -489,6 +496,7 @@ var Gallery = function Gallery(props) {
|
|
|
489
496
|
images: images,
|
|
490
497
|
legacyImageViewerSwipeBehaviour: legacyImageViewerSwipeBehaviour,
|
|
491
498
|
message: message,
|
|
499
|
+
myMessageTheme: myMessageTheme,
|
|
492
500
|
onLongPress: onLongPress,
|
|
493
501
|
onPress: onPress,
|
|
494
502
|
onPressIn: onPressIn,
|
|
@@ -502,7 +510,7 @@ var Gallery = function Gallery(props) {
|
|
|
502
510
|
__self: _this,
|
|
503
511
|
__source: {
|
|
504
512
|
fileName: _jsxFileName,
|
|
505
|
-
lineNumber:
|
|
513
|
+
lineNumber: 622,
|
|
506
514
|
columnNumber: 5
|
|
507
515
|
}
|
|
508
516
|
});
|