stream-chat-react-native-core 5.8.1-beta.3 → 5.9.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js +38 -65
  2. package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
  3. package/lib/commonjs/components/ChannelList/ChannelList.js +6 -2
  4. package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
  5. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js +22 -17
  6. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
  7. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js +17 -7
  8. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
  9. package/lib/commonjs/components/MessageInput/FileUploadPreview.js +22 -21
  10. package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
  11. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +82 -112
  12. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  13. package/lib/commonjs/types/types.js.map +1 -1
  14. package/lib/commonjs/version.json +1 -1
  15. package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js +38 -65
  16. package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
  17. package/lib/module/components/ChannelList/ChannelList.js +6 -2
  18. package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
  19. package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js +22 -17
  20. package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
  21. package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js +17 -7
  22. package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
  23. package/lib/module/components/MessageInput/FileUploadPreview.js +22 -21
  24. package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
  25. package/lib/module/contexts/messageInputContext/MessageInputContext.js +82 -112
  26. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  27. package/lib/module/types/types.js.map +1 -1
  28. package/lib/module/version.json +1 -1
  29. package/lib/typescript/components/ChannelList/ChannelList.d.ts +23 -0
  30. package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessage.d.ts +3 -2
  31. package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessageNotification.d.ts +2 -1
  32. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +1 -6
  33. package/lib/typescript/types/types.d.ts +1 -0
  34. package/package.json +1 -1
  35. package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +3 -5
  36. package/src/components/ChannelList/ChannelList.tsx +34 -0
  37. package/src/components/ChannelList/__tests__/ChannelList.test.js +37 -0
  38. package/src/components/ChannelList/hooks/listeners/useNewMessage.ts +29 -19
  39. package/src/components/ChannelList/hooks/listeners/useNewMessageNotification.ts +10 -0
  40. package/src/components/MessageInput/FileUploadPreview.tsx +1 -0
  41. package/src/contexts/messageInputContext/MessageInputContext.tsx +10 -32
  42. package/src/types/types.ts +1 -0
  43. package/src/version.json +1 -1
@@ -73,7 +73,8 @@ var styles = _reactNative.StyleSheet.create({
73
73
  overlay: {
74
74
  borderRadius: 12,
75
75
  marginLeft: 8,
76
- marginRight: 8
76
+ marginRight: 8,
77
+ marginTop: 2
77
78
  },
78
79
  unsupportedFile: {
79
80
  flexDirection: 'row',
@@ -105,7 +106,7 @@ var UnsupportedFileTypeOrFileSizeIndicator = function UnsupportedFileTypeOrFileS
105
106
  __self: _this,
106
107
  __source: {
107
108
  fileName: _jsxFileName,
108
- lineNumber: 106,
109
+ lineNumber: 107,
109
110
  columnNumber: 5
110
111
  }
111
112
  }, _react["default"].createElement(_Warning.Warning, {
@@ -116,7 +117,7 @@ var UnsupportedFileTypeOrFileSizeIndicator = function UnsupportedFileTypeOrFileS
116
117
  __self: _this,
117
118
  __source: {
118
119
  fileName: _jsxFileName,
119
- lineNumber: 107,
120
+ lineNumber: 108,
120
121
  columnNumber: 7
121
122
  }
122
123
  }), _react["default"].createElement(_reactNative.Text, {
@@ -126,7 +127,7 @@ var UnsupportedFileTypeOrFileSizeIndicator = function UnsupportedFileTypeOrFileS
126
127
  __self: _this,
127
128
  __source: {
128
129
  fileName: _jsxFileName,
129
- lineNumber: 113,
130
+ lineNumber: 114,
130
131
  columnNumber: 7
131
132
  }
132
133
  }, t('File type not supported'))) : _react["default"].createElement(_WritingDirectionAwareText.WritingDirectionAwareText, {
@@ -136,7 +137,7 @@ var UnsupportedFileTypeOrFileSizeIndicator = function UnsupportedFileTypeOrFileS
136
137
  __self: _this,
137
138
  __source: {
138
139
  fileName: _jsxFileName,
139
- lineNumber: 118,
140
+ lineNumber: 119,
140
141
  columnNumber: 5
141
142
  }
142
143
  }, item.file.duration || (0, _FileAttachment.getFileSizeDisplayText)(item.file.size));
@@ -216,7 +217,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
216
217
  return _react["default"].createElement(_react["default"].Fragment, {
217
218
  __source: {
218
219
  fileName: _jsxFileName,
219
- lineNumber: 222,
220
+ lineNumber: 223,
220
221
  columnNumber: 7
221
222
  }
222
223
  }, _react["default"].createElement(_UploadProgressIndicator.UploadProgressIndicator, {
@@ -230,7 +231,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
230
231
  __self: _this,
231
232
  __source: {
232
233
  fileName: _jsxFileName,
233
- lineNumber: 223,
234
+ lineNumber: 224,
234
235
  columnNumber: 9
235
236
  }
236
237
  }, (_item$file$type = item.file.type) != null && _item$file$type.startsWith('audio/') && (0, _native.isAudioPackageAvailable)() ? _react["default"].createElement(_reactNative.View, {
@@ -240,7 +241,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
240
241
  __self: _this,
241
242
  __source: {
242
243
  fileName: _jsxFileName,
243
- lineNumber: 231,
244
+ lineNumber: 232,
244
245
  columnNumber: 13
245
246
  }
246
247
  }, _react["default"].createElement(_reactNative.View, {
@@ -255,7 +256,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
255
256
  __self: _this,
256
257
  __source: {
257
258
  fileName: _jsxFileName,
258
- lineNumber: 237,
259
+ lineNumber: 238,
259
260
  columnNumber: 15
260
261
  }
261
262
  }, _react["default"].createElement(AudioAttachment, {
@@ -267,7 +268,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
267
268
  __self: _this,
268
269
  __source: {
269
270
  fileName: _jsxFileName,
270
- lineNumber: 254,
271
+ lineNumber: 255,
271
272
  columnNumber: 17
272
273
  }
273
274
  }))) : _react["default"].createElement(_reactNative.View, {
@@ -280,7 +281,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
280
281
  __self: _this,
281
282
  __source: {
282
283
  fileName: _jsxFileName,
283
- lineNumber: 264,
284
+ lineNumber: 265,
284
285
  columnNumber: 13
285
286
  }
286
287
  }, _react["default"].createElement(_reactNative.View, {
@@ -288,7 +289,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
288
289
  __self: _this,
289
290
  __source: {
290
291
  fileName: _jsxFileName,
291
- lineNumber: 279,
292
+ lineNumber: 280,
292
293
  columnNumber: 15
293
294
  }
294
295
  }, _react["default"].createElement(_reactNative.View, {
@@ -296,7 +297,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
296
297
  __self: _this,
297
298
  __source: {
298
299
  fileName: _jsxFileName,
299
- lineNumber: 280,
300
+ lineNumber: 281,
300
301
  columnNumber: 17
301
302
  }
302
303
  }, _react["default"].createElement(FileAttachmentIcon, {
@@ -304,7 +305,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
304
305
  __self: _this,
305
306
  __source: {
306
307
  fileName: _jsxFileName,
307
- lineNumber: 281,
308
+ lineNumber: 282,
308
309
  columnNumber: 19
309
310
  }
310
311
  })), _react["default"].createElement(_reactNative.View, {
@@ -312,7 +313,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
312
313
  __self: _this,
313
314
  __source: {
314
315
  fileName: _jsxFileName,
315
- lineNumber: 283,
316
+ lineNumber: 284,
316
317
  columnNumber: 17
317
318
  }
318
319
  }, _react["default"].createElement(_reactNative.Text, {
@@ -328,7 +329,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
328
329
  __self: _this,
329
330
  __source: {
330
331
  fileName: _jsxFileName,
331
- lineNumber: 284,
332
+ lineNumber: 285,
332
333
  columnNumber: 19
333
334
  }
334
335
  }, item.file.name.slice(0, 12) + '...' + item.file.name.slice(lastIndexOfDot)), indicatorType !== null && _react["default"].createElement(UnsupportedFileTypeOrFileSizeIndicator, {
@@ -337,7 +338,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
337
338
  __self: _this,
338
339
  __source: {
339
340
  fileName: _jsxFileName,
340
- lineNumber: 304,
341
+ lineNumber: 305,
341
342
  columnNumber: 21
342
343
  }
343
344
  })))), _react["default"].createElement(_reactNative.TouchableOpacity, {
@@ -351,7 +352,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
351
352
  __self: _this,
352
353
  __source: {
353
354
  fileName: _jsxFileName,
354
- lineNumber: 313,
355
+ lineNumber: 314,
355
356
  columnNumber: 11
356
357
  }
357
358
  }, _react["default"].createElement(_Close.Close, {
@@ -359,7 +360,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
359
360
  __self: _this,
360
361
  __source: {
361
362
  fileName: _jsxFileName,
362
- lineNumber: 320,
363
+ lineNumber: 321,
363
364
  columnNumber: 13
364
365
  }
365
366
  }))));
@@ -395,7 +396,7 @@ var FileUploadPreviewWithContext = function FileUploadPreviewWithContext(props)
395
396
  __self: _this,
396
397
  __source: {
397
398
  fileName: _jsxFileName,
398
- lineNumber: 336,
399
+ lineNumber: 337,
399
400
  columnNumber: 5
400
401
  }
401
402
  }) : null;
@@ -431,7 +432,7 @@ var FileUploadPreview = function FileUploadPreview(props) {
431
432
  __self: _this,
432
433
  __source: {
433
434
  fileName: _jsxFileName,
434
- lineNumber: 401,
435
+ lineNumber: 402,
435
436
  columnNumber: 5
436
437
  }
437
438
  }));
@@ -1 +1 @@
1
- {"version":3,"names":["FILE_PREVIEW_HEIGHT","WARNING_ICON_SIZE","styles","StyleSheet","create","dismiss","borderRadius","height","position","right","top","width","fileContainer","borderWidth","flexDirection","justifyContent","marginBottom","paddingLeft","paddingRight","fileContentContainer","fileIcon","alignItems","alignSelf","filenameText","fontSize","fontWeight","paddingHorizontal","fileSizeText","fileTextContainer","flatList","maxHeight","overlay","marginLeft","marginRight","unsupportedFile","unsupportedFileText","marginHorizontal","warningIconStyle","marginTop","UnsupportedFileTypeOrFileSizeIndicator","indicatorType","item","useTheme","theme","colors","accent_red","grey","grey_dark","messageInput","fileUploadPreview","useTranslationContext","t","ProgressIndicatorTypes","NOT_SUPPORTED","color","file","duration","getFileSizeDisplayText","size","FileUploadPreviewWithContext","props","AudioAttachment","enableOfflineSupport","FileAttachmentIcon","fileUploads","removeFile","setFileUploads","uploadFile","flatListRef","useRef","useState","flatListWidth","setFlatListWidth","onLoad","index","prevFileUploads","map","fileUpload","id","onProgress","currentTime","hasEnd","progress","onPlayPause","pausedStatus","paused","black","grey_gainsboro","grey_whisper","white","audioAttachmentFileContainer","renderItem","getIndicatorTypeForFileState","state","lastIndexOfDot","name","lastIndexOf","newFile","type","startsWith","isAudioPackageAvailable","FileState","UPLOADED","length","backgroundColor","borderColor","I18nManager","isRTL","writingDirection","slice","fileUploadsLength","useEffect","current","setTimeout","scrollToEnd","_","offset","nativeEvent","layout","areEqual","prevProps","nextProps","nextFileUploads","every","prevFileUpload","MemoizedFileUploadPreview","React","memo","FileUploadPreview","useChatContext","useMessageInputContext","useMessagesContext","displayName"],"sources":["FileUploadPreview.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { FlatList, I18nManager, StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { UploadProgressIndicator } from './UploadProgressIndicator';\n\nimport { ChatContextValue, useChatContext } from '../../contexts';\nimport {\n FileUpload,\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 { useTranslationContext } from '../../contexts/translationContext/TranslationContext';\nimport { Close } from '../../icons/Close';\nimport { Warning } from '../../icons/Warning';\nimport { isAudioPackageAvailable } from '../../native';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { FileState, getIndicatorTypeForFileState, ProgressIndicatorTypes } from '../../utils/utils';\nimport { getFileSizeDisplayText } from '../Attachment/FileAttachment';\nimport { WritingDirectionAwareText } from '../RTLComponents/WritingDirectionAwareText';\n\nconst FILE_PREVIEW_HEIGHT = 60;\nconst WARNING_ICON_SIZE = 16;\n\nconst styles = StyleSheet.create({\n dismiss: {\n borderRadius: 24,\n height: 24,\n position: 'absolute',\n right: 8,\n top: 8,\n width: 24,\n },\n fileContainer: {\n borderRadius: 12,\n borderWidth: 1,\n flexDirection: 'row',\n height: FILE_PREVIEW_HEIGHT,\n justifyContent: 'space-between',\n marginBottom: 8,\n paddingLeft: 8,\n paddingRight: 8,\n },\n fileContentContainer: { flexDirection: 'row' },\n fileIcon: {\n alignItems: 'center',\n alignSelf: 'center',\n justifyContent: 'center',\n },\n filenameText: {\n fontSize: 14,\n fontWeight: 'bold',\n paddingHorizontal: 10,\n },\n fileSizeText: {\n fontSize: 12,\n paddingHorizontal: 10,\n },\n fileTextContainer: {\n height: '100%',\n justifyContent: 'space-around',\n },\n flatList: { marginBottom: 12, maxHeight: FILE_PREVIEW_HEIGHT * 2.5 + 16 },\n overlay: {\n borderRadius: 12,\n marginLeft: 8,\n marginRight: 8,\n },\n unsupportedFile: {\n flexDirection: 'row',\n paddingLeft: 10,\n },\n unsupportedFileText: {\n fontSize: 12,\n marginHorizontal: 4,\n },\n warningIconStyle: {\n borderRadius: 24,\n marginTop: 2,\n },\n});\n\nconst UnsupportedFileTypeOrFileSizeIndicator = ({\n indicatorType,\n item,\n}: {\n indicatorType: typeof ProgressIndicatorTypes[keyof typeof ProgressIndicatorTypes];\n item: FileUpload;\n}) => {\n const {\n theme: {\n colors: { accent_red, grey, grey_dark },\n messageInput: {\n fileUploadPreview: { fileSizeText },\n },\n },\n } = useTheme();\n\n const { t } = useTranslationContext();\n\n return indicatorType === ProgressIndicatorTypes.NOT_SUPPORTED ? (\n <View style={styles.unsupportedFile}>\n <Warning\n height={WARNING_ICON_SIZE}\n pathFill={accent_red}\n style={styles.warningIconStyle}\n width={WARNING_ICON_SIZE}\n />\n <Text style={[styles.unsupportedFileText, { color: grey_dark }]}>\n {t('File type not supported')}\n </Text>\n </View>\n ) : (\n <WritingDirectionAwareText style={[styles.fileSizeText, { color: grey }, fileSizeText]}>\n {item.file.duration || getFileSizeDisplayText(item.file.size)}\n </WritingDirectionAwareText>\n );\n};\n\ntype FileUploadPreviewPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n MessageInputContextValue<StreamChatGenerics>,\n 'fileUploads' | 'removeFile' | 'uploadFile' | 'setFileUploads'\n> &\n Pick<MessagesContextValue<StreamChatGenerics>, 'AudioAttachment' | 'FileAttachmentIcon'> &\n Pick<ChatContextValue<StreamChatGenerics>, 'enableOfflineSupport'>;\n\nconst FileUploadPreviewWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileUploadPreviewPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n AudioAttachment,\n enableOfflineSupport,\n FileAttachmentIcon,\n fileUploads,\n removeFile,\n setFileUploads,\n uploadFile,\n } = props;\n\n const flatListRef = useRef<FlatList<FileUpload> | null>(null);\n const [flatListWidth, setFlatListWidth] = useState(0);\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 setFileUploads((prevFileUploads) =>\n prevFileUploads.map((fileUpload) => ({\n ...fileUpload,\n duration: fileUpload.id === index ? duration : fileUpload.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 setFileUploads((prevFileUploads) =>\n prevFileUploads.map((fileUpload) => ({\n ...fileUpload,\n progress:\n fileUpload.id === 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 setFileUploads((prevFileUploads) =>\n prevFileUploads.map((fileUpload) => ({\n ...fileUpload,\n paused: fileUpload.id === 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 setFileUploads((prevFileUploads) =>\n prevFileUploads.map((fileUpload) => ({\n ...fileUpload,\n paused: true,\n })),\n );\n }\n };\n\n const {\n theme: {\n colors: { black, grey_dark, grey_gainsboro, grey_whisper, white },\n messageInput: {\n fileUploadPreview: {\n audioAttachmentFileContainer,\n dismiss,\n fileContainer,\n fileContentContainer,\n filenameText,\n fileTextContainer,\n flatList,\n },\n },\n },\n } = useTheme();\n\n const renderItem = ({ index, item }: { index: number; item: FileUpload }) => {\n const indicatorType = getIndicatorTypeForFileState(item.state, enableOfflineSupport);\n\n const lastIndexOfDot = item.file.name.lastIndexOf('.');\n\n return (\n <>\n <UploadProgressIndicator\n action={() => {\n uploadFile({ newFile: item });\n }}\n style={styles.overlay}\n type={indicatorType}\n >\n {item.file.type?.startsWith('audio/') && isAudioPackageAvailable() ? (\n <View\n style={[\n { marginBottom: item.state === FileState.UPLOADED ? 8 : 0 },\n audioAttachmentFileContainer,\n ]}\n >\n <View\n style={[\n styles.fileContainer,\n index === fileUploads.length - 1\n ? {\n marginBottom: 0,\n }\n : {},\n {\n backgroundColor: white,\n borderColor: grey_whisper,\n width: -16,\n },\n fileContainer,\n ]}\n testID='audio-attachment-upload-preview'\n >\n <AudioAttachment\n item={item}\n onLoad={onLoad}\n onPlayPause={onPlayPause}\n onProgress={onProgress}\n testID='audio-attachment-upload-preview'\n />\n </View>\n </View>\n ) : (\n <View\n style={[\n styles.fileContainer,\n index === fileUploads.length - 1\n ? {\n marginBottom: 0,\n }\n : {},\n {\n borderColor: grey_whisper,\n width: flatListWidth - 16,\n },\n fileContainer,\n ]}\n >\n <View style={[styles.fileContentContainer, fileContentContainer]}>\n <View style={styles.fileIcon}>\n <FileAttachmentIcon mimeType={item.file.type} />\n </View>\n <View style={[styles.fileTextContainer, fileTextContainer]}>\n <Text\n numberOfLines={1}\n style={[\n styles.filenameText,\n {\n color: black,\n width:\n flatListWidth -\n 16 - // 16 = horizontal padding\n 40 - // 40 = file icon size\n 24 - // 24 = close icon size\n 24, // 24 = internal padding\n },\n I18nManager.isRTL ? { writingDirection: 'rtl' } : { writingDirection: 'ltr' },\n filenameText,\n ]}\n >\n {item.file.name.slice(0, 12) + '...' + item.file.name.slice(lastIndexOfDot)}\n </Text>\n {indicatorType !== null && (\n <UnsupportedFileTypeOrFileSizeIndicator\n indicatorType={indicatorType}\n item={item}\n />\n )}\n </View>\n </View>\n </View>\n )}\n <TouchableOpacity\n onPress={() => {\n removeFile(item.id);\n }}\n style={[styles.dismiss, { backgroundColor: grey_gainsboro }, dismiss]}\n testID='remove-file-upload-preview'\n >\n <Close pathFill={grey_dark} />\n </TouchableOpacity>\n </UploadProgressIndicator>\n </>\n );\n };\n\n const fileUploadsLength = fileUploads.length;\n\n useEffect(() => {\n if (fileUploadsLength && flatListRef.current) {\n setTimeout(() => flatListRef.current?.scrollToEnd(), 1);\n }\n }, [fileUploadsLength]);\n\n return fileUploadsLength ? (\n <FlatList\n data={fileUploads}\n getItemLayout={(_, index) => ({\n index,\n length: FILE_PREVIEW_HEIGHT + 8,\n offset: (FILE_PREVIEW_HEIGHT + 8) * index,\n })}\n keyExtractor={(item) => `${item.id}`}\n onLayout={({\n nativeEvent: {\n layout: { width },\n },\n }) => {\n setFlatListWidth(width);\n }}\n ref={flatListRef}\n renderItem={renderItem}\n style={[styles.flatList, flatList]}\n />\n ) : null;\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: FileUploadPreviewPropsWithContext<StreamChatGenerics>,\n nextProps: FileUploadPreviewPropsWithContext<StreamChatGenerics>,\n) => {\n const { fileUploads: prevFileUploads } = prevProps;\n const { fileUploads: nextFileUploads } = nextProps;\n\n return (\n prevFileUploads.length === nextFileUploads.length &&\n prevFileUploads.every(\n (prevFileUpload, index) =>\n prevFileUpload.state === nextFileUploads[index].state &&\n prevFileUpload.paused === nextFileUploads[index].paused &&\n prevFileUpload.progress === nextFileUploads[index].progress &&\n prevFileUpload.duration === nextFileUploads[index].duration,\n )\n );\n};\n\nconst MemoizedFileUploadPreview = React.memo(\n FileUploadPreviewWithContext,\n areEqual,\n) as typeof FileUploadPreviewWithContext;\n\nexport type FileUploadPreviewProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<FileUploadPreviewPropsWithContext<StreamChatGenerics>>;\n\n/**\n * FileUploadPreview\n * UI Component to preview the files set for upload\n */\nexport const FileUploadPreview = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileUploadPreviewProps<StreamChatGenerics>,\n) => {\n const { enableOfflineSupport } = useChatContext<StreamChatGenerics>();\n const { fileUploads, removeFile, setFileUploads, uploadFile } =\n useMessageInputContext<StreamChatGenerics>();\n const { AudioAttachment, FileAttachmentIcon } = useMessagesContext<StreamChatGenerics>();\n\n return (\n <MemoizedFileUploadPreview\n {...{\n AudioAttachment,\n FileAttachmentIcon,\n fileUploads,\n removeFile,\n setFileUploads,\n uploadFile,\n }}\n {...{ enableOfflineSupport }}\n {...props}\n />\n );\n};\n\nFileUploadPreview.displayName = 'FileUploadPreview{messageInput{fileUploadPreview}}';\n"],"mappings":";;;;;;;;AAAA;AACA;AAEA;AAEA;AACA;AAKA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAuF;EAAA;AAAA;AAAA;AAEvF,IAAMA,mBAAmB,GAAG,EAAE;AAC9B,IAAMC,iBAAiB,GAAG,EAAE;AAE5B,IAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,OAAO,EAAE;IACPC,YAAY,EAAE,EAAE;IAChBC,MAAM,EAAE,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE;EACT,CAAC;EACDC,aAAa,EAAE;IACbN,YAAY,EAAE,EAAE;IAChBO,WAAW,EAAE,CAAC;IACdC,aAAa,EAAE,KAAK;IACpBP,MAAM,EAAEP,mBAAmB;IAC3Be,cAAc,EAAE,eAAe;IAC/BC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE;EAChB,CAAC;EACDC,oBAAoB,EAAE;IAAEL,aAAa,EAAE;EAAM,CAAC;EAC9CM,QAAQ,EAAE;IACRC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE,QAAQ;IACnBP,cAAc,EAAE;EAClB,CAAC;EACDQ,YAAY,EAAE;IACZC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,iBAAiB,EAAE;EACrB,CAAC;EACDC,YAAY,EAAE;IACZH,QAAQ,EAAE,EAAE;IACZE,iBAAiB,EAAE;EACrB,CAAC;EACDE,iBAAiB,EAAE;IACjBrB,MAAM,EAAE,MAAM;IACdQ,cAA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CAACvC,MAAM,KAAKqC,eAAe,CAAChD,KAAK,CAAC,CAACW,MAAM,IACvDuC,cAAc,CAAC1C,QAAQ,KAAKwC,eAAe,CAAChD,KAAK,CAAC,CAACQ,QAAQ,IAC3D0C,cAAc,CAACpE,QAAQ,KAAKkE,eAAe,CAAChD,KAAK,CAAC,CAAClB,QAAQ;EAAA,EAC9D;AAEL,CAAC;AAED,IAAMqE,yBAAyB,GAAGC,iBAAK,CAACC,IAAI,CAC1CpE,4BAA4B,EAC5B4D,QAAQ,CAC8B;AAUjC,IAAMS,iBAAiB,GAAG,SAApBA,iBAAiB,CAG5BpE,KAAiD,EAC9C;EACH,sBAAiC,IAAAqE,wBAAc,GAAsB;IAA7DnE,oBAAoB,mBAApBA,oBAAoB;EAC5B,4BACE,IAAAoE,2CAAsB,GAAsB;IADtClE,WAAW,yBAAXA,WAAW;IAAEC,UAAU,yBAAVA,UAAU;IAAEC,cAAc,yBAAdA,cAAc;IAAEC,UAAU,yBAAVA,UAAU;EAE3D,0BAAgD,IAAAgE,mCAAkB,GAAsB;IAAhFtE,eAAe,uBAAfA,eAAe;IAAEE,kBAAkB,uBAAlBA,kBAAkB;EAE3C,OACE,gCAAC,yBAAyB;IAEtBF,eAAe,EAAfA,eAAe;IACfE,kBAAkB,EAAlBA,kBAAkB;IAClBC,WAAW,EAAXA,WAAW;IACXC,UAAU,EAAVA,UAAU;IACVC,cAAc,EAAdA,cAAc;IACdC,UAAU,EAAVA,UAAU;IAENL,oBAAoB,EAApBA;EAAoB,GACtBF,KAAK;IAAA;IAAA;MAAA;MAAA;MAAA;IAAA;EAAA,GACT;AAEN,CAAC;AAAC;AAEFoE,iBAAiB,CAACI,WAAW,GAAG,oDAAoD"}
1
+ {"version":3,"names":["FILE_PREVIEW_HEIGHT","WARNING_ICON_SIZE","styles","StyleSheet","create","dismiss","borderRadius","height","position","right","top","width","fileContainer","borderWidth","flexDirection","justifyContent","marginBottom","paddingLeft","paddingRight","fileContentContainer","fileIcon","alignItems","alignSelf","filenameText","fontSize","fontWeight","paddingHorizontal","fileSizeText","fileTextContainer","flatList","maxHeight","overlay","marginLeft","marginRight","marginTop","unsupportedFile","unsupportedFileText","marginHorizontal","warningIconStyle","UnsupportedFileTypeOrFileSizeIndicator","indicatorType","item","useTheme","theme","colors","accent_red","grey","grey_dark","messageInput","fileUploadPreview","useTranslationContext","t","ProgressIndicatorTypes","NOT_SUPPORTED","color","file","duration","getFileSizeDisplayText","size","FileUploadPreviewWithContext","props","AudioAttachment","enableOfflineSupport","FileAttachmentIcon","fileUploads","removeFile","setFileUploads","uploadFile","flatListRef","useRef","useState","flatListWidth","setFlatListWidth","onLoad","index","prevFileUploads","map","fileUpload","id","onProgress","currentTime","hasEnd","progress","onPlayPause","pausedStatus","paused","black","grey_gainsboro","grey_whisper","white","audioAttachmentFileContainer","renderItem","getIndicatorTypeForFileState","state","lastIndexOfDot","name","lastIndexOf","newFile","type","startsWith","isAudioPackageAvailable","FileState","UPLOADED","length","backgroundColor","borderColor","I18nManager","isRTL","writingDirection","slice","fileUploadsLength","useEffect","current","setTimeout","scrollToEnd","_","offset","nativeEvent","layout","areEqual","prevProps","nextProps","nextFileUploads","every","prevFileUpload","MemoizedFileUploadPreview","React","memo","FileUploadPreview","useChatContext","useMessageInputContext","useMessagesContext","displayName"],"sources":["FileUploadPreview.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { FlatList, I18nManager, StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { UploadProgressIndicator } from './UploadProgressIndicator';\n\nimport { ChatContextValue, useChatContext } from '../../contexts';\nimport {\n FileUpload,\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 { useTranslationContext } from '../../contexts/translationContext/TranslationContext';\nimport { Close } from '../../icons/Close';\nimport { Warning } from '../../icons/Warning';\nimport { isAudioPackageAvailable } from '../../native';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { FileState, getIndicatorTypeForFileState, ProgressIndicatorTypes } from '../../utils/utils';\nimport { getFileSizeDisplayText } from '../Attachment/FileAttachment';\nimport { WritingDirectionAwareText } from '../RTLComponents/WritingDirectionAwareText';\n\nconst FILE_PREVIEW_HEIGHT = 60;\nconst WARNING_ICON_SIZE = 16;\n\nconst styles = StyleSheet.create({\n dismiss: {\n borderRadius: 24,\n height: 24,\n position: 'absolute',\n right: 8,\n top: 8,\n width: 24,\n },\n fileContainer: {\n borderRadius: 12,\n borderWidth: 1,\n flexDirection: 'row',\n height: FILE_PREVIEW_HEIGHT,\n justifyContent: 'space-between',\n marginBottom: 8,\n paddingLeft: 8,\n paddingRight: 8,\n },\n fileContentContainer: { flexDirection: 'row' },\n fileIcon: {\n alignItems: 'center',\n alignSelf: 'center',\n justifyContent: 'center',\n },\n filenameText: {\n fontSize: 14,\n fontWeight: 'bold',\n paddingHorizontal: 10,\n },\n fileSizeText: {\n fontSize: 12,\n paddingHorizontal: 10,\n },\n fileTextContainer: {\n height: '100%',\n justifyContent: 'space-around',\n },\n flatList: { marginBottom: 12, maxHeight: FILE_PREVIEW_HEIGHT * 2.5 + 16 },\n overlay: {\n borderRadius: 12,\n marginLeft: 8,\n marginRight: 8,\n marginTop: 2,\n },\n unsupportedFile: {\n flexDirection: 'row',\n paddingLeft: 10,\n },\n unsupportedFileText: {\n fontSize: 12,\n marginHorizontal: 4,\n },\n warningIconStyle: {\n borderRadius: 24,\n marginTop: 2,\n },\n});\n\nconst UnsupportedFileTypeOrFileSizeIndicator = ({\n indicatorType,\n item,\n}: {\n indicatorType: typeof ProgressIndicatorTypes[keyof typeof ProgressIndicatorTypes];\n item: FileUpload;\n}) => {\n const {\n theme: {\n colors: { accent_red, grey, grey_dark },\n messageInput: {\n fileUploadPreview: { fileSizeText },\n },\n },\n } = useTheme();\n\n const { t } = useTranslationContext();\n\n return indicatorType === ProgressIndicatorTypes.NOT_SUPPORTED ? (\n <View style={styles.unsupportedFile}>\n <Warning\n height={WARNING_ICON_SIZE}\n pathFill={accent_red}\n style={styles.warningIconStyle}\n width={WARNING_ICON_SIZE}\n />\n <Text style={[styles.unsupportedFileText, { color: grey_dark }]}>\n {t('File type not supported')}\n </Text>\n </View>\n ) : (\n <WritingDirectionAwareText style={[styles.fileSizeText, { color: grey }, fileSizeText]}>\n {item.file.duration || getFileSizeDisplayText(item.file.size)}\n </WritingDirectionAwareText>\n );\n};\n\ntype FileUploadPreviewPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<\n MessageInputContextValue<StreamChatGenerics>,\n 'fileUploads' | 'removeFile' | 'uploadFile' | 'setFileUploads'\n> &\n Pick<MessagesContextValue<StreamChatGenerics>, 'AudioAttachment' | 'FileAttachmentIcon'> &\n Pick<ChatContextValue<StreamChatGenerics>, 'enableOfflineSupport'>;\n\nconst FileUploadPreviewWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileUploadPreviewPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n AudioAttachment,\n enableOfflineSupport,\n FileAttachmentIcon,\n fileUploads,\n removeFile,\n setFileUploads,\n uploadFile,\n } = props;\n\n const flatListRef = useRef<FlatList<FileUpload> | null>(null);\n const [flatListWidth, setFlatListWidth] = useState(0);\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 setFileUploads((prevFileUploads) =>\n prevFileUploads.map((fileUpload) => ({\n ...fileUpload,\n duration: fileUpload.id === index ? duration : fileUpload.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 setFileUploads((prevFileUploads) =>\n prevFileUploads.map((fileUpload) => ({\n ...fileUpload,\n progress:\n fileUpload.id === 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 setFileUploads((prevFileUploads) =>\n prevFileUploads.map((fileUpload) => ({\n ...fileUpload,\n paused: fileUpload.id === 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 setFileUploads((prevFileUploads) =>\n prevFileUploads.map((fileUpload) => ({\n ...fileUpload,\n paused: true,\n })),\n );\n }\n };\n\n const {\n theme: {\n colors: { black, grey_dark, grey_gainsboro, grey_whisper, white },\n messageInput: {\n fileUploadPreview: {\n audioAttachmentFileContainer,\n dismiss,\n fileContainer,\n fileContentContainer,\n filenameText,\n fileTextContainer,\n flatList,\n },\n },\n },\n } = useTheme();\n\n const renderItem = ({ index, item }: { index: number; item: FileUpload }) => {\n const indicatorType = getIndicatorTypeForFileState(item.state, enableOfflineSupport);\n\n const lastIndexOfDot = item.file.name.lastIndexOf('.');\n\n return (\n <>\n <UploadProgressIndicator\n action={() => {\n uploadFile({ newFile: item });\n }}\n style={styles.overlay}\n type={indicatorType}\n >\n {item.file.type?.startsWith('audio/') && isAudioPackageAvailable() ? (\n <View\n style={[\n { marginBottom: item.state === FileState.UPLOADED ? 8 : 0 },\n audioAttachmentFileContainer,\n ]}\n >\n <View\n style={[\n styles.fileContainer,\n index === fileUploads.length - 1\n ? {\n marginBottom: 0,\n }\n : {},\n {\n backgroundColor: white,\n borderColor: grey_whisper,\n width: -16,\n },\n fileContainer,\n ]}\n testID='audio-attachment-upload-preview'\n >\n <AudioAttachment\n item={item}\n onLoad={onLoad}\n onPlayPause={onPlayPause}\n onProgress={onProgress}\n testID='audio-attachment-upload-preview'\n />\n </View>\n </View>\n ) : (\n <View\n style={[\n styles.fileContainer,\n index === fileUploads.length - 1\n ? {\n marginBottom: 0,\n }\n : {},\n {\n borderColor: grey_whisper,\n width: flatListWidth - 16,\n },\n fileContainer,\n ]}\n >\n <View style={[styles.fileContentContainer, fileContentContainer]}>\n <View style={styles.fileIcon}>\n <FileAttachmentIcon mimeType={item.file.type} />\n </View>\n <View style={[styles.fileTextContainer, fileTextContainer]}>\n <Text\n numberOfLines={1}\n style={[\n styles.filenameText,\n {\n color: black,\n width:\n flatListWidth -\n 16 - // 16 = horizontal padding\n 40 - // 40 = file icon size\n 24 - // 24 = close icon size\n 24, // 24 = internal padding\n },\n I18nManager.isRTL ? { writingDirection: 'rtl' } : { writingDirection: 'ltr' },\n filenameText,\n ]}\n >\n {item.file.name.slice(0, 12) + '...' + item.file.name.slice(lastIndexOfDot)}\n </Text>\n {indicatorType !== null && (\n <UnsupportedFileTypeOrFileSizeIndicator\n indicatorType={indicatorType}\n item={item}\n />\n )}\n </View>\n </View>\n </View>\n )}\n <TouchableOpacity\n onPress={() => {\n removeFile(item.id);\n }}\n style={[styles.dismiss, { backgroundColor: grey_gainsboro }, dismiss]}\n testID='remove-file-upload-preview'\n >\n <Close pathFill={grey_dark} />\n </TouchableOpacity>\n </UploadProgressIndicator>\n </>\n );\n };\n\n const fileUploadsLength = fileUploads.length;\n\n useEffect(() => {\n if (fileUploadsLength && flatListRef.current) {\n setTimeout(() => flatListRef.current?.scrollToEnd(), 1);\n }\n }, [fileUploadsLength]);\n\n return fileUploadsLength ? (\n <FlatList\n data={fileUploads}\n getItemLayout={(_, index) => ({\n index,\n length: FILE_PREVIEW_HEIGHT + 8,\n offset: (FILE_PREVIEW_HEIGHT + 8) * index,\n })}\n keyExtractor={(item) => `${item.id}`}\n onLayout={({\n nativeEvent: {\n layout: { width },\n },\n }) => {\n setFlatListWidth(width);\n }}\n ref={flatListRef}\n renderItem={renderItem}\n style={[styles.flatList, flatList]}\n />\n ) : null;\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: FileUploadPreviewPropsWithContext<StreamChatGenerics>,\n nextProps: FileUploadPreviewPropsWithContext<StreamChatGenerics>,\n) => {\n const { fileUploads: prevFileUploads } = prevProps;\n const { fileUploads: nextFileUploads } = nextProps;\n\n return (\n prevFileUploads.length === nextFileUploads.length &&\n prevFileUploads.every(\n (prevFileUpload, index) =>\n prevFileUpload.state === nextFileUploads[index].state &&\n prevFileUpload.paused === nextFileUploads[index].paused &&\n prevFileUpload.progress === nextFileUploads[index].progress &&\n prevFileUpload.duration === nextFileUploads[index].duration,\n )\n );\n};\n\nconst MemoizedFileUploadPreview = React.memo(\n FileUploadPreviewWithContext,\n areEqual,\n) as typeof FileUploadPreviewWithContext;\n\nexport type FileUploadPreviewProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<FileUploadPreviewPropsWithContext<StreamChatGenerics>>;\n\n/**\n * FileUploadPreview\n * UI Component to preview the files set for upload\n */\nexport const FileUploadPreview = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: FileUploadPreviewProps<StreamChatGenerics>,\n) => {\n const { enableOfflineSupport } = useChatContext<StreamChatGenerics>();\n const { fileUploads, removeFile, setFileUploads, uploadFile } =\n useMessageInputContext<StreamChatGenerics>();\n const { AudioAttachment, FileAttachmentIcon } = useMessagesContext<StreamChatGenerics>();\n\n return (\n <MemoizedFileUploadPreview\n {...{\n AudioAttachment,\n FileAttachmentIcon,\n fileUploads,\n removeFile,\n setFileUploads,\n uploadFile,\n }}\n {...{ enableOfflineSupport }}\n {...props}\n />\n );\n};\n\nFileUploadPreview.displayName = 'FileUploadPreview{messageInput{fileUploadPreview}}';\n"],"mappings":";;;;;;;;AAAA;AACA;AAEA;AAEA;AACA;AAKA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAuF;EAAA;AAAA;AAAA;AAEvF,IAAMA,mBAAmB,GAAG,EAAE;AAC9B,IA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IAAMS,iBAAiB,GAAG,SAApBA,iBAAiB,CAG5BpE,KAAiD,EAC9C;EACH,sBAAiC,IAAAqE,wBAAc,GAAsB;IAA7DnE,oBAAoB,mBAApBA,oBAAoB;EAC5B,4BACE,IAAAoE,2CAAsB,GAAsB;IADtClE,WAAW,yBAAXA,WAAW;IAAEC,UAAU,yBAAVA,UAAU;IAAEC,cAAc,yBAAdA,cAAc;IAAEC,UAAU,yBAAVA,UAAU;EAE3D,0BAAgD,IAAAgE,mCAAkB,GAAsB;IAAhFtE,eAAe,uBAAfA,eAAe;IAAEE,kBAAkB,uBAAlBA,kBAAkB;EAE3C,OACE,gCAAC,yBAAyB;IAEtBF,eAAe,EAAfA,eAAe;IACfE,kBAAkB,EAAlBA,kBAAkB;IAClBC,WAAW,EAAXA,WAAW;IACXC,UAAU,EAAVA,UAAU;IACVC,cAAc,EAAdA,cAAc;IACdC,UAAU,EAAVA,UAAU;IAENL,oBAAoB,EAApBA;EAAoB,GACtBF,KAAK;IAAA;IAAA;MAAA;MAAA;MAAA;IAAA;EAAA,GACT;AAEN,CAAC;AAAC;AAEFoE,iBAAiB,CAACI,WAAW,GAAG,oDAAoD"}
@@ -679,7 +679,7 @@ var MessageInputProvider = function MessageInputProvider(_ref) {
679
679
  };
680
680
  var uploadFile = function () {
681
681
  var _ref6 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee5(_ref5) {
682
- var newFile, file, id, response, extraData;
682
+ var newFile, file, id, response, localAssetURI, extraData;
683
683
  return _regenerator["default"].wrap(function _callee5$(_context5) {
684
684
  while (1) switch (_context5.prev = _context5.next) {
685
685
  case 0:
@@ -696,136 +696,106 @@ var MessageInputProvider = function MessageInputProvider(_ref) {
696
696
  return value.doDocUploadRequest(file, channel);
697
697
  case 8:
698
698
  response = _context5.sent;
699
- _context5.next = 15;
699
+ _context5.next = 21;
700
700
  break;
701
701
  case 11:
702
702
  if (!(channel && file.uri)) {
703
- _context5.next = 15;
703
+ _context5.next = 21;
704
704
  break;
705
705
  }
706
- _context5.next = 14;
707
- return channel.sendFile(file.uri, file.name, file.type);
708
- case 14:
706
+ _context5.t0 = _reactNative.Platform.OS === 'ios' && file.id;
707
+ if (!_context5.t0) {
708
+ _context5.next = 17;
709
+ break;
710
+ }
711
+ _context5.next = 16;
712
+ return (0, _native.getLocalAssetUri)(file.id);
713
+ case 16:
714
+ _context5.t0 = _context5.sent;
715
+ case 17:
716
+ localAssetURI = _context5.t0;
717
+ _context5.next = 20;
718
+ return channel.sendFile(localAssetURI || file.uri, file.name, file.type);
719
+ case 20:
709
720
  response = _context5.sent;
710
- case 15:
721
+ case 21:
711
722
  extraData = {
712
723
  thumb_url: response.thumb_url,
713
724
  url: response.file
714
725
  };
715
726
  setFileUploads(getUploadSetStateAction(id, _utils.FileState.UPLOADED, extraData));
716
- _context5.next = 22;
727
+ _context5.next = 28;
717
728
  break;
718
- case 19:
719
- _context5.prev = 19;
720
- _context5.t0 = _context5["catch"](4);
721
- handleFileOrImageUploadError(_context5.t0, false, id);
722
- case 22:
729
+ case 25:
730
+ _context5.prev = 25;
731
+ _context5.t1 = _context5["catch"](4);
732
+ handleFileOrImageUploadError(_context5.t1, false, id);
733
+ case 28:
723
734
  case "end":
724
735
  return _context5.stop();
725
736
  }
726
- }, _callee5, null, [[4, 19]]);
737
+ }, _callee5, null, [[4, 25]]);
727
738
  }));
728
739
  return function uploadFile(_x) {
729
740
  return _ref6.apply(this, arguments);
730
741
  };
731
742
  }();
732
743
  var uploadImage = function () {
733
- var _ref8 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee7(_ref7) {
734
- var newImage, _ref9, file, id, response, getLocalUri, uri, compressedUri, filename, contentType, newImageUploads;
735
- return _regenerator["default"].wrap(function _callee7$(_context7) {
736
- while (1) switch (_context7.prev = _context7.next) {
744
+ var _ref8 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee6(_ref7) {
745
+ var newImage, _ref9, file, id, response, localAssetURI, uri, compressedUri, filename, contentType, newImageUploads;
746
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
747
+ while (1) switch (_context6.prev = _context6.next) {
737
748
  case 0:
738
749
  newImage = _ref7.newImage;
739
750
  _ref9 = newImage || {}, file = _ref9.file, id = _ref9.id;
740
751
  if (file) {
741
- _context7.next = 4;
752
+ _context6.next = 4;
742
753
  break;
743
754
  }
744
- return _context7.abrupt("return");
755
+ return _context6.abrupt("return");
745
756
  case 4:
746
757
  response = {};
747
- _context7.prev = 5;
748
- getLocalUri = function () {
749
- var _ref10 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee6() {
750
- var _file$uri;
751
- return _regenerator["default"].wrap(function _callee6$(_context6) {
752
- while (1) switch (_context6.prev = _context6.next) {
753
- case 0:
754
- if (!file.id) {
755
- _context6.next = 6;
756
- break;
757
- }
758
- _context6.next = 3;
759
- return (0, _native.getLocalAssetUri)(file.id);
760
- case 3:
761
- return _context6.abrupt("return", _context6.sent);
762
- case 6:
763
- if (!((_file$uri = file.uri) != null && _file$uri.match(/assets-library/))) {
764
- _context6.next = 10;
765
- break;
766
- }
767
- _context6.next = 9;
768
- return (0, _native.getLocalAssetUri)(file.uri);
769
- case 9:
770
- return _context6.abrupt("return", _context6.sent);
771
- case 10:
772
- return _context6.abrupt("return", file.uri);
773
- case 11:
774
- case "end":
775
- return _context6.stop();
776
- }
777
- }, _callee6);
778
- }));
779
- return function getLocalUri() {
780
- return _ref10.apply(this, arguments);
781
- };
782
- }();
783
- _context7.t1 = file.name;
784
- if (_context7.t1) {
785
- _context7.next = 12;
758
+ _context6.prev = 5;
759
+ _context6.t0 = _reactNative.Platform.OS === 'ios' && file.id;
760
+ if (!_context6.t0) {
761
+ _context6.next = 11;
786
762
  break;
787
763
  }
788
- _context7.next = 11;
789
- return getLocalUri();
764
+ _context6.next = 10;
765
+ return (0, _native.getLocalAssetUri)(file.id);
766
+ case 10:
767
+ _context6.t0 = _context6.sent;
790
768
  case 11:
791
- _context7.t1 = _context7.sent;
792
- case 12:
793
- _context7.t0 = _context7.t1;
794
- if (_context7.t0) {
795
- _context7.next = 15;
796
- break;
797
- }
798
- _context7.t0 = '';
799
- case 15:
800
- uri = _context7.t0;
801
- _context7.next = 18;
769
+ localAssetURI = _context6.t0;
770
+ uri = localAssetURI || file.uri || '';
771
+ _context6.next = 15;
802
772
  return file.source === 'camera' || !file.height || !file.width || typeof value.compressImageQuality !== 'number' || value.compressImageQuality === 1 ? uri : (0, _native.compressImage)({
803
773
  compressImageQuality: value.compressImageQuality,
804
774
  height: file.height,
805
775
  uri: uri,
806
776
  width: file.width
807
777
  });
808
- case 18:
809
- compressedUri = _context7.sent;
778
+ case 15:
779
+ compressedUri = _context6.sent;
810
780
  filename = uri.replace(/^(file:\/\/|content:\/\/|assets-library:\/\/)/, '');
811
781
  contentType = (0, _mimeTypes.lookup)(filename) || 'multipart/form-data';
812
782
  if (!value.doImageUploadRequest) {
813
- _context7.next = 27;
783
+ _context6.next = 24;
814
784
  break;
815
785
  }
816
- _context7.next = 24;
786
+ _context6.next = 21;
817
787
  return value.doImageUploadRequest(file, channel);
818
- case 24:
819
- response = _context7.sent;
820
- _context7.next = 35;
788
+ case 21:
789
+ response = _context6.sent;
790
+ _context6.next = 32;
821
791
  break;
822
- case 27:
792
+ case 24:
823
793
  if (!(compressedUri && channel)) {
824
- _context7.next = 35;
794
+ _context6.next = 32;
825
795
  break;
826
796
  }
827
797
  if (!value.sendImageAsync) {
828
- _context7.next = 32;
798
+ _context6.next = 29;
829
799
  break;
830
800
  }
831
801
  channel.sendImage(compressedUri, file.filename, contentType).then(function (res) {
@@ -844,14 +814,14 @@ var MessageInputProvider = function MessageInputProvider(_ref) {
844
814
  setImageUploads(newImageUploads);
845
815
  }
846
816
  });
847
- _context7.next = 35;
817
+ _context6.next = 32;
848
818
  break;
849
- case 32:
850
- _context7.next = 34;
819
+ case 29:
820
+ _context6.next = 31;
851
821
  return channel.sendImage(compressedUri, file.filename, contentType);
852
- case 34:
853
- response = _context7.sent;
854
- case 35:
822
+ case 31:
823
+ response = _context6.sent;
824
+ case 32:
855
825
  if (Object.keys(response).length) {
856
826
  newImageUploads = getUploadSetStateAction(id, _utils.FileState.UPLOADED, {
857
827
  height: file.height,
@@ -860,27 +830,27 @@ var MessageInputProvider = function MessageInputProvider(_ref) {
860
830
  });
861
831
  setImageUploads(newImageUploads);
862
832
  }
863
- _context7.next = 41;
833
+ _context6.next = 38;
864
834
  break;
835
+ case 35:
836
+ _context6.prev = 35;
837
+ _context6.t1 = _context6["catch"](5);
838
+ handleFileOrImageUploadError(_context6.t1, true, id);
865
839
  case 38:
866
- _context7.prev = 38;
867
- _context7.t2 = _context7["catch"](5);
868
- handleFileOrImageUploadError(_context7.t2, true, id);
869
- case 41:
870
840
  case "end":
871
- return _context7.stop();
841
+ return _context6.stop();
872
842
  }
873
- }, _callee7, null, [[5, 38]]);
843
+ }, _callee6, null, [[5, 35]]);
874
844
  }));
875
845
  return function uploadImage(_x2) {
876
846
  return _ref8.apply(this, arguments);
877
847
  };
878
848
  }();
879
849
  var uploadNewFile = function () {
880
- var _ref11 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee8(file) {
850
+ var _ref10 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee7(file) {
881
851
  var id, mimeType, isBlockedFileExtension, isBlockedFileMimeType, fileState, newFile;
882
- return _regenerator["default"].wrap(function _callee8$(_context8) {
883
- while (1) switch (_context8.prev = _context8.next) {
852
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
853
+ while (1) switch (_context7.prev = _context7.next) {
884
854
  case 0:
885
855
  id = (0, _utils.generateRandomId)();
886
856
  mimeType = (0, _mimeTypes.lookup)(file.name);
@@ -898,12 +868,12 @@ var MessageInputProvider = function MessageInputProvider(_ref) {
898
868
  file: (0, _extends2["default"])({}, file, {
899
869
  type: mimeType || (file == null ? void 0 : file.type)
900
870
  }),
901
- id: id,
871
+ id: file.id || id,
902
872
  paused: true,
903
873
  progress: 0,
904
874
  state: fileState
905
875
  };
906
- _context8.next = 8;
876
+ _context7.next = 8;
907
877
  return Promise.all([setFileUploads(function (prevFileUploads) {
908
878
  return prevFileUploads.concat([newFile]);
909
879
  }), setNumberOfUploads(function (prevNumberOfUploads) {
@@ -917,19 +887,19 @@ var MessageInputProvider = function MessageInputProvider(_ref) {
917
887
  }
918
888
  case 9:
919
889
  case "end":
920
- return _context8.stop();
890
+ return _context7.stop();
921
891
  }
922
- }, _callee8);
892
+ }, _callee7);
923
893
  }));
924
894
  return function uploadNewFile(_x3) {
925
- return _ref11.apply(this, arguments);
895
+ return _ref10.apply(this, arguments);
926
896
  };
927
897
  }();
928
898
  var uploadNewImage = function () {
929
- var _ref12 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee9(image) {
899
+ var _ref11 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee8(image) {
930
900
  var id, isBlockedImageMimeType, isBlockedImageExtension, imageState, newImage;
931
- return _regenerator["default"].wrap(function _callee9$(_context9) {
932
- while (1) switch (_context9.prev = _context9.next) {
901
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
902
+ while (1) switch (_context8.prev = _context8.next) {
933
903
  case 0:
934
904
  id = (0, _utils.generateRandomId)();
935
905
  isBlockedImageMimeType = blockedImageMimeTypes == null ? void 0 : blockedImageMimeTypes.some(function (mimeType) {
@@ -949,7 +919,7 @@ var MessageInputProvider = function MessageInputProvider(_ref) {
949
919
  url: image.uri,
950
920
  width: image.width
951
921
  };
952
- _context9.next = 7;
922
+ _context8.next = 7;
953
923
  return Promise.all([setImageUploads(function (prevImageUploads) {
954
924
  return prevImageUploads.concat([newImage]);
955
925
  }), setNumberOfUploads(function (prevNumberOfUploads) {
@@ -963,12 +933,12 @@ var MessageInputProvider = function MessageInputProvider(_ref) {
963
933
  }
964
934
  case 8:
965
935
  case "end":
966
- return _context9.stop();
936
+ return _context8.stop();
967
937
  }
968
- }, _callee9);
938
+ }, _callee8);
969
939
  }));
970
940
  return function uploadNewImage(_x4) {
971
- return _ref12.apply(this, arguments);
941
+ return _ref11.apply(this, arguments);
972
942
  };
973
943
  }();
974
944
  var messageInputContext = (0, _useCreateMessageInputContext.useCreateMessageInputContext)((0, _extends2["default"])({
@@ -1027,7 +997,7 @@ var MessageInputProvider = function MessageInputProvider(_ref) {
1027
997
  __self: _this,
1028
998
  __source: {
1029
999
  fileName: _jsxFileName,
1030
- lineNumber: 1199,
1000
+ lineNumber: 1177,
1031
1001
  columnNumber: 5
1032
1002
  }
1033
1003
  }, children);
@@ -1048,7 +1018,7 @@ var withMessageInputContext = function withMessageInputContext(Component) {
1048
1018
  __self: _this,
1049
1019
  __source: {
1050
1020
  fileName: _jsxFileName,
1051
- lineNumber: 1239,
1021
+ lineNumber: 1217,
1052
1022
  columnNumber: 12
1053
1023
  }
1054
1024
  }));