stream-chat-react-native-core 4.12.0-beta.2 → 4.12.0-beta.3
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/{MessageInput/AudioAttachmentUploadPreview.js → Attachment/AudioAttachment.js} +26 -23
- package/lib/commonjs/components/Attachment/AudioAttachment.js.map +1 -0
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +113 -10
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/commonjs/components/Attachment/VideoThumbnail.js +12 -6
- package/lib/commonjs/components/Attachment/VideoThumbnail.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +5 -5
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -2
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +11 -10
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +10 -31
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/index.js +13 -13
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +2 -2
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -2
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +2 -2
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/{MessageInput/AudioAttachmentUploadPreview.js → Attachment/AudioAttachment.js} +26 -23
- package/lib/module/components/Attachment/AudioAttachment.js.map +1 -0
- package/lib/module/components/Attachment/FileAttachmentGroup.js +113 -10
- package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/module/components/Attachment/VideoThumbnail.js +12 -6
- package/lib/module/components/Attachment/VideoThumbnail.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +5 -5
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -2
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +11 -10
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +10 -31
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/index.js +13 -13
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +2 -2
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -2
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +2 -2
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/AudioAttachment.d.ts +26 -0
- package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts +2 -1
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +1 -1
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +1 -1
- package/lib/typescript/components/index.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +4 -4
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/{MessageInput/AudioAttachmentUploadPreview.tsx → Attachment/AudioAttachment.tsx} +21 -26
- package/src/components/Attachment/FileAttachmentGroup.tsx +96 -7
- package/src/components/Attachment/VideoThumbnail.tsx +3 -2
- package/src/components/Channel/Channel.tsx +3 -3
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +2 -2
- package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +12 -7
- package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +4 -2
- package/src/components/MessageInput/FileUploadPreview.tsx +8 -17
- package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.tsx +4 -7
- package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.tsx +4 -7
- package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +5 -5
- package/src/components/index.ts +1 -1
- package/src/contexts/messageInputContext/MessageInputContext.tsx +3 -5
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +2 -2
- package/src/contexts/themeContext/utils/theme.ts +4 -4
- package/src/version.json +1 -1
- package/lib/commonjs/components/MessageInput/AudioAttachmentUploadPreview.js.map +0 -1
- package/lib/module/components/MessageInput/AudioAttachmentUploadPreview.js.map +0 -1
- package/lib/typescript/components/MessageInput/AudioAttachmentUploadPreview.d.ts +0 -26
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
2
|
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.FileAttachmentGroup = void 0;
|
|
7
9
|
|
|
8
|
-
var
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
15
|
|
|
10
16
|
var _reactNative = require("react-native");
|
|
11
17
|
|
|
@@ -13,13 +19,21 @@ var _Attachment = require("./Attachment");
|
|
|
13
19
|
|
|
14
20
|
var _MessageContext = require("../../contexts/messageContext/MessageContext");
|
|
15
21
|
|
|
22
|
+
var _MessageInputContext = require("../../contexts/messageInputContext/MessageInputContext");
|
|
23
|
+
|
|
16
24
|
var _MessagesContext = require("../../contexts/messagesContext/MessagesContext");
|
|
17
25
|
|
|
18
26
|
var _ThemeContext = require("../../contexts/themeContext/ThemeContext");
|
|
19
27
|
|
|
28
|
+
var _native = require("../../native");
|
|
29
|
+
|
|
20
30
|
var _this = this,
|
|
21
31
|
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Attachment/FileAttachmentGroup.tsx";
|
|
22
32
|
|
|
33
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
34
|
+
|
|
35
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
36
|
+
|
|
23
37
|
var styles = _reactNative.StyleSheet.create({
|
|
24
38
|
container: {
|
|
25
39
|
padding: 4
|
|
@@ -28,11 +42,67 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
28
42
|
|
|
29
43
|
var FileAttachmentGroupWithContext = function FileAttachmentGroupWithContext(props) {
|
|
30
44
|
var Attachment = props.Attachment,
|
|
45
|
+
AudioAttachment = props.AudioAttachment,
|
|
31
46
|
files = props.files,
|
|
32
47
|
messageId = props.messageId,
|
|
33
48
|
_props$styles = props.styles,
|
|
34
49
|
stylesProp = _props$styles === void 0 ? {} : _props$styles;
|
|
35
50
|
|
|
51
|
+
var _useState = (0, _react.useState)([]),
|
|
52
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
53
|
+
filesToDisplay = _useState2[0],
|
|
54
|
+
setFilesToDisplay = _useState2[1];
|
|
55
|
+
|
|
56
|
+
(0, _react.useEffect)(function () {
|
|
57
|
+
setFilesToDisplay(files.map(function (file) {
|
|
58
|
+
return (0, _extends2["default"])({}, file, {
|
|
59
|
+
duration: 0,
|
|
60
|
+
paused: true,
|
|
61
|
+
progress: 0
|
|
62
|
+
});
|
|
63
|
+
}));
|
|
64
|
+
}, [files]);
|
|
65
|
+
|
|
66
|
+
var onLoad = function onLoad(index, duration) {
|
|
67
|
+
setFilesToDisplay(function (prevFilesToDisplay) {
|
|
68
|
+
return prevFilesToDisplay.map(function (fileToDisplay, id) {
|
|
69
|
+
return (0, _extends2["default"])({}, fileToDisplay, {
|
|
70
|
+
duration: id.toString() === index ? duration : fileToDisplay.duration
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var onProgress = function onProgress(index, currentTime, hasEnd) {
|
|
77
|
+
setFilesToDisplay(function (prevFileUploads) {
|
|
78
|
+
return prevFileUploads.map(function (fileUpload, id) {
|
|
79
|
+
return (0, _extends2["default"])({}, fileUpload, {
|
|
80
|
+
progress: id.toString() === index ? hasEnd ? 1 : currentTime ? currentTime / fileUpload.duration : 0 : fileUpload.progress
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
var onPlayPause = function onPlayPause(index, pausedStatus) {
|
|
87
|
+
if (pausedStatus === false) {
|
|
88
|
+
setFilesToDisplay(function (prevFileUploads) {
|
|
89
|
+
return prevFileUploads.map(function (fileUpload, id) {
|
|
90
|
+
return (0, _extends2["default"])({}, fileUpload, {
|
|
91
|
+
paused: id.toString() === index ? false : true
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
} else {
|
|
96
|
+
setFilesToDisplay(function (prevFileUploads) {
|
|
97
|
+
return prevFileUploads.map(function (fileUpload) {
|
|
98
|
+
return (0, _extends2["default"])({}, fileUpload, {
|
|
99
|
+
paused: true
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
36
106
|
var _useTheme = (0, _ThemeContext.useTheme)(),
|
|
37
107
|
container = _useTheme.theme.messageSimple.fileAttachmentGroup.container;
|
|
38
108
|
|
|
@@ -41,10 +111,10 @@ var FileAttachmentGroupWithContext = function FileAttachmentGroupWithContext(pro
|
|
|
41
111
|
__self: _this,
|
|
42
112
|
__source: {
|
|
43
113
|
fileName: _jsxFileName,
|
|
44
|
-
lineNumber:
|
|
114
|
+
lineNumber: 123,
|
|
45
115
|
columnNumber: 5
|
|
46
116
|
}
|
|
47
|
-
},
|
|
117
|
+
}, filesToDisplay.map(function (file, index) {
|
|
48
118
|
return _react["default"].createElement(_reactNative.View, {
|
|
49
119
|
key: messageId + "-" + index,
|
|
50
120
|
style: [{
|
|
@@ -53,16 +123,46 @@ var FileAttachmentGroupWithContext = function FileAttachmentGroupWithContext(pro
|
|
|
53
123
|
__self: _this,
|
|
54
124
|
__source: {
|
|
55
125
|
fileName: _jsxFileName,
|
|
56
|
-
lineNumber:
|
|
126
|
+
lineNumber: 125,
|
|
57
127
|
columnNumber: 9
|
|
58
128
|
}
|
|
59
|
-
}, _react["default"].createElement(
|
|
129
|
+
}, file.type === 'audio' && (0, _native.isAudioPackageAvailable)() ? _react["default"].createElement(_reactNative.View, {
|
|
130
|
+
accessibilityLabel: "audio-attachment-preview",
|
|
131
|
+
__self: _this,
|
|
132
|
+
__source: {
|
|
133
|
+
fileName: _jsxFileName,
|
|
134
|
+
lineNumber: 133,
|
|
135
|
+
columnNumber: 13
|
|
136
|
+
}
|
|
137
|
+
}, _react["default"].createElement(AudioAttachment, {
|
|
138
|
+
index: index,
|
|
139
|
+
item: {
|
|
140
|
+
duration: file.duration,
|
|
141
|
+
file: {
|
|
142
|
+
name: file.title,
|
|
143
|
+
uri: file.asset_url
|
|
144
|
+
},
|
|
145
|
+
id: index.toString(),
|
|
146
|
+
paused: file.paused,
|
|
147
|
+
progress: file.progress
|
|
148
|
+
},
|
|
149
|
+
onLoad: onLoad,
|
|
150
|
+
onPlayPause: onPlayPause,
|
|
151
|
+
onProgress: onProgress,
|
|
152
|
+
testID: "audio-attachment-preview",
|
|
153
|
+
__self: _this,
|
|
154
|
+
__source: {
|
|
155
|
+
fileName: _jsxFileName,
|
|
156
|
+
lineNumber: 134,
|
|
157
|
+
columnNumber: 15
|
|
158
|
+
}
|
|
159
|
+
})) : _react["default"].createElement(Attachment, {
|
|
60
160
|
attachment: file,
|
|
61
161
|
__self: _this,
|
|
62
162
|
__source: {
|
|
63
163
|
fileName: _jsxFileName,
|
|
64
|
-
lineNumber:
|
|
65
|
-
columnNumber:
|
|
164
|
+
lineNumber: 150,
|
|
165
|
+
columnNumber: 13
|
|
66
166
|
}
|
|
67
167
|
}));
|
|
68
168
|
}));
|
|
@@ -71,8 +171,7 @@ var FileAttachmentGroupWithContext = function FileAttachmentGroupWithContext(pro
|
|
|
71
171
|
var areEqual = function areEqual(prevProps, nextProps) {
|
|
72
172
|
var prevFiles = prevProps.files;
|
|
73
173
|
var nextFiles = nextProps.files;
|
|
74
|
-
|
|
75
|
-
return filesEqual;
|
|
174
|
+
return prevFiles.length === nextFiles.length;
|
|
76
175
|
};
|
|
77
176
|
|
|
78
177
|
var MemoizedFileAttachmentGroup = _react["default"].memo(FileAttachmentGroupWithContext, areEqual);
|
|
@@ -88,16 +187,20 @@ var FileAttachmentGroup = function FileAttachmentGroup(props) {
|
|
|
88
187
|
_useMessagesContext$A = _useMessagesContext.Attachment,
|
|
89
188
|
Attachment = _useMessagesContext$A === void 0 ? _Attachment.Attachment : _useMessagesContext$A;
|
|
90
189
|
|
|
190
|
+
var _useMessageInputConte = (0, _MessageInputContext.useMessageInputContext)(),
|
|
191
|
+
AudioAttachment = _useMessageInputConte.AudioAttachment;
|
|
192
|
+
|
|
91
193
|
var files = propFiles || contextFiles;
|
|
92
194
|
if (!files.length) return null;
|
|
93
195
|
return _react["default"].createElement(MemoizedFileAttachmentGroup, {
|
|
94
196
|
Attachment: Attachment,
|
|
197
|
+
AudioAttachment: AudioAttachment,
|
|
95
198
|
files: files,
|
|
96
199
|
messageId: messageId,
|
|
97
200
|
__self: _this,
|
|
98
201
|
__source: {
|
|
99
202
|
fileName: _jsxFileName,
|
|
100
|
-
lineNumber:
|
|
203
|
+
lineNumber: 196,
|
|
101
204
|
columnNumber: 5
|
|
102
205
|
}
|
|
103
206
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FileAttachmentGroup.tsx"],"names":["styles","StyleSheet","create","container","padding","FileAttachmentGroupWithContext","props","Attachment","files","messageId","stylesProp","theme","messageSimple","fileAttachmentGroup","map","file","index","paddingBottom","length","attachmentContainer","areEqual","prevProps","nextProps","prevFiles","nextFiles","filesEqual","MemoizedFileAttachmentGroup","React","memo","FileAttachmentGroup","propFiles","contextFiles","AttachmentDefault","displayName"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAEA;;AAIA;;AAIA;;;;;AAIA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,I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AQd,KAAR;AAEA,MAAMiB,UAAU,GAAGF,SAAS,CAACL,MAAV,KAAqBM,SAAS,CAACN,MAAlD;AAEA,SAAOO,UAAP;AACD,CAVD;;AAYA,IAAMC,2BAA2B,GAAGC,kBAAMC,IAAN,CAClCvB,8BADkC,EAElCe,QAFkC,CAApC;;AAUO,IAAMS,mBAAmB,GAAG,SAAtBA,mBAAsB,CAGjCvB,KAHiC,EAI9B;AACH,MAAewB,SAAf,GAAwCxB,KAAxC,CAAQE,KAAR;AAAA,MAA0BC,SAA1B,GAAwCH,KAAxC,CAA0BG,SAA1B;;AAEA,2BAAgC,wCAAhC;AAAA,MAAesB,YAAf,sBAAQvB,KAAR;;AAEA,4BAA2C,0CAA3C;AAAA,kDAAQD,UAAR;AAAA,MAAQA,UAAR,sCAAqByB,sBAArB;;AAEA,MAAMxB,KAAK,GAAGsB,SAAS,IAAIC,YAA3B;AAEA,MAAI,CAACvB,KAAK,CAACU,MAAX,EAAmB,OAAO,IAAP;AAEnB,SACE,gCAAC,2BAAD;AAEIX,IAAAA,UAAU,EAAVA,UAFJ;AAGIC,IAAAA,KAAK,EAALA,KAHJ;AAIIC,IAAAA,SAAS,EAATA,SAJJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IADF;AASD,CAxBM;;;AA0BPoB,mBAAmB,CAACI,WAApB,GAAkC,yDAAlC","sourcesContent":["import React from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { Attachment as AttachmentDefault } from './Attachment';\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';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n container: {\n padding: 4,\n },\n});\n\nexport type FileAttachmentGroupPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<MessageContextValue<StreamChatGenerics>, 'files'> &\n Pick<MessagesContextValue<StreamChatGenerics>, 'Attachment'> & {\n /**\n * The unique id for the message with file attachments\n */\n messageId: string;\n styles?: Partial<{\n attachmentContainer: StyleProp<ViewStyle>;\n container: StyleProp<ViewStyle>;\n }>;\n };\n\nconst FileAttachmentGroupWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileAttachmentGroupPropsWithContext<StreamChatGenerics>,\n) => {\n const { Attachment, files, messageId, styles: stylesProp = {} } = props;\n\n const {\n theme: {\n messageSimple: {\n fileAttachmentGroup: { container },\n },\n },\n } = useTheme();\n\n return (\n <View style={[styles.container, container, stylesProp.container]}>\n {files.map((file, index) => (\n <View\n key={`${messageId}-${index}`}\n style={[\n { paddingBottom: index !== files.length - 1 ? 4 : 0 },\n stylesProp.attachmentContainer,\n ]}\n >\n <Attachment attachment={file} />\n </View>\n ))}\n </View>\n );\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: FileAttachmentGroupPropsWithContext<StreamChatGenerics>,\n nextProps: FileAttachmentGroupPropsWithContext<StreamChatGenerics>,\n) => {\n const { files: prevFiles } = prevProps;\n const { files: nextFiles } = nextProps;\n\n const filesEqual = prevFiles.length === nextFiles.length;\n\n return filesEqual;\n};\n\nconst MemoizedFileAttachmentGroup = React.memo(\n FileAttachmentGroupWithContext,\n areEqual,\n) as typeof FileAttachmentGroupWithContext;\n\nexport type FileAttachmentGroupProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<Omit<FileAttachmentGroupPropsWithContext<StreamChatGenerics>, 'messageId'>> &\n Pick<FileAttachmentGroupPropsWithContext<StreamChatGenerics>, 'messageId'>;\n\nexport const FileAttachmentGroup = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileAttachmentGroupProps<StreamChatGenerics>,\n) => {\n const { files: propFiles, messageId } = props;\n\n const { files: contextFiles } = useMessageContext<StreamChatGenerics>();\n\n const { Attachment = AttachmentDefault } = useMessagesContext<StreamChatGenerics>();\n\n const files = propFiles || contextFiles;\n\n if (!files.length) return null;\n\n return (\n <MemoizedFileAttachmentGroup\n {...{\n Attachment,\n files,\n messageId,\n }}\n />\n );\n};\n\nFileAttachmentGroup.displayName = 'FileAttachmentGroup{messageSimple{fileAttachmentGroup}}';\n"]}
|
|
1
|
+
{"version":3,"sources":["FileAttachmentGroup.tsx"],"names":["styles","StyleSheet","create","container","padding","FileAttachmentGroupWithContext","props","Attachment","AudioAttachment","files","messageId","stylesProp","filesToDisplay","setFilesToDisplay","map","file","duration","paused","progress","onLoad","index","prevFilesToDisplay","fileToDisplay","id","toString","onProgress","currentTime","hasEnd","prevFileUploads","fileUpload","onPlayPause","pausedStatus","theme","messageSimple","fileAttachmentGroup","paddingBottom","length","attachmentContainer","type","name","title","uri","asset_url","areEqual","prevProps","nextProps","prevFiles","nextFiles","MemoizedFileAttachmentGroup","React","memo","FileAttachmentGroup","propFiles","contextFiles","AttachmentDefault","displayName"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAIA;;AAEA;;AAIA;;AAIA;;AAIA;;AACA;;;;;;;;;AAIA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,OAAO,EAAE;AADA;AADoB,CAAlB,CAAf;;AA6BA,IAAMC,8BAA8B,GAAG,SAAjCA,8BAAiC,CAGrCC,KAHqC,EAIlC;AACH,MAAQC,UAAR,GAAmFD,KAAnF,CAAQC,UAAR;AAAA,MAAoBC,eAApB,GAAmFF,KAAnF,CAAoBE,eAApB;AAAA,MAAqCC,KAArC,GAAmFH,KAAnF,CAAqCG,KAArC;AAAA,MAA4CC,SAA5C,GAAmFJ,KAAnF,CAA4CI,SAA5C;AAAA,sBAAmFJ,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Ae8C,SAAf,GAAwC9C,KAAxC,CAAQG,KAAR;AAAA,MAA0BC,SAA1B,GAAwCJ,KAAxC,CAA0BI,SAA1B;;AAEA,2BAAgC,wCAAhC;AAAA,MAAe2C,YAAf,sBAAQ5C,KAAR;;AAEA,4BAA2C,0CAA3C;AAAA,kDAAQF,UAAR;AAAA,MAAQA,UAAR,sCAAqB+C,sBAArB;;AAEA,8BAA4B,kDAA5B;AAAA,MAAQ9C,eAAR,yBAAQA,eAAR;;AAEA,MAAMC,KAAK,GAAG2C,SAAS,IAAIC,YAA3B;AAEA,MAAI,CAAC5C,KAAK,CAAC2B,MAAX,EAAmB,OAAO,IAAP;AAEnB,SACE,gCAAC,2BAAD;AAEI7B,IAAAA,UAAU,EAAVA,UAFJ;AAGIC,IAAAA,eAAe,EAAfA,eAHJ;AAIIC,IAAAA,KAAK,EAALA,KAJJ;AAKIC,IAAAA,SAAS,EAATA,SALJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IADF;AAUD,CA3BM;;;AA6BPyC,mBAAmB,CAACI,WAApB,GAAkC,yDAAlC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { Attachment as AttachmentDefault } from './Attachment';\n\nimport {\n MessageContextValue,\n useMessageContext,\n} from '../../contexts/messageContext/MessageContext';\nimport {\n MessageInputContextValue,\n useMessageInputContext,\n} from '../../contexts/messageInputContext/MessageInputContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { isAudioPackageAvailable } from '../../native';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n container: {\n padding: 4,\n },\n});\n\nexport type FileAttachmentGroupPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<MessageContextValue<StreamChatGenerics>, 'files'> &\n Pick<MessageInputContextValue<StreamChatGenerics>, 'AudioAttachment'> &\n Pick<MessagesContextValue<StreamChatGenerics>, 'Attachment'> & {\n /**\n * The unique id for the message with file attachments\n */\n messageId: string;\n styles?: Partial<{\n attachmentContainer: StyleProp<ViewStyle>;\n container: StyleProp<ViewStyle>;\n }>;\n };\n\ntype FilesToDisplayType<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Attachment<StreamChatGenerics> & {\n duration: number;\n paused: boolean;\n progress: number;\n};\n\nconst FileAttachmentGroupWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileAttachmentGroupPropsWithContext<StreamChatGenerics>,\n) => {\n const { Attachment, AudioAttachment, files, messageId, styles: stylesProp = {} } = props;\n const [filesToDisplay, setFilesToDisplay] = useState<FilesToDisplayType[]>([]);\n\n useEffect(() => {\n setFilesToDisplay(files.map((file) => ({ ...file, duration: 0, paused: true, progress: 0 })));\n }, [files]);\n\n // Handler triggered when an audio is loaded in the message input. The initial state is defined for the audio here and the duration is set.\n const onLoad = (index: string, duration: number) => {\n setFilesToDisplay((prevFilesToDisplay) =>\n prevFilesToDisplay.map((fileToDisplay, id) => ({\n ...fileToDisplay,\n duration: id.toString() === index ? duration : fileToDisplay.duration,\n })),\n );\n };\n\n // The handler which is triggered when the audio progresses/ the thumb is dragged in the progress control. The progressed duration is set here.\n const onProgress = (index: string, currentTime?: number, hasEnd?: boolean) => {\n setFilesToDisplay((prevFileUploads) =>\n prevFileUploads.map((fileUpload, id) => ({\n ...fileUpload,\n progress:\n id.toString() === index\n ? hasEnd\n ? 1\n : currentTime\n ? currentTime / (fileUpload.duration as number)\n : 0\n : fileUpload.progress,\n })),\n );\n };\n\n // The handler which controls or sets the paused/played state of the audio.\n const onPlayPause = (index: string, pausedStatus?: boolean) => {\n if (pausedStatus === false) {\n // If the status is false we set the audio with the index as playing and the others as paused.\n setFilesToDisplay((prevFileUploads) =>\n prevFileUploads.map((fileUpload, id) => ({\n ...fileUpload,\n paused: id.toString() === index ? false : true,\n })),\n );\n } else {\n // If the status is true we simply set all the audio's paused state as true.\n setFilesToDisplay((prevFileUploads) =>\n prevFileUploads.map((fileUpload) => ({\n ...fileUpload,\n paused: true,\n })),\n );\n }\n };\n\n const {\n theme: {\n messageSimple: {\n fileAttachmentGroup: { container },\n },\n },\n } = useTheme();\n\n return (\n <View style={[styles.container, container, stylesProp.container]}>\n {filesToDisplay.map((file, index) => (\n <View\n key={`${messageId}-${index}`}\n style={[\n { paddingBottom: index !== files.length - 1 ? 4 : 0 },\n stylesProp.attachmentContainer,\n ]}\n >\n {file.type === 'audio' && isAudioPackageAvailable() ? (\n <View accessibilityLabel='audio-attachment-preview'>\n <AudioAttachment\n index={index}\n item={{\n duration: file.duration,\n file: { name: file.title as string, uri: file.asset_url },\n id: index.toString(),\n paused: file.paused,\n progress: file.progress,\n }}\n onLoad={onLoad}\n onPlayPause={onPlayPause}\n onProgress={onProgress}\n testID='audio-attachment-preview'\n />\n </View>\n ) : (\n <Attachment attachment={file} />\n )}\n </View>\n ))}\n </View>\n );\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: FileAttachmentGroupPropsWithContext<StreamChatGenerics>,\n nextProps: FileAttachmentGroupPropsWithContext<StreamChatGenerics>,\n) => {\n const { files: prevFiles } = prevProps;\n const { files: nextFiles } = nextProps;\n\n return prevFiles.length === nextFiles.length;\n};\n\nconst MemoizedFileAttachmentGroup = React.memo(\n FileAttachmentGroupWithContext,\n areEqual,\n) as typeof FileAttachmentGroupWithContext;\n\nexport type FileAttachmentGroupProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<Omit<FileAttachmentGroupPropsWithContext<StreamChatGenerics>, 'messageId'>> &\n Pick<FileAttachmentGroupPropsWithContext<StreamChatGenerics>, 'messageId'>;\n\nexport const FileAttachmentGroup = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileAttachmentGroupProps<StreamChatGenerics>,\n) => {\n const { files: propFiles, messageId } = props;\n\n const { files: contextFiles } = useMessageContext<StreamChatGenerics>();\n\n const { Attachment = AttachmentDefault } = useMessagesContext<StreamChatGenerics>();\n\n const { AudioAttachment } = useMessageInputContext<StreamChatGenerics>();\n\n const files = propFiles || contextFiles;\n\n if (!files.length) return null;\n\n return (\n <MemoizedFileAttachmentGroup\n {...{\n Attachment,\n AudioAttachment,\n files,\n messageId,\n }}\n />\n );\n};\n\nFileAttachmentGroup.displayName = 'FileAttachmentGroup{messageSimple{fileAttachmentGroup}}';\n"]}
|
|
@@ -45,7 +45,11 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
45
45
|
|
|
46
46
|
var VideoThumbnail = function VideoThumbnail(props) {
|
|
47
47
|
var _useTheme = (0, _ThemeContext.useTheme)(),
|
|
48
|
-
_useTheme$theme
|
|
48
|
+
_useTheme$theme = _useTheme.theme,
|
|
49
|
+
_useTheme$theme$color = _useTheme$theme.colors,
|
|
50
|
+
static_black = _useTheme$theme$color.static_black,
|
|
51
|
+
static_white = _useTheme$theme$color.static_white,
|
|
52
|
+
_useTheme$theme$messa = _useTheme$theme.messageSimple.videoThumbnail,
|
|
49
53
|
container = _useTheme$theme$messa.container,
|
|
50
54
|
roundedView = _useTheme$theme$messa.roundedView;
|
|
51
55
|
|
|
@@ -62,25 +66,27 @@ var VideoThumbnail = function VideoThumbnail(props) {
|
|
|
62
66
|
__self: _this,
|
|
63
67
|
__source: {
|
|
64
68
|
fileName: _jsxFileName,
|
|
65
|
-
lineNumber:
|
|
69
|
+
lineNumber: 51,
|
|
66
70
|
columnNumber: 5
|
|
67
71
|
}
|
|
68
72
|
}, _react["default"].createElement(_reactNative.View, {
|
|
69
|
-
style: [styles.roundedView, roundedView
|
|
73
|
+
style: [styles.roundedView, roundedView, {
|
|
74
|
+
backgroundColor: static_white
|
|
75
|
+
}],
|
|
70
76
|
__self: _this,
|
|
71
77
|
__source: {
|
|
72
78
|
fileName: _jsxFileName,
|
|
73
|
-
lineNumber:
|
|
79
|
+
lineNumber: 57,
|
|
74
80
|
columnNumber: 7
|
|
75
81
|
}
|
|
76
82
|
}, _react["default"].createElement(_icons.Play, {
|
|
77
83
|
height: 24,
|
|
78
|
-
pathFill:
|
|
84
|
+
pathFill: static_black,
|
|
79
85
|
width: 24,
|
|
80
86
|
__self: _this,
|
|
81
87
|
__source: {
|
|
82
88
|
fileName: _jsxFileName,
|
|
83
|
-
lineNumber:
|
|
89
|
+
lineNumber: 58,
|
|
84
90
|
columnNumber: 9
|
|
85
91
|
}
|
|
86
92
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoThumbnail.tsx"],"names":["styles","StyleSheet","create","container","alignItems","backgroundColor","display","height","justifyContent","width","roundedView","borderRadius","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","VideoThumbnail","props","theme","messageSimple","videoThumbnail","imageStyle","style","thumb_url","uri"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,UAAU,EAAE,QADH;AAETC,IAAAA,eAAe,EAAE,OAFR;AAGTC,IAAAA,OAAO,EAAE,MAHA;AAITC,IAAAA,MAAM,EAAE,MAJC;AAKTC,IAAAA,cAAc,EAAE,QALP;AAMTC,IAAAA,KAAK,EAAE;AANE,GADoB;AAS/BC,EAAAA,WAAW,EAAE;AACXN,IAAAA,UAAU,EAAE,QADD;AAEXO,IAAAA,YAAY,EAAE,EAFH;AAGXL,IAAAA,OAAO,EAAE,MAHE;AAIXM,IAAAA,SAAS,EAAE,CAJA;AAKXL,IAAAA,MAAM,EAAE,EALG;AAMXC,IAAAA,cAAc,EAAE,QANL;AAOXK,IAAAA,WAAW,EAAE,MAPF;AAQXC,IAAAA,YAAY,EAAE;AACZP,MAAAA,MAAM,EAAE,CADI;AAEZE,MAAAA,KAAK,EAAE;AAFK,KARH;AAYXM,IAAAA,aAAa,EAAE,IAZJ;AAaXC,IAAAA,YAAY,EAAE,IAbH;AAcXP,IAAAA,KAAK,EAAE;AAdI;AATkB,CAAlB,CAAf;;AAiCO,IAAMQ,cAA6C,GAAG,SAAhDA,cAAgD,CAACC,KAAD,EAAW;AACtE,
|
|
1
|
+
{"version":3,"sources":["VideoThumbnail.tsx"],"names":["styles","StyleSheet","create","container","alignItems","backgroundColor","display","height","justifyContent","width","roundedView","borderRadius","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","VideoThumbnail","props","theme","colors","static_black","static_white","messageSimple","videoThumbnail","imageStyle","style","thumb_url","uri"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,UAAU,EAAE,QADH;AAETC,IAAAA,eAAe,EAAE,OAFR;AAGTC,IAAAA,OAAO,EAAE,MAHA;AAITC,IAAAA,MAAM,EAAE,MAJC;AAKTC,IAAAA,cAAc,EAAE,QALP;AAMTC,IAAAA,KAAK,EAAE;AANE,GADoB;AAS/BC,EAAAA,WAAW,EAAE;AACXN,IAAAA,UAAU,EAAE,QADD;AAEXO,IAAAA,YAAY,EAAE,EAFH;AAGXL,IAAAA,OAAO,EAAE,MAHE;AAIXM,IAAAA,SAAS,EAAE,CAJA;AAKXL,IAAAA,MAAM,EAAE,EALG;AAMXC,IAAAA,cAAc,EAAE,QANL;AAOXK,IAAAA,WAAW,EAAE,MAPF;AAQXC,IAAAA,YAAY,EAAE;AACZP,MAAAA,MAAM,EAAE,CADI;AAEZE,MAAAA,KAAK,EAAE;AAFK,KARH;AAYXM,IAAAA,aAAa,EAAE,IAZJ;AAaXC,IAAAA,YAAY,EAAE,IAbH;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'react-native';\n\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Play } from '../../icons';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n backgroundColor: 'black',\n display: 'flex',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n },\n roundedView: {\n alignItems: 'center',\n borderRadius: 50,\n display: 'flex',\n elevation: 6,\n height: 36,\n justifyContent: 'center',\n shadowColor: '#000',\n shadowOffset: {\n height: 3,\n width: 0,\n },\n shadowOpacity: 0.27,\n shadowRadius: 4.65,\n width: 36,\n },\n});\n\nexport type VideoThumbnailProps = {\n imageStyle?: StyleProp<ImageStyle>;\n style?: StyleProp<ViewStyle>;\n thumb_url?: string;\n};\n\nexport const VideoThumbnail: React.FC<VideoThumbnailProps> = (props) => {\n const {\n theme: {\n colors: { static_black, static_white },\n messageSimple: {\n videoThumbnail: { container, roundedView },\n },\n },\n } = useTheme();\n const { imageStyle, style, thumb_url } = props;\n return (\n <ImageBackground\n accessibilityLabel='Video Thumbnail'\n imageStyle={imageStyle}\n source={{ uri: thumb_url }}\n style={[styles.container, container, style]}\n >\n <View style={[styles.roundedView, roundedView, { backgroundColor: static_white }]}>\n <Play height={24} pathFill={static_black} width={24} />\n </View>\n </ImageBackground>\n );\n};\n"]}
|
|
@@ -81,6 +81,8 @@ var _Attachment = require("../Attachment/Attachment");
|
|
|
81
81
|
|
|
82
82
|
var _AttachmentActions = require("../Attachment/AttachmentActions");
|
|
83
83
|
|
|
84
|
+
var _AudioAttachment = require("../Attachment/AudioAttachment");
|
|
85
|
+
|
|
84
86
|
var _Card = require("../Attachment/Card");
|
|
85
87
|
|
|
86
88
|
var _FileAttachment = require("../Attachment/FileAttachment");
|
|
@@ -137,8 +139,6 @@ var _ReactionList = require("../Message/MessageSimple/ReactionList");
|
|
|
137
139
|
|
|
138
140
|
var _AttachButton = require("../MessageInput/AttachButton");
|
|
139
141
|
|
|
140
|
-
var _AudioAttachmentUploadPreview = require("../MessageInput/AudioAttachmentUploadPreview");
|
|
141
|
-
|
|
142
142
|
var _CommandsButton = require("../MessageInput/CommandsButton");
|
|
143
143
|
|
|
144
144
|
var _InputEditingStateHeader = require("../MessageInput/components/InputEditingStateHeader");
|
|
@@ -248,8 +248,8 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
248
248
|
Attachment = _props$Attachment === void 0 ? _Attachment.Attachment : _props$Attachment,
|
|
249
249
|
_props$AttachmentActi = props.AttachmentActions,
|
|
250
250
|
AttachmentActions = _props$AttachmentActi === void 0 ? _AttachmentActions.AttachmentActions : _props$AttachmentActi,
|
|
251
|
-
_props$AudioAttachmen = props.
|
|
252
|
-
|
|
251
|
+
_props$AudioAttachmen = props.AudioAttachment,
|
|
252
|
+
AudioAttachment = _props$AudioAttachmen === void 0 ? _AudioAttachment.AudioAttachment : _props$AudioAttachmen,
|
|
253
253
|
_props$AutoCompleteSu = props.AutoCompleteSuggestionHeader,
|
|
254
254
|
AutoCompleteSuggestionHeader = _props$AutoCompleteSu === void 0 ? _AutoCompleteSuggestionHeader.AutoCompleteSuggestionHeader : _props$AutoCompleteSu,
|
|
255
255
|
_props$AutoCompleteSu2 = props.AutoCompleteSuggestionItem,
|
|
@@ -1905,7 +1905,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1905
1905
|
var inputMessageInputContext = (0, _useCreateInputMessageInputContext.useCreateInputMessageInputContext)({
|
|
1906
1906
|
additionalTextInputProps: additionalTextInputProps,
|
|
1907
1907
|
AttachButton: AttachButton,
|
|
1908
|
-
|
|
1908
|
+
AudioAttachment: AudioAttachment,
|
|
1909
1909
|
autoCompleteSuggestionsLimit: autoCompleteSuggestionsLimit,
|
|
1910
1910
|
autoCompleteTriggerSettings: autoCompleteTriggerSettings,
|
|
1911
1911
|
channelId: channelId,
|